Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

Byte array return values in smart contracts do not get serialized #4099

Open
drmathias opened this issue Nov 28, 2019 · 1 comment
Open

Byte array return values in smart contracts do not get serialized #4099

drmathias opened this issue Nov 28, 2019 · 1 comment

Comments

@drmathias
Copy link
Contributor

Byte array return values in smart contracts are not being serialized into the receipt.

public class ExampleContract : SmartContract
{
    ...
    public byte[] CallMe() => new byte[] { 3, 2, 1 };
}

This is what the receipt of a call to the method looks like.

{
    "transactionHash": "910a3bea51f0fab7556452df11e86f937d811f03e76d81db644e2face14fcddc",
    "blockHash": "b06c03ecb1da9f1348e01bd4145b43d242e1178ee239efbac2c281a0c41afbd2",
    "postState": "20aa982de5fea75eda5888817d26e9a58cc4813d0e501ee4772d0fd150935e9d",
    "gasUsed": 10221,
    "from": "CUtNvY1Jxpn4V4RD1tgphsUKpQdo4q5i54",
    "to": "CKYmR2MpUm5opnkKZpPyrTKrV8xCgtk3Dq",
    "newContractAddress": null,
    "success": true,
    "returnValue": "System.Byte[]",
    "bloom": "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "error": null,
    "logs": []
}

I'd expect the return value to show the byte array value serialized as a hex string.

@rowandh
Copy link
Collaborator

rowandh commented Nov 29, 2019

Thanks @drmathias, there's a related issue with structs being fixed at the moment so I'd imagine this could be done as part of that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants