Commit 9e229c62 authored by smartcontracts's avatar smartcontracts Committed by GitHub

Merge pull request #2192 from ethereum-optimism/sc/itest-rm-unreliable

fix: skip an unreliable integration test
parents 9784c462 8cb2535b
---
'@eth-optimism/integration-tests': patch
---
Skip an unreliable test
......@@ -144,33 +144,32 @@ describe('OVM Context: Layer 2 EVM Context', () => {
* context. The data returned should match what is actually being used as the
* OVM context.
*/
it('should return same timestamp and blocknumbers between `eth_call` and `rollup_getInfo`', async () => {
// As atomically as possible, call `rollup_getInfo` and Multicall for the
// blocknumber and timestamp. If this is not atomic, then the sequencer can
// happend to update the timestamp between the `eth_call` and the `rollup_getInfo`
const [info, [, returnData]] = await Promise.all([
L2Provider.send('rollup_getInfo', []),
Multicall.callStatic.aggregate([
[
OVMContextStorage.address,
OVMContextStorage.interface.encodeFunctionData(
'getCurrentBlockTimestamp'
),
],
[
OVMContextStorage.address,
OVMContextStorage.interface.encodeFunctionData(
'getCurrentL1BlockNumber'
),
],
]),
])
const timestamp = BigNumber.from(returnData[0])
const blockNumber = BigNumber.from(returnData[1])
expect(info.ethContext.blockNumber).to.deep.equal(blockNumber.toNumber())
expect(info.ethContext.timestamp).to.deep.equal(timestamp.toNumber())
// TODO: This test is not reliable. If we really care about this then we need to figure out a
// more reliable way to test this behavior.
it.skip('should return same timestamp and blocknumbers between `eth_call` and `rollup_getInfo`', async () => {
// // As atomically as possible, call `rollup_getInfo` and Multicall for the
// // blocknumber and timestamp. If this is not atomic, then the sequencer can
// // happend to update the timestamp between the `eth_call` and the `rollup_getInfo`
// const [info, [, returnData]] = await Promise.all([
// L2Provider.send('rollup_getInfo', []),
// Multicall.callStatic.aggregate([
// [
// OVMContextStorage.address,
// OVMContextStorage.interface.encodeFunctionData(
// 'getCurrentBlockTimestamp'
// ),
// ],
// [
// OVMContextStorage.address,
// OVMContextStorage.interface.encodeFunctionData(
// 'getCurrentL1BlockNumber'
// ),
// ],
// ]),
// ])
// const timestamp = BigNumber.from(returnData[0])
// const blockNumber = BigNumber.from(returnData[1])
// expect(info.ethContext.blockNumber).to.deep.equal(blockNumber.toNumber())
// expect(info.ethContext.timestamp).to.deep.equal(timestamp.toNumber())
})
})
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