Skip to content

Commit

Permalink
Exchange CLI commands (#1732)
Browse files Browse the repository at this point in the history
* [1701]: Create root tx and query commands and stub out all the sub-commands.

* [1701]: Add some standard flags to the commands.

* [1701]: Do the create-ask and create-bid commands.

* [1701]: Create the cancel-order command.

* [1701]: Commands for fill-asks and fill-bids.

* [1701]: Create the market-settle command. Add the ability to provide a buyer, seller, or signer other than the --from to the other commands.

* [1701]: Reorder the stuff in helpers.go to be alphabetized by the flag.

* [1701]: Rename helpers.go to flags.go so I can extract the cmd flag adds/reads into helpers.go and leave flags.go as the generic more flag stuff.

* [1701]: Refactor a few flag funcs to take in the client context as the first arg since you're supposed to always have the context first (even though it's a secondary thing in these cases, but oh well).

* [1701]: Extract the flag additions and msg creation into helper functions and use those in the commands instead of having them directly in the commands. This should make testing easier since those parts can then be tested without needing to run a command (and fire up a chain).

* [1701]: Create the market-withdraw command. Rename the helpers for consitency.

* [1701]: Create the market-set-external-id command.

* [1701]: Change the comments on the flags adders and MakeMsgs to reference eachother instead of the command.

* [1701]: Create the market-details command.

* [1701]: Create the market-enabled and market-user-settle commands.

* [1701]: Create the market-permissions command.

* [1701]: Create the market-req-attrs command.

* [1701]: Make ParseCoin public.

* [1702]: Create the create-market command.

* [1701]: Get rid of all the simple AddFlagX and ReadFlagX funcs and just put that stuff in the AddFlagsMsgX and MakeMsgX funcs. Swap most of the stuff in helpers.go and flags.go.

* [1701]: Use the new MarkFlagsOneRequired func for enable/disable.

* [1701]: Add tx flags and gov flags before the msg-specific ones. Change MarkFlagRequired into MarkFlagsRequired and take in varargs names. When adding flags, mark all requireds together and add some one-of lists.

* [1701]: Change the create-market command to gov-create-market. Ignore the Long field and just put everything in the Use field because that reads much better in output. Add all the flags to the Use line in the funcs that add the flags. Also add the description sections to the Use field in there too (that stuff used to be in the Long field). Don't include [flags] at the end of the Use output. Don't include help if there's an error generating/sending the tx.

* [1701]: Create the gov-manage-fees command.

* [1701]: Create the gov-update-params command.

* [1701]: Some func reorg in helpers.go and some func renames for standardization.

* [1701]: Create the order-fee-calc query command.

* [1701]: Create the get-order and get-order-by-external-id query commands.

* [1701]: Create the  market-orders, owner-orders, and asset-orders queries. Move Args definition into the flag setters for queries.

* [1701]: Move the Args definition into the flag adders for the tx commands too.

* [1701]: Create the all-orders query command.

* [1701]: Create the market and all-markets query commands.

* [1701]: Split out the command setup funcs into query_setup.go and tx_setup.go. Reorg the stuff in flags.go and helpers.go to hopefully make more sense.

* [1701]: Rename the cmd setup funcs from AddFlags to SetupCmd to better reflect what they're doing.

* [1701]: Move the tx and query flag additions back into the command funcs.

* [1701]: Create the params query.

* [1701]: Create the validate-create-market, validate-market, and validate-manage-fees queries.

* [1701]: Stub out a bunch of TODOs for unit tests and create the CmdTestSuite struct and setup.

* [1701]: Some tweaks to the flags stuff to clean up error messages. Write unit tests on all the flags stuff.

* [1701]: Fix AddQueryExample to not add an ending space if no args are given. Unit tests on the helpers.

* [1701]: Unit tests on all the cmd setup funcs.

* [1701]: Fix a couple of the query makers. Unit tests on all the query makers.

* [1701]: Unit tests on the tx makers.

* [1701]: Create the beginnings of the Cmd tests.

* [1701]: Create ParseCoins to replace sdk.ParseCoinsNormalized similar to ParseCoin.

* [1701]: Add some orders to the cli unit test gen state and write some followup helpers to run some checks.

* [1701]: Lint fixes.

* [1701]: Unit tests on the order-fee-calc and get-order commands.

* [1701]: Unit tests on the order getter commands.

* [1701]: Unit tests on the market and all-markets commands.

* [1701]: Unit tests on the params query.

* [1701]: Unit tests on the validation queries. Query unit tests done.

* [1701]: Unit tests on the create-ask and create-bid endpoints.

* [1701]: Unit tests on the cancel-order command.

* [1701]: Unit tests on the fill-bids, fill-asks, and market-settle endpoints.

* [1701]: Unit tests on the market-set-external-id command.

* [1701]: Unit tests on the market-withdraw, market-update-details, market-update-enabled, and market-update-user-settle commands.

* [1701]: Unit tests on the market-permissions, and market-req-attrs commands.

* [1701]: Unit tests on the gov prop commands.

* [1701]: A light reorg in cli_test.go and a couple lint/compilation fixes.

* [1701]: Wrap all the no xxx provided errors in angle-brackets.

* [1701]: Update ReqAdminDesc to have angle-brackets around stuff. Get rid of the suite's authorityAddr field and just use cli.AuthorityAddr for that. Tweak some comments in helpers.go.

* [1701]: Add the get-params alias to the params command. Tweak a few other comments.

* [1701]: for the create-market and manage-fees commands and validation queries, allow the proposal to be provided via file.

* [1701]: Change ReadFlagBoolOrDefault to pay attention to whether or not the flag was provided rather than trying to just go off the value returned by GetBool. Fix a failing unit test in TestReadFlagAuthority that broke when I changed it to return the default even when there's an error.

* [1701]: Create getSingleMsgFromPropFlag and use that in ReadMsgGovManageFeesRequestFromProposalFlag and ReadMsgGovCreateMarketRequestFromProposalFlag. Add some extra comments in flags.go about assumptions and related funcs.

* [1701]: Add changelog entry.

* [1701]: Add a little reasoning to the comment in ParseCoin.

* [1701]: Update ReqSignerDesc to wrap the field name in angle-brackets (like the other stuff does).

* [1701]: Tweak a couple helper.go descriptions and comments.

* [1701]: Make a function for adding the [--asks|--bids] flags to the queries.

* [1701]: Fix some comments in flags.go.

* [1701]: Fix the addrs used in TestParseAccessGrants.

* [1701]: A little cleanup of cli_test.go.

* [1701]: Tweak the aliases on the query commands.

* [1701]: Tweak the aliases in the tx commands that update or manage market things.

* [1701]: Use --after (instead of --order) for the after_order_id query fields.

* [1701]: Fix some typos.

* [1701]: Update ReadFlagAuthorityOrDefault to use the standard authority as the default if no default is provided.

* [1701]: A little cleanup in query_test.go.

* [1701]: Move the MarkFlagsRequired into flags.go (from helpers.go).
  • Loading branch information
SpicyLemon committed Jan 10, 2024
1 parent 91b0813 commit dceb212
Show file tree
Hide file tree
Showing 17 changed files with 11,195 additions and 14 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ Ref: https://keepachangelog.com/en/1.0.0/

## [Unreleased]

* nothing
### Features

* Add CLI commands for the exchange module endpoints and queries [#1701](https://github.com/provenance-io/provenance/issues/1701).

---

Expand Down
Loading

0 comments on commit dceb212

Please sign in to comment.