Add named return parameters and _checkSelector function to AccessManager (#4624)

This commit is contained in:
Ernesto García
2023-09-28 13:52:42 -06:00
committed by GitHub
parent 2472e51e80
commit 57865f8b20
5 changed files with 75 additions and 30 deletions

View File

@ -84,6 +84,18 @@ contract('GovernorTimelockAccess', function (accounts) {
this.unrestricted.operation.target,
this.unrestricted.operation.data,
);
this.fallback = {};
this.fallback.operation = {
target: this.receiver.address,
value: '0',
data: '0x1234',
};
this.fallback.operationId = hashOperation(
this.mock.address,
this.fallback.operation.target,
this.fallback.operation.data,
);
});
it('accepts ether transfers', async function () {
@ -180,7 +192,7 @@ contract('GovernorTimelockAccess', function (accounts) {
await this.manager.grantRole(roleId, this.mock.address, managerDelay, { from: admin });
this.proposal = await this.helper.setProposal(
[this.restricted.operation, this.unrestricted.operation],
[this.restricted.operation, this.unrestricted.operation, this.fallback.operation],
'descr',
);
@ -209,6 +221,7 @@ contract('GovernorTimelockAccess', function (accounts) {
});
await expectEvent.inTransaction(txExecute.tx, this.receiver, 'CalledRestricted');
await expectEvent.inTransaction(txExecute.tx, this.receiver, 'CalledUnrestricted');
await expectEvent.inTransaction(txExecute.tx, this.receiver, 'CalledFallback');
});
describe('cancel', function () {