diff --git a/PENDING.md b/PENDING.md index 60fafbdc167..7fd70146408 100644 --- a/PENDING.md +++ b/PENDING.md @@ -69,6 +69,8 @@ decoded automatically. ### SDK +* \#3559 fix occasional failing due to non-determinism in lcd test TestBonding + where validator is unexpectedly slashed throwing off test calculations * [\#3411] Include the `RequestInitChain.Time` in the block header init during `InitChain`. diff --git a/client/lcd/lcd_test.go b/client/lcd/lcd_test.go index 41f569949fa..681078a510e 100644 --- a/client/lcd/lcd_test.go +++ b/client/lcd/lcd_test.go @@ -545,10 +545,18 @@ func TestBonding(t *testing.T) { require.Equal(t, resultTx.Height, txs[0].Height) // query delegations, unbondings and redelegations from validator and delegator - rdShares := rdTokens.ToDec() delegatorDels = getDelegatorDelegations(t, port, addr) require.Len(t, delegatorDels, 1) - require.Equal(t, rdShares, delegatorDels[0].GetShares()) + require.Equal(t, operAddrs[1], delegatorDels[0].ValidatorAddr) + + // 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 := delegatorDels[0].GetShares().Mul(validator2.DelegatorShareExRate()) + require.Equal(t, rdTokens.ToDec(), delTokensAfterRedelegation) redelegation := getRedelegations(t, port, addr, operAddrs[0], operAddrs[1]) require.Len(t, redelegation, 1)