Skip to content

Commit

Permalink
fix: deserialize the FileAppendTransaction (#2145)
Browse files Browse the repository at this point in the history
Signed-off-by: svetoslav-nikol0v <[email protected]>
  • Loading branch information
svetoslav-nikol0v authored Feb 20, 2024
1 parent c43fad1 commit 641e18c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/file/FileAppendTransaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,13 @@ export default class FileAppendTransaction extends Transaction {
);

let contents;
for (let i = 0; i < bodies.length; i += nodeIds.length) {

// The increment value depends on whether the node IDs list is empty or not.
// The node IDs list is not empty if the transaction has been frozen
// before serialization and deserialization, otherwise, it's empty.
const incrementValue = nodeIds.length > 0 ? nodeIds.length : 1

for (let i = 0; i < bodies.length; i += incrementValue) {
const fileAppend =
/** @type {HashgraphProto.proto.IFileAppendTransactionBody} */ (
bodies[i].fileAppend
Expand Down

0 comments on commit 641e18c

Please sign in to comment.