Skip to content

Commit

Permalink
update tests, rm empty base denom in trace.go
Browse files Browse the repository at this point in the history
  • Loading branch information
charleenfei committed Jul 20, 2022
1 parent 96aabb5 commit b608e89
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
3 changes: 1 addition & 2 deletions modules/apps/transfer/keeper/migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ func (m Migrator) MigrateTraces(ctx sdk.Context) error {
newTrace := types.ParseDenomTrace(dt.GetFullDenomPath())
err := newTrace.Validate()
if err != nil {
iterErr = err
return true
panic(err)
}
if !equalTraces(newTrace, dt) {
newTraces = append(newTraces, newTrace)
Expand Down
4 changes: 2 additions & 2 deletions modules/apps/transfer/keeper/migrations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func (suite *KeeperTestSuite) TestMigratorMigrateTraces() {
suite.chainA.GetSimApp().TransferKeeper.SetDenomTrace(
suite.chainA.GetContext(),
transfertypes.DenomTrace{
BaseDenom: "1", Path: "transfer/channel-0/gamm/pool",
BaseDenom: "pool/1", Path: "transfer/channel-0/gamm",
})
},
transfertypes.Traces{
Expand All @@ -36,7 +36,7 @@ func (suite *KeeperTestSuite) TestMigratorMigrateTraces() {
suite.chainA.GetSimApp().TransferKeeper.SetDenomTrace(
suite.chainA.GetContext(),
transfertypes.DenomTrace{
BaseDenom: "", Path: "transfer/channel-149/erc/0x85bcBCd7e79Ec36f4fBBDc54F90C643d921151AA",
BaseDenom: "0x85bcBCd7e79Ec36f4fBBDc54F90C643d921151AA", Path: "transfer/channel-149/erc",
})
},
transfertypes.Traces{
Expand Down
3 changes: 0 additions & 3 deletions modules/apps/transfer/types/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ func (dt DenomTrace) GetFullDenomPath() string {
if dt.Path == "" {
return dt.BaseDenom
}
if dt.BaseDenom == "" {
return dt.Path
}
return dt.GetPrefix() + dt.BaseDenom
}

Expand Down

0 comments on commit b608e89

Please sign in to comment.