Skip to content

Commit

Permalink
test: fixing a broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
themantre committed Nov 10, 2023
1 parent 7f29b9b commit 7fb4a27
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion execution/executor/unbond_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,16 @@ func TestExecuteUnbondTx(t *testing.T) {
td := setup(t)
exe := NewUnbondExecutor(true)

bonderAddr, bonderAcc := td.sandbox.TestStore.RandomTestAcc()
bonderBalance := bonderAcc.Balance()
stake, _ := td.randomAmountAndFee(td.sandbox.TestParams.MinimumStake, bonderBalance)
bonderAcc.SubtractFromBalance(stake)
td.sandbox.UpdateAccount(bonderAddr, bonderAcc)

pub, _ := td.RandBLSKeyPair()
valAddr := pub.ValidatorAddress()
val := td.sandbox.MakeNewValidator(pub)
val.AddToStake(stake)
td.sandbox.UpdateValidator(val)
lockTime := td.sandbox.CurrentHeight()

Expand Down Expand Up @@ -53,7 +60,7 @@ func TestExecuteUnbondTx(t *testing.T) {
assert.Error(t, err)
})

assert.Zero(t, td.sandbox.Validator(valAddr).Stake())
assert.Equal(t, stake, td.sandbox.Validator(valAddr).Stake())
assert.Zero(t, td.sandbox.Validator(valAddr).Power())
assert.Equal(t, td.sandbox.Validator(valAddr).UnbondingHeight(), td.sandbox.CurrentHeight())
assert.Equal(t, td.sandbox.PowerDelta(), -1*val.Stake())
Expand Down

0 comments on commit 7fb4a27

Please sign in to comment.