Skip to content

Commit

Permalink
Merge pull request #416 from multiversx/remove-options-check-for-hash…
Browse files Browse the repository at this point in the history
…-signing

Removed options check for hash signing
  • Loading branch information
andreibancioiu authored Mar 25, 2024
2 parents b070f26 + 650d989 commit f13877c
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
4 changes: 1 addition & 3 deletions src/transaction.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,9 +620,7 @@ describe("test transaction", async () => {
options: 1,
});

transaction.signature = await wallets.alice.signer.sign(
Buffer.from(transactionComputer.computeBytesForSigning(transaction)),
);
transaction.signature = await wallets.alice.signer.sign(transactionComputer.computeHashForSigning(transaction));

assert.equal(
"f0c81f2393b1ec5972c813f817bae8daa00ade91c6f75ea604ab6a4d2797aca4378d783023ff98f1a02717fe4f24240cdfba0b674ee9abb18042203d713bc70a",
Expand Down
4 changes: 0 additions & 4 deletions src/transactionComputer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ export class TransactionComputer {
computeBytesForSigning(transaction: ITransaction): Uint8Array {
this.ensureValidTransactionFields(transaction);

if (transaction.version >= 2 && this.hasOptionsSetForHashSigning(transaction)) {
return this.computeHashForSigning(transaction);
}

const plainTransaction = this.toPlainObjectForSigning(transaction);
const serialized = JSON.stringify(plainTransaction);
return new Uint8Array(Buffer.from(serialized));
Expand Down

0 comments on commit f13877c

Please sign in to comment.