Make TransparentUpgradeableProxy deploy its ProxyAdmin and optimize proxy interfaces (#4382)

This commit is contained in:
Francisco Giordano
2023-07-09 16:54:32 -03:00
parent e47b53bce4
commit 8fff875589
24 changed files with 300 additions and 308 deletions

View File

@ -59,9 +59,8 @@ contract('BeaconProxy', function (accounts) {
it('no initialization', async function () {
const data = Buffer.from('');
const balance = '10';
this.proxy = await BeaconProxy.new(this.beacon.address, data, { value: balance });
await this.assertInitialized({ value: '0', balance });
this.proxy = await BeaconProxy.new(this.beacon.address, data);
await this.assertInitialized({ value: '0', balance: '0' });
});
it('non-payable initialization', async function () {
@ -79,7 +78,16 @@ contract('BeaconProxy', function (accounts) {
await this.assertInitialized({ value, balance });
});
it('reverting initialization', async function () {
it('reverting initialization due to value', async function () {
const data = Buffer.from('');
await expectRevertCustomError(
BeaconProxy.new(this.beacon.address, data, { value: '1' }),
'ERC1967NonPayable',
[],
);
});
it('reverting initialization function', async function () {
const data = this.implementationV0.contract.methods.reverts().encodeABI();
await expectRevert(BeaconProxy.new(this.beacon.address, data), 'DummyImplementation reverted');
});