Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update tests
  • Loading branch information
JulissaDantes committed Nov 7, 2022
commit 8355b5bbada431f82ddf1a16bd30fb4d33e4370a
2 changes: 0 additions & 2 deletions contracts/governance/README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ Operations status can be queried using the functions:

The admins are in charge of managing proposers and executors. For the timelock to be self-governed, this role should only be given to the timelock itself. Upon deployment, the admin role can be granted to any address (in addition to the timelock itself). After further configuration and testing, this optional admin should renounce its role such that all further maintenance operations have to go through the timelock process.

This role is identified by the *TIMELOCK_ADMIN_ROLE* value: `0x5f58e3a2316349923ce3780f8d587db2d72378aed66a8261c916544fa6846ca5`

[[timelock-proposer]]
===== Proposer

Expand Down
8 changes: 4 additions & 4 deletions test/governance/TimelockController.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function genOperationBatch (targets, values, payloads, predecessor, salt) {
contract('TimelockController', function (accounts) {
const [ , admin, proposer, canceller, executor, other ] = accounts;

const TIMELOCK_ADMIN_ROLE = web3.utils.soliditySha3('TIMELOCK_ADMIN_ROLE');
const DEFAULT_ADMIN_ROLE = '0x0000000000000000000000000000000000000000000000000000000000000000';
const PROPOSER_ROLE = web3.utils.soliditySha3('PROPOSER_ROLE');
const EXECUTOR_ROLE = web3.utils.soliditySha3('EXECUTOR_ROLE');
const CANCELLER_ROLE = web3.utils.soliditySha3('CANCELLER_ROLE');
Expand Down Expand Up @@ -84,7 +84,7 @@ contract('TimelockController', function (accounts) {
it('initial state', async function () {
expect(await this.mock.getMinDelay()).to.be.bignumber.equal(MINDELAY);

expect(await this.mock.TIMELOCK_ADMIN_ROLE()).to.be.equal(TIMELOCK_ADMIN_ROLE);
expect(await this.mock.DEFAULT_ADMIN_ROLE()).to.be.equal(DEFAULT_ADMIN_ROLE);
expect(await this.mock.PROPOSER_ROLE()).to.be.equal(PROPOSER_ROLE);
expect(await this.mock.EXECUTOR_ROLE()).to.be.equal(EXECUTOR_ROLE);
expect(await this.mock.CANCELLER_ROLE()).to.be.equal(CANCELLER_ROLE);
Expand All @@ -111,8 +111,8 @@ contract('TimelockController', function (accounts) {
{ from: other },
);

expect(await mock.hasRole(TIMELOCK_ADMIN_ROLE, admin)).to.be.equal(false);
expect(await mock.hasRole(TIMELOCK_ADMIN_ROLE, other)).to.be.equal(false);
expect(await mock.hasRole(DEFAULT_ADMIN_ROLE, admin)).to.be.equal(false);
expect(await mock.hasRole(DEFAULT_ADMIN_ROLE, other)).to.be.equal(false);
});

describe('methods', function () {
Expand Down
6 changes: 3 additions & 3 deletions test/governance/extensions/GovernorTimelockControl.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const CallReceiver = artifacts.require('CallReceiverMock');
contract('GovernorTimelockControl', function (accounts) {
const [ owner, voter1, voter2, voter3, voter4, other ] = accounts;

const TIMELOCK_ADMIN_ROLE = web3.utils.soliditySha3('TIMELOCK_ADMIN_ROLE');
const DEFAULT_ADMIN_ROLE = '0x0000000000000000000000000000000000000000000000000000000000000000';
const PROPOSER_ROLE = web3.utils.soliditySha3('PROPOSER_ROLE');
const EXECUTOR_ROLE = web3.utils.soliditySha3('EXECUTOR_ROLE');
const CANCELLER_ROLE = web3.utils.soliditySha3('CANCELLER_ROLE');
Expand Down Expand Up @@ -46,7 +46,7 @@ contract('GovernorTimelockControl', function (accounts) {

this.helper = new GovernorHelper(this.mock);

this.TIMELOCK_ADMIN_ROLE = await this.timelock.TIMELOCK_ADMIN_ROLE();
this.DEFAULT_ADMIN_ROLE = await this.timelock.DEFAULT_ADMIN_ROLE();
this.PROPOSER_ROLE = await this.timelock.PROPOSER_ROLE();
this.EXECUTOR_ROLE = await this.timelock.EXECUTOR_ROLE();
this.CANCELLER_ROLE = await this.timelock.CANCELLER_ROLE();
Expand All @@ -59,7 +59,7 @@ contract('GovernorTimelockControl', function (accounts) {
await this.timelock.grantRole(CANCELLER_ROLE, this.mock.address);
await this.timelock.grantRole(CANCELLER_ROLE, owner);
await this.timelock.grantRole(EXECUTOR_ROLE, constants.ZERO_ADDRESS);
await this.timelock.revokeRole(TIMELOCK_ADMIN_ROLE, deployer);
await this.timelock.revokeRole(DEFAULT_ADMIN_ROLE, deployer);

await this.token.mint(owner, tokenSupply);
await this.helper.delegate({ token: this.token, to: voter1, value: web3.utils.toWei('10') }, { from: owner });
Expand Down