hashgraph / hedera-sdk-js

Hedera™ Hashgraph SDK for JavaScript/TypeScript
https://docs.hedera.com/guides/docs/sdks
Apache License 2.0
277 stars 145 forks source link

Receipt toBytes() and then fromBytes() missing token id #956

Closed teacoat closed 2 years ago

teacoat commented 2 years ago

Description

When converting a transaction receipt to bytes and back token id is missing.

I am using v2.7.1 but have tried in 2.9.1 and the issue remains.

Steps to reproduce

1) Do a token create transaction 2) Get receipt 3) Convert to bytes and back

const rec = await val.getReceipt(client);
console.log(rec);
let test2 = TransactionReceipt.fromBytes(rec.toBytes());
console.log(test2);

Additional context

Before toBytes: image

After fromBytes: image

Hedera network

testnet

Version

2.7.1

Operating system

Linux

janaakhterov commented 2 years ago

I believe this is already fixed on develop, but our unit test was only testing TransactionReceipt.[_to|_from]Protobuf() instead of TransactionReceipt.[to|from]Bytes() I adjust that along with fixing some of the issues raised from that change here: https://github.com/hashgraph/hedera-sdk-js/commit/f73d6b62d4d743281c757d392a50d805b48e466b#diff-562c7392e5f0ca5781d13fa1e23ca2f0ea2de990497d9d1ff527599a99d26026R60 This will be part of the 2.11.0-beta.1 release.

teacoat commented 2 years ago

Thank you @danielakhterov !