-
Notifications
You must be signed in to change notification settings - Fork 477
Add readable proposals to governance:view command #2545
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
Changes from all commits
dac9d54
d93002c
bc4201c
fe5f5d1
c53865a
c0ee392
3fe532c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -342,11 +342,13 @@ export class GovernanceWrapper extends BaseWrapper<Governance> { | |
| ) | ||
|
|
||
| /** | ||
| * Returns the proposal dequeue as list of proposal IDs. | ||
| * Returns the (existing) proposal dequeue as list of proposal IDs. | ||
| */ | ||
| getDequeue = proxyCall(this.contract.methods.getDequeue, undefined, (arrayObject) => | ||
| arrayObject.map(valueToBigNumber) | ||
| ) | ||
| async getDequeue() { | ||
| const dequeue = await this.contract.methods.getDequeue().call() | ||
| // filter non-zero as dequeued indices are reused and `deleteDequeuedProposal` zeroes | ||
| return dequeue.map(valueToBigNumber).filter((id) => !id.isZero()) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When would the IDs be zero?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dequeued indices are reused after proposals are deleted (when expired) |
||
| } | ||
|
|
||
| /** | ||
| * Dequeues any queued proposals if `dequeueFrequency` seconds have elapsed since the last dequeue | ||
|
|
@@ -430,9 +432,11 @@ export class GovernanceWrapper extends BaseWrapper<Governance> { | |
|
|
||
| private async lesserAndGreaterAfterUpvote(upvoter: Address, proposalID: BigNumber.Value) { | ||
| const upvoteRecord = await this.getUpvoteRecord(upvoter) | ||
| const queue = upvoteRecord.proposalID.isZero() | ||
| ? await this.getQueue() | ||
| : (await this.withUpvoteRevoked(upvoter)).queue | ||
| const recordQueued = await this.isQueued(upvoteRecord.proposalID) | ||
| // if existing upvote exists in queue, revoke it before applying new upvote | ||
| const queue = recordQueued | ||
| ? (await this.withUpvoteRevoked(upvoter)).queue | ||
| : await this.getQueue() | ||
| const upvoteQueue = await this.withUpvoteApplied(upvoter, proposalID, queue) | ||
| return this.lesserAndGreater(proposalID, upvoteQueue) | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
defaults to false (equivalent to excluding as flag in oclif)