Skip to content

Commit

Permalink
merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
nbaztec committed Sep 26, 2023
1 parent 620d47c commit 8339b70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,10 @@ impl<S: ForkSource + std::fmt::Debug> InMemoryNode<S> {
let mut block_hashes = HashMap::<u64, H256>::new();
block_hashes.insert(0, H256::zero());
let mut blocks = HashMap::<H256, Block<TransactionVariant>>::new();
blocks.insert(H256::zero(), create_empty_block(0, 0, 1));
blocks.insert(
H256::zero(),
create_empty_block(0, NON_FORK_FIRST_BLOCK_TIMESTAMP, 0),
);

InMemoryNodeInner {
current_timestamp: NON_FORK_FIRST_BLOCK_TIMESTAMP,
Expand Down
1 change: 1 addition & 0 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ pub fn mine_empty_blocks<S: std::fmt::Debug + ForkSource>(
// we need these to use the unsafeOverrideBlock method in SystemContext.sol
let bootloader_code = node.system_contracts.contacts_for_l2_call();
let (batch_env, mut next_block) = node.create_l1_batch_env(storage.clone());
println!("timestamp {}", next_block.timestamp);
// override the next block's timestamp to match up with interval for subsequent blocks
if i != 0 {
next_block.timestamp = node.current_timestamp.saturating_add(interval_ms);
Expand Down

0 comments on commit 8339b70

Please sign in to comment.