Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjusted WalletRegistry authorization unit tests to changes in stakin…
…g contract The change in the staking contract modified how authorized stake is reduced after slashing, making the reduction "global", to all authorized applications, and not only "local" to a single application, as it was initially. The original approach was to decrease authorization on the slashing application and decrease authorizations on other applications only if necessary, that is, if the staked amount after the slashing was lower than the authorization on the other application. For example, let's assume the staking provider has 1000 T delegated and three applications authorized: - A application authorized for 950 T - B application authorized for 500 T - C application authorized for 100 T If C slashed for 50 T, authorization on C would be reduced by 50 T, to 100 - 50 = 50 T. If A slashed for 950 T, authorizations on A would be reduced to 0, and authorizations on B and C would be reduced to 50 T. The new approach assumes all applications are decreasing authorizations in case of slashing, no matter which application executed the slash. If C slashed for 50 T, authorization on A would be reduced to 950 - 50 = 900 T, authorization on B would be reduced to 500 - 50 = 450 T, and authorization on C would be reduced to 100 - 50 = 50 T. If A slashed for 950 T, authorizations on A, B, and C would be reduced to 0 T. The unit tests had to be adjusted to reflect the new reality. See threshold-network/solidity-contracts#87
- Loading branch information