Skip to content

Commit 7c58dd2

Browse files
committed
Adding upgrade version
1 parent e496862 commit 7c58dd2

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

primitives/account/src/account/staking_contract/staker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ impl StakingContract {
289289
protocol_version: u16,
290290
tx_logger: &mut TransactionLog,
291291
) -> Result<AddStakeReceipt, AccountError> {
292-
if protocol_version < 2 {
292+
if protocol_version < Policy::ADD_STAKE_PROTOCOL_UPGRADE_VERSION {
293293
return self.legacy_add_stake(store, staker_address, value, tx_logger);
294294
}
295295
// Get the staker.

primitives/src/policy.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ impl Policy {
162162
/// A value of `80` means 80% of the stake needs to support the upgrade.
163163
pub const UPGRADE_MIN_SUPPORT: u64 = 80;
164164

165+
/// Add Stake contract upgrade.
166+
pub const ADD_STAKE_PROTOCOL_UPGRADE_VERSION: u16 = 1;
167+
165168
/// This function is used to determine if a validator signalled for a specific upgrade.
166169
/// This is checking the first two bytes of the signal data.
167170
/// However, the check could also be version specific in the future.

0 commit comments

Comments
 (0)