Fix testcases & update changelog

This commit is contained in:
Christopher Goes
2018-04-23 18:41:36 +02:00
parent 5b1e2a3786
commit 86b79b9c84
3 changed files with 6 additions and 9 deletions
+5
View File
@@ -76,7 +76,10 @@ func TestIncrementsMsgDelegate(t *testing.T) {
// just send the same msgbond multiple times
msgDelegate := newTestMsgDelegate(delegatorAddr, candidateAddr, bondAmount)
for i := 0; i < 5; i++ {
ctx = ctx.WithBlockHeight(int64(i))
got := handleMsgDelegate(ctx, msgDelegate, keeper)
require.True(t, got.IsOK(), "expected msg %d to be ok, got %v", i, got)
@@ -90,6 +93,8 @@ func TestIncrementsMsgDelegate(t *testing.T) {
expLiabilities := int64(i+2) * bondAmount // (1 self delegation)
expDelegatorAcc := initBond - expBond
require.Equal(t, bond.Height, int64(i), "Incorrect bond height")
gotBond := bond.Shares.Evaluate()
gotLiabilities := candidate.Liabilities.Evaluate()
gotDelegatorAcc := accMapper.GetAccount(ctx, delegatorAddr).GetCoins().AmountOf(params.BondDenom)
-9
View File
@@ -143,15 +143,6 @@ func TestBond(t *testing.T) {
assert.True(t, found)
assert.True(t, bondsEqual(bond1to1, resBond))
// test height
ctx = ctx.WithBlockHeight(10)
keeper.setDelegatorBond(ctx, bond1to1)
resBond, found = keeper.GetDelegatorBond(ctx, addrDels[0], addrVals[0])
assert.True(t, found)
assert.Equal(t, resBond.Height, 10)
ctx = ctx.WithBlockHeight(0)
keeper.setDelegatorBond(ctx, bond1to1)
// add some more records
keeper.setCandidate(ctx, candidates[1])
keeper.setCandidate(ctx, candidates[2])