mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
This commit is contained in:
parent
06b2524fb2
commit
1b09e585ab
2 changed files with 4 additions and 4 deletions
|
|
@ -34,11 +34,10 @@ import (
|
|||
"encoding/hex"
|
||||
"fmt"
|
||||
"math/big"
|
||||
"math/bits"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
const uintBits = 32 << (uint64(^uint(0)) >> 63)
|
||||
|
||||
var (
|
||||
ErrEmptyString = &decError{"empty hex string"}
|
||||
ErrSyntax = &decError{"invalid hex string"}
|
||||
|
|
@ -47,7 +46,7 @@ var (
|
|||
ErrEmptyNumber = &decError{"hex string \"0x\""}
|
||||
ErrLeadingZero = &decError{"hex number with leading zero digits"}
|
||||
ErrUint64Range = &decError{"hex number > 64 bits"}
|
||||
ErrUintRange = &decError{fmt.Sprintf("hex number > %d bits", uintBits)}
|
||||
ErrUintRange = &decError{fmt.Sprintf("hex number > %d bits", bits.UintSize)}
|
||||
ErrBig256Range = &decError{"hex number > 256 bits"}
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import (
|
|||
"encoding/json"
|
||||
"errors"
|
||||
"math/big"
|
||||
"math/bits"
|
||||
"testing"
|
||||
|
||||
"github.com/holiman/uint256"
|
||||
|
|
@ -384,7 +385,7 @@ func TestUnmarshalUint(t *testing.T) {
|
|||
for _, test := range unmarshalUintTests {
|
||||
var v Uint
|
||||
err := json.Unmarshal([]byte(test.input), &v)
|
||||
if uintBits == 32 && test.wantErr32bit != nil {
|
||||
if bits.UintSize == 32 && test.wantErr32bit != nil {
|
||||
checkError(t, test.input, err, test.wantErr32bit)
|
||||
continue
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue