Merge PR #3958: Fix lcd-testing 303030 bug continued
* 303030 bug part 2 * further rearrange
This commit is contained in:
parent
424adf1461
commit
9b27901b2a
|
@ -520,9 +520,21 @@ func TestBonding(t *testing.T) {
|
|||
// test redelegation
|
||||
rdTokens := sdk.TokensFromTendermintPower(30)
|
||||
resultTx = doBeginRedelegation(t, port, name1, pw, addr, operAddrs[0], operAddrs[1], rdTokens, fees)
|
||||
tests.WaitForHeight(resultTx.Height+1, port)
|
||||
|
||||
require.Equal(t, uint32(0), resultTx.Code)
|
||||
tests.WaitForHeight(resultTx.Height+1, port)
|
||||
validator2 := getValidator(t, port, operAddrs[1])
|
||||
|
||||
// query delegations, unbondings and redelegations from validator and delegator
|
||||
delegatorDels = getDelegatorDelegations(t, port, addr)
|
||||
require.Len(t, delegatorDels, 1)
|
||||
require.Equal(t, operAddrs[1], delegatorDels[0].ValidatorAddress)
|
||||
|
||||
// because the second validator never signs during these tests, if this
|
||||
// this test takes a long time to run, eventually this second validator
|
||||
// will get slashed, meaning that it's exchange rate is no-longer 1-to-1,
|
||||
// hence we utilize the exchange rate in the following test
|
||||
delTokensAfterRedelegation := validator2.ShareTokens(delegatorDels[0].GetShares())
|
||||
require.Equal(t, rdTokens.ToDec(), delTokensAfterRedelegation)
|
||||
|
||||
// verify balance after paying fees
|
||||
acc = getAccount(t, port, addr)
|
||||
|
@ -542,20 +554,6 @@ func TestBonding(t *testing.T) {
|
|||
require.Len(t, txs, 1)
|
||||
require.Equal(t, resultTx.Height, txs[0].Height)
|
||||
|
||||
// query delegations, unbondings and redelegations from validator and delegator
|
||||
delegatorDels = getDelegatorDelegations(t, port, addr)
|
||||
require.Len(t, delegatorDels, 1)
|
||||
require.Equal(t, operAddrs[1], delegatorDels[0].ValidatorAddress)
|
||||
|
||||
// because the second validator never signs during these tests, if this
|
||||
// this test takes a long time to run, eventually this second validator
|
||||
// will get slashed, meaning that it's exchange rate is no-longer 1-to-1,
|
||||
// hence we utilize the exchange rate in the following test
|
||||
|
||||
validator2 := getValidator(t, port, operAddrs[1])
|
||||
delTokensAfterRedelegation := validator2.ShareTokens(delegatorDels[0].GetShares())
|
||||
require.Equal(t, rdTokens.ToDec(), delTokensAfterRedelegation)
|
||||
|
||||
redelegation := getRedelegations(t, port, addr, operAddrs[0], operAddrs[1])
|
||||
require.Len(t, redelegation, 1)
|
||||
require.Len(t, redelegation[0].Entries, 1)
|
||||
|
|
Loading…
Reference in New Issue