Skip to content

Commit 75432e3

Browse files
author
Greg S
committed
fix MerkleHashBuilder.length typing ; remove networkType from calculateInnerTransactionHash
1 parent 479bfab commit 75432e3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/core/crypto/MerkleHashBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class MerkleHashBuilder {
3535
*
3636
* @var {number}
3737
*/
38-
public readonly length: 32 | 64,
38+
public readonly length: number,
3939
/**
4040
* Signature schema used (hash algorithm diff)
4141
*

src/model/transaction/AggregateTransaction.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ export class AggregateTransaction extends Transaction {
340340
this.type.valueOf(),
341341
new AmountDto(this.maxFee.toDTO()),
342342
new TimestampDto(this.deadline.toDTO()),
343-
new Hash256Dto(this.calculateInnerTransactionHash(this.networkType)),
343+
new Hash256Dto(this.calculateInnerTransactionHash()),
344344
transactions,
345345
cosignatures,
346346
) :
@@ -352,7 +352,7 @@ export class AggregateTransaction extends Transaction {
352352
this.type.valueOf(),
353353
new AmountDto(this.maxFee.toDTO()),
354354
new TimestampDto(this.deadline.toDTO()),
355-
new Hash256Dto(this.calculateInnerTransactionHash(this.networkType)),
355+
new Hash256Dto(this.calculateInnerTransactionHash()),
356356
transactions,
357357
cosignatures,
358358
);
@@ -372,7 +372,7 @@ export class AggregateTransaction extends Transaction {
372372
* Generate inner transaction root hash (merkle tree)
373373
* @returns {Uint8Array}
374374
*/
375-
private calculateInnerTransactionHash(networkType: NetworkType): Uint8Array {
375+
private calculateInnerTransactionHash(): Uint8Array {
376376
// Note: Transaction hashing *always* uses SHA3
377377
const hasher = SHA3Hasher.createHasher(32, SignSchema.SHA3);
378378
const builder = new MerkleHashBuilder(32, SignSchema.SHA3);

0 commit comments

Comments
 (0)