Skip to content

Commit 61a5976

Browse files
jsvisagballet
authored andcommitted
accounts: remove deadcode isSigned (#16990)
1 parent 88c42ab commit 61a5976

2 files changed

Lines changed: 0 additions & 26 deletions

File tree

‎accounts/abi/numbers.go‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,29 +31,14 @@ var (
3131
uint16T = reflect.TypeOf(uint16(0))
3232
uint32T = reflect.TypeOf(uint32(0))
3333
uint64T = reflect.TypeOf(uint64(0))
34-
intT = reflect.TypeOf(int(0))
3534
int8T = reflect.TypeOf(int8(0))
3635
int16T = reflect.TypeOf(int16(0))
3736
int32T = reflect.TypeOf(int32(0))
3837
int64T = reflect.TypeOf(int64(0))
3938
addressT = reflect.TypeOf(common.Address{})
40-
intTS = reflect.TypeOf([]int(nil))
41-
int8TS = reflect.TypeOf([]int8(nil))
42-
int16TS = reflect.TypeOf([]int16(nil))
43-
int32TS = reflect.TypeOf([]int32(nil))
44-
int64TS = reflect.TypeOf([]int64(nil))
4539
)
4640

4741
// U256 converts a big Int into a 256bit EVM number.
4842
func U256(n *big.Int) []byte {
4943
return math.PaddedBigBytes(math.U256(n), 32)
5044
}
51-
52-
// checks whether the given reflect value is signed. This also works for slices with a number type
53-
func isSigned(v reflect.Value) bool {
54-
switch v.Type() {
55-
case intTS, int8TS, int16TS, int32TS, int64TS, intT, int8T, int16T, int32T, int64T:
56-
return true
57-
}
58-
return false
59-
}

‎accounts/abi/numbers_test.go‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ package abi
1919
import (
2020
"bytes"
2121
"math/big"
22-
"reflect"
2322
"testing"
2423
)
2524

@@ -32,13 +31,3 @@ func TestNumberTypes(t *testing.T) {
3231
t.Errorf("expected %x got %x", ubytes, unsigned)
3332
}
3433
}
35-
36-
func TestSigned(t *testing.T) {
37-
if isSigned(reflect.ValueOf(uint(10))) {
38-
t.Error("signed")
39-
}
40-
41-
if !isSigned(reflect.ValueOf(int(10))) {
42-
t.Error("not signed")
43-
}
44-
}

0 commit comments

Comments
 (0)