diff --git a/lens/util/repo.go b/lens/util/repo.go index 46e4177dd..6a1bcdee1 100644 --- a/lens/util/repo.go +++ b/lens/util/repo.go @@ -35,6 +35,10 @@ func init() { var log = logging.Logger("lily/lens") +type CBORByteArray struct { + Params string +} + func ParseVmMessageParams(params []byte, paramsCodec uint64, method abi.MethodNum, actCode cid.Cid) (string, string, error) { m, found := ActorRegistry.Methods[actCode][method] if !found { @@ -52,7 +56,11 @@ func ParseVmMessageParams(params []byte, paramsCodec uint64, method abi.MethodNu // If the codec is 0, the parameters/return value are "empty". // If the codec is 0x55, it's bytes. if paramsCodec == 0 || paramsCodec == 0x55 { - return string(params), m.Name, nil + paramj, err := json.Marshal(CBORByteArray{Params: string(params)}) + if err != nil { + return "", "", err + } + return string(paramj), m.Name, nil } return ParseParams(params, method, actCode) } @@ -74,7 +82,11 @@ func ParseVmMessageReturn(ret []byte, retCodec uint64, method abi.MethodNum, act // If the codec is 0, the parameters/return value are "empty". // If the codec is 0x55, it's bytes. if retCodec == 0 || retCodec == 0x55 { - return string(ret), m.Name, nil + retj, err := json.Marshal(CBORByteArray{Params: string(ret)}) + if err != nil { + return "", "", err + } + return string(retj), m.Name, nil } return ParseReturn(ret, method, actCode) }