Function: rmStakePool(address _poolAddress)
Allows removing a stake pool.
Inputs
_poolAddress
Control: Fully controlled by the owner.
Constraints: Checked that it exists within
bondedPools
.Impact: The address of the pool to remove.
Branches and code coverage (including function calls)
Intended branches
Should delete the
poolInfoOf[_poolAddress]
entry.Should remove the
_poolAddress
frombondedPools
.Should remove all additional states related to the pool, like the validator IDs.
Assure that each entry of the validators does not have any stake on the pool.
Negative behavior
Should not allow anyone other than the admin to call this function. Ensured through the
onlyAdmin
modifier.Should not allow removing a nonexisting pool. Ensured through the
require
statement.Should not allow removing a pool that has active or bonded amounts. Ensured through the
require
statement.
Function call analysis
poolAddress.getTotalStakeOnValidator(validators[j])
What is controllable? Validators, to some extent.
If return value controllable, how is it used and how can it go wrong? Returns whether the validator has any stake on the pool.
What happens if it reverts, reenters, or does other unusual control flow? N/A.