Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve: add ProposalExecuted event #4374

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ contract OptimisticGovernor is Module, Lockable {

event TransactionExecuted(bytes32 indexed proposalHash, uint256 indexed transactionIndex);

event ProposalExecuted(bytes32 indexed proposalHash, uint256 indexed proposalTime);

event ProposalDeleted(bytes32 indexed proposalHash, address indexed sender, bytes32 indexed status);

event SetBond(IERC20 indexed collateral, uint256 indexed bondAmount);
Expand Down Expand Up @@ -273,7 +275,7 @@ contract OptimisticGovernor is Module, Lockable {
"Must call deleteDisputedProposal instead"
);

// Remove proposal hash so transactions can not be executed again.
// Remove proposal hash mapping so transactions can not be executed again.
delete proposalHashes[_proposalHash];

// This will revert if the price has not been settled and can not currently be settled.
Expand All @@ -289,6 +291,8 @@ contract OptimisticGovernor is Module, Lockable {
);
emit TransactionExecuted(_proposalHash, i);
}

emit ProposalExecuted(_proposalHash, _originalTime);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,13 @@ describe("OptimisticGovernor", () => {
(await testToken2.methods.balanceOf(proposer).call()).toString(),
startingBalance3.add(toBN(toWei("2"))).toString()
);

await assertEventEmitted(
receipt,
optimisticOracleModule,
"ProposalExecuted",
(event) => event.proposalHash == proposalHash && event.proposalTime == proposalTime
);
});

it("Proposals can not be executed twice", async function () {});
Expand Down