Finalize test migration: remove legacy dependencies and test helpers (#4797)
This commit is contained in:
@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user