Commit e80ef9ff authored by Taylor Gerring's avatar Taylor Gerring

Cleanup

parent 29930da5
...@@ -13,7 +13,6 @@ import ( ...@@ -13,7 +13,6 @@ import (
type EthereumApi struct { type EthereumApi struct {
eth *xeth.XEth eth *xeth.XEth
xethMu sync.RWMutex xethMu sync.RWMutex
db common.Database
} }
func NewEthereumApi(xeth *xeth.XEth) *EthereumApi { func NewEthereumApi(xeth *xeth.XEth) *EthereumApi {
......
package rpc package rpc
import ( import (
"bytes"
"encoding/json" "encoding/json"
// "errors"
"fmt" "fmt"
"math/big" "math/big"
...@@ -105,8 +103,8 @@ type GetBlockByHashArgs struct { ...@@ -105,8 +103,8 @@ type GetBlockByHashArgs struct {
func (args *GetBlockByHashArgs) UnmarshalJSON(b []byte) (err error) { func (args *GetBlockByHashArgs) UnmarshalJSON(b []byte) (err error) {
var obj []interface{} var obj []interface{}
r := bytes.NewReader(b)
if err := json.NewDecoder(r).Decode(&obj); err != nil { if err := json.Unmarshal(b, &obj); err != nil {
return NewDecodeParamError(err.Error()) return NewDecodeParamError(err.Error())
} }
...@@ -134,8 +132,7 @@ type GetBlockByNumberArgs struct { ...@@ -134,8 +132,7 @@ type GetBlockByNumberArgs struct {
func (args *GetBlockByNumberArgs) UnmarshalJSON(b []byte) (err error) { func (args *GetBlockByNumberArgs) UnmarshalJSON(b []byte) (err error) {
var obj []interface{} var obj []interface{}
r := bytes.NewReader(b) if err := json.Unmarshal(b, &obj); err != nil {
if err := json.NewDecoder(r).Decode(&obj); err != nil {
return NewDecodeParamError(err.Error()) return NewDecodeParamError(err.Error())
} }
...@@ -405,8 +402,7 @@ type BlockNumIndexArgs struct { ...@@ -405,8 +402,7 @@ type BlockNumIndexArgs struct {
func (args *BlockNumIndexArgs) UnmarshalJSON(b []byte) (err error) { func (args *BlockNumIndexArgs) UnmarshalJSON(b []byte) (err error) {
var obj []interface{} var obj []interface{}
r := bytes.NewReader(b) if err := json.Unmarshal(b, &obj); err != nil {
if err := json.NewDecoder(r).Decode(&obj); err != nil {
return NewDecodeParamError(err.Error()) return NewDecodeParamError(err.Error())
} }
...@@ -436,8 +432,7 @@ type HashIndexArgs struct { ...@@ -436,8 +432,7 @@ type HashIndexArgs struct {
func (args *HashIndexArgs) UnmarshalJSON(b []byte) (err error) { func (args *HashIndexArgs) UnmarshalJSON(b []byte) (err error) {
var obj []interface{} var obj []interface{}
r := bytes.NewReader(b) if err := json.Unmarshal(b, &obj); err != nil {
if err := json.NewDecoder(r).Decode(&obj); err != nil {
return NewDecodeParamError(err.Error()) return NewDecodeParamError(err.Error())
} }
...@@ -468,8 +463,7 @@ type Sha3Args struct { ...@@ -468,8 +463,7 @@ type Sha3Args struct {
func (args *Sha3Args) UnmarshalJSON(b []byte) (err error) { func (args *Sha3Args) UnmarshalJSON(b []byte) (err error) {
var obj []interface{} var obj []interface{}
r := bytes.NewReader(b) if err := json.Unmarshal(b, &obj); err != nil {
if err := json.NewDecoder(r).Decode(&obj); err != nil {
return NewDecodeParamError(err.Error()) return NewDecodeParamError(err.Error())
} }
...@@ -798,8 +792,7 @@ type FilterStringArgs struct { ...@@ -798,8 +792,7 @@ type FilterStringArgs struct {
func (args *FilterStringArgs) UnmarshalJSON(b []byte) (err error) { func (args *FilterStringArgs) UnmarshalJSON(b []byte) (err error) {
var obj []interface{} var obj []interface{}
r := bytes.NewReader(b) if err := json.Unmarshal(b, &obj); err != nil {
if err := json.NewDecoder(r).Decode(&obj); err != nil {
return NewDecodeParamError(err.Error()) return NewDecodeParamError(err.Error())
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment