diff options
author | obscuren <geffobscura@gmail.com> | 2015-03-16 18:27:38 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-03-16 18:27:38 +0800 |
commit | b5234413611ce5984292f85a01de1f56c045b490 (patch) | |
tree | e6e0c6f7fe8358a2dc63cdea11ac66b4f59397f5 /rpc/args.go | |
parent | 0b8f66ed9ef177dc72442dd7ba337c6733e30344 (diff) | |
download | dexon-b5234413611ce5984292f85a01de1f56c045b490.tar.gz dexon-b5234413611ce5984292f85a01de1f56c045b490.tar.zst dexon-b5234413611ce5984292f85a01de1f56c045b490.zip |
Moved ethutil => common
Diffstat (limited to 'rpc/args.go')
-rw-r--r-- | rpc/args.go | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/rpc/args.go b/rpc/args.go index b935c5007..7ed482c30 100644 --- a/rpc/args.go +++ b/rpc/args.go @@ -5,7 +5,7 @@ import ( "encoding/json" "math/big" - "github.com/ethereum/go-ethereum/ethutil" + "github.com/ethereum/go-ethereum/common" ) func blockNumber(raw json.RawMessage, number *int64) (err error) { @@ -20,7 +20,7 @@ func blockNumber(raw json.RawMessage, number *int64) (err error) { case "pending": *number = 0 default: - *number = ethutil.String2Big(str).Int64() + *number = common.String2Big(str).Int64() } return nil } @@ -73,7 +73,7 @@ func (args *GetBlockByNumberArgs) UnmarshalJSON(b []byte) (err error) { if v, ok := obj[0].(float64); ok { args.BlockNumber = int64(v) } else { - args.BlockNumber = ethutil.Big(obj[0].(string)).Int64() + args.BlockNumber = common.Big(obj[0].(string)).Int64() } if len(obj) > 1 { @@ -102,9 +102,9 @@ func (args *NewTxArgs) UnmarshalJSON(b []byte) (err error) { args.From = obj.From args.To = obj.To - args.Value = ethutil.Big(obj.Value) - args.Gas = ethutil.Big(obj.Gas) - args.GasPrice = ethutil.Big(obj.GasPrice) + args.Value = common.Big(obj.Value) + args.Gas = common.Big(obj.Gas) + args.GasPrice = common.Big(obj.GasPrice) args.Data = obj.Data return nil @@ -208,7 +208,7 @@ func (args *GetBalanceArgs) UnmarshalJSON(b []byte) (err error) { if obj[1].(string) == "latest" { args.BlockNumber = -1 } else { - args.BlockNumber = ethutil.Big(obj[1].(string)).Int64() + args.BlockNumber = common.Big(obj[1].(string)).Int64() } } @@ -266,14 +266,14 @@ func (args *BlockNumIndexArgs) UnmarshalJSON(b []byte) (err error) { if !ok { return NewDecodeParamError("BlockNumber is not string") } - args.BlockNumber = ethutil.Big(arg0).Int64() + args.BlockNumber = common.Big(arg0).Int64() if len(obj) > 1 { arg1, ok := obj[1].(string) if !ok { return NewDecodeParamError("Index not a string") } - args.Index = ethutil.Big(arg1).Int64() + args.Index = common.Big(arg1).Int64() } return nil @@ -306,7 +306,7 @@ func (args *HashIndexArgs) UnmarshalJSON(b []byte) (err error) { if !ok { return NewDecodeParamError("Index not a string") } - args.Index = ethutil.Big(arg1).Int64() + args.Index = common.Big(arg1).Int64() } return nil @@ -357,10 +357,10 @@ func (args *Sha3Args) UnmarshalJSON(b []byte) (err error) { // if len(obj) < 1 { // return errArguments // } -// args.FromBlock = uint64(ethutil.Big(obj[0].FromBlock).Int64()) -// args.ToBlock = uint64(ethutil.Big(obj[0].ToBlock).Int64()) -// args.Limit = uint64(ethutil.Big(obj[0].Limit).Int64()) -// args.Offset = uint64(ethutil.Big(obj[0].Offset).Int64()) +// args.FromBlock = uint64(common.Big(obj[0].FromBlock).Int64()) +// args.ToBlock = uint64(common.Big(obj[0].ToBlock).Int64()) +// args.Limit = uint64(common.Big(obj[0].Limit).Int64()) +// args.Offset = uint64(common.Big(obj[0].Offset).Int64()) // args.Address = obj[0].Address // args.Topics = obj[0].Topics @@ -394,10 +394,10 @@ func (args *FilterOptions) UnmarshalJSON(b []byte) (err error) { return NewInsufficientParamsError(len(obj), 1) } - args.Earliest = int64(ethutil.Big(obj[0].FromBlock).Int64()) - args.Latest = int64(ethutil.Big(obj[0].ToBlock).Int64()) - args.Max = int(ethutil.Big(obj[0].Limit).Int64()) - args.Skip = int(ethutil.Big(obj[0].Offset).Int64()) + args.Earliest = int64(common.Big(obj[0].FromBlock).Int64()) + args.Latest = int64(common.Big(obj[0].ToBlock).Int64()) + args.Max = int(common.Big(obj[0].Limit).Int64()) + args.Skip = int(common.Big(obj[0].Offset).Int64()) args.Address = obj[0].Address args.Topics = obj[0].Topics @@ -474,8 +474,8 @@ func (args *WhisperMessageArgs) UnmarshalJSON(b []byte) (err error) { args.To = obj[0].To args.From = obj[0].From args.Topics = obj[0].Topics - args.Priority = uint32(ethutil.Big(obj[0].Priority).Int64()) - args.Ttl = uint32(ethutil.Big(obj[0].Ttl).Int64()) + args.Priority = uint32(common.Big(obj[0].Priority).Int64()) + args.Ttl = uint32(common.Big(obj[0].Ttl).Int64()) return nil } @@ -538,7 +538,7 @@ func (args *FilterIdArgs) UnmarshalJSON(b []byte) (err error) { return NewInsufficientParamsError(len(obj), 1) } - args.Id = int(ethutil.Big(obj[0]).Int64()) + args.Id = int(common.Big(obj[0]).Int64()) return nil } |