TokenStaking: method to increase authorization to max#161
TokenStaking: method to increase authorization to max#161
Conversation
Co-authored-by: David Núñez <david@nucypher.com> Co-authored-by: Michalina <michalina.cienciala@akena.co>
…m governance contracts Co-authored-by: Michalina <michalina.cienciala@akena.co>
…not paused, not disabled)
0dacff1 to
0bef9ad
Compare
|
Solidity API documentation preview available in the artifacts of the https://github.com/threshold-network/solidity-contracts/actions/runs/7037152523 check. |
|
Solidity API documentation preview available in the artifacts of the https://github.com/threshold-network/solidity-contracts/actions/runs/7037171903 check. |
|
Solidity API documentation preview available in the artifacts of the https://github.com/threshold-network/solidity-contracts/actions/runs/7053764375 check. |
The base branch was changed.
| if (amount == tStake) { | ||
| stakingProviderStruct.authorizedApplications.push(application); | ||
| authorizedApplications++; | ||
| } |
There was a problem hiding this comment.
Does it make sense to put this if block inside the if (amount > 0) block below? This can remove the need to make this check when amount == 0, which in any case wouldn't imply pushing a new app.
There was a problem hiding this comment.
I'm not fan of nested if(s) and for(s) so basically here I'm trying to make it easier to read in expense of one additional check. If you think it's not great approach then I can change it
There was a problem hiding this comment.
It's not a strong opinion. If you prefer it this way, I'm fine with that 👍
Based on #159
This new method will be useful for new stakers especially when
TokenStakingwill have more than 2 approved applications