Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 11 additions & 22 deletions packages/contracts/test/contracts/L2/predeploys/OVM_ETH.spec.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,34 @@
/* External Imports */
import { ethers } from 'hardhat'
import { ContractFactory, Contract, Signer } from 'ethers'
import { Contract } from 'ethers'
import { SignerWithAddress } from '@nomiclabs/hardhat-ethers/signers'

import { expect } from '../../../setup'
import { deploy } from '../../../helpers'

describe('OVM_ETH', () => {
let signer1: Signer
let signer2: Signer
let signer1: SignerWithAddress
let signer2: SignerWithAddress
before(async () => {
;[signer1, signer2] = await ethers.getSigners()
})

let Factory__OVM_ETH: ContractFactory
before(async () => {
Factory__OVM_ETH = await ethers.getContractFactory('OVM_ETH')
})

let OVM_ETH: Contract
beforeEach(async () => {
OVM_ETH = await Factory__OVM_ETH.deploy()
OVM_ETH = await deploy('OVM_ETH')
})

describe('transfer', () => {
it('should revert', async () => {
await expect(
OVM_ETH.transfer(await signer2.getAddress(), 100)
).to.be.revertedWith(
await expect(OVM_ETH.transfer(signer2.address, 100)).to.be.revertedWith(
'OVM_ETH: transfer is disabled pending further community discussion.'
)
})
})

describe('approve', () => {
it('should revert', async () => {
await expect(
OVM_ETH.approve(await signer2.getAddress(), 100)
).to.be.revertedWith(
await expect(OVM_ETH.approve(signer2.address, 100)).to.be.revertedWith(
'OVM_ETH: approve is disabled pending further community discussion.'
)
})
Expand All @@ -44,11 +37,7 @@ describe('OVM_ETH', () => {
describe('transferFrom', () => {
it('should revert', async () => {
await expect(
OVM_ETH.transferFrom(
await signer1.getAddress(),
await signer2.getAddress(),
100
)
OVM_ETH.transferFrom(signer1.address, signer2.address, 100)
).to.be.revertedWith(
'OVM_ETH: transferFrom is disabled pending further community discussion.'
)
Expand All @@ -58,7 +47,7 @@ describe('OVM_ETH', () => {
describe('increaseAllowance', () => {
it('should revert', async () => {
await expect(
OVM_ETH.increaseAllowance(await signer2.getAddress(), 100)
OVM_ETH.increaseAllowance(signer2.address, 100)
).to.be.revertedWith(
'OVM_ETH: increaseAllowance is disabled pending further community discussion.'
)
Expand All @@ -68,7 +57,7 @@ describe('OVM_ETH', () => {
describe('decreaseAllowance', () => {
it('should revert', async () => {
await expect(
OVM_ETH.decreaseAllowance(await signer2.getAddress(), 100)
OVM_ETH.decreaseAllowance(signer2.address, 100)
).to.be.revertedWith(
'OVM_ETH: decreaseAllowance is disabled pending further community discussion.'
)
Expand Down