Commit d0104ffa authored by Mark Tyneway's avatar Mark Tyneway

fault-mon: fix tests

parent ad7018c1
...@@ -3,6 +3,7 @@ import '@nomiclabs/hardhat-ethers' ...@@ -3,6 +3,7 @@ import '@nomiclabs/hardhat-ethers'
import { Contract, utils } from 'ethers' import { Contract, utils } from 'ethers'
import { toRpcHexString } from '@eth-optimism/core-utils' import { toRpcHexString } from '@eth-optimism/core-utils'
import Artifact__L2OutputOracle from '@eth-optimism/contracts-bedrock/forge-artifacts/L2OutputOracle.sol/L2OutputOracle.json' import Artifact__L2OutputOracle from '@eth-optimism/contracts-bedrock/forge-artifacts/L2OutputOracle.sol/L2OutputOracle.json'
import Artifact__Proxy from '@eth-optimism/contracts-bedrock/forge-artifacts/Proxy.sol/Proxy.json'
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers' import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'
import { expect } from './setup' import { expect } from './setup'
...@@ -29,22 +30,43 @@ describe('helpers', () => { ...@@ -29,22 +30,43 @@ describe('helpers', () => {
}) })
let L2OutputOracle: Contract let L2OutputOracle: Contract
let Proxy: Contract
beforeEach(async () => { beforeEach(async () => {
const Factory__Proxy = new hre.ethers.ContractFactory(
Artifact__Proxy.abi,
Artifact__Proxy.bytecode.object,
signer
)
Proxy = await Factory__Proxy.deploy(signer.address)
const Factory__L2OutputOracle = new hre.ethers.ContractFactory( const Factory__L2OutputOracle = new hre.ethers.ContractFactory(
Artifact__L2OutputOracle.abi, Artifact__L2OutputOracle.abi,
Artifact__L2OutputOracle.bytecode.object, Artifact__L2OutputOracle.bytecode.object,
signer signer
) )
L2OutputOracle = await Factory__L2OutputOracle.deploy( const L2OutputOracleImplementation = await Factory__L2OutputOracle.deploy(
deployConfig.l2OutputOracleSubmissionInterval, deployConfig.l2OutputOracleSubmissionInterval,
deployConfig.l2BlockTime, deployConfig.l2BlockTime,
deployConfig.l2OutputOracleStartingBlockNumber,
deployConfig.l2OutputOracleStartingTimestamp,
deployConfig.l2OutputOracleProposer,
deployConfig.l2OutputOracleChallenger,
deployConfig.finalizationPeriodSeconds deployConfig.finalizationPeriodSeconds
) )
await Proxy.upgradeToAndCall(
L2OutputOracleImplementation.address,
L2OutputOracleImplementation.interface.encodeFunctionData('initialize', [
deployConfig.l2OutputOracleStartingBlockNumber,
deployConfig.l2OutputOracleStartingTimestamp,
deployConfig.l2OutputOracleProposer,
deployConfig.l2OutputOracleChallenger,
])
)
L2OutputOracle = new hre.ethers.Contract(
Proxy.address,
Artifact__L2OutputOracle.abi,
signer
)
}) })
describe('findOutputForIndex', () => { describe('findOutputForIndex', () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment