diff --git a/app/app.go b/app/app.go index ce44812f..30eaf681 100644 --- a/app/app.go +++ b/app/app.go @@ -121,6 +121,7 @@ import ( ibctesting "github.com/cosmos/ibc-go/v8/testing" ibctestingtypes "github.com/cosmos/ibc-go/v8/testing/types" + coinswapv1 "github.com/Canto-Network/Canto/v7/api/canto/coinswap/v1" erc20v1 "github.com/Canto-Network/Canto/v7/api/canto/erc20/v1" evmv1 "github.com/evmos/ethermint/api/ethermint/evm/v1" ethante "github.com/evmos/ethermint/app/ante" @@ -314,6 +315,7 @@ func NewCanto( // evm/MsgEthereumTx, erc20/MsgConvertERC20 signingOptions.DefineCustomGetSigners(protov2.MessageName(&evmv1.MsgEthereumTx{}), evmtypes.GetSignersFromMsgEthereumTxV2) signingOptions.DefineCustomGetSigners(protov2.MessageName(&erc20v1.MsgConvertERC20{}), erc20types.GetSignersFromMsgConvertERC20V2) + signingOptions.DefineCustomGetSigners(protov2.MessageName(&coinswapv1.MsgSwapOrder{}), coinswaptypes.GetSignersFromMsgSwapOrderV2) interfaceRegistry, _ := types.NewInterfaceRegistryWithOptions(types.InterfaceRegistryOptions{ ProtoFiles: proto.HybridResolver, diff --git a/x/coinswap/types/msgs.go b/x/coinswap/types/msgs.go index e064bb1c..560437b1 100644 --- a/x/coinswap/types/msgs.go +++ b/x/coinswap/types/msgs.go @@ -2,7 +2,9 @@ package types import ( sdkmath "cosmossdk.io/math" + coinswapv1 "github.com/Canto-Network/Canto/v7/api/canto/coinswap/v1" sdk "github.com/cosmos/cosmos-sdk/types" + protov2 "google.golang.org/protobuf/proto" ) var ( @@ -72,3 +74,15 @@ func NewMsgRemoveLiquidity( Sender: sender, } } + +func GetSignersFromMsgSwapOrderV2(msg protov2.Message) ([][]byte, error) { + msgv2, ok := msg.(*coinswapv1.MsgSwapOrder) + if !ok { + return nil, nil + } + + signers := [][]byte{} + signers = append(signers, []byte(msgv2.Input.Address)) + + return signers, nil +}