mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-25 02:31:46 +00:00
RPCResponse.Result && EventData are registered interfaces; -skip_upnp option
This commit is contained in:
@ -7,21 +7,21 @@ import (
|
||||
ctypes "github.com/tendermint/tendermint/rpc/core/types"
|
||||
)
|
||||
|
||||
func GenPrivAccount() (*acm.PrivAccount, error) {
|
||||
return acm.GenPrivAccount(), nil
|
||||
func GenPrivAccount() (*ctypes.ResultGenPrivAccount, error) {
|
||||
return &ctypes.ResultGenPrivAccount{acm.GenPrivAccount()}, nil
|
||||
}
|
||||
|
||||
// If the account is not known, returns nil, nil.
|
||||
func GetAccount(address []byte) (*acm.Account, error) {
|
||||
func GetAccount(address []byte) (*ctypes.ResultGetAccount, error) {
|
||||
cache := mempoolReactor.Mempool.GetCache()
|
||||
account := cache.GetAccount(address)
|
||||
if account == nil {
|
||||
return nil, nil
|
||||
}
|
||||
return account, nil
|
||||
return &ctypes.ResultGetAccount{account}, nil
|
||||
}
|
||||
|
||||
func GetStorage(address, key []byte) (*ctypes.ResponseGetStorage, error) {
|
||||
func GetStorage(address, key []byte) (*ctypes.ResultGetStorage, error) {
|
||||
state := consensusState.GetState()
|
||||
account := state.GetAccount(address)
|
||||
if account == nil {
|
||||
@ -32,12 +32,12 @@ func GetStorage(address, key []byte) (*ctypes.ResponseGetStorage, error) {
|
||||
|
||||
_, value := storageTree.Get(LeftPadWord256(key).Bytes())
|
||||
if value == nil {
|
||||
return &ctypes.ResponseGetStorage{key, nil}, nil
|
||||
return &ctypes.ResultGetStorage{key, nil}, nil
|
||||
}
|
||||
return &ctypes.ResponseGetStorage{key, value.([]byte)}, nil
|
||||
return &ctypes.ResultGetStorage{key, value.([]byte)}, nil
|
||||
}
|
||||
|
||||
func ListAccounts() (*ctypes.ResponseListAccounts, error) {
|
||||
func ListAccounts() (*ctypes.ResultListAccounts, error) {
|
||||
var blockHeight int
|
||||
var accounts []*acm.Account
|
||||
state := consensusState.GetState()
|
||||
@ -46,10 +46,10 @@ func ListAccounts() (*ctypes.ResponseListAccounts, error) {
|
||||
accounts = append(accounts, value.(*acm.Account))
|
||||
return false
|
||||
})
|
||||
return &ctypes.ResponseListAccounts{blockHeight, accounts}, nil
|
||||
return &ctypes.ResultListAccounts{blockHeight, accounts}, nil
|
||||
}
|
||||
|
||||
func DumpStorage(address []byte) (*ctypes.ResponseDumpStorage, error) {
|
||||
func DumpStorage(address []byte) (*ctypes.ResultDumpStorage, error) {
|
||||
state := consensusState.GetState()
|
||||
account := state.GetAccount(address)
|
||||
if account == nil {
|
||||
@ -63,5 +63,5 @@ func DumpStorage(address []byte) (*ctypes.ResponseDumpStorage, error) {
|
||||
key.([]byte), value.([]byte)})
|
||||
return false
|
||||
})
|
||||
return &ctypes.ResponseDumpStorage{storageRoot, storageItems}, nil
|
||||
return &ctypes.ResultDumpStorage{storageRoot, storageItems}, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user