Skip to content

Commit

Permalink
Merge pull request #3695 from BitGo/WP-155-fix-uploading-unsigned-swe…
Browse files Browse the repository at this point in the history
…ep-tx-for-sol-dot-and-ada

fix(wrw): fix uploading unsigned sweep tx for sol, dot and ada
  • Loading branch information
alia-bitgo committed Jun 29, 2023
2 parents 6fe6055 + ea85586 commit c488f0e
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 c488f0e

Please sign in to comment.