Skip to content

Commit

Permalink
feat: auto add tron prefix (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
zakir-code committed Feb 28, 2024
1 parent 8374306 commit 5883b33
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions types/address.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ func ParseAddress(addr string) (accAddr sdk.AccAddress, isEvmAddr bool, err erro

func AddressToStr(bt []byte, module string) string {
if module == "tron" {
if len(bt) == common.AddressLength {
bt = append([]byte{tronaddress.TronBytePrefix}, bt...)
}
return tronaddress.Address(bt).String()
} else {
return common.BytesToAddress(bt).String()
Expand Down

0 comments on commit 5883b33

Please sign in to comment.