fix: recreate legacy behaviour for addresscodec (backport #17870) (#17871)

Co-authored-by: Marko <marbar3778@yahoo.com>
This commit is contained in:
mergify[bot]
2023-09-25 14:20:31 +00:00
committed by GitHub
co-authored by Marko
parent 5ccb0057e6
commit 19632293df
+4
View File
@@ -46,6 +46,10 @@ func (bc Bech32Codec) StringToBytes(text string) ([]byte, error) {
// BytesToString decodes bytes to text
func (bc Bech32Codec) BytesToString(bz []byte) (string, error) {
if len(bz) == 0 {
return "", nil
}
text, err := bech32.ConvertAndEncode(bc.Bech32Prefix, bz)
if err != nil {
return "", err