Remove GovernorCompatibilyBravo and add simpler GovernorStorage (#4360)

Co-authored-by: Ernesto García <ernestognw@gmail.com>
Co-authored-by: Francisco Giordano <fg@frang.io>
This commit is contained in:
Hadrien Croubois
2023-08-03 17:51:07 +02:00
committed by GitHub
parent d39df78f6c
commit 21716722ad
27 changed files with 755 additions and 1259 deletions

View File

@ -2,11 +2,9 @@ const { constants, expectEvent, expectRevert, time } = require('@openzeppelin/te
const { expect } = require('chai');
const Enums = require('../../helpers/enums');
const { GovernorHelper, proposalStatesToBitMap } = require('../../helpers/governance');
const { GovernorHelper, proposalStatesToBitMap, timelockSalt } = require('../../helpers/governance');
const { expectRevertCustomError } = require('../../helpers/customError');
const { shouldSupportInterfaces } = require('../../utils/introspection/SupportsInterface.behavior');
const Timelock = artifacts.require('TimelockController');
const Governor = artifacts.require('$GovernorTimelockControlMock');
const CallReceiver = artifacts.require('CallReceiverMock');
@ -37,9 +35,6 @@ contract('GovernorTimelockControl', function (accounts) {
for (const { mode, Token } of TOKENS) {
describe(`using ${Token._json.contractName}`, function () {
const timelockSalt = (address, descriptionHash) =>
'0x' + web3.utils.toBN(address).shln(96).xor(web3.utils.toBN(descriptionHash)).toString(16, 64);
beforeEach(async function () {
const [deployer] = await web3.eth.getAccounts();
@ -97,8 +92,6 @@ contract('GovernorTimelockControl', function (accounts) {
);
});
shouldSupportInterfaces(['ERC165', 'Governor', 'GovernorWithParams', 'GovernorTimelock']);
it("doesn't accept ether transfers", async function () {
await expectRevert.unspecified(web3.eth.sendTransaction({ from: owner, to: this.mock.address, value: 1 }));
});