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

Bounty module CLI commands #3102

Open
wants to merge 16 commits into
base: rhodes
Choose a base branch
from

Conversation

zeeshanakram3
Copy link
Contributor

@zeeshanakram3 zeeshanakram3 commented Jan 25, 2022

This draft PR contains my initial work related to Bounty module CLI commands.

Related issue:

The purpose of this PR is to add the following Bounty management commands and describe their usage in cli package README.md;

  • Get a bounty by id bounty:bounty
  • List all bounties bounty:bounties
  • Creating a bounty bounty:createBounty
  • Canceling a bounty bounty:cancelBounty
  • Vetoing a bounty bounty:vetoBounty
  • Funding a bounty bounty:fundBounty
  • Withdrawing funds from the bounty bounty:withdrawFunding
  • Withdraw work entrant funds bounty:withdrawWorkEntrantFunds
  • Announcing the work entry for a successful bounty bounty:announceWorkEntry
  • Withdraw work entry from a bounty bounty:withdrawWorkEntry
  • Get a work entry by id bounty:entry
  • List of work entries bounty:entries
  • Submitting work for a given bounty bounty:submitWork
  • Submitting oracle judgment bounty:submitOracleJudgment

The code that needs double-check/review or has not been implemented is marked with TODO comments.

The implementation details of the initial work are as follows:

  • Added JSBounty & BountyMilestone types in the types/src/bounty.ts, these two types were missing in olympia base branch. I named bounty as JSBonuty because augment/augment-api-query.ts already had Bounty imported from Polkadot js treasury.
  • The abstract class BountyCommandBase extends RolesCommandBase, defines the helpers function used in the bounties related commands
  • bounty:createBounty command ensures that all bounty creation parameters are valid.
  • bounty:cancelBounty & bounty:vetoBountycommand ensures that bounty can only be canceled/vetoed if it's in the Created Stage and has zero contributions. Also, bounty can only be canceled by member who created it.
  • The bounty stage calculation helper functions are defined to make sure that validations on bounty stage are performed in the following commands: announceWorkEntry, withdrawWorkEntry, submitWork, submitOracleJudgment etc
  • Generated correct TS type for submitOracleJudgment extrinsic, previously on TS side oracleJudgment was defined as
enum oracleJudgment { Winner: { reward: number }, Rejected }


However the correct type that runtime extrinsic accepts is 





BTreeMap<EntryId, OracleWorkEntryJudgment> 





where OracleWorkEntryJudgment corresponds to 






enum OracleWorkEntryJudgment  { Winner: { reward: number }, Rejected }

@vercel
Copy link

vercel bot commented Jan 25, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/joystream/pioneer-testnet/63VKGSBizLCT4N3K6x59HFyjM4jZ
✅ Preview: Canceled

[Deployment for 0a0fd8c canceled]

@zeeshanakram3 zeeshanakram3 added CLI Command Line Interface Tool bounty-pallet and removed bounty-pallet labels Jan 25, 2022
@zeeshanakram3 zeeshanakram3 self-assigned this Jan 25, 2022
@zeeshanakram3 zeeshanakram3 changed the title Bounty cli Bounty module CLI commands Jan 25, 2022
@bedeho bedeho requested a review from Lezek123 January 26, 2022 09:25
@zeeshanakram3 zeeshanakram3 moved this from In progress to Review in progress in CLI Bounty Module support Jan 28, 2022
@zeeshanakram3 zeeshanakram3 marked this pull request as ready for review January 28, 2022 13:16
@zeeshanakram3 zeeshanakram3 changed the base branch from olympia to rhodes March 18, 2022 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty-pallet CLI Command Line Interface Tool
Projects
No open projects
CLI Bounty Module support
Review in progress
Development

Successfully merging this pull request may close these issues.

None yet

1 participant