File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -370,7 +370,7 @@ func collectEmissionReward(addr std.Address) uint64 {
370
370
return 0
371
371
}
372
372
373
- govStakerGnsBalance := xgns .BalanceOf(a2u(consts.GOV_STAKER_ADDR))
373
+ govStakerGnsBalance := gns .BalanceOf(a2u(consts.GOV_STAKER_ADDR))
374
374
if govStakerGnsBalance < emissionReward {
375
375
panic(addDetailToError(
376
376
errNotEnoughBalance,
Original file line number Diff line number Diff line change @@ -382,19 +382,25 @@ func TestProtocolFee(t *testing.T) {
382
382
}
383
383
384
384
func TestRedelegate(t *testing.T) {
385
- // assume realm user
386
- std.TestSetRealm(userRealm)
385
+ std.TestSetRealm(std.NewCodeRealm(consts.EMISSION_PATH))
386
+ std.TestSkipHeights(100)
387
+ gns.MintGns(a2u(userRealm.Addr())) // 2M gns
387
388
388
389
// user has xGNS from previous test (some minted)
389
390
// try re-delegating
390
391
std.TestSetRealm(userRealm)
391
392
from := userRealm.Addr()
392
393
to := makeFakeAddress("validator_1")
393
- println("to", to)
394
394
amount := uint64(1_000_000)
395
395
396
396
std.TestSetOrigCaller(userRealm.Addr())
397
+ gns.Approve(a2u(consts.GOV_STAKER_ADDR), amount)
398
+ Delegate(to, amount)
399
+
400
+ std.TestSetOrigCaller(userRealm.Addr())
401
+ gns.Approve(a2u(consts.GOV_STAKER_ADDR), amount)
397
402
Redelegate(from, to, amount)
403
+
398
404
// check data: user xGNS must remain the same, but from-> to shift in staker structure?
399
405
400
406
// not enough xGNS => panic
You can’t perform that action at this time.
0 commit comments