aboutsummaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorTaylor Gerring <taylor.gerring@gmail.com>2015-04-01 17:45:29 +0800
committerTaylor Gerring <taylor.gerring@gmail.com>2015-04-01 17:45:29 +0800
commitb860b6769329137c24024c2330529d7b2078d89d (patch)
tree9a810f1b56c91fea455f26b1d3185797d3f91ad2 /rpc
parent7b7392826d7b76fd4a0bd57baa7ca1224a19a3f6 (diff)
downloadgo-tangerine-b860b6769329137c24024c2330529d7b2078d89d.tar
go-tangerine-b860b6769329137c24024c2330529d7b2078d89d.tar.gz
go-tangerine-b860b6769329137c24024c2330529d7b2078d89d.tar.bz2
go-tangerine-b860b6769329137c24024c2330529d7b2078d89d.tar.lz
go-tangerine-b860b6769329137c24024c2330529d7b2078d89d.tar.xz
go-tangerine-b860b6769329137c24024c2330529d7b2078d89d.tar.zst
go-tangerine-b860b6769329137c24024c2330529d7b2078d89d.zip
Remove extra type assetion
Diffstat (limited to 'rpc')
-rw-r--r--rpc/messages.go24
1 files changed, 12 insertions, 12 deletions
diff --git a/rpc/messages.go b/rpc/messages.go
index 42af53c58..f868c5f9b 100644
--- a/rpc/messages.go
+++ b/rpc/messages.go
@@ -45,29 +45,29 @@ func (d *hexdata) UnmarshalJSON(b []byte) (err error) {
func newHexData(input interface{}) *hexdata {
d := new(hexdata)
- switch input.(type) {
+ switch input := input.(type) {
case []byte:
- d.data = input.([]byte)
+ d.data = input
case common.Hash:
- d.data = input.(common.Hash).Bytes()
+ d.data = input.Bytes()
case *common.Hash:
- d.data = input.(*common.Hash).Bytes()
+ d.data = input.Bytes()
case common.Address:
- d.data = input.(common.Address).Bytes()
+ d.data = input.Bytes()
case *common.Address:
- d.data = input.(*common.Address).Bytes()
+ d.data = input.Bytes()
case *big.Int:
- d.data = input.(*big.Int).Bytes()
+ d.data = input.Bytes()
case int64:
- d.data = big.NewInt(input.(int64)).Bytes()
+ d.data = big.NewInt(input).Bytes()
case uint64:
- d.data = big.NewInt(int64(input.(uint64))).Bytes()
+ d.data = big.NewInt(int64(input)).Bytes()
case int:
- d.data = big.NewInt(int64(input.(int))).Bytes()
+ d.data = big.NewInt(int64(input)).Bytes()
case uint:
- d.data = big.NewInt(int64(input.(uint))).Bytes()
+ d.data = big.NewInt(int64(input)).Bytes()
case string: // hexstring
- d.data = common.Big(input.(string)).Bytes()
+ d.data = common.Big(input).Bytes()
default:
d.data = nil
}