Skip to content

Commit

Permalink
Add function to test if arbBlockHash on pending block returns latest
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshvanahalli committed Mar 15, 2024
1 parent b3df270 commit 11e643e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/mocks/PendingBlkTimeAndNrAdvanceCheck.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,12 @@ contract PendingBlkTimeAndNrAdvanceCheck {
require(block.timestamp > deployedAt, "Time didn't advance");
require(ArbSys(address(100)).arbBlockNumber() > deployedAtBlock, "Block didn't advance");
}

function checkArbBlockHashReturnsLatest(bytes32 expected) external {
bytes32 gotBlockHash = ArbSys(address(100)).arbBlockHash(
ArbSys(address(100)).arbBlockNumber() - 1
);
require(gotBlockHash != bytes32(0), "ZERO_BLOCK_HASH");
require(gotBlockHash == expected, "WRONG_BLOCK_HASH");
}
}

0 comments on commit 11e643e

Please sign in to comment.