mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-28 20:21:47 +00:00
rpc: return (*Response, error) for all functions
This commit is contained in:
59
rpc/core/responses.go
Normal file
59
rpc/core/responses.go
Normal file
@ -0,0 +1,59 @@
|
||||
package core
|
||||
|
||||
import (
|
||||
"github.com/tendermint/tendermint/account"
|
||||
sm "github.com/tendermint/tendermint/state"
|
||||
"github.com/tendermint/tendermint/types"
|
||||
)
|
||||
|
||||
type ResponseGenPrivAccount struct {
|
||||
PrivAccount *account.PrivAccount
|
||||
}
|
||||
|
||||
type ResponseGetAccount struct {
|
||||
Account *account.Account
|
||||
}
|
||||
|
||||
type ResponseListAccounts struct {
|
||||
BlockHeight uint
|
||||
Accounts []*account.Account
|
||||
}
|
||||
|
||||
type ResponseBlockchainInfo struct {
|
||||
LastHeight uint
|
||||
BlockMetas []*types.BlockMeta
|
||||
}
|
||||
|
||||
type ResponseGetBlock struct {
|
||||
BlockMeta *types.BlockMeta
|
||||
Block *types.Block
|
||||
}
|
||||
|
||||
// curl -H 'content-type: text/plain;' http://127.0.0.1:8888/submit_tx?tx=...
|
||||
type ResponseBroadcastTx struct {
|
||||
Receipt Receipt
|
||||
}
|
||||
|
||||
type ResponseStatus struct {
|
||||
GenesisHash []byte
|
||||
Network string
|
||||
LatestBlockHash []byte
|
||||
LatestBlockHeight uint
|
||||
LatestBlockTime int64 // nano
|
||||
}
|
||||
|
||||
type ResponseNetInfo struct {
|
||||
NumPeers int
|
||||
Listening bool
|
||||
Network string
|
||||
}
|
||||
|
||||
type ResponseSignTx struct {
|
||||
Tx types.Tx
|
||||
}
|
||||
|
||||
type ResponseListValidators struct {
|
||||
BlockHeight uint
|
||||
BondedValidators []*sm.Validator
|
||||
UnbondingValidators []*sm.Validator
|
||||
}
|
Reference in New Issue
Block a user