Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Payments to the Exchange module (#1868)
* [1703]: Update proto stuff to have all the paymen stuff and stuff. * [1703]: Stub out all the msg server, query server, and msg methods. * [1703]: Create the Payment.Validate() method and tweak ValidateExternalID to not contain the entire external id when it's too long. * [1703]: Create Payment.String() so that things can compile * [1703]: Fix unit tests that broke because I change the external id too-long error message. * [1703]: Set some default payment fee param values and add validation checks on the new fields. Write the state store stuff for the new entries. * [1703]: Add some payment fee consumer stuff. * [1703]: Put the params key strings in some constants and fix a couple params-related unit tests that broke with recent changes. * [1703]: Payment validation and hopefully an improvement on the Payment.String() method. Unit tests on those too. * [1703]: New msg validation funcs and their unit tests. * [1703]: Add some params test cases to cover new keeper stuff. * [1703]: Create key stuff for payments. * [1703]: Unit tests on the target to payment index key creators. * [1703]: Rename the target to payments index key prefix makers to include the word 'Key'. * [1703]: Write most of the payment stuff in the keeper and fill out the msg server endpoint methods. * [1703]: Fill in the query endpoint methods. * [1703]: Add payments to the geneis doc. * [1703]: Add validation to genesis payments. Add payments to genesis import and export. Unit test on that stuff too. * [1703]: Add some payment-related events to the protos. * [1703]: Constructors for the new events and emit them when doing keeper stuff. * [1703]: Unit tests on the new event constructors. * [1703]: Unit tests on the GetPayment and CreatePayment keeper methods. * [1703]: Fix AcceptPayment to correctly release the hold on the payment before trying to move funds. * [1703]: Update RejectPayments to check for at least one source. * [1703]: AcceptPayment, tweak the errors a tiny bit and use the existing record for the sends and stuff. In RejectPayment, require a target and source, and make sure the existing target isn't empty. * [1703]: Unit tests on AcceptPayment and RejectPayment. * [1703]: In RejectPayment: return an error if the target is empty and skip duplicated source entries. In CancelPayments: return an error if the source is empty and skip duplicated external ids. * [1703]: Unit tests on RejectPayments and CancelPayments. * [1703]: Update CancelPayments to use requirePaymentFromStore and improve the same-target error when it's empty. * [1703]: Unit tests on UpdatePaymentTarget. In all the payment keeper tests, check that the payments and index entries match. * [1703]: Maintain the ordering of the fee entries in params when they're being read out of state. * [1703]: Unit test on the GetPaymentsForTargetAndSource, IteratePayments, and CalculatePaymentFees keeper funcs. * [1703]: Consume the commitment settlment fee only if the settlement succeeds. * [1703]: In RejectPayments, include the sources index in the error message. In ChangePaymentTarget, allow the new target to be empty. * [1703]: Unit tests on the msg server endpoints. * [1703]: In the GetPayment query endpoint, ignore any error that comes back from GetPayment and treat it like that payment doesn't exist. * [1703]: Unit tests on the new query endpoints. * [1703]: Add TODOs for the CLI stuff and spec stuff. * [1703]: For the genaccounts tests, fix empty stuff related to payments. * [1703]: Fix a couple CLI unit tests that were failing because of the added fields in Params. * [1703]: Add a bunch of TODOs for the CLI stuff. * [1703]: Create the payment tx CLI Stuff. * [1703]: Add payment queries to CLI. * [1703]: Unit tests on the new flags stuff. * [1703]: Make it possible to include an empty string in the external ids of the CancelPayments command. Require a source in RejectPayment. Require either from or source with ChangePaymentTarget. Unit tests on all the tx setup funcs. * [1703]: In the setup tests, ensure that each of the expected flags also appears in the command's Use. * [1703]: Make a reusalbe use string for indicating there are pagination flags. Make the external id optional in MakeQueryGetPayment. Unit tests on the new query CLI setup stuff. * [1703]: Update the cli test suite setup to include a bunch of payments. * [1703]: Make the GetPayment query return an error if the payment isn't found. * [1703]: Unit tests on the CreatePayment command. * [1703]: Unit tests on the rest of the tx commands. * [1703]: Add a 'no results' test case to the GetPaymentsWithSource and GetPaymentsWithTarget keeper unit tests. * [1703]: Unit tests on the query commands. * [1703]: Fix the names of the payment keeper unit tests. * [1703]: Add payments to state, messages, events, queries, and params spec docs. * [1703]: Update the line numbers in all the proto links in the spec docs. * [1703]: Standardize the empty lines before headers in the concepts spec doc. * [1703]: Add payments to the concepts spec doc. * [1703]: Create the tourmaline-rc3 upgrade to set the new exchange params relating to payments. * [1703]: Add changelog entries. * [1703]: Add some missing function comments in the cli test helpers. * [1703]: Fix typo in the CmdQueryGetPayment Short. * [1703]: Tweak the new payments concepts spec docs to clarify some stuff. * [1703]: Remove line that was accidentally added to runMsgServerTestCase, but didn't do anything. * [1703]: Add an expected log entry to TestTourmaline indicating that the payment params are being set. * [1703]: Add comment to parsePaymentStoreValue indicating that nil, nil is returned when the value is empty (or nil). * [1703]: Remove the AddressString decoration from a couple external id proto fields. * [1703]: Change default exchange payment params to 10hash to create and 8hash to accept. * [1703]: Add some logging to the queries to help identify issues when there are any. --------- Co-authored-by: Ira Miller <[email protected]>
- Loading branch information