rpc: add sort_order option to tx_search (#4342)

I have added order_by which can be "asc" or "desc" (should be in string format) in the tx_search RPC method.

Fixes: #3333

Author: @princesinha19
This commit is contained in:
Anton Kaliaev
2020-01-27 21:20:56 +04:00
committed by GitHub
parent 59a922d38a
commit d90dc9db26
12 changed files with 95 additions and 65 deletions
+3 -2
View File
@@ -295,8 +295,9 @@ func (c *Client) Tx(hash []byte, prove bool) (*ctypes.ResultTx, error) {
return res, res.Proof.Validate(h.DataHash)
}
func (c *Client) TxSearch(query string, prove bool, page, perPage int) (*ctypes.ResultTxSearch, error) {
return c.next.TxSearch(query, prove, page, perPage)
func (c *Client) TxSearch(query string, prove bool, page, perPage int, orderBy string) (
*ctypes.ResultTxSearch, error) {
return c.next.TxSearch(query, prove, page, perPage, orderBy)
}
func (c *Client) Validators(height *int64, page, perPage int) (*ctypes.ResultValidators, error) {