Skip to content

Commit 305fe2b

Browse files
fix: 1874 Transaction.getTransactionHash(sender) rename (#1876)
1 parent f7de71b commit 305fe2b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/diagrams/architecture/transaction.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ classDiagram
3434
+Address origin
3535
+Uint8Array signature?
3636
+Transaction decode(Uint8Array rawTransaction, boolean isSigned)$
37-
+Blake2b256 getTransactionHash(Address gasPayer?)
37+
+Blake2b256 getTransactionHash(Address sender?)
3838
+VTHO intrinsicGas(TransactionClause[] clauses)$
3939
+boolean isValidBody(TransactionBody body)$
4040
+Transaction of(TransactionBody: body, Uint8Array signature?)$

packages/core/src/transaction/Transaction.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -380,20 +380,20 @@ class Transaction {
380380
/**
381381
* Computes the transaction hash, optionally incorporating a gas payer's address.
382382
*
383-
* @param {Address} [gasPayer] - Optional gas payer's address to include in the hash computation.
383+
* @param {Address} [sender] - Optional transaction origin's address to include in the hash computation.
384384
* @return {Blake2b256} - The computed transaction hash.
385385
*
386386
* @remarks
387-
* `gasPayer` is used to sign a transaction on behalf of another account.
387+
* `sender` is used to sign a transaction on behalf of another account.
388388
*
389389
* @remarks Security auditable method, depends on
390390
* - {@link Blake2b256.of}.
391391
*/
392-
public getTransactionHash(gasPayer?: Address): Blake2b256 {
392+
public getTransactionHash(sender?: Address): Blake2b256 {
393393
const txHash = Blake2b256.of(this.encode(false));
394-
if (gasPayer !== undefined) {
394+
if (sender !== undefined) {
395395
return Blake2b256.of(
396-
nc_utils.concatBytes(txHash.bytes, gasPayer.bytes)
396+
nc_utils.concatBytes(txHash.bytes, sender.bytes)
397397
);
398398
}
399399
return txHash;

0 commit comments

Comments
 (0)