Add a public Governor.cancel function (#3983)
This commit is contained in:
@ -62,14 +62,19 @@ class GovernorHelper {
|
||||
);
|
||||
}
|
||||
|
||||
cancel(opts = null) {
|
||||
cancel(visibility = 'external', opts = null) {
|
||||
const proposal = this.currentProposal;
|
||||
|
||||
return proposal.useCompatibilityInterface
|
||||
? this.governor.methods['cancel(uint256)'](...concatOpts([proposal.id], opts))
|
||||
: this.governor.methods['$_cancel(address[],uint256[],bytes[],bytes32)'](
|
||||
switch (visibility) {
|
||||
case 'external':
|
||||
return this.governor.methods['cancel(uint256)'](...concatOpts([proposal.id], opts));
|
||||
case 'internal':
|
||||
return this.governor.methods['$_cancel(address[],uint256[],bytes[],bytes32)'](
|
||||
...concatOpts(proposal.shortProposal, opts),
|
||||
);
|
||||
default:
|
||||
throw new Error(`unsuported visibility "${visibility}"`);
|
||||
}
|
||||
}
|
||||
|
||||
vote(vote = {}, opts = null) {
|
||||
|
||||
Reference in New Issue
Block a user