From b5234413611ce5984292f85a01de1f56c045b490 Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 16 Mar 2015 11:27:38 +0100 Subject: Moved ethutil => common --- accounts/abi/numbers.go | 10 +++++----- accounts/abi/type.go | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'accounts') diff --git a/accounts/abi/numbers.go b/accounts/abi/numbers.go index 378f6541e..9205c005e 100644 --- a/accounts/abi/numbers.go +++ b/accounts/abi/numbers.go @@ -4,7 +4,7 @@ import ( "math/big" "reflect" - "github.com/ethereum/go-ethereum/ethutil" + "github.com/ethereum/go-ethereum/common" ) var big_t = reflect.TypeOf(&big.Int{}) @@ -38,13 +38,13 @@ var big_ts = reflect.TypeOf([]*big.Int(nil)) // U256 will ensure unsigned 256bit on big nums func U256(n *big.Int) []byte { - return ethutil.LeftPadBytes(ethutil.U256(n).Bytes(), 32) + return common.LeftPadBytes(common.U256(n).Bytes(), 32) } func S256(n *big.Int) []byte { - sint := ethutil.S256(n) - ret := ethutil.LeftPadBytes(sint.Bytes(), 32) - if sint.Cmp(ethutil.Big0) < 0 { + sint := common.S256(n) + ret := common.LeftPadBytes(sint.Bytes(), 32) + if sint.Cmp(common.Big0) < 0 { for i, b := range ret { if b == 0 { ret[i] = 1 diff --git a/accounts/abi/type.go b/accounts/abi/type.go index b2d4abbd3..56520b672 100644 --- a/accounts/abi/type.go +++ b/accounts/abi/type.go @@ -6,7 +6,7 @@ import ( "regexp" "strconv" - "github.com/ethereum/go-ethereum/ethutil" + "github.com/ethereum/go-ethereum/common" ) const ( @@ -157,7 +157,7 @@ func (t Type) pack(v interface{}) ([]byte, error) { if t.Size > -1 && value.Len() > t.Size { return nil, fmt.Errorf("%v out of bound. %d for %d", value.Kind(), value.Len(), t.Size) } - return []byte(ethutil.LeftPadString(t.String(), 32)), nil + return []byte(common.LeftPadString(t.String(), 32)), nil case reflect.Slice: if t.Size > -1 && value.Len() > t.Size { return nil, fmt.Errorf("%v out of bound. %d for %d", value.Kind(), value.Len(), t.Size) @@ -165,7 +165,7 @@ func (t Type) pack(v interface{}) ([]byte, error) { // Address is a special slice. The slice acts as one rather than a list of elements. if t.T == AddressTy { - return ethutil.LeftPadBytes(v.([]byte), 32), nil + return common.LeftPadBytes(v.([]byte), 32), nil } // Signed / Unsigned check @@ -180,9 +180,9 @@ func (t Type) pack(v interface{}) ([]byte, error) { return packed, nil case reflect.Bool: if value.Bool() { - return ethutil.LeftPadBytes(ethutil.Big1.Bytes(), 32), nil + return common.LeftPadBytes(common.Big1.Bytes(), 32), nil } else { - return ethutil.LeftPadBytes(ethutil.Big0.Bytes(), 32), nil + return common.LeftPadBytes(common.Big0.Bytes(), 32), nil } } -- cgit v1.2.3