mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
accounts/abi: move limit variables out of function
This commit is contained in:
parent
20de19f263
commit
fd2900820b
1 changed files with 6 additions and 5 deletions
|
|
@ -25,16 +25,17 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/common"
|
"github.com/ethereum/go-ethereum/common"
|
||||||
)
|
)
|
||||||
|
|
||||||
// reads the integer based on its kind
|
var (
|
||||||
func readInteger(typ byte, kind reflect.Kind, b []byte) interface{} {
|
maxUint256 = big.NewInt(0).Add(
|
||||||
var maxUint256 = big.NewInt(0).Add(
|
|
||||||
big.NewInt(0).Exp(big.NewInt(2), big.NewInt(256), nil),
|
big.NewInt(0).Exp(big.NewInt(2), big.NewInt(256), nil),
|
||||||
big.NewInt(-1))
|
big.NewInt(-1))
|
||||||
|
maxInt256 = big.NewInt(0).Add(
|
||||||
var maxInt256 = big.NewInt(0).Add(
|
|
||||||
big.NewInt(0).Exp(big.NewInt(2), big.NewInt(255), nil),
|
big.NewInt(0).Exp(big.NewInt(2), big.NewInt(255), nil),
|
||||||
big.NewInt(-1))
|
big.NewInt(-1))
|
||||||
|
)
|
||||||
|
|
||||||
|
// reads the integer based on its kind
|
||||||
|
func readInteger(typ byte, kind reflect.Kind, b []byte) interface{} {
|
||||||
switch kind {
|
switch kind {
|
||||||
case reflect.Uint8:
|
case reflect.Uint8:
|
||||||
return b[len(b)-1]
|
return b[len(b)-1]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue