Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(apt): transaction builder #5428

Merged
merged 1 commit into from
Jan 25, 2025

Conversation

baltiyal
Copy link
Contributor

@baltiyal baltiyal commented Jan 24, 2025

TICKET: COIN-2896

Doesn't not need test cases, as already present test cases e.g. apt.ts or transferBuilder.ts provide sufficient coverage-

  • No change in code flow.
  • Just restructuring of the code.

Purpose-

  • To have common code for token and coin in base classes and unique code in respective classes.
  • Current PR makes changes for already existing coin code, no changes for token done here.
  • Provides a base for token sdk transaction building

@baltiyal baltiyal requested a review from a team as a code owner January 24, 2025 15:30
@baltiyal baltiyal force-pushed the COIN-2896-apt-transfer-correction branch from da95911 to 21410fc Compare January 24, 2025 15:41
Copy link
Contributor

@ananth99 ananth99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@baltiyal baltiyal merged commit 3b77c20 into master Jan 25, 2025
6 checks passed
@@ -50,4 +32,64 @@ export class TransferTransaction extends Transaction {
feePayer: this.feePayerAddress,
};
}

fromRawTransaction(rawTransaction: string): void {
Copy link
Contributor

@bhavidhingra bhavidhingra Jan 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method will also stay in the parent class because it will be the same for all types of transactions.

try {
const rawTxn = signedTxn.raw_txn;
this._sender = rawTxn.sender.toString();
this._recipient = utils.getRecipientFromTransactionPayload(rawTxn.payload);
Copy link
Contributor

@bhavidhingra bhavidhingra Jan 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make getRecipientFromTransactionPayload an abstract method in the parent class, because only this portion varies for different transactions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants