From d8f47127d9e0946061e8bdc19d675bb0b666c42d Mon Sep 17 00:00:00 2001 From: marbar3778 Date: Mon, 25 Sep 2023 15:43:19 +0200 Subject: [PATCH] recreate legacy behavior --- codec/address/bech32_codec.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/codec/address/bech32_codec.go b/codec/address/bech32_codec.go index aaac921f35e2..45e9d2c01177 100644 --- a/codec/address/bech32_codec.go +++ b/codec/address/bech32_codec.go @@ -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