diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e325bb917c..4945cec488d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ * `ERC20`: reduce allowance before triggering transfer. ([#3056](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/#3056)) ### Bugfixes - * `GovernorCompatibilityBravo`: Fix error in the encoding of calldata for proposal submitted through the compatibility interface. Older versions incorrectly prefixed the calldata with the bytes length, leadding to incorrect call executions.([#3100](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/#3100)) + * `GovernorCompatibilityBravo`: Fix error in the encoding of calldata for proposals submitted through the compatibility interface. Older versions incorrectly prefixed the calldata with the bytes length, leading to incorrect call executions. ([#3100](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/#3100)) ## 4.4.1 (2021-12-14) diff --git a/test/governance/GovernorWorkflow.behavior.js b/test/governance/GovernorWorkflow.behavior.js index 2e01be49b63..8cfa9dcafd9 100644 --- a/test/governance/GovernorWorkflow.behavior.js +++ b/test/governance/GovernorWorkflow.behavior.js @@ -32,8 +32,15 @@ function runGovernorWorkflow () { beforeEach(async function () { this.receipts = {}; + // distinguish depending on the proposal length + // - length 4: propose(address[], uint256[], bytes[], string) → GovernorCore + // - length 5: propose(address[], uint256[], string[], bytes[], string) → GovernorCompatibilityBravo this.useCompatibilityInterface = this.settings.proposal.length === 5; + + // compute description hash this.descriptionHash = web3.utils.keccak256(this.settings.proposal.slice(-1).find(Boolean)); + + // condensed proposal, used for queue and execute operation this.settings.shortProposal = [ // targets this.settings.proposal[0], @@ -50,6 +57,7 @@ function runGovernorWorkflow () { this.descriptionHash, ]; + // proposal id this.id = await this.mock.hashProposal(...this.settings.shortProposal); });