This commit is contained in:
Jeffrey Paul 2018-10-17 23:31:43 -07:00
parent 0289c414fd
commit 74f68b0e00
Signed by: sneak
GPG Key ID: 052443F4DF2A55C2
2 changed files with 12 additions and 13 deletions

View File

@ -27,16 +27,16 @@ func (err JSONRPCError) Error() string {
} }
type JSONRPCResponse struct { type JSONRPCResponse struct {
ID string `json:"id"` ID string `json:"id"`
JSONRPC string `json:"jsonrpc"` JSONRPC string `json:"jsonrpc"`
Result json.RawMessage `json:"result"` Result json.RawMessage `json:"result"`
Error *JSONRPCError `json:"error"` Error *JSONRPCError `json:"error"`
} }
type JSONRPCRequest struct { type JSONRPCRequest struct {
ID string `json:"id"` ID string `json:"id"`
JSONRPC string `json:"jsonrpc"` JSONRPC string `json:"jsonrpc"`
Method string `json:"method"` Method string `json:"method"`
Params []json.RawMessage `json:"params"` Params []json.RawMessage `json:"params"`
} }

View File

@ -3,7 +3,6 @@ package main
import "encoding/json" import "encoding/json"
import "github.com/joeshaw/iso8601" import "github.com/joeshaw/iso8601"
type SteemVirtualTransaction struct { type SteemVirtualTransaction struct {
TxID string `json:"trx_id"` TxID string `json:"trx_id"`
BlockNum uint64 `json:"block"` BlockNum uint64 `json:"block"`
@ -20,13 +19,13 @@ func (rpc *JSONRPC) GetVirtualOpsInBlock(blockNum int) ([]*SteemVirtualTransacti
return nil, err1 return nil, err1
} }
tmp := make([]SteemVirtualTransaction) tmp := make([]SteemVirtualTransaction)
//var result []interface{} //var result []interface{}
err2 := json.Unmarshal(raw, &tmp) err2 := json.Unmarshal(raw, &tmp)
if err2 != nil { if err2 != nil {
return result, nil return result, nil
} }
return nil, err2 return nil, err2
} }
func (rpc *JSONRPC) GetOpsInBlock(blockNum int) (json.RawMessage, error) { func (rpc *JSONRPC) GetOpsInBlock(blockNum int) (json.RawMessage, error) {