-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: move custom interchaintest logic from notional repo * refactor: refactor interchain test --------- Co-authored-by: Tien Nguyen <[email protected]>
- Loading branch information
1 parent
7f8685b
commit fb6075a
Showing
11 changed files
with
798 additions
and
1,010 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package feeabs | ||
|
||
import ( | ||
"encoding/base64" | ||
abcitypes "github.com/cometbft/cometbft/abci/types" | ||
) | ||
|
||
func AttributeValue(events []abcitypes.Event, eventType, attrKey string) (string, bool) { | ||
for _, event := range events { | ||
if event.Type != eventType { | ||
continue | ||
} | ||
for _, attr := range event.Attributes { | ||
if attr.Key == attrKey { | ||
return attr.Value, true | ||
} | ||
|
||
// tendermint < v0.37-alpha returns base64 encoded strings in events. | ||
key, err := base64.StdEncoding.DecodeString(attr.Key) | ||
if err != nil { | ||
continue | ||
} | ||
if string(key) == attrKey { | ||
value, err := base64.StdEncoding.DecodeString(attr.Value) | ||
if err != nil { | ||
continue | ||
} | ||
return string(value), true | ||
} | ||
} | ||
} | ||
return "", false | ||
} |
Oops, something went wrong.