Finalize test migration: remove legacy dependencies and test helpers (#4797)

This commit is contained in:
Hadrien Croubois
2023-12-26 23:46:06 +01:00
committed by GitHub
parent abcf9dd8b7
commit a72c9561b9
96 changed files with 951 additions and 6503 deletions

View File

@ -1,19 +1,19 @@
const { ethers } = require('hardhat');
const { expect } = require('chai');
const { getAddressInSlot, ImplementationSlot } = require('../helpers/erc1967');
const { getAddressInSlot, ImplementationSlot } = require('../helpers/storage');
module.exports = function shouldBehaveLikeProxy() {
it('cannot be initialized with a non-contract address', async function () {
const initializeData = '0x';
await expect(this.createProxy(this.nonContractAddress, initializeData))
.to.be.revertedWithCustomError(await ethers.getContractFactory('ERC1967Proxy'), 'ERC1967InvalidImplementation')
.withArgs(this.nonContractAddress.address);
.withArgs(this.nonContractAddress);
});
const assertProxyInitialization = function ({ value, balance }) {
it('sets the implementation address', async function () {
expect(await getAddressInSlot(this.proxy, ImplementationSlot)).to.equal(this.implementation.target);
expect(await getAddressInSlot(this.proxy, ImplementationSlot)).to.equal(this.implementation);
});
it('initializes the proxy', async function () {