Skip to content

Add readable proposals to governance:view command#2545

Merged
celo-ci-bot-user merged 7 commits intomasterfrom
yorhodes/readable-proposals
Jan 28, 2020
Merged

Add readable proposals to governance:view command#2545
celo-ci-bot-user merged 7 commits intomasterfrom
yorhodes/readable-proposals

Conversation

@yorhodes
Copy link
Copy Markdown
Contributor

Description

Adds a raw flag to governance:view which dictates whether proposal should be translated to JSON when outputted

Tested

Against yarn test:livechain
image (2)

Other changes

Adds optional parameters named map to ProposalTransactionJSON interface

Related issues

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 25, 2020

Codecov Report

Merging #2545 into master will increase coverage by 0.31%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2545      +/-   ##
==========================================
+ Coverage    73.6%   73.91%   +0.31%     
==========================================
  Files         556      557       +1     
  Lines       13822    13826       +4     
  Branches     1364     1661     +297     
==========================================
+ Hits        10173    10219      +46     
+ Misses       3370     3327      -43     
- Partials      279      280       +1
Flag Coverage Δ
#mobile 74.1% <ø> (ø) ⬆️
#web 73.63% <100%> (+0.74%) ⬆️
Impacted Files Coverage Δ
packages/web/src/fauceting/PhoneInput.tsx 90.32% <ø> (+67.74%) ⬆️
packages/web/src/_page-tests/test-utils.ts 100% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c0ee392...3fe532c. Read the comment docs.

static flags = {
...BaseCommand.flags,
proposalID: flags.string({ required: true, description: 'UUID of proposal to view' }),
raw: flags.boolean({ required: false, description: 'Display proposal in raw bytes format' }),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the default?

Copy link
Copy Markdown
Contributor Author

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)

)
async getDequeue() {
const dequeue = await this.contract.methods.getDequeue().call()
return dequeue.map(valueToBigNumber).filter((id) => !id.isZero())
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When would the IDs be zero?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dequeued indices are reused after proposals are deleted (when expired)
the proposalID is set to zero in deleteDequeuedProposal, I will add a comment

Comment thread packages/contractkit/src/wrappers/Governance.ts Outdated
@nambrot nambrot assigned yorhodes and unassigned nambrot Jan 27, 2020
@yorhodes yorhodes assigned nambrot and unassigned yorhodes Jan 27, 2020
@asaj asaj assigned yorhodes and unassigned asaj, mcortesi and tkporter Jan 28, 2020
@celo-ci-bot-user celo-ci-bot-user merged commit 69b8a5c into master Jan 28, 2020
@celo-ci-bot-user celo-ci-bot-user deleted the yorhodes/readable-proposals branch January 28, 2020 20:38
aaronmgdr added a commit that referenced this pull request Jan 28, 2020
* master:
  🧹Web cleanup (readme + static dir) (#2562)
  Add readable proposals to governance:view command (#2545)
  Add explicit gas to exchange transactions to prevent errors (#2552)
  Fix off-by-one error in attributing signatures to blocks in CLI (#2559)
  ✅ add test for phone Input component (#2554)
  Add Youtube to Footer +  (#2556)
  Fix rounding error in Election.sol (#2540)
  [Wallet] Bump @celo/client to 0.0.266 (#2551)
  [Wallet] E2E test improvements (#2542)
  Deployed integration (#2550)
  do not fetch affiliates (#2508)
  Added more CLI checks for registering validators and groups (#2491)
  Micro Improvement to web tests (#2527)
  [Wallet] Prompt users with connectivity issues to switch to forno (#2526)
  cli: Fix voter rewards presentation (#2543)
  [Wallet] Fix missing spanish translation  (#2539)
  Downtime slashing when epoch changes (#2436)
aaronmgdr added a commit that referenced this pull request Jan 28, 2020
* master:
  🧹Web cleanup (readme + static dir) (#2562)
  Add readable proposals to governance:view command (#2545)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Everyone SBAT easily view the state of Celo governance

6 participants