Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle committed Oct 30, 2024
1 parent 737c455 commit 6c4e88a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 62 deletions.
4 changes: 2 additions & 2 deletions modules/apps/transfer/keeper/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
90 changes: 30 additions & 60 deletions modules/apps/transfer/keeper/migrations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
}
},
Expand All @@ -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",
},
}
},
Expand All @@ -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",
},
}
},
Expand All @@ -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",
},
}

Expand Down

0 comments on commit 6c4e88a

Please sign in to comment.