Skip to content

Commit 6af5137

Browse files
committed
leaf2Addr: add support for address when it's in the last position
1 parent 7a6f264 commit 6af5137

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

api/tree.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ func leaf2Addr(leaf []byte, ltd []string, packed bool) common.Address {
3232
if len(ltd) == 0 || (len(ltd) == 1 && ltd[0] == "address") {
3333
return common.BytesToAddress(leaf)
3434
}
35+
if ltd[len(ltd)-1] == "address" && len(leaf) > 20 {
36+
return common.BytesToAddress(leaf[len(leaf)-20:])
37+
}
38+
3539
if packed {
3640
return addrPacked(leaf, ltd)
3741
}

0 commit comments

Comments
 (0)