@@ -5,13 +5,14 @@ import (
5
5
6
6
"github.com/stretchr/testify/require"
7
7
8
+ "github.com/evmos/ethermint/x/evm/types"
9
+
8
10
"github.com/cosmos/cosmos-sdk/testutil"
9
11
sdk "github.com/cosmos/cosmos-sdk/types"
10
-
11
12
"github.com/evmos/ethermint/app"
12
13
"github.com/evmos/ethermint/encoding"
13
14
v4 "github.com/evmos/ethermint/x/evm/migrations/v4"
14
- "github.com/evmos/ethermint/x/evm/types"
15
+ v4types "github.com/evmos/ethermint/x/evm/migrations/v4 /types"
15
16
)
16
17
17
18
type mockSubspace struct {
@@ -38,9 +39,36 @@ func TestMigrate(t *testing.T) {
38
39
legacySubspace := newMockSubspace (types .DefaultParams ())
39
40
require .NoError (t , v4 .MigrateStore (ctx , storeKey , legacySubspace , cdc ))
40
41
41
- paramsBz := kvStore .Get (types .KeyPrefixParams )
42
- var params types.Params
43
- cdc .MustUnmarshal (paramsBz , & params )
42
+ // Get all the new parameters from the kvStore
43
+ var evmDenom string
44
+ bz := kvStore .Get (types .ParamStoreKeyEVMDenom )
45
+ evmDenom = string (bz )
46
+
47
+ allowUnprotectedTx := kvStore .Has (types .ParamStoreKeyAllowUnprotectedTxs )
48
+ enableCreate := kvStore .Has (types .ParamStoreKeyEnableCreate )
49
+ enableCall := kvStore .Has (types .ParamStoreKeyEnableCall )
50
+
51
+ var chainCfg v4types.V4ChainConfig
52
+ bz = kvStore .Get (types .ParamStoreKeyChainConfig )
53
+ cdc .MustUnmarshal (bz , & chainCfg )
54
+
55
+ var extraEIPs v4types.ExtraEIPs
56
+ bz = kvStore .Get (types .ParamStoreKeyExtraEIPs )
57
+ cdc .MustUnmarshal (bz , & extraEIPs )
58
+ require .Equal (t , []int64 (nil ), extraEIPs .EIPs )
59
+
60
+ params := v4types.V4Params {
61
+ EvmDenom : evmDenom ,
62
+ AllowUnprotectedTxs : allowUnprotectedTx ,
63
+ EnableCreate : enableCreate ,
64
+ EnableCall : enableCall ,
65
+ V4ChainConfig : chainCfg ,
66
+ ExtraEIPs : extraEIPs ,
67
+ }
44
68
45
- require .Equal (t , params , legacySubspace .ps )
69
+ require .Equal (t , legacySubspace .ps .EnableCall , params .EnableCall )
70
+ require .Equal (t , legacySubspace .ps .EnableCreate , params .EnableCreate )
71
+ require .Equal (t , legacySubspace .ps .AllowUnprotectedTxs , params .AllowUnprotectedTxs )
72
+ require .Equal (t , legacySubspace .ps .ExtraEIPs , params .ExtraEIPs .EIPs )
73
+ require .EqualValues (t , legacySubspace .ps .ChainConfig , params .V4ChainConfig )
46
74
}
0 commit comments