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(ecocredit/marketplace): buy direct cli commands #1008

Merged
merged 7 commits into from
Apr 22, 2022

Conversation

technicallyty
Copy link
Contributor

@technicallyty technicallyty commented Apr 11, 2022

Description

  • adds 2 CLI commands for buy direct:
    • buy direct single (one order)
    • buy direct batch (multiple orders using a json file)

Closes: #983


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)

@codecov
Copy link

codecov bot commented Apr 11, 2022

Codecov Report

Merging #1008 (de3ab03) into master (0ad686d) will decrease coverage by 0.09%.
The diff coverage is 40.00%.

@@            Coverage Diff             @@
##           master    #1008      +/-   ##
==========================================
- Coverage   59.86%   59.76%   -0.10%     
==========================================
  Files         231      231              
  Lines       22840    22918      +78     
==========================================
+ Hits        13674    13698      +24     
- Misses       7842     7891      +49     
- Partials     1324     1329       +5     
Flag Coverage Δ
experimental-codecov 59.66% <40.00%> (-0.09%) ⬇️
stable-codecov 53.30% <40.00%> (-0.06%) ⬇️

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

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.

Looking good. Do we need to create a followup task for adding the integration tests or can we include those here? I think we can include them here without conflicting with #901 but maybe I'm missing something.

Comment on lines 95 to 103
[
{
"sell_order_id": 52,
"quantity": "32.5",
"bid_price": {"denom": "uregen", "amount": "32000000"},
"disable_auto_retire": false,
"retirement_location": "US-NY"
},
]`),
Copy link
Member

Choose a reason for hiding this comment

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

We should probably be consistent with how we do batch orders in the create sell order and update sell order commands. We use yaml there but we use json here.

Any reason you chose json over yaml? Should we update here or there? cc @aleem1314

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmm not sure, i know we have that gen-batch-json command, so that's what i had in mind with this PR. I can change my PR here, but i dont think that would be the end of our inconsistencies 🤷🏻

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ill look into adding tests as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so looks like our CLI integration tests are still commented out until our test suite is wired up to work with ORM. i think we had this issue when we did our v3 sprint.

should be able to add tests for this once the wiring mayhem is done

Copy link
Member

Choose a reason for hiding this comment

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

until our test suite is wired up to work with ORM

This should be good to go now that #901 is merged, correct?

Copy link
Contributor Author

@technicallyty technicallyty Apr 13, 2022

Choose a reason for hiding this comment

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

not exactly,,

// TODO: enable integrations test after ORM migration
// suite.Run(t, NewIntegrationTestSuite(cfg))
// // setup another cfg for testing ecocredit enabled class creators list.
// genesisState := ecocredit.DefaultGenesisState()
// genesisState.Params.AllowlistEnabled = true
// bz, err := cfg.Codec.MarshalJSON(genesisState)
// require.NoError(t, err)
// cfg.GenesisState[ecocredit.ModuleName] = bz
// suite.Run(t, NewAllowListEnabledTestSuite(cfg))

#901 switched the client impls to use the updated types, but the tests are not updated yet.

@technicallyty
Copy link
Contributor Author

waiting for #1026 to add tests and merge

@ryanchristo
Copy link
Member

ryanchristo commented Apr 20, 2022

Can we add a unit test for the command as it looks like we might migrate away from integration tests? #1041

Moving forward, we will treat cli tests as a last priority and as a nice to have in the backlog.

@technicallyty technicallyty enabled auto-merge (squash) April 22, 2022 01:18
@technicallyty technicallyty merged commit b2dee96 into master Apr 22, 2022
@technicallyty technicallyty deleted the ty/983-buy_direct_cli branch April 22, 2022 15:22
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.

CLI command for BuyDirect
3 participants