Skip to content

Commit

Permalink
fix: changed approach, remove looping.
Browse files Browse the repository at this point in the history
  • Loading branch information
nakul1010 committed Sep 25, 2023
1 parent d5794fe commit 76db096
Show file tree
Hide file tree
Showing 5 changed files with 167 additions and 189 deletions.
5 changes: 1 addition & 4 deletions crates/btc-relay/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,8 @@ pub mod benchmarks {
}
}

BtcRelay::<T>::insert_block_hash(0, DIFFICULTY_ADJUSTMENT_INTERVAL, init_block_hash);

// new fork up to block before swapping the main chain
for chain_id in 1..(BestBlockHeight::<T>::get() + SECURE_BITCOIN_CONFIRMATIONS) {
BtcRelay::<T>::insert_block_hash(chain_id, DIFFICULTY_ADJUSTMENT_INTERVAL, init_block_hash);
for _ in 1..(BestBlockHeight::<T>::get() + SECURE_BITCOIN_CONFIRMATIONS) {
let block = add_new_block_to_relay::<T>(caller.clone(), init_block_hash, f as usize);
init_block_hash = block.header.hash;
}
Expand Down
Loading

0 comments on commit 76db096

Please sign in to comment.