File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -28,11 +28,11 @@ import (
28
28
)
29
29
30
30
var (
31
- bytesT = reflect .TypeOf ( Bytes ( nil ) )
32
- bigT = reflect .TypeOf (( * Big )( nil ) )
33
- uintT = reflect .TypeOf ( Uint ( 0 ) )
34
- uint64T = reflect .TypeOf ( Uint64 ( 0 ) )
35
- u256T = reflect .TypeOf (( * uint256 .Int )( nil ) )
31
+ bytesT = reflect .TypeFor [ Bytes ]( )
32
+ bigT = reflect .TypeFor [ * Big ]( )
33
+ uintT = reflect .TypeFor [ Uint ]( )
34
+ uint64T = reflect .TypeFor [ Uint64 ]( )
35
+ u256T = reflect .TypeFor [ * uint256.Int ]( )
36
36
)
37
37
38
38
// Bytes marshals/unmarshals as a JSON string with 0x prefix.
Original file line number Diff line number Diff line change @@ -42,8 +42,8 @@ const (
42
42
)
43
43
44
44
var (
45
- hashT = reflect .TypeOf ( Hash {} )
46
- addressT = reflect .TypeOf ( Address {} )
45
+ hashT = reflect .TypeFor [ Hash ]( )
46
+ addressT = reflect .TypeFor [ Address ]( )
47
47
48
48
// MaxAddress represents the maximum possible address value.
49
49
MaxAddress = HexToAddress ("0xffffffffffffffffffffffffffffffffffffffff" )
@@ -466,7 +466,7 @@ func isString(input []byte) bool {
466
466
// UnmarshalJSON parses a hash in hex syntax.
467
467
func (d * Decimal ) UnmarshalJSON (input []byte ) error {
468
468
if ! isString (input ) {
469
- return & json.UnmarshalTypeError {Value : "non-string" , Type : reflect .TypeOf ( uint64 ( 0 ) )}
469
+ return & json.UnmarshalTypeError {Value : "non-string" , Type : reflect .TypeFor [ uint64 ]( )}
470
470
}
471
471
if i , err := strconv .ParseUint (string (input [1 :len (input )- 1 ]), 10 , 64 ); err == nil {
472
472
* d = Decimal (i )
You can’t perform that action at this time.
0 commit comments