Remove extra type assetion

This commit is contained in:
Taylor Gerring 2015-04-01 11:45:29 +02:00
parent 7b7392826d
commit b860b67693
1 changed files with 12 additions and 12 deletions

View File

@ -45,29 +45,29 @@ func (d *hexdata) UnmarshalJSON(b []byte) (err error) {
func newHexData(input interface{}) *hexdata { func newHexData(input interface{}) *hexdata {
d := new(hexdata) d := new(hexdata)
switch input.(type) { switch input := input.(type) {
case []byte: case []byte:
d.data = input.([]byte) d.data = input
case common.Hash: case common.Hash:
d.data = input.(common.Hash).Bytes() d.data = input.Bytes()
case *common.Hash: case *common.Hash:
d.data = input.(*common.Hash).Bytes() d.data = input.Bytes()
case common.Address: case common.Address:
d.data = input.(common.Address).Bytes() d.data = input.Bytes()
case *common.Address: case *common.Address:
d.data = input.(*common.Address).Bytes() d.data = input.Bytes()
case *big.Int: case *big.Int:
d.data = input.(*big.Int).Bytes() d.data = input.Bytes()
case int64: case int64:
d.data = big.NewInt(input.(int64)).Bytes() d.data = big.NewInt(input).Bytes()
case uint64: case uint64:
d.data = big.NewInt(int64(input.(uint64))).Bytes() d.data = big.NewInt(int64(input)).Bytes()
case int: case int:
d.data = big.NewInt(int64(input.(int))).Bytes() d.data = big.NewInt(int64(input)).Bytes()
case uint: case uint:
d.data = big.NewInt(int64(input.(uint))).Bytes() d.data = big.NewInt(int64(input)).Bytes()
case string: // hexstring case string: // hexstring
d.data = common.Big(input.(string)).Bytes() d.data = common.Big(input).Bytes()
default: default:
d.data = nil d.data = nil
} }