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

feat(x/ecocredit): add simpler version of send command #1213

Conversation

sfishel18
Copy link
Contributor

@sfishel18 sfishel18 commented Jun 27, 2022

Description

Closes: #1023

Renames the existing send command to send-bulk, and adds implementation of a simpler send command that can only handle a single transaction of a single credit type but does not require YAML arguments.


Author Checklist

All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.

I have...

  • included the correct type prefix in the PR title
  • added ! to the type prefix if API or client breaking change
  • targeted the correct branch (see PR Targeting)
  • provided a link to the relevant issue or specification
  • followed the guidelines for building modules
  • included the necessary unit and integration tests
  • added a changelog entry to CHANGELOG.md
  • included comments for documenting Go code
  • updated the relevant documentation or specification
  • reviewed "Files changed" and left comments if necessary
  • confirmed all CI checks have passed

Reviewers Checklist

All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.

I have...

  • confirmed the correct type prefix in the PR title
  • confirmed ! in the type prefix if API or client breaking change
  • confirmed all author checklist items have been addressed
  • reviewed state machine logic
  • reviewed API design and naming
  • reviewed documentation is accurate
  • reviewed tests and test coverage
  • manually tested (if applicable)

@sfishel18
Copy link
Contributor Author

hi @ryanchristo and @technicallyty, this is still WIP so no need for an in-depth review, but i'm somewhat new to Go and to this project so wanted to check in and make sure this is on the right track.

i still need to implement the --retire-to option and add tests.

also, i found my self getting confused with batch in the context of a credit batch and send-batch as the new name for what the send command currently does, so i went with send-bulk instead. but of course it's easy to change.

@codecov
Copy link

codecov bot commented Jun 27, 2022

Codecov Report

Merging #1213 (af51056) into master (7c2e904) will increase coverage by 0.06%.
The diff coverage is 95.87%.

@@            Coverage Diff             @@
##           master    #1213      +/-   ##
==========================================
+ Coverage   80.02%   80.09%   +0.06%     
==========================================
  Files         232      232              
  Lines       21533    21626      +93     
==========================================
+ Hits        17232    17321      +89     
- Misses       2988     2990       +2     
- Partials     1313     1315       +2     
Flag Coverage Δ
experimental-codecov 80.10% <95.87%> (+0.03%) ⬆️
stable-codecov 75.25% <95.87%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
x/ecocredit/client/tx.go 82.16% <89.18%> (+0.50%) ⬆️
x/ecocredit/client/testsuite/tx.go 100.00% <100.00%> (ø)

@technicallyty
Copy link
Contributor

hey thanks for the contribution! the intent of the issue was to only add a new CLI command (so no additional protobuf messages/rpc methods), and to use the existing MsgSend and Send method inside the command, as they are setup up already to handle any number of credits. Let me know if that makes sense or if theres any question i can answer 😄

@sfishel18
Copy link
Contributor Author

hey thanks for the contribution! the intent of the issue was to only add a new CLI command (so no additional protobuf messages/rpc methods), and to use the existing MsgSend and Send method inside the command, as they are setup up already to handle any number of credits. Let me know if that makes sense or if theres any question i can answer 😄

ahhh, i see. yeah that totally makes sense. i'll take another crack at it, thanks!

@sfishel18 sfishel18 force-pushed the sfishel18/1023-simple-send-credit-command branch 2 times, most recently from 9a25fcb to a50a9e7 Compare June 28, 2022 05:05
Copy link
Member

@ryanchristo ryanchristo left a comment

Choose a reason for hiding this comment

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

Thanks again for another contribution!

This is looking good. And it looks like you got some experience with proto even if that's not what was needed for this pull request. We just made some changes to the transaction commands so it looks like there will be a few conflicts to resolve. It would be great to add a test as well, which should be pretty straightforward using an existing transaction command test as an example.

@sfishel18
Copy link
Contributor Author

Thanks again for another contribution!

This is looking good. And it looks like you got some experience with proto even if that's not what was needed for this pull request. We just made some changes to the transaction commands so it looks like there will be a few conflicts to resolve. It would be great to add a test as well, which should be pretty straightforward using an existing transaction command test as an example.

my pleasure! thanks for the detailed feedback, i'll get another rev of this up for review in the next few days

@sfishel18 sfishel18 force-pushed the sfishel18/1023-simple-send-credit-command branch from a50a9e7 to 2510b4c Compare July 1, 2022 05:22
@sfishel18 sfishel18 marked this pull request as ready for review July 1, 2022 05:23
Copy link
Contributor

@technicallyty technicallyty left a comment

Choose a reason for hiding this comment

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

great work! just a few nits and then this should be good to go! 🎉

x/ecocredit/client/tx.go Outdated Show resolved Hide resolved
x/ecocredit/client/tx.go Outdated Show resolved Hide resolved
x/ecocredit/client/tx.go Outdated Show resolved Hide resolved
x/ecocredit/client/tx.go Outdated Show resolved Hide resolved
@sfishel18
Copy link
Contributor Author

great work! just a few nits and then this should be good to go! 🎉

thanks! all comments addressed

Copy link
Member

@ryanchristo ryanchristo left a comment

Choose a reason for hiding this comment

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

This is looking good. Just a couple small changes and then I think it's good to go.

x/ecocredit/client/testsuite/tx.go Outdated Show resolved Hide resolved
x/ecocredit/client/testsuite/tx.go Outdated Show resolved Hide resolved
x/ecocredit/client/tx.go Outdated Show resolved Hide resolved
@sfishel18 sfishel18 requested a review from ryanchristo July 9, 2022 05:28
Copy link
Member

@ryanchristo ryanchristo left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks again for the contribution @sfishel18 ! 🎉

@ryanchristo ryanchristo changed the title !feat(x/ecocredit): add simpler version of send command for exchangi… feat(x/ecocredit): add simpler version of send command Jul 11, 2022
Copy link
Contributor

@technicallyty technicallyty left a comment

Choose a reason for hiding this comment

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

lgtm - thanks!

@technicallyty technicallyty merged commit 5830f2f into regen-network:master Jul 11, 2022
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.

Simple Send Credit CLI Command
3 participants