Commit d7fce2b2 authored by Kelvin Fichter's avatar Kelvin Fichter Committed by GitHub

dev: Move OVM_BondManager test into the right location (#282)

* Put bond manager test in its place 0.0

* Fix helper import

* Update test/helpers/utils/eth-time.ts
Co-authored-by: default avatarMark Tyneway <mark.tyneway@gmail.com>
parent 0a4b8bbb
......@@ -21,6 +21,7 @@ import {
increaseEthTime,
getBlockTime,
ZERO_ADDRESS,
mineBlock,
} from '../../../helpers'
import { defaultAbiCoder, keccak256 } from 'ethers/lib/utils'
......@@ -1221,7 +1222,7 @@ describe('OVM_CanonicalTransactionChain', () => {
const timestamp = await getEthTime(ethers.provider)
for (let i = 0; i < FORCE_INCLUSION_PERIOD_BLOCKS + 1; i++) {
await ethers.provider.send('evm_mine', [])
await mineBlock(ethers.provider)
}
await expect(
......
import { expect } from '../../../setup'
/* External Imports */
import { waffle, ethers as deployer } from 'hardhat'
import { smoddit, smockit } from '@eth-optimism/smock'
import { expect } from 'chai'
import { ethers, Contract, BigNumber } from 'ethers'
async function mineBlock(provider: any, timestamp: number): Promise<void> {
await provider.send('evm_mine', [timestamp])
}
/* Internal Imports */
import { mineBlock } from '../../../helpers'
describe('BondManager', () => {
describe('OVM_BondManager', () => {
const provider = waffle.provider
const wallets = provider.getWallets()
......
......@@ -14,14 +14,21 @@ export const increaseEthTime = async (
amount: number
): Promise<void> => {
await setEthTime(provider, (await getEthTime(provider)) + amount)
await provider.send('evm_mine', [])
await mineBlock(provider)
}
export const mineBlock = async (
provider: any,
timestamp?: number
): Promise<void> => {
await provider.send('evm_mine', timestamp ? [timestamp] : [])
}
export const getBlockTime = async (
provider: any,
block?: number
): Promise<number> => {
await provider.send('evm_mine', [])
await mineBlock(provider)
if (!!block) {
block = await getNextBlockNumber(provider)
}
......
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