// Check the expected values of a account against the account's values in the tree.
// If an expected value is nil, we check that it must not exists in the tree.
Check the expected values of a account against the account's values in the tree.
If an expected value is nil, we check that it must not exists in the tree.
// Check the expected values of a account against the account ' s values in the tree . // If an expected value is nil we check that it must not exists in the tree .
func checkAccount(t *testing.T, tree *avl.Tree, id AccountID, expectedBalance, expectedReward, expectedStake *uint64) {
	var balance, reward, stake uint64
	var exist bool
	balance, exist = ReadAccountBalance(tree, id)
	assert.Equal(t, expectedBalance != nil, exist, "account ID: %x", id)
	reward, exist = ReadAccountReward(tree, id)
	assert.Equal(t, expectedReward != nil, exist, "account ID: %x", id)
	stake, exist = ReadAccountStake(tree, id)
	assert.Equal(t, expectedStake != nil, exist, "account ID: %x", id)
	if expectedBalance != nil {
		assert.Equal(t, balance, *expectedBalance, "account ID: %x", id)
	}
	if expectedReward != nil {
		assert.Equal(t, reward, *expectedReward, "account ID: %x", id)
	}
	if expectedStake != nil {
		assert.Equal(t, stake, *expectedStake, "account ID: %x", id)
	}
}
func checkAccount ( t * testing . T , tree * avl . Tree , id AccountID , expectedBalance , expectedReward , expectedStake * uint64 ) { var balance , reward , stake uint64 var exist bool balance , exist = ReadAccountBalance ( tree , id ) assert . Equal ( t , expectedBalance != nil , exist , " " , id ) reward , exist = ReadAccountReward ( tree , id ) assert . Equal ( t , expectedReward != nil , exist , " " , id ) stake , exist = ReadAccountStake ( tree , id ) assert . Equal ( t , expectedStake != nil , exist , " " , id ) if expectedBalance != nil { assert . Equal ( t , balance , * expectedBalance , " " , id ) } if expectedReward != nil { assert . Equal ( t , reward , * expectedReward , " " , id ) } if expectedStake != nil { assert . Equal ( t , stake , * expectedStake , " " , id ) } }
Check the expected values of a account against the account's values in the tree.
Check the expected values of a account against the account ' s values in the tree .