From 5883b33082a6eb671f4027cd51d18bcf629b22ce Mon Sep 17 00:00:00 2001 From: zakir <80246097+zakir-code@users.noreply.github.com> Date: Wed, 28 Feb 2024 18:31:44 +0800 Subject: [PATCH] feat: auto add tron prefix (#237) --- types/address.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/types/address.go b/types/address.go index 80383ed14..e64e9789e 100644 --- a/types/address.go +++ b/types/address.go @@ -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()