vm: use hex for ByteArray JSON marshallization

It's way more convenient for different purposes.
This commit is contained in:
Roman Khimov 2019-11-14 16:07:15 +03:00
parent 5ce269c035
commit 64e20508e0

View file

@ -2,6 +2,7 @@ package vm
import (
"encoding/binary"
"encoding/hex"
"encoding/json"
"fmt"
"math/big"
@ -197,7 +198,7 @@ func (i *ByteArrayItem) Value() interface{} {
// MarshalJSON implements the json.Marshaler interface.
func (i *ByteArrayItem) MarshalJSON() ([]byte, error) {
return json.Marshal(string(i.value))
return json.Marshal(hex.EncodeToString(i.value))
}
func (i *ByteArrayItem) String() string {