staking-contract icon indicating copy to clipboard operation
staking-contract copied to clipboard

Throw exceptions in unreachable branches instead of having no-op

Open anton-trunov opened this issue 4 years ago • 1 comments

There is a couple of unreachable branches in the code with comment like won't reach and no-ops. It's safer against future changes to insert throw instructions instead of no-op as in this case if the invariant is violated the state changes will be reverted.

See CalculateTotalWithdrawal and WithdrawalStakeRewards procedures.

anton-trunov avatar Sep 07 '20 10:09 anton-trunov

OK, will do that!

renlulu avatar Sep 14 '20 10:09 renlulu