Skip to content

Commit

Permalink
address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshvanahalli committed Mar 18, 2024
1 parent 11e643e commit 1cab72f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/mocks/PendingBlkTimeAndNrAdvanceCheck.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,20 @@ import "../precompiles/ArbSys.sol";
contract PendingBlkTimeAndNrAdvanceCheck {
uint256 immutable deployedAt;
uint256 immutable deployedAtBlock;
ArbSys constant ARB_SYS = ArbSys(address(100));

constructor() {
deployedAt = block.timestamp;
deployedAtBlock = ArbSys(address(100)).arbBlockNumber();
deployedAtBlock = ARB_SYS.arbBlockNumber();
}

function isAdvancing() external {
require(block.timestamp > deployedAt, "Time didn't advance");
require(ArbSys(address(100)).arbBlockNumber() > deployedAtBlock, "Block didn't advance");
require(ARB_SYS.arbBlockNumber() > deployedAtBlock, "Block didn't advance");
}

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

0 comments on commit 1cab72f

Please sign in to comment.