forked from TrueCloudLab/neoneo-go
interop: refactor address.FromHash160 code
Make it more simple.
This commit is contained in:
parent
5d578fdd95
commit
24c107e3a2
1 changed files with 1 additions and 3 deletions
|
@ -29,8 +29,6 @@ func FromHash160(hash interop.Hash160) string {
|
||||||
if len(hash) != interop.Hash160Len {
|
if len(hash) != interop.Hash160Len {
|
||||||
panic("invalid Hash160 length")
|
panic("invalid Hash160 length")
|
||||||
}
|
}
|
||||||
var res = make([]byte, interop.Hash160Len+1)
|
res := append([]byte{byte(runtime.GetAddressVersion())}, hash...)
|
||||||
res[0] = byte(runtime.GetAddressVersion())
|
|
||||||
copy(res[1:], hash) // @fixme #2696
|
|
||||||
return std.Base58CheckEncode(res)
|
return std.Base58CheckEncode(res)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue