Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
fix: remove proto message registration from legacy v09 types to fix c…
Browse files Browse the repository at this point in the history
…onflict (#1023)

with existing types

Co-authored-by: Federico Kunze Küllmer <[email protected]>
  • Loading branch information
Nick DeLuca and fedekunze authored Apr 5, 2022
1 parent 56c4a31 commit ea3c16e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
23 changes: 23 additions & 0 deletions x/feemarket/migrations/v010/migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
"github.com/tharsis/ethermint/app"
feemarketkeeper "github.com/tharsis/ethermint/x/feemarket/keeper"
v010 "github.com/tharsis/ethermint/x/feemarket/migrations/v010"
v09types "github.com/tharsis/ethermint/x/feemarket/migrations/v09/types"
"github.com/tharsis/ethermint/x/feemarket/types"
feemarkettypes "github.com/tharsis/ethermint/x/feemarket/types"
)
Expand Down Expand Up @@ -44,3 +45,25 @@ func TestMigrateStore(t *testing.T) {

require.Equal(t, baseFee.Int64(), params.BaseFee.Int64())
}

func TestMigrateJSON(t *testing.T) {
rawJson := `{
"base_fee": "669921875",
"block_gas": "0",
"params": {
"base_fee_change_denominator": 8,
"elasticity_multiplier": 2,
"enable_height": "0",
"initial_base_fee": "1000000000",
"no_base_fee": false
}
}`
encCfg := encoding.MakeConfig(app.ModuleBasics)
var genState v09types.GenesisState
err := encCfg.Marshaler.UnmarshalJSON([]byte(rawJson), &genState)
require.NoError(t, err)

migratedGenState := v010.MigrateJSON(genState)

require.Equal(t, int64(669921875), migratedGenState.Params.BaseFee.Int64())
}
8 changes: 0 additions & 8 deletions x/feemarket/migrations/v09/types/feemarket.pb copy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions x/feemarket/migrations/v09/types/genesis.pb copy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ea3c16e

Please sign in to comment.