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

Vote for update(pool) command #68

Merged
merged 7 commits into from
Jul 7, 2022
Merged

Vote for update(pool) command #68

merged 7 commits into from
Jul 7, 2022

Conversation

kettlebell
Copy link
Collaborator

Close #26

@coveralls
Copy link

coveralls commented Jun 25, 2022

Pull Request Test Coverage Report for Build 2614749097

  • 204 of 279 (73.12%) changed or added relevant lines in 11 files are covered.
  • 25 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+1.7%) to 64.817%

Changes Missing Coverage Covered Lines Changed/Added Lines %
core/src/contracts/ballot.rs 30 34 88.24%
core/src/box_kind/ballot_box.rs 48 53 90.57%
core/src/main.rs 0 5 0.0%
core/src/scans.rs 0 7 0.0%
core/src/oracle_state.rs 0 17 0.0%
core/src/cli_commands/vote_update_pool.rs 118 155 76.13%
Files with Coverage Reduction New Missed Lines %
core/src/contracts/update.rs 1 86.21%
core/src/oracle_state.rs 1 0%
core/src/cli_commands/bootstrap.rs 23 79.25%
Totals Coverage Status
Change from base Build 2593962893: 1.7%
Covered Lines: 1308
Relevant Lines: 2018

💛 - Coveralls

@kettlebell kettlebell marked this pull request as ready for review July 3, 2022 15:00
@kettlebell kettlebell requested a review from greenhat July 3, 2022 15:00
Copy link
Member

@greenhat greenhat left a comment

Choose a reason for hiding this comment

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

Looking great! I appreciate tests for both cases (with/without ballot box)! Please check my comments.

@@ -93,6 +93,12 @@ enum Command {
TransferOracleToken {
oracle_token_address: String,
},
VoteUpdatePool {
Copy link
Member

Choose a reason for hiding this comment

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

Let's add comments describing the parameters. It'd be awesome if they also are shown in cmdline --help as option descriptions. I suspect there should be an attribute in clap for this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done, and I've added some brief comments for the other commands. All it took was adding doc comments. Looks like this
oracle cli docs
:

Copy link
Member

Choose a reason for hiding this comment

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

Nice! Thanks! Comments, huh? :) clap has awesome UX!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah for sure!

ballot_box_min_storage_rent: u64,
update_nft_token_id: TokenId,
ballot_token_id: TokenId,
ballot_token_owner_address: String,
Copy link
Member

Choose a reason for hiding this comment

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

ballot_token_owner_address can be a Address, i.e. parsed before the call. This will allow removing network_prefix argument as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, it's done.

amount: 1.try_into().unwrap(),
};
let tokens = BoxTokens::from_vec(vec![ballot_token]).unwrap();
let in_ballot_box = ErgoBox::new(
Copy link
Member

Choose a reason for hiding this comment

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

You can call make_local_ballot_box_candidate and then ErgoBox::from_candidate(...) afterwards.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done, thanks.

@kettlebell kettlebell requested a review from greenhat July 5, 2022 08:27
Copy link
Member

@greenhat greenhat left a comment

Choose a reason for hiding this comment

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

Great! Thank you!

@@ -93,6 +93,12 @@ enum Command {
TransferOracleToken {
oracle_token_address: String,
},
VoteUpdatePool {
Copy link
Member

Choose a reason for hiding this comment

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

Nice! Thanks! Comments, huh? :) clap has awesome UX!

@greenhat greenhat merged commit eeb4470 into develop Jul 7, 2022
@greenhat greenhat deleted the issue_26 branch July 7, 2022 05:15
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.

[300 SigmaUSD] Vote for update(pool) command
3 participants