mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-07 12:30:45 +00:00
Instead of using anonymous maps, define tagged struct types for JSON argument encoding. This allows us to have the encoding rules we want without tmjson. This commit handles the "easy" cases. BroadcastEvidence is omitted here, because it depends on the interface encoding rules from tmjson. I will address that in a forthcoming change.
60 lines
1.3 KiB
Go
60 lines
1.3 KiB
Go
package http
|
|
|
|
// The types in this file define the JSON encoding for RPC method parameters
|
|
// from the client to the server.
|
|
|
|
import (
|
|
"github.com/tendermint/tendermint/libs/bytes"
|
|
)
|
|
|
|
type abciQueryArgs struct {
|
|
Path string `json:"path"`
|
|
Data bytes.HexBytes `json:"data"`
|
|
Height int64 `json:"height,string"`
|
|
Prove bool `json:"prove"`
|
|
}
|
|
|
|
type txArgs struct {
|
|
Tx []byte `json:"tx"`
|
|
}
|
|
|
|
type txKeyArgs struct {
|
|
TxKey []byte `json:"tx_key"`
|
|
}
|
|
|
|
type unconfirmedArgs struct {
|
|
Limit *int `json:"limit,string,omitempty"`
|
|
}
|
|
|
|
type heightArgs struct {
|
|
Height *int64 `json:"height,string,omitempty"`
|
|
}
|
|
|
|
type hashArgs struct {
|
|
Hash bytes.HexBytes `json:"hash"`
|
|
Prove bool `json:"prove,omitempty"`
|
|
}
|
|
|
|
type blockchainInfoArgs struct {
|
|
MinHeight int64 `json:"minHeight,string"`
|
|
MaxHeight int64 `json:"maxHeight,string"`
|
|
}
|
|
|
|
type genesisChunkArgs struct {
|
|
Chunk uint `json:"chunk,string"`
|
|
}
|
|
|
|
type searchArgs struct {
|
|
Query string `json:"query"`
|
|
Prove bool `json:"prove,omitempty"`
|
|
OrderBy string `json:"order_by,omitempty"`
|
|
Page *int `json:"page,string,omitempty"`
|
|
PerPage *int `json:"per_page,string,omitempty"`
|
|
}
|
|
|
|
type validatorArgs struct {
|
|
Height *int64 `json:"height,string,omitempty"`
|
|
Page *int `json:"page,string,omitempty"`
|
|
PerPage *int `json:"per_page,string,omitempty"`
|
|
}
|