|
|
@ -6,6 +6,7 @@ import ( |
|
|
|
"github.com/tendermint/go-rpc/types" |
|
|
|
"github.com/tendermint/go-wire" |
|
|
|
"github.com/tendermint/tendermint/types" |
|
|
|
tmsp "github.com/tendermint/tmsp/types" |
|
|
|
) |
|
|
|
|
|
|
|
type ResultBlockchainInfo struct { |
|
|
@ -17,7 +18,7 @@ type ResultGenesis struct { |
|
|
|
Genesis *types.GenesisDoc `json:"genesis"` |
|
|
|
} |
|
|
|
|
|
|
|
type ResultGetBlock struct { |
|
|
|
type ResultBlock struct { |
|
|
|
BlockMeta *types.BlockMeta `json:"block_meta"` |
|
|
|
Block *types.Block `json:"block"` |
|
|
|
} |
|
|
@ -46,7 +47,7 @@ type Peer struct { |
|
|
|
ConnectionStatus p2p.ConnectionStatus `json:"connection_status"` |
|
|
|
} |
|
|
|
|
|
|
|
type ResultListValidators struct { |
|
|
|
type ResultValidators struct { |
|
|
|
BlockHeight int `json:"block_height"` |
|
|
|
Validators []*types.Validator `json:"validators"` |
|
|
|
} |
|
|
@ -57,9 +58,12 @@ type ResultDumpConsensusState struct { |
|
|
|
} |
|
|
|
|
|
|
|
type ResultBroadcastTx struct { |
|
|
|
Code tmsp.CodeType `json:"code"` |
|
|
|
Data []byte `json:"data"` |
|
|
|
Log string `json:"log"` |
|
|
|
} |
|
|
|
|
|
|
|
type ResultListUnconfirmedTxs struct { |
|
|
|
type ResultUnconfirmedTxs struct { |
|
|
|
N int `json:"n_txs"` |
|
|
|
Txs []types.Tx `json:"txs"` |
|
|
|
} |
|
|
@ -82,7 +86,7 @@ const ( |
|
|
|
// 0x0 bytes are for the blockchain
|
|
|
|
ResultTypeGenesis = byte(0x01) |
|
|
|
ResultTypeBlockchainInfo = byte(0x02) |
|
|
|
ResultTypeGetBlock = byte(0x03) |
|
|
|
ResultTypeBlock = byte(0x03) |
|
|
|
|
|
|
|
// 0x2 bytes are for the network
|
|
|
|
ResultTypeStatus = byte(0x20) |
|
|
@ -90,12 +94,12 @@ const ( |
|
|
|
ResultTypeDialSeeds = byte(0x22) |
|
|
|
|
|
|
|
// 0x4 bytes are for the consensus
|
|
|
|
ResultTypeListValidators = byte(0x40) |
|
|
|
ResultTypeValidators = byte(0x40) |
|
|
|
ResultTypeDumpConsensusState = byte(0x41) |
|
|
|
|
|
|
|
// 0x6 bytes are for txs / the application
|
|
|
|
ResultTypeBroadcastTx = byte(0x60) |
|
|
|
ResultTypeListUnconfirmedTxs = byte(0x61) |
|
|
|
ResultTypeBroadcastTx = byte(0x60) |
|
|
|
ResultTypeUnconfirmedTxs = byte(0x61) |
|
|
|
|
|
|
|
// 0x8 bytes are for events
|
|
|
|
ResultTypeSubscribe = byte(0x80) |
|
|
@ -112,14 +116,14 @@ var _ = wire.RegisterInterface( |
|
|
|
struct{ TMResult }{}, |
|
|
|
wire.ConcreteType{&ResultGenesis{}, ResultTypeGenesis}, |
|
|
|
wire.ConcreteType{&ResultBlockchainInfo{}, ResultTypeBlockchainInfo}, |
|
|
|
wire.ConcreteType{&ResultGetBlock{}, ResultTypeGetBlock}, |
|
|
|
wire.ConcreteType{&ResultBlock{}, ResultTypeBlock}, |
|
|
|
wire.ConcreteType{&ResultStatus{}, ResultTypeStatus}, |
|
|
|
wire.ConcreteType{&ResultNetInfo{}, ResultTypeNetInfo}, |
|
|
|
wire.ConcreteType{&ResultDialSeeds{}, ResultTypeDialSeeds}, |
|
|
|
wire.ConcreteType{&ResultListValidators{}, ResultTypeListValidators}, |
|
|
|
wire.ConcreteType{&ResultValidators{}, ResultTypeValidators}, |
|
|
|
wire.ConcreteType{&ResultDumpConsensusState{}, ResultTypeDumpConsensusState}, |
|
|
|
wire.ConcreteType{&ResultBroadcastTx{}, ResultTypeBroadcastTx}, |
|
|
|
wire.ConcreteType{&ResultListUnconfirmedTxs{}, ResultTypeListUnconfirmedTxs}, |
|
|
|
wire.ConcreteType{&ResultUnconfirmedTxs{}, ResultTypeUnconfirmedTxs}, |
|
|
|
wire.ConcreteType{&ResultSubscribe{}, ResultTypeSubscribe}, |
|
|
|
wire.ConcreteType{&ResultUnsubscribe{}, ResultTypeUnsubscribe}, |
|
|
|
wire.ConcreteType{&ResultEvent{}, ResultTypeEvent}, |
|
|
|