Skip to content

Commit

Permalink
leaf2Addr: add support for address when it's in the last position
Browse files Browse the repository at this point in the history
  • Loading branch information
worm-emoji committed Jun 14, 2023
1 parent 7a6f264 commit 6af5137
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ func leaf2Addr(leaf []byte, ltd []string, packed bool) common.Address {
if len(ltd) == 0 || (len(ltd) == 1 && ltd[0] == "address") {
return common.BytesToAddress(leaf)
}
if ltd[len(ltd)-1] == "address" && len(leaf) > 20 {
return common.BytesToAddress(leaf[len(leaf)-20:])
}

if packed {
return addrPacked(leaf, ltd)
}
Expand Down

1 comment on commit 6af5137

@vercel
Copy link

@vercel vercel bot commented on 6af5137 Jun 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lanyard – ./

lanyard.mf.dev
lanyard-production.mf.dev
lanyard-git-main.mf.dev

Please sign in to comment.