diff --git a/x/wasm/keeper/msg_server_integration_test.go b/x/wasm/keeper/msg_server_integration_test.go index c0c1942f61..cf2681462e 100644 --- a/x/wasm/keeper/msg_server_integration_test.go +++ b/x/wasm/keeper/msg_server_integration_test.go @@ -485,7 +485,7 @@ func TestClearAdmin(t *testing.T) { addr: myAddress.String(), expErr: false, expEvents: []abci.Event{ - createMsgEvent(myAddress), + types.CreateMsgEvent(myAddress), { Type: "update_contract_admin", Attributes: []abci.EventAttribute{ @@ -526,20 +526,3 @@ func TestClearAdmin(t *testing.T) { }) } } - -func createMsgEvent(sender sdk.AccAddress) abci.Event { - // msg event - return abci.Event{ - Type: "message", - Attributes: []abci.EventAttribute{ - { - Key: []byte("module"), - Value: []byte("wasm"), - }, - { - Key: []byte("sender"), - Value: []byte(sender.String()), - }, - }, - } -} diff --git a/x/wasm/types/test_fixtures.go b/x/wasm/types/test_fixtures.go index dce20e0db2..7c95a3aabc 100644 --- a/x/wasm/types/test_fixtures.go +++ b/x/wasm/types/test_fixtures.go @@ -7,6 +7,7 @@ import ( "math/rand" sdk "github.com/Finschia/finschia-sdk/types" + abci "github.com/tendermint/tendermint/abci/types" ) func GenesisFixture(mutators ...func(*GenesisState)) GenesisState { @@ -329,3 +330,20 @@ func ClearAdminProposalFixture(mutators ...func(p *ClearAdminProposal)) *ClearAd } return p } + +// This function is utilized to generate the msg event for event checking in integration tests. +func CreateMsgEvent(sender sdk.AccAddress) abci.Event { + return abci.Event{ + Type: "message", + Attributes: []abci.EventAttribute{ + { + Key: []byte("module"), + Value: []byte("wasm"), + }, + { + Key: []byte("sender"), + Value: []byte(sender.String()), + }, + }, + } +}