@@ -120,8 +120,13 @@ func initFixture(tb testing.TB) *fixture {
120
120
addrDels := simtestutil .AddTestAddrsIncremental (bankKeeper , stakingKeeper , sdkCtx , 6 , stakingKeeper .TokensFromConsensusPower (sdkCtx , 200 ))
121
121
valAddrs := simtestutil .ConvertAddrsToValAddrs (addrDels )
122
122
123
- info1 := slashingtypes .NewValidatorSigningInfo (sdk .ConsAddress (addrDels [0 ]), int64 (4 ), int64 (3 ), time .Unix (2 , 0 ), false , int64 (10 ))
124
- info2 := slashingtypes .NewValidatorSigningInfo (sdk .ConsAddress (addrDels [1 ]), int64 (5 ), int64 (4 ), time .Unix (2 , 0 ), false , int64 (10 ))
123
+ consaddr0 , err := stakingKeeper .ConsensusAddressCodec ().BytesToString (addrDels [0 ])
124
+ assert .NilError (tb , err )
125
+ consaddr1 , err := stakingKeeper .ConsensusAddressCodec ().BytesToString (addrDels [1 ])
126
+ assert .NilError (tb , err )
127
+
128
+ info1 := slashingtypes .NewValidatorSigningInfo (consaddr0 , int64 (4 ), int64 (3 ), time .Unix (2 , 0 ), false , int64 (10 ))
129
+ info2 := slashingtypes .NewValidatorSigningInfo (consaddr1 , int64 (5 ), int64 (4 ), time .Unix (2 , 0 ), false , int64 (10 ))
125
130
126
131
err = slashingKeeper .ValidatorSigningInfo .Set (sdkCtx , sdk .ConsAddress (addrDels [0 ]), info1 )
127
132
assert .NilError (tb , err )
@@ -234,7 +239,10 @@ func TestHandleNewValidator(t *testing.T) {
234
239
235
240
assert .NilError (t , f .slashingKeeper .AddrPubkeyRelation .Set (f .ctx , pks [0 ].Address (), pks [0 ]))
236
241
237
- info := slashingtypes .NewValidatorSigningInfo (sdk .ConsAddress (valpubkey .Address ()), f .ctx .BlockHeight (), int64 (0 ), time .Unix (0 , 0 ), false , int64 (0 ))
242
+ consaddr , err := f .stakingKeeper .ConsensusAddressCodec ().BytesToString (valpubkey .Address ())
243
+ assert .NilError (t , err )
244
+
245
+ info := slashingtypes .NewValidatorSigningInfo (consaddr , f .ctx .BlockHeight (), int64 (0 ), time .Unix (0 , 0 ), false , int64 (0 ))
238
246
assert .NilError (t , f .slashingKeeper .ValidatorSigningInfo .Set (f .ctx , sdk .ConsAddress (valpubkey .Address ()), info ))
239
247
240
248
// Validator created
@@ -289,7 +297,10 @@ func TestHandleAlreadyJailed(t *testing.T) {
289
297
err := f .slashingKeeper .AddrPubkeyRelation .Set (f .ctx , pks [0 ].Address (), pks [0 ])
290
298
assert .NilError (t , err )
291
299
292
- info := slashingtypes .NewValidatorSigningInfo (sdk .ConsAddress (val .Address ()), f .ctx .BlockHeight (), int64 (0 ), time .Unix (0 , 0 ), false , int64 (0 ))
300
+ consaddr , err := f .stakingKeeper .ConsensusAddressCodec ().BytesToString (val .Address ())
301
+ assert .NilError (t , err )
302
+
303
+ info := slashingtypes .NewValidatorSigningInfo (consaddr , f .ctx .BlockHeight (), int64 (0 ), time .Unix (0 , 0 ), false , int64 (0 ))
293
304
assert .NilError (t , f .slashingKeeper .ValidatorSigningInfo .Set (f .ctx , sdk .ConsAddress (val .Address ()), info ))
294
305
295
306
amt := tstaking .CreateValidatorWithValPower (addr , val , power , true )
@@ -363,7 +374,10 @@ func TestValidatorDippingInAndOut(t *testing.T) {
363
374
364
375
assert .NilError (t , f .slashingKeeper .AddrPubkeyRelation .Set (f .ctx , pks [0 ].Address (), pks [0 ]))
365
376
366
- info := slashingtypes .NewValidatorSigningInfo (consAddr , f .ctx .BlockHeight (), int64 (0 ), time .Unix (0 , 0 ), false , int64 (0 ))
377
+ consaddrStr , err := f .stakingKeeper .ConsensusAddressCodec ().BytesToString (addr )
378
+ assert .NilError (t , err )
379
+
380
+ info := slashingtypes .NewValidatorSigningInfo (consaddrStr , f .ctx .BlockHeight (), int64 (0 ), time .Unix (0 , 0 ), false , int64 (0 ))
367
381
assert .NilError (t , f .slashingKeeper .ValidatorSigningInfo .Set (f .ctx , consAddr , info ))
368
382
369
383
tstaking .CreateValidatorWithValPower (valAddr , val , power , true )
@@ -424,7 +438,7 @@ func TestValidatorDippingInAndOut(t *testing.T) {
424
438
assert .NilError (t , err )
425
439
tstaking .CheckValidator (valAddr , stakingtypes .Unbonding , true )
426
440
427
- info = slashingtypes .NewValidatorSigningInfo (consAddr , f .ctx .BlockHeight (), int64 (0 ), time .Unix (0 , 0 ), false , int64 (0 ))
441
+ info = slashingtypes .NewValidatorSigningInfo (consaddrStr , f .ctx .BlockHeight (), int64 (0 ), time .Unix (0 , 0 ), false , int64 (0 ))
428
442
err = f .slashingKeeper .ValidatorSigningInfo .Set (f .ctx , consAddr , info )
429
443
assert .NilError (t , err )
430
444
@@ -439,7 +453,7 @@ func TestValidatorDippingInAndOut(t *testing.T) {
439
453
height = int64 (5000 )
440
454
f .ctx = f .ctx .WithBlockHeight (height )
441
455
442
- info = slashingtypes .NewValidatorSigningInfo (consAddr , f .ctx .BlockHeight (), int64 (0 ), time .Unix (0 , 0 ), false , int64 (0 ))
456
+ info = slashingtypes .NewValidatorSigningInfo (consaddrStr , f .ctx .BlockHeight (), int64 (0 ), time .Unix (0 , 0 ), false , int64 (0 ))
443
457
err = f .slashingKeeper .ValidatorSigningInfo .Set (f .ctx , consAddr , info )
444
458
assert .NilError (t , err )
445
459
0 commit comments