Migrate to Hardhat (#2397)
This commit is contained in:
@ -1,13 +1,11 @@
|
||||
const { accounts, contract, web3 } = require('@openzeppelin/test-environment');
|
||||
|
||||
const { balance, ether, expectRevert, send, expectEvent } = require('@openzeppelin/test-helpers');
|
||||
const { expect } = require('chai');
|
||||
|
||||
const AddressImpl = contract.fromArtifact('AddressImpl');
|
||||
const EtherReceiver = contract.fromArtifact('EtherReceiverMock');
|
||||
const CallReceiverMock = contract.fromArtifact('CallReceiverMock');
|
||||
const AddressImpl = artifacts.require('AddressImpl');
|
||||
const EtherReceiver = artifacts.require('EtherReceiverMock');
|
||||
const CallReceiverMock = artifacts.require('CallReceiverMock');
|
||||
|
||||
describe('Address', function () {
|
||||
contract('Address', function (accounts) {
|
||||
const [ recipient, other ] = accounts;
|
||||
|
||||
beforeEach(async function () {
|
||||
@ -145,8 +143,8 @@ describe('Address', function () {
|
||||
}, []);
|
||||
|
||||
await expectRevert(
|
||||
this.mock.functionCall(this.contractRecipient.address, abiEncodedCall),
|
||||
'Address: low-level call failed'
|
||||
this.mock.functionCall(this.contractRecipient.address, abiEncodedCall, { gas: '90000' }),
|
||||
'Address: low-level call failed',
|
||||
);
|
||||
}).timeout(5000);
|
||||
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
const { contract } = require('@openzeppelin/test-environment');
|
||||
require('@openzeppelin/test-helpers');
|
||||
|
||||
const { expect } = require('chai');
|
||||
|
||||
const ArraysImpl = contract.fromArtifact('ArraysImpl');
|
||||
const ArraysImpl = artifacts.require('ArraysImpl');
|
||||
|
||||
describe('Arrays', function () {
|
||||
contract('Arrays', function (accounts) {
|
||||
describe('findUpperBound', function () {
|
||||
context('Even number of elements', function () {
|
||||
const EVEN_ELEMENTS_ARRAY = [11, 12, 13, 14, 15, 16, 17, 18, 19, 20];
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
const { contract } = require('@openzeppelin/test-environment');
|
||||
const { expectRevert } = require('@openzeppelin/test-helpers');
|
||||
|
||||
const { expect } = require('chai');
|
||||
|
||||
const CountersImpl = contract.fromArtifact('CountersImpl');
|
||||
const CountersImpl = artifacts.require('CountersImpl');
|
||||
|
||||
describe('Counters', function () {
|
||||
contract('Counters', function (accounts) {
|
||||
beforeEach(async function () {
|
||||
this.counter = await CountersImpl.new();
|
||||
});
|
||||
|
||||
@ -1,13 +1,12 @@
|
||||
const { contract, accounts, web3 } = require('@openzeppelin/test-environment');
|
||||
const { balance, BN, ether, expectRevert, send } = require('@openzeppelin/test-helpers');
|
||||
|
||||
const { expect } = require('chai');
|
||||
|
||||
const Create2Impl = contract.fromArtifact('Create2Impl');
|
||||
const ERC20Mock = contract.fromArtifact('ERC20Mock');
|
||||
const ERC1820Implementer = contract.fromArtifact('ERC1820Implementer');
|
||||
const Create2Impl = artifacts.require('Create2Impl');
|
||||
const ERC20Mock = artifacts.require('ERC20Mock');
|
||||
const ERC1820Implementer = artifacts.require('ERC1820Implementer');
|
||||
|
||||
describe('Create2', function () {
|
||||
contract('Create2', function (accounts) {
|
||||
const [deployerAccount] = accounts;
|
||||
|
||||
const salt = 'salt message';
|
||||
|
||||
@ -1,12 +1,11 @@
|
||||
const { accounts, contract } = require('@openzeppelin/test-environment');
|
||||
const { BN, expectEvent } = require('@openzeppelin/test-helpers');
|
||||
const { expect } = require('chai');
|
||||
|
||||
const zip = require('lodash.zip');
|
||||
|
||||
const EnumerableMapMock = contract.fromArtifact('EnumerableMapMock');
|
||||
const EnumerableMapMock = artifacts.require('EnumerableMapMock');
|
||||
|
||||
describe('EnumerableMap', function () {
|
||||
contract('EnumerableMap', function (accounts) {
|
||||
const [ accountA, accountB, accountC ] = accounts;
|
||||
|
||||
const keyA = new BN('7891');
|
||||
|
||||
@ -1,12 +1,11 @@
|
||||
const { accounts, contract } = require('@openzeppelin/test-environment');
|
||||
const { BN } = require('@openzeppelin/test-helpers');
|
||||
|
||||
const EnumerableAddressSetMock = contract.fromArtifact('EnumerableAddressSetMock');
|
||||
const EnumerableUintSetMock = contract.fromArtifact('EnumerableUintSetMock');
|
||||
const EnumerableAddressSetMock = artifacts.require('EnumerableAddressSetMock');
|
||||
const EnumerableUintSetMock = artifacts.require('EnumerableUintSetMock');
|
||||
|
||||
const { shouldBehaveLikeSet } = require('./EnumerableSet.behavior');
|
||||
|
||||
describe('EnumerableSet', function () {
|
||||
contract('EnumerableSet', function (accounts) {
|
||||
// AddressSet
|
||||
describe('EnumerableAddressSet', function () {
|
||||
const [ accountA, accountB, accountC ] = accounts;
|
||||
|
||||
@ -1,12 +1,10 @@
|
||||
const { accounts, contract } = require('@openzeppelin/test-environment');
|
||||
|
||||
const { expectEvent, expectRevert } = require('@openzeppelin/test-helpers');
|
||||
|
||||
const { expect } = require('chai');
|
||||
|
||||
const PausableMock = contract.fromArtifact('PausableMock');
|
||||
const PausableMock = artifacts.require('PausableMock');
|
||||
|
||||
describe('Pausable', function () {
|
||||
contract('Pausable', function (accounts) {
|
||||
const [ pauser ] = accounts;
|
||||
|
||||
beforeEach(async function () {
|
||||
|
||||
@ -1,12 +1,11 @@
|
||||
const { contract } = require('@openzeppelin/test-environment');
|
||||
const { expectRevert } = require('@openzeppelin/test-helpers');
|
||||
|
||||
const { expect } = require('chai');
|
||||
|
||||
const ReentrancyMock = contract.fromArtifact('ReentrancyMock');
|
||||
const ReentrancyAttack = contract.fromArtifact('ReentrancyAttack');
|
||||
const ReentrancyMock = artifacts.require('ReentrancyMock');
|
||||
const ReentrancyAttack = artifacts.require('ReentrancyAttack');
|
||||
|
||||
describe('ReentrancyGuard', function () {
|
||||
contract('ReentrancyGuard', function (accounts) {
|
||||
beforeEach(async function () {
|
||||
this.reentrancyMock = await ReentrancyMock.new();
|
||||
expect(await this.reentrancyMock.counter()).to.be.bignumber.equal('0');
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
const { contract } = require('@openzeppelin/test-environment');
|
||||
const { BN, expectRevert } = require('@openzeppelin/test-helpers');
|
||||
|
||||
const { expect } = require('chai');
|
||||
|
||||
const SafeCastMock = contract.fromArtifact('SafeCastMock');
|
||||
const SafeCastMock = artifacts.require('SafeCastMock');
|
||||
|
||||
describe('SafeCast', async () => {
|
||||
contract('SafeCast', async (accounts) => {
|
||||
beforeEach(async function () {
|
||||
this.safeCast = await SafeCastMock.new();
|
||||
});
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
const { contract } = require('@openzeppelin/test-environment');
|
||||
const { constants } = require('@openzeppelin/test-helpers');
|
||||
|
||||
const { expect } = require('chai');
|
||||
|
||||
const StringsMock = contract.fromArtifact('StringsMock');
|
||||
const StringsMock = artifacts.require('StringsMock');
|
||||
|
||||
describe('Strings', function () {
|
||||
contract('Strings', function (accounts) {
|
||||
beforeEach(async function () {
|
||||
this.strings = await StringsMock.new();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user