Migrate metatx tests to ethers.js (#4737)

Co-authored-by: ernestognw <ernestognw@gmail.com>
This commit is contained in:
Hadrien Croubois
2023-11-23 03:24:21 +01:00
committed by GitHub
parent 6bc1173c8e
commit e473bcf859
6 changed files with 408 additions and 485 deletions

View File

@ -1,17 +1,18 @@
require('@openzeppelin/test-helpers');
const ContextMock = artifacts.require('ContextMock');
const ContextMockCaller = artifacts.require('ContextMockCaller');
const { ethers } = require('hardhat');
const { loadFixture } = require('@nomicfoundation/hardhat-network-helpers');
const { shouldBehaveLikeRegularContext } = require('./Context.behavior');
contract('Context', function (accounts) {
const [sender] = accounts;
async function fixture() {
const [sender] = await ethers.getSigners();
const context = await ethers.deployContract('ContextMock', []);
return { sender, context };
}
describe('Context', function () {
beforeEach(async function () {
this.context = await ContextMock.new();
this.caller = await ContextMockCaller.new();
Object.assign(this, await loadFixture(fixture));
});
shouldBehaveLikeRegularContext(sender);
shouldBehaveLikeRegularContext();
});