From 39c06bdb87860a7626564530ea2d50a3af882df9 Mon Sep 17 00:00:00 2001 From: Federico Kunze Date: Thu, 14 May 2020 19:57:59 -0400 Subject: [PATCH 1/2] x/transfer: move ICS20 out from x/ibc --- crypto/types/types.pb.go | 110 +++++++++--------- simapp/app.go | 16 +-- simapp/sim_test.go | 2 +- x/ibc/04-channel/keeper/packet_test.go | 2 +- x/ibc/spec/README.md | 2 +- x/{ibc/20-transfer => transfer}/alias.go | 21 ++-- .../client/cli/cli.go | 0 .../client/cli/query.go | 2 +- .../20-transfer => transfer}/client/cli/tx.go | 2 +- .../client/rest/query.go | 2 +- .../client/rest/rest.go | 0 .../client/rest/tx.go | 2 +- .../client/utils/utils.go | 0 x/{ibc/20-transfer => transfer}/genesis.go | 4 +- x/{ibc/20-transfer => transfer}/handler.go | 0 .../20-transfer => transfer}/handler_test.go | 4 +- .../20-transfer => transfer}/keeper/keeper.go | 6 +- .../keeper/keeper_test.go | 7 +- .../20-transfer => transfer}/keeper/relay.go | 14 +-- .../keeper/relay_test.go | 2 +- x/{ibc/20-transfer => transfer}/module.go | 8 +- .../simulation/genesis.go | 2 +- .../20-transfer => transfer}/types/codec.go | 8 +- .../20-transfer => transfer}/types/errors.go | 0 .../20-transfer => transfer}/types/events.go | 0 .../types/expected_keepers.go | 0 .../20-transfer => transfer}/types/genesis.go | 0 .../types/genesis_test.go | 2 +- x/{ibc/20-transfer => transfer}/types/keys.go | 6 - x/{ibc/20-transfer => transfer}/types/msgs.go | 0 .../types/msgs_test.go | 2 +- .../20-transfer => transfer}/types/packet.go | 0 .../types/packet_test.go | 0 .../types/types.pb.go | 83 +++++++------ .../types/types.proto | 4 +- 35 files changed, 151 insertions(+), 162 deletions(-) rename x/{ibc/20-transfer => transfer}/alias.go (74%) rename x/{ibc/20-transfer => transfer}/client/cli/cli.go (100%) rename x/{ibc/20-transfer => transfer}/client/cli/query.go (95%) rename x/{ibc/20-transfer => transfer}/client/cli/tx.go (96%) rename x/{ibc/20-transfer => transfer}/client/rest/query.go (96%) rename x/{ibc/20-transfer => transfer}/client/rest/rest.go (100%) rename x/{ibc/20-transfer => transfer}/client/rest/tx.go (97%) rename x/{ibc/20-transfer => transfer}/client/utils/utils.go (100%) rename x/{ibc/20-transfer => transfer}/genesis.go (87%) rename x/{ibc/20-transfer => transfer}/handler.go (100%) rename x/{ibc/20-transfer => transfer}/handler_test.go (98%) rename x/{ibc/20-transfer => transfer}/keeper/keeper.go (95%) rename x/{ibc/20-transfer => transfer}/keeper/keeper_test.go (97%) rename x/{ibc/20-transfer => transfer}/keeper/relay.go (94%) rename x/{ibc/20-transfer => transfer}/keeper/relay_test.go (99%) rename x/{ibc/20-transfer => transfer}/module.go (97%) rename x/{ibc/20-transfer => transfer}/simulation/genesis.go (93%) rename x/{ibc/20-transfer => transfer}/types/codec.go (79%) rename x/{ibc/20-transfer => transfer}/types/errors.go (100%) rename x/{ibc/20-transfer => transfer}/types/events.go (100%) rename x/{ibc/20-transfer => transfer}/types/expected_keepers.go (100%) rename x/{ibc/20-transfer => transfer}/types/genesis.go (100%) rename x/{ibc/20-transfer => transfer}/types/genesis_test.go (92%) rename x/{ibc/20-transfer => transfer}/types/keys.go (84%) rename x/{ibc/20-transfer => transfer}/types/msgs.go (100%) rename x/{ibc/20-transfer => transfer}/types/msgs_test.go (93%) rename x/{ibc/20-transfer => transfer}/types/packet.go (100%) rename x/{ibc/20-transfer => transfer}/types/packet_test.go (100%) rename x/{ibc/20-transfer => transfer}/types/types.pb.go (88%) rename x/{ibc/20-transfer => transfer}/types/types.proto (94%) diff --git a/crypto/types/types.pb.go b/crypto/types/types.pb.go index f859315e093e..394067599fca 100644 --- a/crypto/types/types.pb.go +++ b/crypto/types/types.pb.go @@ -218,25 +218,25 @@ func (m *PubKeyMultisigThreshold) GetPubKeys() []*PublicKey { return nil } -// Multisignature wraps the signatures from a PubKeyMultisigThreshold. +// MultiSignature wraps the signatures from a PubKeyMultisigThreshold. // See cosmos_sdk.tx.v1.ModeInfo.Multi for how to specify which signers signed // and with which modes -type Multisignature struct { +type MultiSignature struct { Sigs [][]byte `protobuf:"bytes,1,rep,name=sigs,proto3" json:"sigs,omitempty"` } -func (m *Multisignature) Reset() { *m = Multisignature{} } -func (m *Multisignature) String() string { return proto.CompactTextString(m) } -func (*Multisignature) ProtoMessage() {} -func (*Multisignature) Descriptor() ([]byte, []int) { +func (m *MultiSignature) Reset() { *m = MultiSignature{} } +func (m *MultiSignature) String() string { return proto.CompactTextString(m) } +func (*MultiSignature) ProtoMessage() {} +func (*MultiSignature) Descriptor() ([]byte, []int) { return fileDescriptor_2165b2a1badb1b0c, []int{2} } -func (m *Multisignature) XXX_Unmarshal(b []byte) error { +func (m *MultiSignature) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Multisignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MultiSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Multisignature.Marshal(b, m, deterministic) + return xxx_messageInfo_MultiSignature.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -246,19 +246,19 @@ func (m *Multisignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } -func (m *Multisignature) XXX_Merge(src proto.Message) { - xxx_messageInfo_Multisignature.Merge(m, src) +func (m *MultiSignature) XXX_Merge(src proto.Message) { + xxx_messageInfo_MultiSignature.Merge(m, src) } -func (m *Multisignature) XXX_Size() int { +func (m *MultiSignature) XXX_Size() int { return m.Size() } -func (m *Multisignature) XXX_DiscardUnknown() { - xxx_messageInfo_Multisignature.DiscardUnknown(m) +func (m *MultiSignature) XXX_DiscardUnknown() { + xxx_messageInfo_MultiSignature.DiscardUnknown(m) } -var xxx_messageInfo_Multisignature proto.InternalMessageInfo +var xxx_messageInfo_MultiSignature proto.InternalMessageInfo -func (m *Multisignature) GetSigs() [][]byte { +func (m *MultiSignature) GetSigs() [][]byte { if m != nil { return m.Sigs } @@ -324,45 +324,45 @@ func (m *CompactBitArray) GetElems() []byte { func init() { proto.RegisterType((*PublicKey)(nil), "cosmos_sdk.crypto.v1.PublicKey") proto.RegisterType((*PubKeyMultisigThreshold)(nil), "cosmos_sdk.crypto.v1.PubKeyMultisigThreshold") - proto.RegisterType((*Multisignature)(nil), "cosmos_sdk.crypto.v1.Multisignature") + proto.RegisterType((*MultiSignature)(nil), "cosmos_sdk.crypto.v1.MultiSignature") proto.RegisterType((*CompactBitArray)(nil), "cosmos_sdk.crypto.v1.CompactBitArray") } func init() { proto.RegisterFile("crypto/types/types.proto", fileDescriptor_2165b2a1badb1b0c) } var fileDescriptor_2165b2a1badb1b0c = []byte{ - // 486 bytes of a gzipped FileDescriptorProto + // 488 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xdd, 0x8a, 0xd3, 0x40, - 0x14, 0x6e, 0xda, 0xad, 0xb5, 0xb3, 0xeb, 0x56, 0x87, 0x82, 0xd9, 0x82, 0x49, 0x09, 0x22, 0x55, - 0xd8, 0x84, 0x54, 0xaa, 0xe8, 0xdd, 0x66, 0x6f, 0x16, 0x8a, 0x50, 0xb2, 0x5e, 0x88, 0x37, 0x21, - 0x3f, 0x63, 0x1a, 0x9a, 0x64, 0xc2, 0x9c, 0x89, 0x38, 0x2f, 0x21, 0x3e, 0x88, 0x0f, 0xe2, 0xe5, - 0x5e, 0x7a, 0x55, 0x24, 0x7d, 0x83, 0x7d, 0x02, 0xd9, 0x4c, 0xb2, 0x5d, 0xc4, 0xbd, 0x49, 0x66, - 0xce, 0xf7, 0x9d, 0x2f, 0xdf, 0x77, 0x4e, 0x90, 0x1a, 0x32, 0x51, 0x70, 0x6a, 0x71, 0x51, 0x10, - 0x90, 0x4f, 0xb3, 0x60, 0x94, 0x53, 0x3c, 0x0e, 0x29, 0x64, 0x14, 0x3c, 0x88, 0x36, 0xa6, 0x24, - 0x99, 0x5f, 0xed, 0xc9, 0x0b, 0xbe, 0x4e, 0x58, 0xe4, 0x15, 0x3e, 0xe3, 0xc2, 0xaa, 0x89, 0x56, - 0x4c, 0x63, 0xba, 0x3f, 0xc9, 0xee, 0xc9, 0x49, 0x4c, 0x69, 0x9c, 0x12, 0x49, 0x09, 0xca, 0x2f, - 0x96, 0x9f, 0x0b, 0x09, 0x19, 0xdf, 0xbb, 0x68, 0xb8, 0x2a, 0x83, 0x34, 0x09, 0x97, 0x44, 0x60, - 0x0d, 0x0d, 0x81, 0x84, 0xc5, 0x7c, 0xf1, 0x66, 0x63, 0xab, 0xca, 0x54, 0x99, 0x1d, 0x5d, 0x74, - 0xdc, 0x7d, 0x09, 0x4f, 0xd0, 0x80, 0x44, 0xf3, 0xc5, 0xc2, 0x7e, 0xa7, 0x76, 0x1b, 0xb4, 0x2d, - 0xdc, 0x60, 0xc0, 0x24, 0xd6, 0x6b, 0xb1, 0xa6, 0x80, 0x97, 0xe8, 0x61, 0x56, 0xa6, 0x3c, 0x81, - 0x24, 0x56, 0x0f, 0xa6, 0xca, 0xec, 0x70, 0x7e, 0x6a, 0xfe, 0x2f, 0x91, 0xb9, 0x2a, 0x83, 0x25, - 0x11, 0x1f, 0x1a, 0xee, 0xc7, 0x35, 0x23, 0xb0, 0xa6, 0x69, 0x74, 0xd1, 0x71, 0x6f, 0x05, 0xee, - 0x98, 0x64, 0xb6, 0xda, 0xff, 0xc7, 0x24, 0xb3, 0xf1, 0x02, 0x21, 0x3f, 0x17, 0x5e, 0x51, 0x06, - 0x1b, 0x22, 0xd4, 0x51, 0xfd, 0xb9, 0xb1, 0x29, 0x47, 0x60, 0xb6, 0x23, 0x30, 0xcf, 0x72, 0x71, - 0xd3, 0xe6, 0xe7, 0x62, 0x55, 0x13, 0x9d, 0x3e, 0xea, 0x41, 0x99, 0x19, 0x3f, 0x15, 0xf4, 0xf4, - 0x1e, 0x17, 0xf8, 0x2d, 0x1a, 0xf2, 0xf6, 0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 0xdd, 0xe9, 0x89, 0x57, 0x9f, 0xcd, 0x15, 0x18, 0x5e, 0x92, 0xac, 0x08, + 0x22, 0xee, 0x62, 0x7e, 0x41, 0x69, 0x20, 0xe0, 0x2b, 0xf0, 0x04, 0x7d, 0xe3, 0x34, 0xf0, 0x43, + 0xcc, 0x99, 0xcf, 0x38, 0xa1, 0xa8, 0xc9, 0xe4, 0x0d, 0x6b, 0xc0, 0xc5, 0x9c, 0xad, 0xea, 0x32, + 0x1c, 0x81, 0x1e, 0x4a, 0x51, 0xc6, 0xe4, 0xd2, 0x3d, 0x79, 0x71, 0x2f, 0x7f, 0x55, 0xba, 0x7a, + 0x5d, 0xe9, 0xea, 0x9f, 0x4a, 0x57, 0x7f, 0xec, 0x74, 0xe5, 0x7a, 0xa7, 0x2b, 0xbf, 0x77, 0xba, + 0xf2, 0xf9, 0x65, 0x82, 0xf9, 0xba, 0x0c, 0xad, 0x88, 0x64, 0xb6, 0xcc, 0xd9, 0xbc, 0xce, 0x59, + 0xbc, 0xb1, 0xef, 0xff, 0xe4, 0xe1, 0x83, 0x7a, 0x21, 0xaf, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, + 0x82, 0xd0, 0x7b, 0xf3, 0xfb, 0x02, 0x00, 0x00, } func (m *PublicKey) Marshal() (dAtA []byte, err error) { @@ -545,7 +545,7 @@ func (m *PubKeyMultisigThreshold) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *Multisignature) Marshal() (dAtA []byte, err error) { +func (m *MultiSignature) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -555,12 +555,12 @@ func (m *Multisignature) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Multisignature) MarshalTo(dAtA []byte) (int, error) { +func (m *MultiSignature) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Multisignature) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MultiSignature) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -725,7 +725,7 @@ func (m *PubKeyMultisigThreshold) Size() (n int) { return n } -func (m *Multisignature) Size() (n int) { +func (m *MultiSignature) Size() (n int) { if m == nil { return 0 } @@ -1123,7 +1123,7 @@ func (m *PubKeyMultisigThreshold) Unmarshal(dAtA []byte) error { } return nil } -func (m *Multisignature) Unmarshal(dAtA []byte) error { +func (m *MultiSignature) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1146,10 +1146,10 @@ func (m *Multisignature) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Multisignature: wiretype end group for non-group") + return fmt.Errorf("proto: MultiSignature: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Multisignature: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MultiSignature: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/simapp/app.go b/simapp/app.go index 793afdff4eb9..731f7c2cab96 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -29,13 +29,13 @@ import ( "github.com/cosmos/cosmos-sdk/x/ibc" ibcclient "github.com/cosmos/cosmos-sdk/x/ibc/02-client" port "github.com/cosmos/cosmos-sdk/x/ibc/05-port" - transfer "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer" "github.com/cosmos/cosmos-sdk/x/mint" "github.com/cosmos/cosmos-sdk/x/params" paramsclient "github.com/cosmos/cosmos-sdk/x/params/client" paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" "github.com/cosmos/cosmos-sdk/x/slashing" "github.com/cosmos/cosmos-sdk/x/staking" + transfer "github.com/cosmos/cosmos-sdk/x/transfer" "github.com/cosmos/cosmos-sdk/x/upgrade" upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" ) @@ -74,13 +74,13 @@ var ( // module account permissions maccPerms = map[string][]string{ - auth.FeeCollectorName: nil, - distr.ModuleName: nil, - mint.ModuleName: {auth.Minter}, - staking.BondedPoolName: {auth.Burner, auth.Staking}, - staking.NotBondedPoolName: {auth.Burner, auth.Staking}, - gov.ModuleName: {auth.Burner}, - transfer.GetModuleAccountName(): {auth.Minter, auth.Burner}, + auth.FeeCollectorName: nil, + distr.ModuleName: nil, + mint.ModuleName: {auth.Minter}, + staking.BondedPoolName: {auth.Burner, auth.Staking}, + staking.NotBondedPoolName: {auth.Burner, auth.Staking}, + gov.ModuleName: {auth.Burner}, + transfer.ModuleName: {auth.Minter, auth.Burner}, } // module accounts that are allowed to receive tokens diff --git a/simapp/sim_test.go b/simapp/sim_test.go index 1e75bec34a33..fc36ccbc9625 100644 --- a/simapp/sim_test.go +++ b/simapp/sim_test.go @@ -24,12 +24,12 @@ import ( "github.com/cosmos/cosmos-sdk/x/evidence" "github.com/cosmos/cosmos-sdk/x/gov" "github.com/cosmos/cosmos-sdk/x/ibc" - transfer "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer" "github.com/cosmos/cosmos-sdk/x/mint" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/cosmos/cosmos-sdk/x/simulation" "github.com/cosmos/cosmos-sdk/x/slashing" "github.com/cosmos/cosmos-sdk/x/staking" + transfer "github.com/cosmos/cosmos-sdk/x/transfer" ) // Get flags every time the simulator is run diff --git a/x/ibc/04-channel/keeper/packet_test.go b/x/ibc/04-channel/keeper/packet_test.go index 48f50c93c7a4..e2d13a0a5ae5 100644 --- a/x/ibc/04-channel/keeper/packet_test.go +++ b/x/ibc/04-channel/keeper/packet_test.go @@ -7,8 +7,8 @@ import ( connection "github.com/cosmos/cosmos-sdk/x/ibc/03-connection" "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/exported" "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types" - transfertypes "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/types" host "github.com/cosmos/cosmos-sdk/x/ibc/24-host" + transfertypes "github.com/cosmos/cosmos-sdk/x/transfer/types" ) func (suite *KeeperTestSuite) TestSendPacket() { diff --git a/x/ibc/spec/README.md b/x/ibc/spec/README.md index ddaec62fab33..f70fd74e2b8d 100644 --- a/x/ibc/spec/README.md +++ b/x/ibc/spec/README.md @@ -44,7 +44,7 @@ in the SDK's `x/ibc` module: * [ICS 007 - Tendermint Client](https://github.com/cosmos/ics/blob/master/spec/ics-007-tendermint-client): Implemented in [`x/ibc/07-tendermint`](https://github.com/cosmos/x/ibc/07-tendermint) * [ICS 009 - Loopback Client](https://github.com/cosmos/ics/blob/master/spec/ics-009-loopback-client): To be implemented in [`x/ibc/09-loopback`](https://github.com/cosmos/x/ibc/09-loopback) * [ICS 018- Relayer Algorithms](https://github.com/cosmos/ics/tree/master/spec/ics-018-relayer-algorithms): Implemented in it's own [relayer repository](https://github.com/cosmos/relayer) -* [ICS 020 - Fungible Token Transfer](https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer): Implemented in [`x/ibc/20-transfer`](https://github.com/cosmos/x/ibc/20-transfer) +* [ICS 020 - Fungible Token Transfer](https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer): Implemented in [`x/transfer`](https://github.com/cosmos/x/transfer) * [ICS 023 - Vector Commitments](https://github.com/cosmos/ics/tree/master/spec/ics-023-vector-commitments): Implemented in [`x/ibc/23-commitment`](https://github.com/cosmos/x/ibc/23-commitment) * [ICS 024 - Host Requirements](https://github.com/cosmos/ics/tree/master/spec/ics-024-host-requirements): Implemented in [`x/ibc/24-host`](https://github.com/cosmos/x/ibc/24-host) * [ICS 025 - Handler Interface](https://github.com/cosmos/ics/tree/master/spec/ics-025-handler-interface): Handler interfaces are implemented at the top level in `x/ibc/handler.go`, diff --git a/x/ibc/20-transfer/alias.go b/x/transfer/alias.go similarity index 74% rename from x/ibc/20-transfer/alias.go rename to x/transfer/alias.go index b6b8c8d43879..03feb83cb5d2 100644 --- a/x/ibc/20-transfer/alias.go +++ b/x/transfer/alias.go @@ -2,12 +2,12 @@ package transfer // autogenerated code using github.com/rigelrozanski/multitool // aliases generated for the following subdirectories: -// ALIASGEN: github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/keeper -// ALIASGEN: github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/types +// ALIASGEN: github.com/cosmos/cosmos-sdk/x/transfer/keeper +// ALIASGEN: github.com/cosmos/cosmos-sdk/x/transfer/types import ( - "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/keeper" - "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/types" + "github.com/cosmos/cosmos-sdk/x/transfer/keeper" + "github.com/cosmos/cosmos-sdk/x/transfer/types" ) const ( @@ -30,13 +30,12 @@ const ( var ( // functions aliases - NewKeeper = keeper.NewKeeper - RegisterCodec = types.RegisterCodec - GetEscrowAddress = types.GetEscrowAddress - GetDenomPrefix = types.GetDenomPrefix - GetModuleAccountName = types.GetModuleAccountName - NewMsgTransfer = types.NewMsgTransfer - RegisterInterfaces = types.RegisterInterfaces + NewKeeper = keeper.NewKeeper + RegisterCodec = types.RegisterCodec + GetEscrowAddress = types.GetEscrowAddress + GetDenomPrefix = types.GetDenomPrefix + NewMsgTransfer = types.NewMsgTransfer + RegisterInterfaces = types.RegisterInterfaces // variable aliases ModuleCdc = types.ModuleCdc diff --git a/x/ibc/20-transfer/client/cli/cli.go b/x/transfer/client/cli/cli.go similarity index 100% rename from x/ibc/20-transfer/client/cli/cli.go rename to x/transfer/client/cli/cli.go diff --git a/x/ibc/20-transfer/client/cli/query.go b/x/transfer/client/cli/query.go similarity index 95% rename from x/ibc/20-transfer/client/cli/query.go rename to x/transfer/client/cli/query.go index 794c70cd8fc0..b4e1e928e701 100644 --- a/x/ibc/20-transfer/client/cli/query.go +++ b/x/transfer/client/cli/query.go @@ -11,7 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/version" - "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/client/utils" + "github.com/cosmos/cosmos-sdk/x/transfer/client/utils" ) // GetCmdQueryNextSequence defines the command to query a next receive sequence diff --git a/x/ibc/20-transfer/client/cli/tx.go b/x/transfer/client/cli/tx.go similarity index 96% rename from x/ibc/20-transfer/client/cli/tx.go rename to x/transfer/client/cli/tx.go index af8a59dba239..fb00cd53c7dc 100644 --- a/x/ibc/20-transfer/client/cli/tx.go +++ b/x/transfer/client/cli/tx.go @@ -12,7 +12,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authclient "github.com/cosmos/cosmos-sdk/x/auth/client" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/types" + "github.com/cosmos/cosmos-sdk/x/transfer/types" ) // IBC transfer flags diff --git a/x/ibc/20-transfer/client/rest/query.go b/x/transfer/client/rest/query.go similarity index 96% rename from x/ibc/20-transfer/client/rest/query.go rename to x/transfer/client/rest/query.go index 4a18ee172b9d..2f21d7f20737 100644 --- a/x/ibc/20-transfer/client/rest/query.go +++ b/x/transfer/client/rest/query.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/context" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/types/rest" - "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/client/utils" + "github.com/cosmos/cosmos-sdk/x/transfer/client/utils" ) func registerQueryRoutes(cliCtx context.CLIContext, r *mux.Router) { diff --git a/x/ibc/20-transfer/client/rest/rest.go b/x/transfer/client/rest/rest.go similarity index 100% rename from x/ibc/20-transfer/client/rest/rest.go rename to x/transfer/client/rest/rest.go diff --git a/x/ibc/20-transfer/client/rest/tx.go b/x/transfer/client/rest/tx.go similarity index 97% rename from x/ibc/20-transfer/client/rest/tx.go rename to x/transfer/client/rest/tx.go index 554a0ae19b1e..3f5fa8cd1943 100644 --- a/x/ibc/20-transfer/client/rest/tx.go +++ b/x/transfer/client/rest/tx.go @@ -10,7 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/rest" authclient "github.com/cosmos/cosmos-sdk/x/auth/client" - "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/types" + "github.com/cosmos/cosmos-sdk/x/transfer/types" ) func registerTxRoutes(cliCtx context.CLIContext, r *mux.Router) { diff --git a/x/ibc/20-transfer/client/utils/utils.go b/x/transfer/client/utils/utils.go similarity index 100% rename from x/ibc/20-transfer/client/utils/utils.go rename to x/transfer/client/utils/utils.go diff --git a/x/ibc/20-transfer/genesis.go b/x/transfer/genesis.go similarity index 87% rename from x/ibc/20-transfer/genesis.go rename to x/transfer/genesis.go index f88dac531073..573808e077e1 100644 --- a/x/ibc/20-transfer/genesis.go +++ b/x/transfer/genesis.go @@ -4,7 +4,7 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/types" + "github.com/cosmos/cosmos-sdk/x/transfer/types" ) // InitGenesis binds to portid from genesis state @@ -25,7 +25,7 @@ func InitGenesis(ctx sdk.Context, keeper Keeper, state types.GenesisState) { // check if the module account exists moduleAcc := keeper.GetTransferAccount(ctx) if moduleAcc == nil { - panic(fmt.Sprintf("%s module account has not been set", types.GetModuleAccountName())) + panic(fmt.Sprintf("%s module account has not been set", ModuleName)) } } diff --git a/x/ibc/20-transfer/handler.go b/x/transfer/handler.go similarity index 100% rename from x/ibc/20-transfer/handler.go rename to x/transfer/handler.go diff --git a/x/ibc/20-transfer/handler_test.go b/x/transfer/handler_test.go similarity index 98% rename from x/ibc/20-transfer/handler_test.go rename to x/transfer/handler_test.go index da5c552dee2f..70f7a7e42c85 100644 --- a/x/ibc/20-transfer/handler_test.go +++ b/x/transfer/handler_test.go @@ -18,10 +18,10 @@ import ( connectiontypes "github.com/cosmos/cosmos-sdk/x/ibc/03-connection/types" channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types" ibctmtypes "github.com/cosmos/cosmos-sdk/x/ibc/07-tendermint/types" - transfer "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer" - "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/types" commitmenttypes "github.com/cosmos/cosmos-sdk/x/ibc/23-commitment/types" host "github.com/cosmos/cosmos-sdk/x/ibc/24-host" + transfer "github.com/cosmos/cosmos-sdk/x/transfer" + "github.com/cosmos/cosmos-sdk/x/transfer/types" "github.com/cosmos/cosmos-sdk/x/staking" ) diff --git a/x/ibc/20-transfer/keeper/keeper.go b/x/transfer/keeper/keeper.go similarity index 95% rename from x/ibc/20-transfer/keeper/keeper.go rename to x/transfer/keeper/keeper.go index da0f400f07c6..dc77f1167a06 100644 --- a/x/ibc/20-transfer/keeper/keeper.go +++ b/x/transfer/keeper/keeper.go @@ -12,8 +12,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/capability" channel "github.com/cosmos/cosmos-sdk/x/ibc/04-channel" channelexported "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/exported" - "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/types" host "github.com/cosmos/cosmos-sdk/x/ibc/24-host" + "github.com/cosmos/cosmos-sdk/x/transfer/types" ) const ( @@ -46,7 +46,7 @@ func NewKeeper( ) Keeper { // ensure ibc transfer module account is set - if addr := authKeeper.GetModuleAddress(types.GetModuleAccountName()); addr == nil { + if addr := authKeeper.GetModuleAddress(types.ModuleName); addr == nil { panic("the IBC transfer module account has not been set") } @@ -68,7 +68,7 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { // GetTransferAccount returns the ICS20 - transfers ModuleAccount func (k Keeper) GetTransferAccount(ctx sdk.Context) authexported.ModuleAccountI { - return k.authKeeper.GetModuleAccount(ctx, types.GetModuleAccountName()) + return k.authKeeper.GetModuleAccount(ctx, types.ModuleName) } // PacketExecuted defines a wrapper function for the channel Keeper's function diff --git a/x/ibc/20-transfer/keeper/keeper_test.go b/x/transfer/keeper/keeper_test.go similarity index 97% rename from x/ibc/20-transfer/keeper/keeper_test.go rename to x/transfer/keeper/keeper_test.go index c9fef7b9e596..8a090fa2519d 100644 --- a/x/ibc/20-transfer/keeper/keeper_test.go +++ b/x/transfer/keeper/keeper_test.go @@ -17,9 +17,9 @@ import ( connectiontypes "github.com/cosmos/cosmos-sdk/x/ibc/03-connection/types" channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types" ibctmtypes "github.com/cosmos/cosmos-sdk/x/ibc/07-tendermint/types" - "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/types" commitmenttypes "github.com/cosmos/cosmos-sdk/x/ibc/23-commitment/types" host "github.com/cosmos/cosmos-sdk/x/ibc/24-host" + "github.com/cosmos/cosmos-sdk/x/transfer/types" "github.com/cosmos/cosmos-sdk/x/staking" ) @@ -87,13 +87,12 @@ func (suite *KeeperTestSuite) queryProof(key []byte) (proof commitmenttypes.Merk } func (suite *KeeperTestSuite) TestGetTransferAccount() { - expectedMaccName := types.GetModuleAccountName() - expectedMaccAddr := sdk.AccAddress(crypto.AddressHash([]byte(expectedMaccName))) + expectedMaccAddr := sdk.AccAddress(crypto.AddressHash([]byte(types.ModuleName))) macc := suite.chainA.App.TransferKeeper.GetTransferAccount(suite.chainA.GetContext()) suite.NotNil(macc) - suite.Equal(expectedMaccName, macc.GetName()) + suite.Equal(types.ModuleName, macc.GetName()) suite.Equal(expectedMaccAddr, macc.GetAddress()) } diff --git a/x/ibc/20-transfer/keeper/relay.go b/x/transfer/keeper/relay.go similarity index 94% rename from x/ibc/20-transfer/keeper/relay.go rename to x/transfer/keeper/relay.go index 6396731f442a..c6498d48a145 100644 --- a/x/ibc/20-transfer/keeper/relay.go +++ b/x/transfer/keeper/relay.go @@ -6,8 +6,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types" - "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/types" host "github.com/cosmos/cosmos-sdk/x/ibc/24-host" + "github.com/cosmos/cosmos-sdk/x/transfer/types" ) // SendTransfer handles transfer sending logic. There are 2 possible cases: @@ -107,14 +107,14 @@ func (k Keeper) createOutgoingPacket( // transfer the coins to the module account and burn them if err := k.bankKeeper.SendCoinsFromAccountToModule( - ctx, sender, types.GetModuleAccountName(), amount, + ctx, sender, types.ModuleName, amount, ); err != nil { return err } // burn vouchers from the sender's balance if the source is from another chain if err := k.bankKeeper.BurnCoins( - ctx, types.GetModuleAccountName(), amount, + ctx, types.ModuleName, amount, ); err != nil { // NOTE: should not happen as the module account was // retrieved on the step above and it has enough balace @@ -161,14 +161,14 @@ func (k Keeper) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet, data t // mint new tokens if the source of the transfer is the same chain if err := k.bankKeeper.MintCoins( - ctx, types.GetModuleAccountName(), data.Amount, + ctx, types.ModuleName, data.Amount, ); err != nil { return err } // send to receiver return k.bankKeeper.SendCoinsFromModuleToAccount( - ctx, types.GetModuleAccountName(), receiver, data.Amount, + ctx, types.ModuleName, receiver, data.Amount, ) } @@ -235,10 +235,10 @@ func (k Keeper) refundPacketAmount(ctx sdk.Context, packet channeltypes.Packet, // mint vouchers back to sender if err := k.bankKeeper.MintCoins( - ctx, types.GetModuleAccountName(), data.Amount, + ctx, types.ModuleName, data.Amount, ); err != nil { return err } - return k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.GetModuleAccountName(), sender, data.Amount) + return k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, sender, data.Amount) } diff --git a/x/ibc/20-transfer/keeper/relay_test.go b/x/transfer/keeper/relay_test.go similarity index 99% rename from x/ibc/20-transfer/keeper/relay_test.go rename to x/transfer/keeper/relay_test.go index 25700140f4eb..e6f3f65c5b48 100644 --- a/x/ibc/20-transfer/keeper/relay_test.go +++ b/x/transfer/keeper/relay_test.go @@ -7,8 +7,8 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank" connection "github.com/cosmos/cosmos-sdk/x/ibc/03-connection" channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types" - "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/types" host "github.com/cosmos/cosmos-sdk/x/ibc/24-host" + "github.com/cosmos/cosmos-sdk/x/transfer/types" ) func (suite *KeeperTestSuite) TestSendTransfer() { diff --git a/x/ibc/20-transfer/module.go b/x/transfer/module.go similarity index 97% rename from x/ibc/20-transfer/module.go rename to x/transfer/module.go index b1ab11fb5bad..98770cac09d8 100644 --- a/x/ibc/20-transfer/module.go +++ b/x/transfer/module.go @@ -22,11 +22,11 @@ import ( channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types" port "github.com/cosmos/cosmos-sdk/x/ibc/05-port" porttypes "github.com/cosmos/cosmos-sdk/x/ibc/05-port/types" - "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/client/cli" - "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/client/rest" - "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/simulation" - "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/types" host "github.com/cosmos/cosmos-sdk/x/ibc/24-host" + "github.com/cosmos/cosmos-sdk/x/transfer/client/cli" + "github.com/cosmos/cosmos-sdk/x/transfer/client/rest" + "github.com/cosmos/cosmos-sdk/x/transfer/simulation" + "github.com/cosmos/cosmos-sdk/x/transfer/types" ) var ( diff --git a/x/ibc/20-transfer/simulation/genesis.go b/x/transfer/simulation/genesis.go similarity index 93% rename from x/ibc/20-transfer/simulation/genesis.go rename to x/transfer/simulation/genesis.go index e0066c456f7e..2195e6d6b368 100644 --- a/x/ibc/20-transfer/simulation/genesis.go +++ b/x/transfer/simulation/genesis.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/types" + "github.com/cosmos/cosmos-sdk/x/transfer/types" ) // Simulation parameter constants diff --git a/x/ibc/20-transfer/types/codec.go b/x/transfer/types/codec.go similarity index 79% rename from x/ibc/20-transfer/types/codec.go rename to x/transfer/types/codec.go index 3e9118a1c962..ddf55f4f8485 100644 --- a/x/ibc/20-transfer/types/codec.go +++ b/x/transfer/types/codec.go @@ -10,8 +10,8 @@ import ( // RegisterCodec registers the IBC transfer types func RegisterCodec(cdc *codec.Codec) { - cdc.RegisterConcrete(MsgTransfer{}, "ibc/transfer/MsgTransfer", nil) - cdc.RegisterConcrete(FungibleTokenPacketData{}, "ibc/transfer/PacketDataTransfer", nil) + cdc.RegisterConcrete(MsgTransfer{}, "cosmos-sdk/MsgTransfer", nil) + cdc.RegisterConcrete(FungibleTokenPacketData{}, "cosmos-sdk/PacketDataTransfer", nil) } // RegisterInterfaces register the ibc transfer module interfaces to protobuf @@ -23,11 +23,11 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { var ( amino = codec.New() - // ModuleCdc references the global x/ibc/20-transfer module codec. Note, the codec + // ModuleCdc references the global x/transfer module codec. Note, the codec // should ONLY be used in certain instances of tests and for JSON encoding as Amino // is still used for that purpose. // - // The actual codec used for serialization should be provided to x/ibc/20-transfer and + // The actual codec used for serialization should be provided to x/transfer and // defined at the application level. ModuleCdc = codec.NewHybridCodec(amino, cdctypes.NewInterfaceRegistry()) ) diff --git a/x/ibc/20-transfer/types/errors.go b/x/transfer/types/errors.go similarity index 100% rename from x/ibc/20-transfer/types/errors.go rename to x/transfer/types/errors.go diff --git a/x/ibc/20-transfer/types/events.go b/x/transfer/types/events.go similarity index 100% rename from x/ibc/20-transfer/types/events.go rename to x/transfer/types/events.go diff --git a/x/ibc/20-transfer/types/expected_keepers.go b/x/transfer/types/expected_keepers.go similarity index 100% rename from x/ibc/20-transfer/types/expected_keepers.go rename to x/transfer/types/expected_keepers.go diff --git a/x/ibc/20-transfer/types/genesis.go b/x/transfer/types/genesis.go similarity index 100% rename from x/ibc/20-transfer/types/genesis.go rename to x/transfer/types/genesis.go diff --git a/x/ibc/20-transfer/types/genesis_test.go b/x/transfer/types/genesis_test.go similarity index 92% rename from x/ibc/20-transfer/types/genesis_test.go rename to x/transfer/types/genesis_test.go index 58a7e86a9552..12fc59d643a9 100644 --- a/x/ibc/20-transfer/types/genesis_test.go +++ b/x/transfer/types/genesis_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/types" + "github.com/cosmos/cosmos-sdk/x/transfer/types" ) func TestValidateGenesis(t *testing.T) { diff --git a/x/ibc/20-transfer/types/keys.go b/x/transfer/types/keys.go similarity index 84% rename from x/ibc/20-transfer/types/keys.go rename to x/transfer/types/keys.go index dfecdf13729d..0812687367e7 100644 --- a/x/ibc/20-transfer/types/keys.go +++ b/x/transfer/types/keys.go @@ -6,7 +6,6 @@ import ( "github.com/tendermint/tendermint/crypto" sdk "github.com/cosmos/cosmos-sdk/types" - host "github.com/cosmos/cosmos-sdk/x/ibc/24-host" ) const ( @@ -46,8 +45,3 @@ func GetEscrowAddress(portID, channelID string) sdk.AccAddress { func GetDenomPrefix(portID, channelID string) string { return fmt.Sprintf("%s/%s/", portID, channelID) } - -// GetModuleAccountName returns the IBC transfer module account name for supply -func GetModuleAccountName() string { - return fmt.Sprintf("%s/%s", host.ModuleName, ModuleName) -} diff --git a/x/ibc/20-transfer/types/msgs.go b/x/transfer/types/msgs.go similarity index 100% rename from x/ibc/20-transfer/types/msgs.go rename to x/transfer/types/msgs.go diff --git a/x/ibc/20-transfer/types/msgs_test.go b/x/transfer/types/msgs_test.go similarity index 93% rename from x/ibc/20-transfer/types/msgs_test.go rename to x/transfer/types/msgs_test.go index a53b6e3e57f9..038aa1e34f82 100644 --- a/x/ibc/20-transfer/types/msgs_test.go +++ b/x/transfer/types/msgs_test.go @@ -96,7 +96,7 @@ func TestMsgTransferGetSignBytes(t *testing.T) { msg := NewMsgTransfer(validPort, validChannel, 10, coins, addr1, addr2) res := msg.GetSignBytes() - expected := `{"type":"ibc/transfer/MsgTransfer","value":{"amount":[{"amount":"100","denom":"atom"}],"destination_height":"10","receiver":"cosmos1w3jhxarpv3j8yvs7f9y7g","sender":"cosmos1w3jhxarpv3j8yvg4ufs4x","source_channel":"testchannel","source_port":"testportid"}}` + expected := `{"type":"cosmos-sdk/MsgTransfer","value":{"amount":[{"amount":"100","denom":"atom"}],"destination_height":"10","receiver":"cosmos1w3jhxarpv3j8yvs7f9y7g","sender":"cosmos1w3jhxarpv3j8yvg4ufs4x","source_channel":"testchannel","source_port":"testportid"}}` require.Equal(t, expected, string(res)) } diff --git a/x/ibc/20-transfer/types/packet.go b/x/transfer/types/packet.go similarity index 100% rename from x/ibc/20-transfer/types/packet.go rename to x/transfer/types/packet.go diff --git a/x/ibc/20-transfer/types/packet_test.go b/x/transfer/types/packet_test.go similarity index 100% rename from x/ibc/20-transfer/types/packet_test.go rename to x/transfer/types/packet_test.go diff --git a/x/ibc/20-transfer/types/types.pb.go b/x/transfer/types/types.pb.go similarity index 88% rename from x/ibc/20-transfer/types/types.pb.go rename to x/transfer/types/types.pb.go index b2b4304a6801..48860c64ab83 100644 --- a/x/ibc/20-transfer/types/types.pb.go +++ b/x/transfer/types/types.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: x/ibc/20-transfer/types/types.proto +// source: x/transfer/types/types.proto package types @@ -46,7 +46,7 @@ func (m *MsgTransfer) Reset() { *m = MsgTransfer{} } func (m *MsgTransfer) String() string { return proto.CompactTextString(m) } func (*MsgTransfer) ProtoMessage() {} func (*MsgTransfer) Descriptor() ([]byte, []int) { - return fileDescriptor_2979e3085e18bdce, []int{0} + return fileDescriptor_5b7f3a4f209aae4b, []int{0} } func (m *MsgTransfer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -132,7 +132,7 @@ func (m *FungibleTokenPacketData) Reset() { *m = FungibleTokenPacketData func (m *FungibleTokenPacketData) String() string { return proto.CompactTextString(m) } func (*FungibleTokenPacketData) ProtoMessage() {} func (*FungibleTokenPacketData) Descriptor() ([]byte, []int) { - return fileDescriptor_2979e3085e18bdce, []int{1} + return fileDescriptor_5b7f3a4f209aae4b, []int{1} } func (m *FungibleTokenPacketData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -194,7 +194,7 @@ func (m *FungibleTokenPacketAcknowledgement) Reset() { *m = FungibleToke func (m *FungibleTokenPacketAcknowledgement) String() string { return proto.CompactTextString(m) } func (*FungibleTokenPacketAcknowledgement) ProtoMessage() {} func (*FungibleTokenPacketAcknowledgement) Descriptor() ([]byte, []int) { - return fileDescriptor_2979e3085e18bdce, []int{2} + return fileDescriptor_5b7f3a4f209aae4b, []int{2} } func (m *FungibleTokenPacketAcknowledgement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -238,48 +238,45 @@ func (m *FungibleTokenPacketAcknowledgement) GetError() string { } func init() { - proto.RegisterType((*MsgTransfer)(nil), "cosmos_sdk.x.ibc.transfer.v1.MsgTransfer") - proto.RegisterType((*FungibleTokenPacketData)(nil), "cosmos_sdk.x.ibc.transfer.v1.FungibleTokenPacketData") - proto.RegisterType((*FungibleTokenPacketAcknowledgement)(nil), "cosmos_sdk.x.ibc.transfer.v1.FungibleTokenPacketAcknowledgement") + proto.RegisterType((*MsgTransfer)(nil), "cosmos_sdk.x.transfer.v1.MsgTransfer") + proto.RegisterType((*FungibleTokenPacketData)(nil), "cosmos_sdk.x.transfer.v1.FungibleTokenPacketData") + proto.RegisterType((*FungibleTokenPacketAcknowledgement)(nil), "cosmos_sdk.x.transfer.v1.FungibleTokenPacketAcknowledgement") } -func init() { - proto.RegisterFile("x/ibc/20-transfer/types/types.proto", fileDescriptor_2979e3085e18bdce) -} +func init() { proto.RegisterFile("x/transfer/types/types.proto", fileDescriptor_5b7f3a4f209aae4b) } -var fileDescriptor_2979e3085e18bdce = []byte{ - // 487 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0xc1, 0x6e, 0xd3, 0x40, - 0x10, 0x8d, 0x49, 0x1b, 0xca, 0x06, 0x90, 0xba, 0x40, 0x71, 0x23, 0xb0, 0x23, 0x23, 0x21, 0x5f, - 0x62, 0x37, 0x05, 0x09, 0x89, 0x13, 0x71, 0x11, 0x02, 0x09, 0x50, 0x65, 0xe5, 0x84, 0x84, 0x22, - 0x7b, 0x3d, 0xd8, 0x2b, 0xc7, 0xbb, 0xd1, 0xee, 0x3a, 0x34, 0x7f, 0xc1, 0x07, 0xf0, 0x05, 0x88, - 0x0f, 0xe9, 0xb1, 0x47, 0x4e, 0x06, 0x25, 0x7f, 0x90, 0x23, 0x27, 0x54, 0xdb, 0x29, 0x81, 0x16, - 0xc4, 0x85, 0x8b, 0xed, 0x37, 0x33, 0xef, 0x79, 0xde, 0xec, 0x2c, 0xba, 0x77, 0xe4, 0xd2, 0x90, - 0xb8, 0xfb, 0x7b, 0x3d, 0x25, 0x02, 0x26, 0xdf, 0x81, 0x70, 0xd5, 0x6c, 0x02, 0xb2, 0x7a, 0x3a, - 0x13, 0xc1, 0x15, 0xc7, 0x77, 0x08, 0x97, 0x19, 0x97, 0x23, 0x19, 0xa5, 0xce, 0x91, 0x43, 0x43, - 0xe2, 0xac, 0x8a, 0x9d, 0x69, 0xbf, 0x73, 0x5f, 0x25, 0x54, 0x44, 0xa3, 0x49, 0x20, 0xd4, 0xcc, - 0x2d, 0x09, 0x6e, 0xcc, 0x63, 0xfe, 0xf3, 0xab, 0x52, 0xe9, 0x6c, 0x9f, 0x13, 0xb6, 0x3e, 0x36, - 0x51, 0xfb, 0x95, 0x8c, 0x87, 0xb5, 0x1a, 0x7e, 0x84, 0xda, 0x92, 0xe7, 0x82, 0xc0, 0x68, 0xc2, - 0x85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67, 0xd8, 0xfa, 0xac, 0xa1, 0xdb, 0xcf, 0x72, - 0x16, 0xd3, 0x70, 0x0c, 0x43, 0x9e, 0x02, 0x3b, 0x0c, 0x48, 0x0a, 0xea, 0x69, 0xa0, 0x82, 0x35, - 0x87, 0xda, 0xff, 0x70, 0xb8, 0x73, 0xe6, 0xb0, 0x3c, 0xc8, 0x0b, 0xdb, 0x6d, 0xfe, 0xd6, 0xee, - 0x10, 0x59, 0x17, 0x74, 0x3b, 0x20, 0x29, 0xe3, 0xef, 0xc7, 0x10, 0xc5, 0x90, 0x01, 0x53, 0x58, - 0x47, 0x97, 0x65, 0x4e, 0x08, 0x48, 0x59, 0xee, 0xd7, 0x96, 0xbf, 0x82, 0xf8, 0x26, 0xda, 0x04, - 0x21, 0xf8, 0xea, 0x97, 0x15, 0xf0, 0x5e, 0x1f, 0xcf, 0x0d, 0xed, 0x64, 0x6e, 0x68, 0xdf, 0xe6, - 0x86, 0xf6, 0x61, 0x61, 0x34, 0x4e, 0x16, 0x46, 0xe3, 0xcb, 0xc2, 0x68, 0xbc, 0x79, 0xf8, 0x57, - 0x57, 0x7f, 0xb8, 0x58, 0x61, 0xab, 0x5c, 0xfd, 0x07, 0x3f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x05, - 0x59, 0xe4, 0x6c, 0x7a, 0x03, 0x00, 0x00, +var fileDescriptor_5b7f3a4f209aae4b = []byte{ + // 477 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0xcd, 0x6e, 0xd3, 0x40, + 0x10, 0xce, 0x92, 0x36, 0x94, 0x0d, 0x20, 0x75, 0x81, 0xe2, 0x46, 0x60, 0x47, 0x3e, 0x20, 0x5f, + 0x6a, 0x13, 0x38, 0x20, 0x71, 0x22, 0x2e, 0xe2, 0x47, 0x02, 0xa9, 0xb2, 0x72, 0x42, 0x42, 0xd1, + 0x66, 0x3d, 0xd8, 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 0x15, 0x24, 0xb7, 0xf1, 0x36, 0x48, 0x29, 0x56, 0xbf, 0xac, 0x80, 0xff, 0xf2, 0x64, + 0x6e, 0xa2, 0xd3, 0xb9, 0x89, 0x7e, 0xcc, 0x4d, 0xf4, 0x69, 0x61, 0x36, 0x4e, 0x17, 0x66, 0xe3, + 0xdb, 0xc2, 0x6c, 0xbc, 0xfb, 0xbb, 0xe3, 0x17, 0x6f, 0xd3, 0xa8, 0x55, 0xee, 0xfc, 0xe3, 0x5f, + 0x01, 0x00, 0x00, 0xff, 0xff, 0x38, 0x87, 0xdd, 0xdc, 0x68, 0x03, 0x00, 0x00, } func (m *MsgTransfer) Marshal() (dAtA []byte, err error) { diff --git a/x/ibc/20-transfer/types/types.proto b/x/transfer/types/types.proto similarity index 94% rename from x/ibc/20-transfer/types/types.proto rename to x/transfer/types/types.proto index 2dbe03e73dcf..9b1a7705d6d6 100644 --- a/x/ibc/20-transfer/types/types.proto +++ b/x/transfer/types/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; -package cosmos_sdk.x.ibc.transfer.v1; +package cosmos_sdk.x.transfer.v1; -option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/20-transfer/types"; +option go_package = "github.com/cosmos/cosmos-sdk/x/transfer/types"; import "third_party/proto/gogoproto/gogo.proto"; import "types/types.proto"; From 2a1a2052475bb72ae89aa55647feab36cc93a821 Mon Sep 17 00:00:00 2001 From: Federico Kunze Date: Fri, 15 May 2020 15:30:25 -0400 Subject: [PATCH 2/2] rename to ibc-transfer --- simapp/app.go | 2 +- simapp/sim_test.go | 2 +- x/{transfer => ibc-transfer}/alias.go | 8 +- .../client/cli/cli.go | 0 .../client/cli/query.go | 2 +- x/{transfer => ibc-transfer}/client/cli/tx.go | 2 +- .../client/rest/query.go | 2 +- .../client/rest/rest.go | 0 .../client/rest/tx.go | 2 +- .../client/utils/utils.go | 0 x/{transfer => ibc-transfer}/genesis.go | 2 +- x/{transfer => ibc-transfer}/handler.go | 0 x/ibc-transfer/handler_test.go | 311 ++++++++++++++++++ x/{transfer => ibc-transfer}/keeper/keeper.go | 2 +- .../keeper/keeper_test.go | 2 +- x/{transfer => ibc-transfer}/keeper/relay.go | 2 +- .../keeper/relay_test.go | 2 +- x/{transfer => ibc-transfer}/module.go | 8 +- .../simulation/genesis.go | 2 +- x/{transfer => ibc-transfer}/types/codec.go | 0 x/{transfer => ibc-transfer}/types/errors.go | 0 x/{transfer => ibc-transfer}/types/events.go | 0 .../types/expected_keepers.go | 0 x/{transfer => ibc-transfer}/types/genesis.go | 0 .../types/genesis_test.go | 2 +- x/{transfer => ibc-transfer}/types/keys.go | 0 x/{transfer => ibc-transfer}/types/msgs.go | 0 .../types/msgs_test.go | 0 x/{transfer => ibc-transfer}/types/packet.go | 0 .../types/packet_test.go | 0 .../types/types.pb.go | 74 ++--- .../types/types.proto | 2 +- x/ibc/04-channel/keeper/packet_test.go | 2 +- x/transfer/handler_test.go | 4 +- 34 files changed, 373 insertions(+), 62 deletions(-) rename x/{transfer => ibc-transfer}/alias.go (89%) rename x/{transfer => ibc-transfer}/client/cli/cli.go (100%) rename x/{transfer => ibc-transfer}/client/cli/query.go (95%) rename x/{transfer => ibc-transfer}/client/cli/tx.go (97%) rename x/{transfer => ibc-transfer}/client/rest/query.go (96%) rename x/{transfer => ibc-transfer}/client/rest/rest.go (100%) rename x/{transfer => ibc-transfer}/client/rest/tx.go (97%) rename x/{transfer => ibc-transfer}/client/utils/utils.go (100%) rename x/{transfer => ibc-transfer}/genesis.go (95%) rename x/{transfer => ibc-transfer}/handler.go (100%) create mode 100644 x/ibc-transfer/handler_test.go rename x/{transfer => ibc-transfer}/keeper/keeper.go (98%) rename x/{transfer => ibc-transfer}/keeper/keeper_test.go (99%) rename x/{transfer => ibc-transfer}/keeper/relay.go (99%) rename x/{transfer => ibc-transfer}/keeper/relay_test.go (99%) rename x/{transfer => ibc-transfer}/module.go (98%) rename x/{transfer => ibc-transfer}/simulation/genesis.go (94%) rename x/{transfer => ibc-transfer}/types/codec.go (100%) rename x/{transfer => ibc-transfer}/types/errors.go (100%) rename x/{transfer => ibc-transfer}/types/events.go (100%) rename x/{transfer => ibc-transfer}/types/expected_keepers.go (100%) rename x/{transfer => ibc-transfer}/types/genesis.go (100%) rename x/{transfer => ibc-transfer}/types/genesis_test.go (92%) rename x/{transfer => ibc-transfer}/types/keys.go (100%) rename x/{transfer => ibc-transfer}/types/msgs.go (100%) rename x/{transfer => ibc-transfer}/types/msgs_test.go (100%) rename x/{transfer => ibc-transfer}/types/packet.go (100%) rename x/{transfer => ibc-transfer}/types/packet_test.go (100%) rename x/{transfer => ibc-transfer}/types/types.pb.go (88%) rename x/{transfer => ibc-transfer}/types/types.proto (96%) diff --git a/simapp/app.go b/simapp/app.go index 731f7c2cab96..e36d92b87a10 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -27,6 +27,7 @@ import ( "github.com/cosmos/cosmos-sdk/x/genutil" "github.com/cosmos/cosmos-sdk/x/gov" "github.com/cosmos/cosmos-sdk/x/ibc" + transfer "github.com/cosmos/cosmos-sdk/x/ibc-transfer" ibcclient "github.com/cosmos/cosmos-sdk/x/ibc/02-client" port "github.com/cosmos/cosmos-sdk/x/ibc/05-port" "github.com/cosmos/cosmos-sdk/x/mint" @@ -35,7 +36,6 @@ import ( paramproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" "github.com/cosmos/cosmos-sdk/x/slashing" "github.com/cosmos/cosmos-sdk/x/staking" - transfer "github.com/cosmos/cosmos-sdk/x/transfer" "github.com/cosmos/cosmos-sdk/x/upgrade" upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" ) diff --git a/simapp/sim_test.go b/simapp/sim_test.go index fc36ccbc9625..2de2ed3faf8b 100644 --- a/simapp/sim_test.go +++ b/simapp/sim_test.go @@ -24,12 +24,12 @@ import ( "github.com/cosmos/cosmos-sdk/x/evidence" "github.com/cosmos/cosmos-sdk/x/gov" "github.com/cosmos/cosmos-sdk/x/ibc" + transfer "github.com/cosmos/cosmos-sdk/x/ibc-transfer" "github.com/cosmos/cosmos-sdk/x/mint" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/cosmos/cosmos-sdk/x/simulation" "github.com/cosmos/cosmos-sdk/x/slashing" "github.com/cosmos/cosmos-sdk/x/staking" - transfer "github.com/cosmos/cosmos-sdk/x/transfer" ) // Get flags every time the simulator is run diff --git a/x/transfer/alias.go b/x/ibc-transfer/alias.go similarity index 89% rename from x/transfer/alias.go rename to x/ibc-transfer/alias.go index 03feb83cb5d2..2fa2b8bb0f73 100644 --- a/x/transfer/alias.go +++ b/x/ibc-transfer/alias.go @@ -2,12 +2,12 @@ package transfer // autogenerated code using github.com/rigelrozanski/multitool // aliases generated for the following subdirectories: -// ALIASGEN: github.com/cosmos/cosmos-sdk/x/transfer/keeper -// ALIASGEN: github.com/cosmos/cosmos-sdk/x/transfer/types +// ALIASGEN: github.com/cosmos/cosmos-sdk/x/ibc-transfer/keeper +// ALIASGEN: github.com/cosmos/cosmos-sdk/x/ibc-transfer/types import ( - "github.com/cosmos/cosmos-sdk/x/transfer/keeper" - "github.com/cosmos/cosmos-sdk/x/transfer/types" + "github.com/cosmos/cosmos-sdk/x/ibc-transfer/keeper" + "github.com/cosmos/cosmos-sdk/x/ibc-transfer/types" ) const ( diff --git a/x/transfer/client/cli/cli.go b/x/ibc-transfer/client/cli/cli.go similarity index 100% rename from x/transfer/client/cli/cli.go rename to x/ibc-transfer/client/cli/cli.go diff --git a/x/transfer/client/cli/query.go b/x/ibc-transfer/client/cli/query.go similarity index 95% rename from x/transfer/client/cli/query.go rename to x/ibc-transfer/client/cli/query.go index b4e1e928e701..8a9a15633e5e 100644 --- a/x/transfer/client/cli/query.go +++ b/x/ibc-transfer/client/cli/query.go @@ -11,7 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/version" - "github.com/cosmos/cosmos-sdk/x/transfer/client/utils" + "github.com/cosmos/cosmos-sdk/x/ibc-transfer/client/utils" ) // GetCmdQueryNextSequence defines the command to query a next receive sequence diff --git a/x/transfer/client/cli/tx.go b/x/ibc-transfer/client/cli/tx.go similarity index 97% rename from x/transfer/client/cli/tx.go rename to x/ibc-transfer/client/cli/tx.go index fb00cd53c7dc..daafae7bf443 100644 --- a/x/transfer/client/cli/tx.go +++ b/x/ibc-transfer/client/cli/tx.go @@ -12,7 +12,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authclient "github.com/cosmos/cosmos-sdk/x/auth/client" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/cosmos/cosmos-sdk/x/transfer/types" + "github.com/cosmos/cosmos-sdk/x/ibc-transfer/types" ) // IBC transfer flags diff --git a/x/transfer/client/rest/query.go b/x/ibc-transfer/client/rest/query.go similarity index 96% rename from x/transfer/client/rest/query.go rename to x/ibc-transfer/client/rest/query.go index 2f21d7f20737..4c5c848d642b 100644 --- a/x/transfer/client/rest/query.go +++ b/x/ibc-transfer/client/rest/query.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/context" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/types/rest" - "github.com/cosmos/cosmos-sdk/x/transfer/client/utils" + "github.com/cosmos/cosmos-sdk/x/ibc-transfer/client/utils" ) func registerQueryRoutes(cliCtx context.CLIContext, r *mux.Router) { diff --git a/x/transfer/client/rest/rest.go b/x/ibc-transfer/client/rest/rest.go similarity index 100% rename from x/transfer/client/rest/rest.go rename to x/ibc-transfer/client/rest/rest.go diff --git a/x/transfer/client/rest/tx.go b/x/ibc-transfer/client/rest/tx.go similarity index 97% rename from x/transfer/client/rest/tx.go rename to x/ibc-transfer/client/rest/tx.go index 3f5fa8cd1943..372602f58f63 100644 --- a/x/transfer/client/rest/tx.go +++ b/x/ibc-transfer/client/rest/tx.go @@ -10,7 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/rest" authclient "github.com/cosmos/cosmos-sdk/x/auth/client" - "github.com/cosmos/cosmos-sdk/x/transfer/types" + "github.com/cosmos/cosmos-sdk/x/ibc-transfer/types" ) func registerTxRoutes(cliCtx context.CLIContext, r *mux.Router) { diff --git a/x/transfer/client/utils/utils.go b/x/ibc-transfer/client/utils/utils.go similarity index 100% rename from x/transfer/client/utils/utils.go rename to x/ibc-transfer/client/utils/utils.go diff --git a/x/transfer/genesis.go b/x/ibc-transfer/genesis.go similarity index 95% rename from x/transfer/genesis.go rename to x/ibc-transfer/genesis.go index 573808e077e1..ad6120ab5782 100644 --- a/x/transfer/genesis.go +++ b/x/ibc-transfer/genesis.go @@ -4,7 +4,7 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/transfer/types" + "github.com/cosmos/cosmos-sdk/x/ibc-transfer/types" ) // InitGenesis binds to portid from genesis state diff --git a/x/transfer/handler.go b/x/ibc-transfer/handler.go similarity index 100% rename from x/transfer/handler.go rename to x/ibc-transfer/handler.go diff --git a/x/ibc-transfer/handler_test.go b/x/ibc-transfer/handler_test.go new file mode 100644 index 000000000000..4509fd2e967d --- /dev/null +++ b/x/ibc-transfer/handler_test.go @@ -0,0 +1,311 @@ +package transfer_test + +import ( + "fmt" + "testing" + "time" + + "github.com/stretchr/testify/suite" + + abci "github.com/tendermint/tendermint/abci/types" + lite "github.com/tendermint/tendermint/lite2" + tmtypes "github.com/tendermint/tendermint/types" + + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/simapp" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/bank" + transfer "github.com/cosmos/cosmos-sdk/x/ibc-transfer" + "github.com/cosmos/cosmos-sdk/x/ibc-transfer/types" + connectiontypes "github.com/cosmos/cosmos-sdk/x/ibc/03-connection/types" + channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types" + ibctmtypes "github.com/cosmos/cosmos-sdk/x/ibc/07-tendermint/types" + commitmenttypes "github.com/cosmos/cosmos-sdk/x/ibc/23-commitment/types" + host "github.com/cosmos/cosmos-sdk/x/ibc/24-host" + + "github.com/cosmos/cosmos-sdk/x/staking" +) + +// define constants used for testing +const ( + testClientIDA = "testclientida" + testClientIDB = "testclientidb" + + testConnection = "testconnection" + testPort1 = "bank" + testPort2 = "testportid" + testChannel1 = "firstchannel" + testChannel2 = "secondchannel" + + trustingPeriod time.Duration = time.Hour * 24 * 7 * 2 + ubdPeriod time.Duration = time.Hour * 24 * 7 * 3 + maxClockDrift time.Duration = time.Second * 10 +) + +// define variables used for testing +var ( + testAddr1 = sdk.AccAddress([]byte("testaddr1")) + testAddr2 = sdk.AccAddress([]byte("testaddr2")) + + testCoins, _ = sdk.ParseCoins("100atom") + testPrefixedCoins1, _ = sdk.ParseCoins(fmt.Sprintf("100%satom", types.GetDenomPrefix(testPort1, testChannel1))) + testPrefixedCoins2, _ = sdk.ParseCoins(fmt.Sprintf("100%satom", types.GetDenomPrefix(testPort2, testChannel2))) +) + +type HandlerTestSuite struct { + suite.Suite + + cdc *codec.Codec + + chainA *TestChain + chainB *TestChain +} + +func (suite *HandlerTestSuite) SetupTest() { + suite.chainA = NewTestChain(testClientIDA) + suite.chainB = NewTestChain(testClientIDB) + + suite.cdc = suite.chainA.App.Codec() +} + +func (suite *HandlerTestSuite) TestHandleMsgTransfer() { + handler := transfer.NewHandler(suite.chainA.App.TransferKeeper) + + // create channel capability from ibc scoped keeper and claim with transfer scoped keeper + capName := host.ChannelCapabilityPath(testPort1, testChannel1) + cap, err := suite.chainA.App.ScopedIBCKeeper.NewCapability(suite.chainA.GetContext(), capName) + suite.Require().Nil(err, "could not create capability") + err = suite.chainA.App.ScopedTransferKeeper.ClaimCapability(suite.chainA.GetContext(), cap, capName) + suite.Require().Nil(err, "transfer module could not claim capability") + + ctx := suite.chainA.GetContext() + msg := transfer.NewMsgTransfer(testPort1, testChannel1, 10, testPrefixedCoins2, testAddr1, testAddr2.String()) + res, err := handler(ctx, msg) + suite.Require().Error(err) + suite.Require().Nil(res, "%+v", res) // channel does not exist + + // Setup channel from A to B + suite.chainA.CreateClient(suite.chainB) + suite.chainA.createConnection(testConnection, testConnection, testClientIDB, testClientIDA, connectiontypes.OPEN) + suite.chainA.createChannel(testPort1, testChannel1, testPort2, testChannel2, channeltypes.OPEN, channeltypes.ORDERED, testConnection) + + res, err = handler(ctx, msg) + suite.Require().Error(err) + suite.Require().Nil(res, "%+v", res) // next send sequence not found + + nextSeqSend := uint64(1) + suite.chainA.App.IBCKeeper.ChannelKeeper.SetNextSequenceSend(ctx, testPort1, testChannel1, nextSeqSend) + res, err = handler(ctx, msg) + suite.Require().Error(err) + suite.Require().Nil(res, "%+v", res) // sender has insufficient coins + + _ = suite.chainA.App.BankKeeper.SetBalances(ctx, testAddr1, testCoins) + res, err = handler(ctx, msg) + suite.Require().NoError(err) + suite.Require().NotNil(res, "%+v", res) // successfully executed + + // test when the source is false + msg = transfer.NewMsgTransfer(testPort1, testChannel1, 10, testPrefixedCoins2, testAddr1, testAddr2.String()) + _ = suite.chainA.App.BankKeeper.SetBalances(ctx, testAddr1, testPrefixedCoins2) + + res, err = handler(ctx, msg) + suite.Require().Error(err) + suite.Require().Nil(res, "%+v", res) // incorrect denom prefix + + msg = transfer.NewMsgTransfer(testPort1, testChannel1, 10, testPrefixedCoins1, testAddr1, testAddr2.String()) + suite.chainA.App.BankKeeper.SetSupply(ctx, bank.NewSupply(testPrefixedCoins1)) + _ = suite.chainA.App.BankKeeper.SetBalances(ctx, testAddr1, testPrefixedCoins1) + + res, err = handler(ctx, msg) + suite.Require().NoError(err) + suite.Require().NotNil(res, "%+v", res) // successfully executed +} + +func TestHandlerTestSuite(t *testing.T) { + suite.Run(t, new(HandlerTestSuite)) +} + +type TestChain struct { + ClientID string + App *simapp.SimApp + Header ibctmtypes.Header + Vals *tmtypes.ValidatorSet + Signers []tmtypes.PrivValidator +} + +func NewTestChain(clientID string) *TestChain { + privVal := tmtypes.NewMockPV() + + pubKey, err := privVal.GetPubKey() + if err != nil { + panic(err) + } + + validator := tmtypes.NewValidator(pubKey, 1) + valSet := tmtypes.NewValidatorSet([]*tmtypes.Validator{validator}) + signers := []tmtypes.PrivValidator{privVal} + now := time.Date(2020, 1, 2, 0, 0, 0, 0, time.UTC) + + header := ibctmtypes.CreateTestHeader(clientID, 1, now, valSet, signers) + + return &TestChain{ + ClientID: clientID, + App: simapp.Setup(false), + Header: header, + Vals: valSet, + Signers: signers, + } +} + +// Creates simple context for testing purposes +func (chain *TestChain) GetContext() sdk.Context { + return chain.App.BaseApp.NewContext(false, abci.Header{ChainID: chain.Header.SignedHeader.Header.ChainID, Height: chain.Header.SignedHeader.Header.Height}) +} + +// createClient will create a client for clientChain on targetChain +func (chain *TestChain) CreateClient(client *TestChain) error { + client.Header = nextHeader(client) + // Commit and create a new block on appTarget to get a fresh CommitID + client.App.Commit() + commitID := client.App.LastCommitID() + client.App.BeginBlock(abci.RequestBeginBlock{Header: abci.Header{Height: client.Header.SignedHeader.Header.Height, Time: client.Header.Time}}) + + // Set HistoricalInfo on client chain after Commit + ctxClient := client.GetContext() + validator := staking.NewValidator( + sdk.ValAddress(client.Vals.Validators[0].Address), client.Vals.Validators[0].PubKey, staking.Description{}, + ) + validator.Status = sdk.Bonded + validator.Tokens = sdk.NewInt(1000000) // get one voting power + validators := []staking.Validator{validator} + histInfo := staking.HistoricalInfo{ + Header: abci.Header{ + AppHash: commitID.Hash, + }, + Valset: validators, + } + client.App.StakingKeeper.SetHistoricalInfo(ctxClient, client.Header.SignedHeader.Header.Height, histInfo) + + // Create target ctx + ctxTarget := chain.GetContext() + + // create client + clientState, err := ibctmtypes.Initialize(client.ClientID, lite.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, client.Header) + if err != nil { + return err + } + _, err = chain.App.IBCKeeper.ClientKeeper.CreateClient(ctxTarget, clientState, client.Header.ConsensusState()) + if err != nil { + return err + } + return nil + + // _, _, err := simapp.SignCheckDeliver( + // suite.T(), + // suite.cdc, + // suite.app.BaseApp, + // ctx.BlockHeader(), + // []sdk.Msg{clienttypes.NewMsgCreateClient(clientID, clientexported.ClientTypeTendermint, consState, accountAddress)}, + // []uint64{baseAccount.GetAccountNumber()}, + // []uint64{baseAccount.GetSequence()}, + // true, true, accountPrivKey, + // ) +} + +// nolint: unused +func (chain *TestChain) updateClient(client *TestChain) { + // Create target ctx + ctxTarget := chain.GetContext() + + // if clientState does not already exist, return without updating + _, found := chain.App.IBCKeeper.ClientKeeper.GetClientState( + ctxTarget, client.ClientID, + ) + if !found { + return + } + + // always commit when updateClient and begin a new block + client.App.Commit() + commitID := client.App.LastCommitID() + + client.Header = nextHeader(client) + client.App.BeginBlock(abci.RequestBeginBlock{Header: abci.Header{Height: client.Header.SignedHeader.Header.Height, Time: client.Header.Time}}) + + // Set HistoricalInfo on client chain after Commit + ctxClient := client.GetContext() + validator := staking.NewValidator( + sdk.ValAddress(client.Vals.Validators[0].Address), client.Vals.Validators[0].PubKey, staking.Description{}, + ) + validator.Status = sdk.Bonded + validator.Tokens = sdk.NewInt(1000000) + validators := []staking.Validator{validator} + histInfo := staking.HistoricalInfo{ + Header: abci.Header{ + AppHash: commitID.Hash, + }, + Valset: validators, + } + client.App.StakingKeeper.SetHistoricalInfo(ctxClient, client.Header.SignedHeader.Header.Height, histInfo) + + consensusState := ibctmtypes.ConsensusState{ + Height: uint64(client.Header.SignedHeader.Header.Height), + Timestamp: client.Header.Time, + Root: commitmenttypes.NewMerkleRoot(commitID.Hash), + ValidatorSet: client.Vals, + } + + chain.App.IBCKeeper.ClientKeeper.SetClientConsensusState( + ctxTarget, client.ClientID, uint64(client.Header.SignedHeader.Header.Height), consensusState, + ) + chain.App.IBCKeeper.ClientKeeper.SetClientState( + ctxTarget, ibctmtypes.NewClientState(client.ClientID, lite.DefaultTrustLevel, trustingPeriod, ubdPeriod, maxClockDrift, client.Header), + ) + + // _, _, err := simapp.SignCheckDeliver( + // suite.T(), + // suite.cdc, + // suite.app.BaseApp, + // ctx.BlockHeader(), + // []sdk.Msg{clienttypes.NewMsgUpdateClient(clientID, suite.header, accountAddress)}, + // []uint64{baseAccount.GetAccountNumber()}, + // []uint64{baseAccount.GetSequence()}, + // true, true, accountPrivKey, + // ) + // suite.Require().NoError(err) +} + +func (chain *TestChain) createConnection( + connID, counterpartyConnID, clientID, counterpartyClientID string, + state connectiontypes.State, +) connectiontypes.ConnectionEnd { + counterparty := connectiontypes.NewCounterparty(counterpartyClientID, counterpartyConnID, commitmenttypes.NewMerklePrefix(chain.App.IBCKeeper.ConnectionKeeper.GetCommitmentPrefix().Bytes())) + connection := connectiontypes.ConnectionEnd{ + State: state, + ClientID: clientID, + Counterparty: counterparty, + Versions: connectiontypes.GetCompatibleVersions(), + } + ctx := chain.GetContext() + chain.App.IBCKeeper.ConnectionKeeper.SetConnection(ctx, connID, connection) + return connection +} + +// nolint: unused +func (chain *TestChain) createChannel( + portID, channelID, counterpartyPortID, counterpartyChannelID string, + state channeltypes.State, order channeltypes.Order, connectionID string, +) channeltypes.Channel { + counterparty := channeltypes.NewCounterparty(counterpartyPortID, counterpartyChannelID) + channel := channeltypes.NewChannel(state, order, counterparty, + []string{connectionID}, "1.0", + ) + ctx := chain.GetContext() + chain.App.IBCKeeper.ChannelKeeper.SetChannel(ctx, portID, channelID, channel) + return channel +} + +func nextHeader(chain *TestChain) ibctmtypes.Header { + return ibctmtypes.CreateTestHeader(chain.Header.SignedHeader.Header.ChainID, chain.Header.SignedHeader.Header.Height+1, + chain.Header.Time.Add(time.Minute), chain.Vals, chain.Signers) +} diff --git a/x/transfer/keeper/keeper.go b/x/ibc-transfer/keeper/keeper.go similarity index 98% rename from x/transfer/keeper/keeper.go rename to x/ibc-transfer/keeper/keeper.go index dc77f1167a06..7c8ff18ef7d3 100644 --- a/x/transfer/keeper/keeper.go +++ b/x/ibc-transfer/keeper/keeper.go @@ -10,10 +10,10 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" authexported "github.com/cosmos/cosmos-sdk/x/auth/exported" "github.com/cosmos/cosmos-sdk/x/capability" + "github.com/cosmos/cosmos-sdk/x/ibc-transfer/types" channel "github.com/cosmos/cosmos-sdk/x/ibc/04-channel" channelexported "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/exported" host "github.com/cosmos/cosmos-sdk/x/ibc/24-host" - "github.com/cosmos/cosmos-sdk/x/transfer/types" ) const ( diff --git a/x/transfer/keeper/keeper_test.go b/x/ibc-transfer/keeper/keeper_test.go similarity index 99% rename from x/transfer/keeper/keeper_test.go rename to x/ibc-transfer/keeper/keeper_test.go index 8a090fa2519d..d8782e1565f8 100644 --- a/x/transfer/keeper/keeper_test.go +++ b/x/ibc-transfer/keeper/keeper_test.go @@ -14,12 +14,12 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/ibc-transfer/types" connectiontypes "github.com/cosmos/cosmos-sdk/x/ibc/03-connection/types" channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types" ibctmtypes "github.com/cosmos/cosmos-sdk/x/ibc/07-tendermint/types" commitmenttypes "github.com/cosmos/cosmos-sdk/x/ibc/23-commitment/types" host "github.com/cosmos/cosmos-sdk/x/ibc/24-host" - "github.com/cosmos/cosmos-sdk/x/transfer/types" "github.com/cosmos/cosmos-sdk/x/staking" ) diff --git a/x/transfer/keeper/relay.go b/x/ibc-transfer/keeper/relay.go similarity index 99% rename from x/transfer/keeper/relay.go rename to x/ibc-transfer/keeper/relay.go index c6498d48a145..25e9e2b0813c 100644 --- a/x/transfer/keeper/relay.go +++ b/x/ibc-transfer/keeper/relay.go @@ -5,9 +5,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/x/ibc-transfer/types" channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types" host "github.com/cosmos/cosmos-sdk/x/ibc/24-host" - "github.com/cosmos/cosmos-sdk/x/transfer/types" ) // SendTransfer handles transfer sending logic. There are 2 possible cases: diff --git a/x/transfer/keeper/relay_test.go b/x/ibc-transfer/keeper/relay_test.go similarity index 99% rename from x/transfer/keeper/relay_test.go rename to x/ibc-transfer/keeper/relay_test.go index e6f3f65c5b48..ece3a4e71e6d 100644 --- a/x/transfer/keeper/relay_test.go +++ b/x/ibc-transfer/keeper/relay_test.go @@ -5,10 +5,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/bank" + "github.com/cosmos/cosmos-sdk/x/ibc-transfer/types" connection "github.com/cosmos/cosmos-sdk/x/ibc/03-connection" channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types" host "github.com/cosmos/cosmos-sdk/x/ibc/24-host" - "github.com/cosmos/cosmos-sdk/x/transfer/types" ) func (suite *KeeperTestSuite) TestSendTransfer() { diff --git a/x/transfer/module.go b/x/ibc-transfer/module.go similarity index 98% rename from x/transfer/module.go rename to x/ibc-transfer/module.go index 98770cac09d8..cca17d18d033 100644 --- a/x/transfer/module.go +++ b/x/ibc-transfer/module.go @@ -18,15 +18,15 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/capability" + "github.com/cosmos/cosmos-sdk/x/ibc-transfer/client/cli" + "github.com/cosmos/cosmos-sdk/x/ibc-transfer/client/rest" + "github.com/cosmos/cosmos-sdk/x/ibc-transfer/simulation" + "github.com/cosmos/cosmos-sdk/x/ibc-transfer/types" channel "github.com/cosmos/cosmos-sdk/x/ibc/04-channel" channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types" port "github.com/cosmos/cosmos-sdk/x/ibc/05-port" porttypes "github.com/cosmos/cosmos-sdk/x/ibc/05-port/types" host "github.com/cosmos/cosmos-sdk/x/ibc/24-host" - "github.com/cosmos/cosmos-sdk/x/transfer/client/cli" - "github.com/cosmos/cosmos-sdk/x/transfer/client/rest" - "github.com/cosmos/cosmos-sdk/x/transfer/simulation" - "github.com/cosmos/cosmos-sdk/x/transfer/types" ) var ( diff --git a/x/transfer/simulation/genesis.go b/x/ibc-transfer/simulation/genesis.go similarity index 94% rename from x/transfer/simulation/genesis.go rename to x/ibc-transfer/simulation/genesis.go index 2195e6d6b368..ea008681fd59 100644 --- a/x/transfer/simulation/genesis.go +++ b/x/ibc-transfer/simulation/genesis.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/cosmos/cosmos-sdk/x/transfer/types" + "github.com/cosmos/cosmos-sdk/x/ibc-transfer/types" ) // Simulation parameter constants diff --git a/x/transfer/types/codec.go b/x/ibc-transfer/types/codec.go similarity index 100% rename from x/transfer/types/codec.go rename to x/ibc-transfer/types/codec.go diff --git a/x/transfer/types/errors.go b/x/ibc-transfer/types/errors.go similarity index 100% rename from x/transfer/types/errors.go rename to x/ibc-transfer/types/errors.go diff --git a/x/transfer/types/events.go b/x/ibc-transfer/types/events.go similarity index 100% rename from x/transfer/types/events.go rename to x/ibc-transfer/types/events.go diff --git a/x/transfer/types/expected_keepers.go b/x/ibc-transfer/types/expected_keepers.go similarity index 100% rename from x/transfer/types/expected_keepers.go rename to x/ibc-transfer/types/expected_keepers.go diff --git a/x/transfer/types/genesis.go b/x/ibc-transfer/types/genesis.go similarity index 100% rename from x/transfer/types/genesis.go rename to x/ibc-transfer/types/genesis.go diff --git a/x/transfer/types/genesis_test.go b/x/ibc-transfer/types/genesis_test.go similarity index 92% rename from x/transfer/types/genesis_test.go rename to x/ibc-transfer/types/genesis_test.go index 8c6e982e5e60..bd687c5561d3 100644 --- a/x/transfer/types/genesis_test.go +++ b/x/ibc-transfer/types/genesis_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/cosmos/cosmos-sdk/x/transfer/types" + "github.com/cosmos/cosmos-sdk/x/ibc-transfer/types" ) func TestValidateGenesis(t *testing.T) { diff --git a/x/transfer/types/keys.go b/x/ibc-transfer/types/keys.go similarity index 100% rename from x/transfer/types/keys.go rename to x/ibc-transfer/types/keys.go diff --git a/x/transfer/types/msgs.go b/x/ibc-transfer/types/msgs.go similarity index 100% rename from x/transfer/types/msgs.go rename to x/ibc-transfer/types/msgs.go diff --git a/x/transfer/types/msgs_test.go b/x/ibc-transfer/types/msgs_test.go similarity index 100% rename from x/transfer/types/msgs_test.go rename to x/ibc-transfer/types/msgs_test.go diff --git a/x/transfer/types/packet.go b/x/ibc-transfer/types/packet.go similarity index 100% rename from x/transfer/types/packet.go rename to x/ibc-transfer/types/packet.go diff --git a/x/transfer/types/packet_test.go b/x/ibc-transfer/types/packet_test.go similarity index 100% rename from x/transfer/types/packet_test.go rename to x/ibc-transfer/types/packet_test.go diff --git a/x/transfer/types/types.pb.go b/x/ibc-transfer/types/types.pb.go similarity index 88% rename from x/transfer/types/types.pb.go rename to x/ibc-transfer/types/types.pb.go index 48860c64ab83..b4f770a2e5a7 100644 --- a/x/transfer/types/types.pb.go +++ b/x/ibc-transfer/types/types.pb.go @@ -1,5 +1,5 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: x/transfer/types/types.proto +// source: x/ibc-transfer/types/types.proto package types @@ -46,7 +46,7 @@ func (m *MsgTransfer) Reset() { *m = MsgTransfer{} } func (m *MsgTransfer) String() string { return proto.CompactTextString(m) } func (*MsgTransfer) ProtoMessage() {} func (*MsgTransfer) Descriptor() ([]byte, []int) { - return fileDescriptor_5b7f3a4f209aae4b, []int{0} + return fileDescriptor_36db19b72d57f809, []int{0} } func (m *MsgTransfer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -132,7 +132,7 @@ func (m *FungibleTokenPacketData) Reset() { *m = FungibleTokenPacketData func (m *FungibleTokenPacketData) String() string { return proto.CompactTextString(m) } func (*FungibleTokenPacketData) ProtoMessage() {} func (*FungibleTokenPacketData) Descriptor() ([]byte, []int) { - return fileDescriptor_5b7f3a4f209aae4b, []int{1} + return fileDescriptor_36db19b72d57f809, []int{1} } func (m *FungibleTokenPacketData) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -194,7 +194,7 @@ func (m *FungibleTokenPacketAcknowledgement) Reset() { *m = FungibleToke func (m *FungibleTokenPacketAcknowledgement) String() string { return proto.CompactTextString(m) } func (*FungibleTokenPacketAcknowledgement) ProtoMessage() {} func (*FungibleTokenPacketAcknowledgement) Descriptor() ([]byte, []int) { - return fileDescriptor_5b7f3a4f209aae4b, []int{2} + return fileDescriptor_36db19b72d57f809, []int{2} } func (m *FungibleTokenPacketAcknowledgement) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -243,40 +243,40 @@ func init() { proto.RegisterType((*FungibleTokenPacketAcknowledgement)(nil), "cosmos_sdk.x.transfer.v1.FungibleTokenPacketAcknowledgement") } -func init() { proto.RegisterFile("x/transfer/types/types.proto", fileDescriptor_5b7f3a4f209aae4b) } +func init() { proto.RegisterFile("x/ibc-transfer/types/types.proto", fileDescriptor_36db19b72d57f809) } -var fileDescriptor_5b7f3a4f209aae4b = []byte{ - // 477 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0xcd, 0x6e, 0xd3, 0x40, - 0x10, 0xce, 0x92, 0x36, 0x94, 0x0d, 0x20, 0x75, 0x81, 0xe2, 0x46, 0x60, 0x47, 0x3e, 0x20, 0x5f, - 0x6a, 0x13, 0x38, 0x20, 0x71, 0x22, 0x2e, 0xe2, 0x47, 0x02, 0xa9, 0xb2, 0x72, 0x42, 0x42, 0xd1, - 0x66, 0x3d, 0xd8, 0x96, 0xe3, 0xdd, 0x68, 0x77, 0x1d, 0x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29, 0x56, 0xbf, 0xac, 0x80, 0xff, 0xf2, 0x64, - 0x6e, 0xa2, 0xd3, 0xb9, 0x89, 0x7e, 0xcc, 0x4d, 0xf4, 0x69, 0x61, 0x36, 0x4e, 0x17, 0x66, 0xe3, - 0xdb, 0xc2, 0x6c, 0xbc, 0xfb, 0xbb, 0xe3, 0x17, 0x6f, 0xd3, 0xa8, 0x55, 0xee, 0xfc, 0xe3, 0x5f, - 0x01, 0x00, 0x00, 0xff, 0xff, 0x38, 0x87, 0xdd, 0xdc, 0x68, 0x03, 0x00, 0x00, +var fileDescriptor_36db19b72d57f809 = []byte{ + // 480 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x53, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x8d, 0x49, 0x1b, 0xca, 0x06, 0x90, 0xba, 0x40, 0x71, 0x23, 0x61, 0x47, 0x3e, 0x20, 0x5f, + 0x62, 0x13, 0x38, 0x20, 0x71, 0x22, 0x2e, 0x42, 0x20, 0x40, 0xaa, 0xac, 0x9c, 0x90, 0x50, 0xb4, + 0x59, 0x0f, 0xf6, 0xca, 0xf1, 0x6e, 0xb4, 0xbb, 0x0e, 0xcd, 0x5f, 0xf0, 0x01, 0x7c, 0x01, 0xe2, + 0x43, 0x7a, 0xec, 0x91, 0x93, 0x41, 0xc9, 0x1f, 0xe4, 0xc8, 0x09, 0xd5, 0x76, 0x4a, 0xa0, 0x11, + 0xe2, 0xc2, 0xc5, 0xf6, 0x9b, 0x79, 0xf3, 0x3c, 0x6f, 0x76, 0x16, 0x75, 0x4f, 0x7c, 0x36, 0xa6, + 0x3d, 0x2d, 0x09, 0x57, 0xef, 0x41, 0xfa, 0x7a, 0x3e, 0x05, 0x55, 0x3d, 0xbd, 0xa9, 0x14, 0x5a, + 0x60, 0x93, 0x0a, 0x95, 0x09, 0x35, 0x52, 0x51, 0xea, 0x9d, 0x78, 0x6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7, 0x75, 0x5e, 0xa0, 0xc2, 0x5a, 0x14, 0xbf, 0x44, 0x2d, 0x05, 0x3c, 0x02, 0x69, 0xee, + 0x76, 0x0d, 0xf7, 0x7a, 0xd0, 0xff, 0x51, 0xd8, 0xbd, 0x7f, 0x50, 0x19, 0x50, 0x3a, 0x88, 0x22, + 0x09, 0x4a, 0x85, 0xb5, 0x00, 0xee, 0xa0, 0x3d, 0x09, 0x14, 0xd8, 0x0c, 0xa4, 0xd9, 0x3a, 0x9f, + 0x59, 0x78, 0x81, 0x9d, 0x2f, 0x06, 0xba, 0xfb, 0x3c, 0xe7, 0x31, 0x1b, 0x4f, 0x60, 0x28, 0x52, + 0xe0, 0xc7, 0x84, 0xa6, 0xa0, 0x9f, 0x11, 0x4d, 0x36, 0x1c, 0x1a, 0xff, 0xc3, 0xe1, 0xc1, 0x85, + 0xc3, 0xf2, 0x20, 0xb7, 0xb6, 0xdb, 0xfc, 0xa3, 0xdd, 0x21, 0x72, 0xb6, 0x74, 0x3b, 0xa0, 0x29, + 0x17, 0x1f, 0x26, 0x10, 0xc5, 0x90, 0x01, 0xd7, 0xd8, 0x44, 0x57, 0x55, 0x4e, 0x29, 0x28, 0x55, + 0xee, 0xd7, 0x5e, 0xb8, 0x86, 0xf8, 0x36, 0xda, 0x05, 0x29, 0xc5, 0xfa, 0x97, 0x15, 0x08, 0x5e, + 0x9d, 0x2e, 0x2c, 0xe3, 0x6c, 0x61, 0x19, 0xdf, 0x17, 0x96, 0xf1, 0x71, 0x69, 0x35, 0xce, 0x96, + 0x56, 0xe3, 0xeb, 0xd2, 0x6a, 0xbc, 0xed, 0xff, 0xd5, 0xd5, 0xb6, 0x1b, 0x35, 0x6e, 0x95, 0x7b, + 0xff, 0xe8, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0x39, 0x62, 0x70, 0xeb, 0x70, 0x03, 0x00, 0x00, } func (m *MsgTransfer) Marshal() (dAtA []byte, err error) { diff --git a/x/transfer/types/types.proto b/x/ibc-transfer/types/types.proto similarity index 96% rename from x/transfer/types/types.proto rename to x/ibc-transfer/types/types.proto index 9b1a7705d6d6..4384eb6a7db9 100644 --- a/x/transfer/types/types.proto +++ b/x/ibc-transfer/types/types.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package cosmos_sdk.x.transfer.v1; -option go_package = "github.com/cosmos/cosmos-sdk/x/transfer/types"; +option go_package = "github.com/cosmos/cosmos-sdk/x/ibc-transfer/types"; import "third_party/proto/gogoproto/gogo.proto"; import "types/types.proto"; diff --git a/x/ibc/04-channel/keeper/packet_test.go b/x/ibc/04-channel/keeper/packet_test.go index e2d13a0a5ae5..d0d5aa62eb0e 100644 --- a/x/ibc/04-channel/keeper/packet_test.go +++ b/x/ibc/04-channel/keeper/packet_test.go @@ -4,11 +4,11 @@ import ( "fmt" "github.com/cosmos/cosmos-sdk/x/capability" + transfertypes "github.com/cosmos/cosmos-sdk/x/ibc-transfer/types" connection "github.com/cosmos/cosmos-sdk/x/ibc/03-connection" "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/exported" "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types" host "github.com/cosmos/cosmos-sdk/x/ibc/24-host" - transfertypes "github.com/cosmos/cosmos-sdk/x/transfer/types" ) func (suite *KeeperTestSuite) TestSendPacket() { diff --git a/x/transfer/handler_test.go b/x/transfer/handler_test.go index 70f7a7e42c85..4509fd2e967d 100644 --- a/x/transfer/handler_test.go +++ b/x/transfer/handler_test.go @@ -15,13 +15,13 @@ import ( "github.com/cosmos/cosmos-sdk/simapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/bank" + transfer "github.com/cosmos/cosmos-sdk/x/ibc-transfer" + "github.com/cosmos/cosmos-sdk/x/ibc-transfer/types" connectiontypes "github.com/cosmos/cosmos-sdk/x/ibc/03-connection/types" channeltypes "github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types" ibctmtypes "github.com/cosmos/cosmos-sdk/x/ibc/07-tendermint/types" commitmenttypes "github.com/cosmos/cosmos-sdk/x/ibc/23-commitment/types" host "github.com/cosmos/cosmos-sdk/x/ibc/24-host" - transfer "github.com/cosmos/cosmos-sdk/x/transfer" - "github.com/cosmos/cosmos-sdk/x/transfer/types" "github.com/cosmos/cosmos-sdk/x/staking" )