diff --git a/modules/apps/transfer/keeper/migrations.go b/modules/apps/transfer/keeper/migrations.go index a2425bf7ccb..768dfbbd23d 100644 --- a/modules/apps/transfer/keeper/migrations.go +++ b/modules/apps/transfer/keeper/migrations.go @@ -43,8 +43,8 @@ func (m Migrator) MigrateDenomMetadata(ctx sdk.Context) error { m.keeper.iterateDenomTraces(ctx, func(dt internaltypes.DenomTrace) (stop bool) { // check if the metadata for the given denom trace does not already exist - denom, present := m.keeper.bankKeeper.GetDenomMetaData(ctx, dt.IBCDenom()) - if !present { + denom, found := m.keeper.bankKeeper.GetDenomMetaData(ctx, dt.IBCDenom()) + if !found { m.keeper.setDenomMetadataWithDenomTrace(ctx, dt, denom) } return false diff --git a/modules/apps/transfer/keeper/migrations_test.go b/modules/apps/transfer/keeper/migrations_test.go index 8eea47d4ab0..547a2b89074 100644 --- a/modules/apps/transfer/keeper/migrations_test.go +++ b/modules/apps/transfer/keeper/migrations_test.go @@ -327,16 +327,11 @@ func (suite *KeeperTestSuite) TestMigratorMigrateMetadata() { expectedMetadata = []banktypes.Metadata{ { Description: "IBC token from transfer/channel-0/foo", - DenomUnits: []*banktypes.DenomUnit{ - { - Denom: "foo", - Exponent: 0, - }, - }, - Base: denomTraces[0].IBCDenom(), // ibc/EB7094899ACFB7A6F2A67DB084DEE2E9A83DEFAA5DEF92D9A9814FFD9FF673FA - Display: "transfer/channel-0/foo", - Name: "transfer/channel-0/foo IBC token", - Symbol: "FOO", + DenomUnits: nil, + Base: denomTraces[0].IBCDenom(), // ibc/EB7094899ACFB7A6F2A67DB084DEE2E9A83DEFAA5DEF92D9A9814FFD9FF673FA + Display: "transfer/channel-0/foo", + Name: "transfer/channel-0/foo IBC token", + Symbol: "FOO", }, } }, @@ -354,16 +349,11 @@ func (suite *KeeperTestSuite) TestMigratorMigrateMetadata() { expectedMetadata = []banktypes.Metadata{ { Description: "IBC token from transfer/channel-1/transfer/channel-2/ubar", - DenomUnits: []*banktypes.DenomUnit{ - { - Denom: "ubar", - Exponent: 0, - }, - }, - Base: denomTraces[0].IBCDenom(), // ibc/8243B3EAA19BAB1DB3B0020B81C0C5A953E7B22C042CEE44E639A11A238BA57C - Display: "transfer/channel-1/transfer/channel-2/ubar", - Name: "transfer/channel-1/transfer/channel-2/ubar IBC token", - Symbol: "UBAR", + DenomUnits: nil, + Base: denomTraces[0].IBCDenom(), // ibc/8243B3EAA19BAB1DB3B0020B81C0C5A953E7B22C042CEE44E639A11A238BA57C + Display: "transfer/channel-1/transfer/channel-2/ubar", + Name: "transfer/channel-1/transfer/channel-2/ubar IBC token", + Symbol: "UBAR", }, } }, @@ -385,29 +375,19 @@ func (suite *KeeperTestSuite) TestMigratorMigrateMetadata() { expectedMetadata = []banktypes.Metadata{ { Description: "IBC token from transfer/channel-0/foo", - DenomUnits: []*banktypes.DenomUnit{ - { - Denom: "foo", - Exponent: 0, - }, - }, - Base: denomTraces[0].IBCDenom(), // ibc/EB7094899ACFB7A6F2A67DB084DEE2E9A83DEFAA5DEF92D9A9814FFD9FF673FA - Display: "transfer/channel-0/foo", - Name: "transfer/channel-0/foo IBC token", - Symbol: "FOO", + DenomUnits: nil, + Base: denomTraces[0].IBCDenom(), // ibc/EB7094899ACFB7A6F2A67DB084DEE2E9A83DEFAA5DEF92D9A9814FFD9FF673FA + Display: "transfer/channel-0/foo", + Name: "transfer/channel-0/foo IBC token", + Symbol: "FOO", }, { Description: "IBC token from transfer/channel-0/bar", - DenomUnits: []*banktypes.DenomUnit{ - { - Denom: "bar", - Exponent: 0, - }, - }, - Base: denomTraces[1].IBCDenom(), // ibc/E1530E21F1848B6C29C9E89256D43E294976897611A61741CACBA55BE21736F5 - Display: "transfer/channel-0/bar", - Name: "transfer/channel-0/bar IBC token", - Symbol: "BAR", + DenomUnits: nil, + Base: denomTraces[1].IBCDenom(), // ibc/E1530E21F1848B6C29C9E89256D43E294976897611A61741CACBA55BE21736F5 + Display: "transfer/channel-0/bar", + Name: "transfer/channel-0/bar IBC token", + Symbol: "BAR", }, } }, @@ -429,29 +409,19 @@ func (suite *KeeperTestSuite) TestMigratorMigrateMetadata() { expectedMetadata = []banktypes.Metadata{ { Description: "IBC token from transfer/channel-0/foo", - DenomUnits: []*banktypes.DenomUnit{ - { - Denom: "foo", - Exponent: 0, - }, - }, - Base: denomTraces[0].IBCDenom(), // ibc/EB7094899ACFB7A6F2A67DB084DEE2E9A83DEFAA5DEF92D9A9814FFD9FF673FA - Display: "transfer/channel-0/foo", - Name: "transfer/channel-0/foo IBC token", - Symbol: "FOO", + DenomUnits: nil, + Base: denomTraces[0].IBCDenom(), // ibc/EB7094899ACFB7A6F2A67DB084DEE2E9A83DEFAA5DEF92D9A9814FFD9FF673FA + Display: "transfer/channel-0/foo", + Name: "transfer/channel-0/foo IBC token", + Symbol: "FOO", }, { Description: "IBC token from transfer/channel-0/bar", - DenomUnits: []*banktypes.DenomUnit{ - { - Denom: "bar", - Exponent: 0, - }, - }, - Base: denomTraces[1].IBCDenom(), // ibc/E1530E21F1848B6C29C9E89256D43E294976897611A61741CACBA55BE21736F5 - Display: "transfer/channel-0/bar", - Name: "transfer/channel-0/bar IBC token", - Symbol: "BAR", + DenomUnits: nil, + Base: denomTraces[1].IBCDenom(), // ibc/E1530E21F1848B6C29C9E89256D43E294976897611A61741CACBA55BE21736F5 + Display: "transfer/channel-0/bar", + Name: "transfer/channel-0/bar IBC token", + Symbol: "BAR", }, }