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

fix(wrw): fix uploading unsigned sweep tx for sol, dot and ada #3695

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions modules/sdk-coin-ada/src/ada.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ interface RecoveryOptions {
interface AdaTx {
serializedTx: string;
scanIndex: number;
coin?: string;
}

export type AdaTransactionExplanation = TransactionExplanation;
Expand Down Expand Up @@ -381,6 +382,8 @@ export class Ada extends BaseCoin {
txBuilder.addSignature({ pub: adaKeyPair.getKeys().pub }, signatureHex);
const signedTransaction = await txBuilder.build();
serializedTx = signedTransaction.toBroadcastFormat();
} else {
return { serializedTx: serializedTx, scanIndex: i, coin: this.getChain() };
}
return { serializedTx: serializedTx, scanIndex: i };
}
Expand Down
3 changes: 3 additions & 0 deletions modules/sdk-coin-dot/src/dot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ interface RecoveryOptions {
interface DotTx {
serializedTx: string;
scanIndex: number;
coin?: string;
}

const dotUtils = Utils.default;
Expand Down Expand Up @@ -441,6 +442,8 @@ export class Dot extends BaseCoin {
txnBuilder.addSignature({ pub: dotKeyPair.getKeys().pub }, signatureHex);
const signedTransaction = await txnBuilder.build();
serializedTx = signedTransaction.toBroadcastFormat();
} else {
return { serializedTx: serializedTx, scanIndex: i, coin: this.getChain() };
}
return { serializedTx: serializedTx, scanIndex: i };
}
Expand Down
8 changes: 8 additions & 0 deletions modules/sdk-coin-sol/src/sol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export interface SolParseTransactionOptions extends BaseParseTransactionOptions
interface SolTx {
serializedTx: string;
scanIndex: number;
coin?: string;
}

interface SolDurableNonceFromNode {
Expand Down Expand Up @@ -709,6 +710,13 @@ export class Sol extends BaseCoin {

const completedTransaction = await txBuilder.build();
const serializedTx = completedTransaction.toBroadcastFormat();
if (isUnsignedSweep) {
return {
serializedTx: serializedTx,
scanIndex: scanIndex,
coin: this.getChain(),
};
}
return {
serializedTx: serializedTx,
scanIndex: scanIndex,
Expand Down