Skip to content

Commit

Permalink
test: fix deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
gzeoneth committed Jan 17, 2024
1 parent b389010 commit 0822446
Showing 1 changed file with 22 additions and 30 deletions.
52 changes: 22 additions & 30 deletions test/contract/sequencerInbox.spec.4844.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,18 +272,6 @@ describe('SequencerInbox', async () => {
await rollupOwner.getAddress()
)

const dataHashReader = await Toolkit4844.deployDataHashReader(fundingWallet)
const blobBasefeeReader = await Toolkit4844.deployBlobBasefeeReader(
fundingWallet
)
const sequencerInboxFac = (await ethers.getContractFactory(
'SequencerInbox'
)) as SequencerInbox__factory
const seqInboxTemplate = await sequencerInboxFac.deploy(
117964,
dataHashReader.address,
blobBasefeeReader.address
)
const inboxFac = new Inbox__factory(deployer)
const inboxTemplate = await inboxFac.deploy(117964)

Expand All @@ -301,34 +289,40 @@ describe('SequencerInbox', async () => {
adminAddr,
'0x'
)
const sequencerInboxProxy = await transparentUpgradeableProxyFac.deploy(
seqInboxTemplate.address,
adminAddr,
'0x'
)

const inboxProxy = await transparentUpgradeableProxyFac.deploy(
inboxTemplate.address,
adminAddr,
'0x'
)
await bridgeProxy.deployed()
await inboxProxy.deployed()
await sequencerInboxProxy.deployed()
const dataHashReader = await Toolkit4844.deployDataHashReader(fundingWallet)
const blobBasefeeReader = await Toolkit4844.deployBlobBasefeeReader(
fundingWallet
)

const bridge = await bridgeFac.attach(bridgeProxy.address).connect(user)
const bridgeAdmin = await bridgeFac
.attach(bridgeProxy.address)
.connect(rollupOwner)
const sequencerInbox = await sequencerInboxFac
.attach(sequencerInboxProxy.address)
.connect(user)
await (await bridgeAdmin.initialize(rollupMock.address)).wait()
await sequencerInbox.initialize(bridgeProxy.address, {
delayBlocks: maxDelayBlocks,
delaySeconds: maxDelayTime,
futureBlocks: 10,
futureSeconds: 3000,
})

const sequencerInboxFac = new SequencerInbox__factory(deployer)
const sequencerInbox = await sequencerInboxFac.deploy(
bridge.address,
{
delayBlocks: maxDelayBlocks,
futureBlocks: 10,
delaySeconds: maxDelayTime,
futureSeconds: 3000,
},
117964,
dataHashReader.address,
blobBasefeeReader.address,
{ gasLimit: 15000000 }
)
await sequencerInbox.deployed()

const inbox = await inboxFac.attach(inboxProxy.address).connect(user)

Expand Down Expand Up @@ -387,9 +381,7 @@ describe('SequencerInbox', async () => {
const subMessageCount = await bridge.sequencerReportedSubMessageCount()
const batchSendTx = await sequencerInbox
.connect(batchPoster)
.functions[
'addSequencerL2BatchFromOrigin(uint256,bytes,uint256,address,uint256,uint256)'
](
.functions.addSequencerL2BatchFromOrigin(
await bridge.sequencerMessageCount(),
'0x0042',
await bridge.delayedMessageCount(),
Expand Down

0 comments on commit 0822446

Please sign in to comment.