Improve TransparentUpgradeableProxy's transparency (#3977)
Co-authored-by: Francisco <fg@frang.io>
(cherry picked from commit 2a62fb4a2d)
This commit is contained in:
committed by
Francisco Giordano
parent
9eee01c5a2
commit
8dfeb5d79e
@ -333,14 +333,23 @@ module.exports = function shouldBehaveLikeTransparentUpgradeableProxy (createPro
|
||||
);
|
||||
});
|
||||
|
||||
context('when function names clash', function () {
|
||||
describe('when function names clash', function () {
|
||||
it('when sender is proxy admin should run the proxy function', async function () {
|
||||
const value = await this.proxy.admin.call({ from: proxyAdminAddress });
|
||||
const value = await this.proxy.admin.call({ from: proxyAdminAddress, value: 0 });
|
||||
expect(value).to.be.equal(proxyAdminAddress);
|
||||
});
|
||||
|
||||
it('when sender is other should delegate to implementation', async function () {
|
||||
const value = await this.proxy.admin.call({ from: anotherAccount });
|
||||
const value = await this.proxy.admin.call({ from: anotherAccount, value: 0 });
|
||||
expect(value).to.be.equal('0x0000000000000000000000000000000011111142');
|
||||
});
|
||||
|
||||
it('when sender is proxy admin value should not be accepted', async function () {
|
||||
await expectRevert.unspecified(this.proxy.admin.call({ from: proxyAdminAddress, value: 1 }));
|
||||
});
|
||||
|
||||
it('when sender is other value should be accepted', async function () {
|
||||
const value = await this.proxy.admin.call({ from: anotherAccount, value: 1 });
|
||||
expect(value).to.be.equal('0x0000000000000000000000000000000011111142');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user