Skip to content

Commit

Permalink
Merge pull request #7842 from ethereum-optimism/ctb/portal-fuzz-bn
Browse files Browse the repository at this point in the history
contracts-bedrock: pseudorandom blocknumber in portal fuzz test
  • Loading branch information
tynes authored Oct 26, 2023
2 parents f0d2d32 + 1ea3bba commit 2372c98
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/contracts-bedrock/test/OptimismPortal.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -997,6 +997,8 @@ contract OptimismPortalResourceFuzz_Test is Portal_Initializer {
vm.assume(((_maxResourceLimit / _elasticityMultiplier) * _elasticityMultiplier) == _maxResourceLimit);
_prevBoughtGas = uint64(bound(_prevBoughtGas, 0, _maxResourceLimit - _gasLimit));
_blockDiff = uint8(bound(_blockDiff, 0, 3));
// Pick a pseudorandom block number
vm.roll(uint256(keccak256(abi.encode(_blockDiff))) % uint256(type(uint16).max) + uint256(_blockDiff));

// Create a resource config to mock the call to the system config with
ResourceMetering.ResourceConfig memory rcfg = ResourceMetering.ResourceConfig({
Expand Down

0 comments on commit 2372c98

Please sign in to comment.