Skip to content

Commit

Permalink
Additional comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan-Ethernal authored and stana-miric committed Feb 6, 2023
1 parent 3dd488e commit 7a53d4e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions e2e-polybft/consensus_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,14 @@ func TestE2E_Consensus_Delegation_Undelegation(t *testing.T) {
// wait for consensus to start
cluster.WaitForBlock(1, 10*time.Second)

// extract delegator's secrets
delegatorSecretsPath := path.Join(cluster.Config.TmpDir, delegatorSecrets)
delegatorAcc, err := sidechain.GetAccountFromDir(delegatorSecretsPath)
require.NoError(t, err)

delegatorAddr := delegatorAcc.Ecdsa.Address()

// extract validator's secrets
validatorSecretsPath := path.Join(cluster.Config.TmpDir, validatorSecrets)

validatorAcc, err := sidechain.GetAccountFromDir(validatorSecretsPath)
Expand All @@ -248,6 +250,7 @@ func TestE2E_Consensus_Delegation_Undelegation(t *testing.T) {
require.NoError(t, err)
require.Equal(t, uint64(types.ReceiptSuccess), receipt.Status)

// getDelegatorInfo queries delegator's balance and its rewards
getDelegatorInfo := func() (balance *big.Int, reward *big.Int) {
currentBlockNum, err := srv.JSONRPC().Eth().BlockNumber()
require.NoError(t, err)
Expand All @@ -263,6 +266,7 @@ func TestE2E_Consensus_Delegation_Undelegation(t *testing.T) {
return
}

// assert that delegator received fund amount from validator
delegatorBalance, _ := getDelegatorInfo()
require.Equal(t, fundAmount, delegatorBalance)

Expand Down

0 comments on commit 7a53d4e

Please sign in to comment.