aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/abi/type.go
diff options
context:
space:
mode:
authorJanos Guljas <janos@resenje.org>2018-09-25 22:57:31 +0800
committerJanos Guljas <janos@resenje.org>2018-09-25 22:57:31 +0800
commit24349144b6c0642755569268bab56b9033743212 (patch)
tree9d9d2b6659fd8a56512dfc807aafe4b733165ae1 /accounts/abi/type.go
parent7d56602391e155e2ce9ba7c261300a1804ab9972 (diff)
parentd3441ebb563439bac0837d70591f92e2c6080303 (diff)
downloadgo-tangerine-24349144b6c0642755569268bab56b9033743212.tar
go-tangerine-24349144b6c0642755569268bab56b9033743212.tar.gz
go-tangerine-24349144b6c0642755569268bab56b9033743212.tar.bz2
go-tangerine-24349144b6c0642755569268bab56b9033743212.tar.lz
go-tangerine-24349144b6c0642755569268bab56b9033743212.tar.xz
go-tangerine-24349144b6c0642755569268bab56b9033743212.tar.zst
go-tangerine-24349144b6c0642755569268bab56b9033743212.zip
Merge branch 'master' into max-stream-peer-servers
Diffstat (limited to 'accounts/abi/type.go')
-rw-r--r--accounts/abi/type.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/accounts/abi/type.go b/accounts/abi/type.go
index 9de36daff..dce89d2b4 100644
--- a/accounts/abi/type.go
+++ b/accounts/abi/type.go
@@ -103,7 +103,12 @@ func NewType(t string) (typ Type, err error) {
return typ, err
}
// parse the type and size of the abi-type.
- parsedType := typeRegex.FindAllStringSubmatch(t, -1)[0]
+ matches := typeRegex.FindAllStringSubmatch(t, -1)
+ if len(matches) == 0 {
+ return Type{}, fmt.Errorf("invalid type '%v'", t)
+ }
+ parsedType := matches[0]
+
// varSize is the size of the variable
var varSize int
if len(parsedType[3]) > 0 {