Skip to content

Commit

Permalink
address comments from PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Amxx committed Jan 10, 2022
1 parent 829ee5d commit 8037b2f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Expand Up @@ -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)

Expand Down
8 changes: 8 additions & 0 deletions test/governance/GovernorWorkflow.behavior.js
Expand Up @@ -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],
Expand All @@ -50,6 +57,7 @@ function runGovernorWorkflow () {
this.descriptionHash,
];

// proposal id
this.id = await this.mock.hashProposal(...this.settings.shortProposal);
});

Expand Down

0 comments on commit 8037b2f

Please sign in to comment.