Skip to content

Commit

Permalink
Feature: ibc relay with type url
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Sep 12, 2024
1 parent 2066b27 commit 52a1a8c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion pkg/indexer/decode/actions.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,9 @@ func parseIbcAction(body *astria.Action_IbcAction, action *storage.Action) error
action.Data = make(map[string]any)

if body.IbcAction != nil && body.IbcAction.GetRawAction() != nil {
action.Data["raw"] = base64.StdEncoding.EncodeToString(body.IbcAction.GetRawAction().GetValue())
data := body.IbcAction.GetRawAction().GetValue()
action.Data["raw"] = base64.StdEncoding.EncodeToString(data)
action.Data["type"] = body.IbcAction.GetRawAction().GetTypeUrl()
}
return nil
}
Expand Down
6 changes: 4 additions & 2 deletions pkg/indexer/decode/actions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ func TestDecodeActions(t *testing.T) {
message := &astria.Action_IbcAction{
IbcAction: &v1.IbcRelay{
RawAction: &anypb.Any{
Value: []byte{0, 0, 0, 0},
Value: []byte{0, 0, 0, 0},
TypeUrl: "msg_type",
},
},
}
Expand All @@ -41,7 +42,8 @@ func TestDecodeActions(t *testing.T) {
Height: 1000,
Type: types.ActionTypeIbcRelay,
Data: map[string]any{
"raw": "AAAAAA==",
"raw": "AAAAAA==",
"type": "msg_type",
},
}

Expand Down

0 comments on commit 52a1a8c

Please sign in to comment.