Function: finishFrozenBalance(AccountTypes.Account account, uint64 withdrawNonce, byte[32] tokenHash, uint128 amount)
This is a function that facilitates the finalization of a frozen balance.
Inputs
account
Control: Fully controllable by calling function.
Constraints: None.
Impact: The account whose balance is to be finalized.
withdrawNonce
Control: Fully controllable by calling function.
Constraints: None.
Impact: The nonce of the withdrawal.
tokenHash
Control: Fully controllable by calling function.
Constraints: None.
Impact: The token whose balance is to be finalized.
amount
Control: Fully controllable by calling function.
Constraints: None.
Impact: The amount by which the balance is to be finalized.
Branches and code coverage
Intended branches
Account frozen balance for the given
withdrawNonce
is reduced by the amount. Currently not performed, as it is reset to zero instead.Account total frozen balance is decreased by the amount.
Negative behavior
Should not allow finalizing balance if there is no frozen balance for the given withdraw nonce. Currently, this is not checked at this level.
Should not allow finalizing balance if the withdraw nonce is not greater than the last withdraw nonce. Currently, this is not checked at this level.
Should not allow finalizing balance if there is still balance to be finalized in the previous withdraw nonce. Currently, this is not checked at this level.