@@ -6,12 +6,12 @@ import (
6
6
7
7
testifysuite "github.com/stretchr/testify/suite"
8
8
9
+ "cosmossdk.io/math"
9
10
sdkmath "cosmossdk.io/math"
10
11
storetypes "cosmossdk.io/store/types"
11
12
12
13
minttypes "cosmossdk.io/x/mint/types"
13
14
"github.com/cosmos/cosmos-sdk/baseapp"
14
- "github.com/cosmos/cosmos-sdk/codec"
15
15
"github.com/cosmos/cosmos-sdk/runtime"
16
16
sdk "github.com/cosmos/cosmos-sdk/types"
17
17
authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper"
@@ -192,7 +192,6 @@ func (suite *KeeperTestSuite) TestSetGetTotalEscrowForDenom() {
192
192
func (suite * KeeperTestSuite ) TestGetAllDenomEscrows () {
193
193
var (
194
194
store storetypes.KVStore
195
- cdc codec.Codec
196
195
expDenomEscrows sdk.Coins
197
196
)
198
197
@@ -208,7 +207,8 @@ func (suite *KeeperTestSuite) TestGetAllDenomEscrows() {
208
207
amount := sdkmath .NewInt (100 )
209
208
expDenomEscrows = append (expDenomEscrows , sdk .NewCoin (denom , amount ))
210
209
211
- bz := cdc .MustMarshal (& sdk.IntProto {Int : amount })
210
+ bz , err := math .Int (amount ).Marshal ()
211
+ suite .Require ().NoError (err )
212
212
store .Set (types .TotalEscrowForDenomKey (denom ), bz )
213
213
},
214
214
true ,
@@ -220,14 +220,16 @@ func (suite *KeeperTestSuite) TestGetAllDenomEscrows() {
220
220
amount := sdkmath .NewInt (100 )
221
221
expDenomEscrows = append (expDenomEscrows , sdk .NewCoin (denom , amount ))
222
222
223
- bz := cdc .MustMarshal (& sdk.IntProto {Int : amount })
223
+ bz , err := math .Int (amount ).Marshal ()
224
+ suite .Require ().NoError (err )
224
225
store .Set (types .TotalEscrowForDenomKey (denom ), bz )
225
226
226
227
denom = "bar/foo"
227
228
amount = sdkmath .NewInt (50 )
228
229
expDenomEscrows = append (expDenomEscrows , sdk .NewCoin (denom , amount ))
229
230
230
- bz = cdc .MustMarshal (& sdk.IntProto {Int : amount })
231
+ bz , err = math .Int (amount ).Marshal ()
232
+ suite .Require ().NoError (err )
231
233
store .Set (types .TotalEscrowForDenomKey (denom ), bz )
232
234
},
233
235
true ,
@@ -239,7 +241,8 @@ func (suite *KeeperTestSuite) TestGetAllDenomEscrows() {
239
241
amount := sdkmath .NewInt (100 )
240
242
expDenomEscrows = append (expDenomEscrows , sdk .NewCoin (denom , amount ))
241
243
242
- bz := cdc .MustMarshal (& sdk.IntProto {Int : amount })
244
+ bz , err := math .Int (amount ).Marshal ()
245
+ suite .Require ().NoError (err )
243
246
store .Set (types .TotalEscrowForDenomKey (denom ), bz )
244
247
},
245
248
true ,
@@ -250,7 +253,8 @@ func (suite *KeeperTestSuite) TestGetAllDenomEscrows() {
250
253
denom := ""
251
254
amount := sdkmath .ZeroInt ()
252
255
253
- bz := cdc .MustMarshal (& sdk.IntProto {Int : amount })
256
+ bz , err := math .Int (amount ).Marshal ()
257
+ suite .Require ().NoError (err )
254
258
store .Set (types .TotalEscrowForDenomKey (denom ), bz )
255
259
},
256
260
false ,
@@ -261,7 +265,8 @@ func (suite *KeeperTestSuite) TestGetAllDenomEscrows() {
261
265
denom := "uatom"
262
266
amount := sdkmath .ZeroInt ()
263
267
264
- bz := cdc .MustMarshal (& sdk.IntProto {Int : amount })
268
+ bz , err := math .Int (amount ).Marshal ()
269
+ suite .Require ().NoError (err )
265
270
store .Set ([]byte (fmt .Sprintf ("wrong-prefix/%s" , denom )), bz )
266
271
},
267
272
false ,
@@ -279,7 +284,6 @@ func (suite *KeeperTestSuite) TestGetAllDenomEscrows() {
279
284
280
285
storeKey := suite .chainA .GetSimApp ().GetKey (types .ModuleName )
281
286
store = ctx .KVStore (storeKey )
282
- cdc = suite .chainA .App .AppCodec ()
283
287
284
288
tc .malleate ()
285
289
0 commit comments