Skip to content

Commit

Permalink
fix(wrw): fix uploading unsigned sweep tx for sol, dot and ada
Browse files Browse the repository at this point in the history
  • Loading branch information
alia-bitgo committed Jun 27, 2023
1 parent c690ed7 commit f807f4a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
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

0 comments on commit f807f4a

Please sign in to comment.