Skip to content

Commit

Permalink
Update TaikoAnchor.t.sol
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik committed Jan 6, 2025
1 parent dbf8d2b commit 230bba0
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/protocol/test/layer2/TaikoAnchor.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ contract TestTaikoAnchor is Layer2Test {
maxGasIssuancePerBlock: _maxGasIssuancePerBlock
});

(uint256 basefee_,,) = anchor.getBasefeeV2(_parentGasUsed, baseFeeConfig);
(uint256 basefee_,,) =
anchor.getBasefeeV2(_parentGasUsed, uint64(block.timestamp), baseFeeConfig);
assertTrue(basefee_ != 0, "basefee is 0");
}

Expand Down Expand Up @@ -140,15 +141,17 @@ contract TestTaikoAnchor is Layer2Test {
new bytes32[](0)
);

(uint256 basefee, uint64 newGasTarget,) = anchor.getBasefeeV2(_parentGasUsed, baseFeeConfig);
(uint256 basefee, uint64 newGasTarget,) =
anchor.getBasefeeV2(_parentGasUsed, uint64(block.timestamp), baseFeeConfig);

assertTrue(basefee != 0, "basefee is 0");
assertEq(newGasTarget, anchor.parentGasTarget());

// change the gas issuance to change the gas target
baseFeeConfig.gasIssuancePerSecond += 1;

(basefee, newGasTarget,) = anchor.getBasefeeV2(_parentGasUsed, baseFeeConfig);
(basefee, newGasTarget,) =
anchor.getBasefeeV2(_parentGasUsed, uint64(block.timestamp), baseFeeConfig);

assertTrue(basefee != 0, "basefee is 0");
assertTrue(newGasTarget != anchor.parentGasTarget());
Expand Down

0 comments on commit 230bba0

Please sign in to comment.