From 24c107e3a262297354909705f85a52d3ae588b9a Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Tue, 27 Sep 2022 13:41:41 +0300 Subject: [PATCH] interop: refactor address.FromHash160 code Make it more simple. --- pkg/interop/lib/address/address.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkg/interop/lib/address/address.go b/pkg/interop/lib/address/address.go index d501220b5..1f4435473 100644 --- a/pkg/interop/lib/address/address.go +++ b/pkg/interop/lib/address/address.go @@ -29,8 +29,6 @@ func FromHash160(hash interop.Hash160) string { if len(hash) != interop.Hash160Len { panic("invalid Hash160 length") } - var res = make([]byte, interop.Hash160Len+1) - res[0] = byte(runtime.GetAddressVersion()) - copy(res[1:], hash) // @fixme #2696 + res := append([]byte{byte(runtime.GetAddressVersion())}, hash...) return std.Base58CheckEncode(res) }