From 47af96447ad55f3889ab111c418d3148ad260f55 Mon Sep 17 00:00:00 2001 From: crodriguezvega Date: Wed, 13 Apr 2022 10:51:26 +0200 Subject: [PATCH 1/3] deprecate GetTransferAccount --- modules/apps/transfer/keeper/genesis.go | 6 ------ modules/apps/transfer/keeper/keeper.go | 6 ------ modules/apps/transfer/keeper/keeper_test.go | 10 ---------- 3 files changed, 22 deletions(-) diff --git a/modules/apps/transfer/keeper/genesis.go b/modules/apps/transfer/keeper/genesis.go index 35bbd231a59..d4020508cc9 100644 --- a/modules/apps/transfer/keeper/genesis.go +++ b/modules/apps/transfer/keeper/genesis.go @@ -28,12 +28,6 @@ func (k Keeper) InitGenesis(ctx sdk.Context, state types.GenesisState) { } k.SetParams(ctx, state.Params) - - // check if the module account exists - moduleAcc := k.GetTransferAccount(ctx) - if moduleAcc == nil { - panic(fmt.Sprintf("%s module account has not been set", types.ModuleName)) - } } // ExportGenesis exports ibc-transfer module's portID and denom trace info into its genesis state. diff --git a/modules/apps/transfer/keeper/keeper.go b/modules/apps/transfer/keeper/keeper.go index 46e3c51aa2a..d3f32d95df7 100644 --- a/modules/apps/transfer/keeper/keeper.go +++ b/modules/apps/transfer/keeper/keeper.go @@ -4,7 +4,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" @@ -64,11 +63,6 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", "x/"+host.ModuleName+"-"+types.ModuleName) } -// GetTransferAccount returns the ICS20 - transfers ModuleAccount -func (k Keeper) GetTransferAccount(ctx sdk.Context) authtypes.ModuleAccountI { - return k.authKeeper.GetModuleAccount(ctx, types.ModuleName) -} - // IsBound checks if the transfer module is already bound to the desired port func (k Keeper) IsBound(ctx sdk.Context, portID string) bool { _, ok := k.scopedKeeper.GetCapability(ctx, host.PortPath(portID)) diff --git a/modules/apps/transfer/keeper/keeper_test.go b/modules/apps/transfer/keeper/keeper_test.go index 1e29626c987..c8c79b4009b 100644 --- a/modules/apps/transfer/keeper/keeper_test.go +++ b/modules/apps/transfer/keeper/keeper_test.go @@ -46,16 +46,6 @@ func NewTransferPath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path { return path } -func (suite *KeeperTestSuite) TestGetTransferAccount() { - expectedMaccAddr := sdk.AccAddress(crypto.AddressHash([]byte(types.ModuleName))) - - macc := suite.chainA.GetSimApp().TransferKeeper.GetTransferAccount(suite.chainA.GetContext()) - - suite.Require().NotNil(macc) - suite.Require().Equal(types.ModuleName, macc.GetName()) - suite.Require().Equal(expectedMaccAddr, macc.GetAddress()) -} - func TestKeeperTestSuite(t *testing.T) { suite.Run(t, new(KeeperTestSuite)) } From d3af71210690a420eee051f670e3b679fabbd312 Mon Sep 17 00:00:00 2001 From: crodriguezvega Date: Wed, 13 Apr 2022 11:00:00 +0200 Subject: [PATCH 2/3] add changelog entry --- CHANGELOG.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 88886e3254e..4d718ea85ea 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,20 +40,22 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### API Breaking +* (transfer) [\#1250](https://github.com/cosmos/ibc-go/pull/1250) Deprecate `GetTransferAccount` since the `transfer` module account is never used. + ### State Machine Breaking ### Improvements + * (modules/core/04-channel) [\#1160](https://github.com/cosmos/ibc-go/pull/1160) Improve `uint64 -> string` performance in `Logger`. * (modules/core/04-channel) [\#1232](https://github.com/cosmos/ibc-go/pull/1232) Updating params on `NewPacketId` and moving to bottom of file. ### Features -* (modules/apps/29-fee) [\#1230](https://github.com/cosmos/ibc-go/pull/1230) Adding CLI command for getting incentivized packets for a specific channel-id. - * [\#276](https://github.com/cosmos/ibc-go/pull/276) Adding the Fee Middleware module v1 * (apps/29-fee) [\#1229](https://github.com/cosmos/ibc-go/pull/1229) Adding CLI commands for getting all unrelayed incentivized packets and packet by packet-id. * (apps/29-fee) [\#1224](https://github.com/cosmos/ibc-go/pull/1224) Adding Query/CounterpartyAddress and CLI to ICS29 fee middleware * (apps/29-fee) [\#1225](https://github.com/cosmos/ibc-go/pull/1225) Adding Query/FeeEnabledChannel and Query/FeeEnabledChannels with CLIs to ICS29 fee middleware. +* (modules/apps/29-fee) [\#1230](https://github.com/cosmos/ibc-go/pull/1230) Adding CLI command for getting incentivized packets for a specific channel-id. ### Bug Fixes From 69b23a05e44122d042394d08b40ef3a18db979b0 Mon Sep 17 00:00:00 2001 From: crodriguezvega Date: Wed, 13 Apr 2022 11:15:36 +0200 Subject: [PATCH 3/3] remove unused imports --- modules/apps/transfer/keeper/keeper_test.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/apps/transfer/keeper/keeper_test.go b/modules/apps/transfer/keeper/keeper_test.go index c8c79b4009b..40ceb6d782f 100644 --- a/modules/apps/transfer/keeper/keeper_test.go +++ b/modules/apps/transfer/keeper/keeper_test.go @@ -4,9 +4,7 @@ import ( "testing" "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" - "github.com/tendermint/tendermint/crypto" "github.com/cosmos/ibc-go/v3/modules/apps/transfer/types" ibctesting "github.com/cosmos/ibc-go/v3/testing"