From b95f82b6d60a67b253cb90a0cc4b905661895d68 Mon Sep 17 00:00:00 2001 From: shotaro <10378902+shotaronowhere@users.noreply.github.com> Date: Mon, 18 Mar 2024 13:53:07 -0300 Subject: [PATCH] chore: refactor buffer types in foundry tests --- test/foundry/BridgeCreator.t.sol | 8 ++++---- test/foundry/DelayBuffer.t.sol | 28 ++++++++++++++-------------- test/foundry/RollupCreator.t.sol | 12 ++++++------ test/foundry/SequencerInbox.t.sol | 30 +++++++++++++++--------------- 4 files changed, 39 insertions(+), 39 deletions(-) diff --git a/test/foundry/BridgeCreator.t.sol b/test/foundry/BridgeCreator.t.sol index 25f8b2639..4fd91a143 100644 --- a/test/foundry/BridgeCreator.t.sol +++ b/test/foundry/BridgeCreator.t.sol @@ -138,12 +138,12 @@ contract BridgeCreatorTest is Test { 30, 40 ); - DelayBuffer.BufferConfig memory bufferConfig = DelayBuffer.BufferConfig({ + BufferConfig memory bufferConfig = BufferConfig({ thresholdSeconds: type(uint64).max, thresholdBlocks: type(uint64).max, maxBufferSeconds: 0, maxBufferBlocks: 0, - replenishRate: DelayBuffer.ReplenishRate({ + replenishRate: ReplenishRate({ secondsPerPeriod: 0, blocksPerPeriod: 0, periodSeconds: 0, @@ -220,12 +220,12 @@ contract BridgeCreatorTest is Test { 30, 40 ); - DelayBuffer.BufferConfig memory bufferConfig = DelayBuffer.BufferConfig({ + BufferConfig memory bufferConfig = BufferConfig({ thresholdSeconds: type(uint64).max, thresholdBlocks: type(uint64).max, maxBufferSeconds: 0, maxBufferBlocks: 0, - replenishRate: DelayBuffer.ReplenishRate({ + replenishRate: ReplenishRate({ secondsPerPeriod: 0, blocksPerPeriod: 0, periodSeconds: 0, diff --git a/test/foundry/DelayBuffer.t.sol b/test/foundry/DelayBuffer.t.sol index 862d8e362..3b509d954 100644 --- a/test/foundry/DelayBuffer.t.sol +++ b/test/foundry/DelayBuffer.t.sol @@ -13,12 +13,12 @@ contract DelayBufferableTest is Test { uint64 constant period = 30; uint64 constant threshold = 5; - DelayBuffer.BufferConfig config = DelayBuffer.BufferConfig({ + BufferConfig config = BufferConfig({ thresholdBlocks: 5, thresholdSeconds: 5, maxBufferBlocks: 1000, maxBufferSeconds: 1000, - replenishRate: DelayBuffer.ReplenishRate({ + replenishRate: ReplenishRate({ blocksPerPeriod: 100, periodBlocks: 30, secondsPerPeriod: 100, @@ -32,28 +32,28 @@ contract DelayBufferableTest is Test { delaySeconds: 24 * 60 * 60, futureSeconds: 32 * 2 * 12 }); - DelayBuffer.BufferConfig configBufferable = DelayBuffer.BufferConfig({ + BufferConfig configBufferable = BufferConfig({ thresholdBlocks: 60 * 60 * 2 / 12, thresholdSeconds: 60 * 60 * 2, maxBufferBlocks: 24 * 60 * 60 / 12 * 2, maxBufferSeconds: 24 * 60 * 60 * 2, - replenishRate: DelayBuffer.ReplenishRate({ + replenishRate: ReplenishRate({ secondsPerPeriod: 1, blocksPerPeriod: 1, periodSeconds: 14, periodBlocks: 14 }) }); - using DelayBuffer for DelayBuffer.BufferData; - DelayBuffer.BufferData delayBuffer; - DelayBuffer.BufferData delayBufferDefault = DelayBuffer.BufferData({ + using DelayBuffer for BufferData; + BufferData delayBuffer; + BufferData delayBufferDefault = BufferData({ bufferBlocks: configBufferable.maxBufferBlocks, bufferSeconds: configBufferable.maxBufferSeconds, syncExpiryBlockNumber: 0, syncExpiryTimestamp: 0, roundOffBlocks: 0, roundOffSeconds: 0, - prevDelay: DelayBuffer.DelayHistory({ + prevDelay: DelayHistory({ blockNumber: 0, timestamp: 0, delayBlocks: 0, @@ -148,14 +148,14 @@ contract DelayBufferableTest is Test { } function testUpdateBuffers() public { - delayBuffer = DelayBuffer.BufferData({ + delayBuffer = BufferData({ bufferBlocks: 10, bufferSeconds: 10, syncExpiryBlockNumber: 0, syncExpiryTimestamp: 0, roundOffBlocks: 10, roundOffSeconds: 10, - prevDelay: DelayBuffer.DelayHistory({ + prevDelay: DelayHistory({ blockNumber: 10, timestamp: 10, delayBlocks: 10, @@ -176,14 +176,14 @@ contract DelayBufferableTest is Test { assertEq(delayBuffer.prevDelay.timestamp, 20); assertEq(delayBuffer.prevDelay.delaySeconds, 5); - delayBuffer = DelayBuffer.BufferData({ + delayBuffer = BufferData({ bufferBlocks: 10, bufferSeconds: 10, syncExpiryBlockNumber: 0, syncExpiryTimestamp: 0, roundOffBlocks: 10, roundOffSeconds: 10, - prevDelay: DelayBuffer.DelayHistory({ + prevDelay: DelayHistory({ blockNumber: 10, timestamp: 10, delayBlocks: 3, @@ -208,14 +208,14 @@ contract DelayBufferableTest is Test { } function testPendingDelay() public { - delayBuffer = DelayBuffer.BufferData({ + delayBuffer = BufferData({ bufferBlocks: 10, bufferSeconds: 10, syncExpiryBlockNumber: 0, syncExpiryTimestamp: 0, roundOffBlocks: 10, roundOffSeconds: 10, - prevDelay: DelayBuffer.DelayHistory({ + prevDelay: DelayHistory({ blockNumber: 10, timestamp: 10, delayBlocks: 10, diff --git a/test/foundry/RollupCreator.t.sol b/test/foundry/RollupCreator.t.sol index 64d344435..743a5c6c0 100644 --- a/test/foundry/RollupCreator.t.sol +++ b/test/foundry/RollupCreator.t.sol @@ -114,12 +114,12 @@ contract RollupCreatorTest is Test { 60 * 60 * 24, 60 * 60 ); - DelayBuffer.BufferConfig memory bufferConfig = DelayBuffer.BufferConfig({ + BufferConfig memory bufferConfig = BufferConfig({ thresholdSeconds: type(uint64).max, thresholdBlocks: type(uint64).max, maxBufferSeconds: 0, maxBufferBlocks: 0, - replenishRate: DelayBuffer.ReplenishRate({ + replenishRate: ReplenishRate({ secondsPerPeriod: 0, blocksPerPeriod: 0, periodSeconds: 0, @@ -282,12 +282,12 @@ contract RollupCreatorTest is Test { 60 * 60 * 24, 60 * 60 ); - DelayBuffer.BufferConfig memory bufferConfig = DelayBuffer.BufferConfig({ + BufferConfig memory bufferConfig = BufferConfig({ thresholdSeconds: type(uint64).max, thresholdBlocks: type(uint64).max, maxBufferSeconds: 0, maxBufferBlocks: 0, - replenishRate: DelayBuffer.ReplenishRate({ + replenishRate: ReplenishRate({ secondsPerPeriod: 0, blocksPerPeriod: 0, periodSeconds: 0, @@ -451,12 +451,12 @@ contract RollupCreatorTest is Test { 60 * 60 * 24, 60 * 60 ); - DelayBuffer.BufferConfig memory bufferConfig = DelayBuffer.BufferConfig({ + BufferConfig memory bufferConfig = BufferConfig({ thresholdSeconds: type(uint64).max, thresholdBlocks: type(uint64).max, maxBufferSeconds: 0, maxBufferBlocks: 0, - replenishRate: DelayBuffer.ReplenishRate({ + replenishRate: ReplenishRate({ secondsPerPeriod: 0, blocksPerPeriod: 0, periodSeconds: 0, diff --git a/test/foundry/SequencerInbox.t.sol b/test/foundry/SequencerInbox.t.sol index 969dda813..e5c508663 100644 --- a/test/foundry/SequencerInbox.t.sol +++ b/test/foundry/SequencerInbox.t.sol @@ -50,12 +50,12 @@ contract SequencerInboxTest is Test { delaySeconds: 100, futureSeconds: 100 }); - DelayBuffer.BufferConfig bufferConfigDefault = DelayBuffer.BufferConfig({ + BufferConfig bufferConfigDefault = BufferConfig({ thresholdSeconds: type(uint64).max, thresholdBlocks: type(uint64).max, maxBufferSeconds: type(uint64).max, maxBufferBlocks: type(uint64).max, - replenishRate: DelayBuffer.ReplenishRate({ + replenishRate: ReplenishRate({ secondsPerPeriod: 1, blocksPerPeriod: 1, periodSeconds: 12, @@ -68,7 +68,7 @@ contract SequencerInboxTest is Test { uint256 public constant MAX_DATA_SIZE = 117964; - function deployRollup(bool isArbHosted, bool isDelayBufferable, DelayBuffer.BufferConfig memory bufferConfig) internal returns (SequencerInbox, Bridge) { + function deployRollup(bool isArbHosted, bool isDelayBufferable, BufferConfig memory bufferConfig) internal returns (SequencerInbox, Bridge) { RollupMock rollupMock = new RollupMock(rollupOwner); Bridge bridgeImpl = new Bridge(); Bridge bridge = Bridge( @@ -231,7 +231,7 @@ contract SequencerInboxTest is Test { bytes biggerData = hex"00a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890a4567890"; - function testAddSequencerL2BatchFromOrigin(DelayBuffer.BufferConfig memory bufferConfig) public { + function testAddSequencerL2BatchFromOrigin(BufferConfig memory bufferConfig) public { (SequencerInbox seqInbox, Bridge bridge) = deployRollup(false, false, bufferConfig); address delayedInboxSender = address(140); uint8 delayedInboxKind = 3; @@ -287,7 +287,7 @@ contract SequencerInboxTest is Test { assertEq(seqInboxProxyFeeToken.isUsingFeeToken(), true, "Invalid isUsingFeeToken"); } - function testInitialize(DelayBuffer.BufferConfig memory bufferConfig) public { + function testInitialize(BufferConfig memory bufferConfig) public { Bridge _bridge = Bridge( address(new TransparentUpgradeableProxy(address(new Bridge()), proxyAdmin, "")) ); @@ -302,7 +302,7 @@ contract SequencerInboxTest is Test { assertEq(address(seqInboxProxy.rollup()), address(_bridge.rollup()), "Invalid rollup"); } - function testInitialize_FeeTokenBased(DelayBuffer.BufferConfig memory bufferConfig) public { + function testInitialize_FeeTokenBased(BufferConfig memory bufferConfig) public { ERC20Bridge _bridge = ERC20Bridge( address(new TransparentUpgradeableProxy(address(new ERC20Bridge()), proxyAdmin, "")) ); @@ -318,7 +318,7 @@ contract SequencerInboxTest is Test { assertEq(address(seqInboxProxy.rollup()), address(_bridge.rollup()), "Invalid rollup"); } - function testInitialize_revert_NativeTokenMismatch_EthFeeToken(DelayBuffer.BufferConfig memory bufferConfig) public { + function testInitialize_revert_NativeTokenMismatch_EthFeeToken(BufferConfig memory bufferConfig) public { Bridge _bridge = Bridge( address(new TransparentUpgradeableProxy(address(new Bridge()), proxyAdmin, "")) ); @@ -331,7 +331,7 @@ contract SequencerInboxTest is Test { seqInboxProxy.initialize(IBridge(_bridge), maxTimeVariation, bufferConfig); } - function testInitialize_revert_NativeTokenMismatch_FeeTokenEth(DelayBuffer.BufferConfig memory bufferConfig) public { + function testInitialize_revert_NativeTokenMismatch_FeeTokenEth(BufferConfig memory bufferConfig) public { ERC20Bridge _bridge = ERC20Bridge( address(new TransparentUpgradeableProxy(address(new ERC20Bridge()), proxyAdmin, "")) ); @@ -345,7 +345,7 @@ contract SequencerInboxTest is Test { seqInboxProxy.initialize(IBridge(_bridge), maxTimeVariation, bufferConfig); } - function testAddSequencerL2BatchFromOrigin_ArbitrumHosted(DelayBuffer.BufferConfig memory bufferConfig) public { + function testAddSequencerL2BatchFromOrigin_ArbitrumHosted(BufferConfig memory bufferConfig) public { // this will result in 'hostChainIsArbitrum = true' vm.mockCall( address(100), @@ -498,7 +498,7 @@ contract SequencerInboxTest is Test { ); } - function isValidBufferConfig(DelayBuffer.BufferConfig memory bufferConfig) internal pure returns (bool) { + function isValidBufferConfig(BufferConfig memory bufferConfig) internal pure returns (bool) { return bufferConfig.thresholdBlocks != 0 && bufferConfig.thresholdSeconds != 0 && bufferConfig.maxBufferBlocks != 0 && @@ -513,7 +513,7 @@ contract SequencerInboxTest is Test { bufferConfig.thresholdSeconds <= bufferConfig.maxBufferSeconds; } - function testPostUpgradeInitAlreadyInit(DelayBuffer.BufferConfig memory bufferConfig) public returns (SequencerInbox, SequencerInbox) { + function testPostUpgradeInitAlreadyInit(BufferConfig memory bufferConfig) public returns (SequencerInbox, SequencerInbox) { vm.assume(isValidBufferConfig(bufferConfig)); (SequencerInbox seqInbox, ) = deployRollup(false, false, bufferConfigDefault); SequencerInbox seqInboxImpl = new SequencerInbox(maxDataSize, dummyReader4844, false, true); @@ -532,7 +532,7 @@ contract SequencerInboxTest is Test { return (seqInbox, seqInboxImpl); } - function testPostUpgradeInit(DelayBuffer.BufferConfig memory bufferConfig) public { + function testPostUpgradeInit(BufferConfig memory bufferConfig) public { vm.assume(isValidBufferConfig(bufferConfig)); (SequencerInbox seqInbox, SequencerInbox seqInboxImpl) = testPostUpgradeInitAlreadyInit(bufferConfig); @@ -562,7 +562,7 @@ contract SequencerInboxTest is Test { uint64 thresholdSeconds, uint64 maxBufferBlocks, uint64 maxBufferSeconds, - DelayBuffer.ReplenishRate memory replenishRate + ReplenishRate memory replenishRate ) = seqInbox.bufferConfig(); (uint64 bufferBlocks, uint64 bufferSeconds, @@ -613,14 +613,14 @@ contract SequencerInboxTest is Test { } - function testSetBufferConfig(DelayBuffer.BufferConfig memory bufferConfig) public { + function testSetBufferConfig(BufferConfig memory bufferConfig) public { vm.assume(isValidBufferConfig(bufferConfig)); (SequencerInbox seqInbox, ) = deployRollup(false, true, bufferConfig); vm.prank(rollupOwner); seqInbox.setBufferConfig(bufferConfig); } - function testSetBufferConfigInvalid(DelayBuffer.BufferConfig memory bufferConfigInvalid) public { + function testSetBufferConfigInvalid(BufferConfig memory bufferConfigInvalid) public { vm.assume(!isValidBufferConfig(bufferConfigInvalid)); (SequencerInbox seqInbox, ) = deployRollup(false, true, bufferConfigDefault); vm.expectRevert(abi.encodeWithSelector(BadBufferConfig.selector));