Skip to content

Commit 2573ee9

Browse files
committed
Add protocol support to staker and validator test helps.
Add tests for legacy add_stake.
1 parent 7c58dd2 commit 2573ee9

6 files changed

Lines changed: 1125 additions & 816 deletions

File tree

blockchain/src/blockchain/history_sync.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,9 @@ impl Blockchain {
208208
// Also, this works only if a single macro block is missing between history items.
209209
let batch_number = Policy::batch_at(hist_tx.block_number);
210210
if batch_number > prev_batch
211-
&& block_state
212-
.last()
213-
.map_or(false, |block_state: &BlockState| {
214-
!Policy::is_macro_block_at(block_state.number)
215-
})
211+
&& block_state.last().is_some_and(|block_state: &BlockState| {
212+
!Policy::is_macro_block_at(block_state.number)
213+
})
216214
{
217215
debug!(
218216
history_item_block_number = hist_tx.block_number,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ impl StakingContract {
290290
tx_logger: &mut TransactionLog,
291291
) -> Result<AddStakeReceipt, AccountError> {
292292
if protocol_version < Policy::ADD_STAKE_PROTOCOL_UPGRADE_VERSION {
293+
log::warn!(%protocol_version, "Adding stake using old protocol version");
293294
return self.legacy_add_stake(store, staker_address, value, tx_logger);
294295
}
295296
// Get the staker.

0 commit comments

Comments
 (0)