2022-03-21 07:27:22 +00:00
|
|
|
package keeper_test
|
|
|
|
|
|
|
|
import (
|
|
|
|
"math/big"
|
|
|
|
|
2022-06-19 09:43:41 +00:00
|
|
|
"github.com/evmos/ethermint/x/feemarket/keeper"
|
|
|
|
v010 "github.com/evmos/ethermint/x/feemarket/migrations/v010"
|
2022-03-21 07:27:22 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func (suite *KeeperTestSuite) TestMigration1To2() {
|
|
|
|
suite.SetupTest()
|
|
|
|
storeKey := suite.app.GetKey("feemarket")
|
|
|
|
store := suite.ctx.KVStore(storeKey)
|
|
|
|
baseFee := big.NewInt(1000)
|
2022-03-30 17:10:54 +00:00
|
|
|
store.Set(v010.KeyPrefixBaseFeeV1, baseFee.Bytes())
|
2022-03-21 07:27:22 +00:00
|
|
|
m := keeper.NewMigrator(suite.app.FeeMarketKeeper)
|
2022-03-30 17:10:54 +00:00
|
|
|
err := m.Migrate1to2(suite.ctx)
|
|
|
|
suite.Require().NoError(err)
|
2022-03-21 07:27:22 +00:00
|
|
|
suite.Require().Equal(baseFee, suite.app.FeeMarketKeeper.GetBaseFee(suite.ctx))
|
|
|
|
}
|