-
Notifications
You must be signed in to change notification settings - Fork 625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: change sdk.Events usage to []abci.Event #3980
Changes from all commits
01f62b6
aa0dbbd
5a0e9e8
1501080
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ import ( | |
|
||
"github.com/stretchr/testify/suite" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
abci "github.com/cometbft/cometbft/abci/types" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems like we have slight inconsistency between There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I like |
||
|
||
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" | ||
connectiontypes "github.com/cosmos/ibc-go/v7/modules/core/03-connection/types" | ||
|
@@ -17,7 +17,7 @@ type EventsMap map[string]map[string]string | |
|
||
// ParseClientIDFromEvents parses events emitted from a MsgCreateClient and returns the | ||
// client identifier. | ||
func ParseClientIDFromEvents(events sdk.Events) (string, error) { | ||
func ParseClientIDFromEvents(events []abci.Event) (string, error) { | ||
for _, ev := range events { | ||
if ev.Type == clienttypes.EventTypeCreateClient { | ||
for _, attr := range ev.Attributes { | ||
|
@@ -32,7 +32,7 @@ func ParseClientIDFromEvents(events sdk.Events) (string, error) { | |
|
||
// ParseConnectionIDFromEvents parses events emitted from a MsgConnectionOpenInit or | ||
// MsgConnectionOpenTry and returns the connection identifier. | ||
func ParseConnectionIDFromEvents(events sdk.Events) (string, error) { | ||
func ParseConnectionIDFromEvents(events []abci.Event) (string, error) { | ||
for _, ev := range events { | ||
if ev.Type == connectiontypes.EventTypeConnectionOpenInit || | ||
ev.Type == connectiontypes.EventTypeConnectionOpenTry { | ||
|
@@ -48,7 +48,7 @@ func ParseConnectionIDFromEvents(events sdk.Events) (string, error) { | |
|
||
// ParseChannelIDFromEvents parses events emitted from a MsgChannelOpenInit or | ||
// MsgChannelOpenTry and returns the channel identifier. | ||
func ParseChannelIDFromEvents(events sdk.Events) (string, error) { | ||
func ParseChannelIDFromEvents(events []abci.Event) (string, error) { | ||
for _, ev := range events { | ||
if ev.Type == channeltypes.EventTypeChannelOpenInit || ev.Type == channeltypes.EventTypeChannelOpenTry { | ||
for _, attr := range ev.Attributes { | ||
|
@@ -63,7 +63,7 @@ func ParseChannelIDFromEvents(events sdk.Events) (string, error) { | |
|
||
// ParsePacketFromEvents parses events emitted from a MsgRecvPacket and returns the | ||
// acknowledgement. | ||
func ParsePacketFromEvents(events sdk.Events) (channeltypes.Packet, error) { | ||
func ParsePacketFromEvents(events []abci.Event) (channeltypes.Packet, error) { | ||
for _, ev := range events { | ||
if ev.Type == channeltypes.EventTypeSendPacket { | ||
packet := channeltypes.Packet{} | ||
|
@@ -121,7 +121,7 @@ func ParsePacketFromEvents(events sdk.Events) (channeltypes.Packet, error) { | |
|
||
// ParseAckFromEvents parses events emitted from a MsgRecvPacket and returns the | ||
// acknowledgement. | ||
func ParseAckFromEvents(events sdk.Events) ([]byte, error) { | ||
func ParseAckFromEvents(events []abci.Event) ([]byte, error) { | ||
for _, ev := range events { | ||
if ev.Type == channeltypes.EventTypeWriteAck { | ||
for _, attr := range ev.Attributes { | ||
|
@@ -139,7 +139,7 @@ func ParseAckFromEvents(events sdk.Events) ([]byte, error) { | |
func AssertEvents( | ||
suite *suite.Suite, | ||
expected EventsMap, | ||
actual sdk.Events, | ||
actual []abci.Event, | ||
) { | ||
hasEvents := make(map[string]bool) | ||
for eventType := range expected { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for convenience I left as is and called
ToABCIEvents()
sincesdk.Events
is just a wrapper around []abci.Event