Skip to content

Commit cc0e1b6

Browse files
Merge pull request #7732 from BitGo/COIN-6732
chore: fix unsigned sweep consolidation not working for SUI and SOL
2 parents e8ea6be + ad29a71 commit cc0e1b6

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

modules/sdk-coin-sol/src/sol.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,7 @@ export class Sol extends BaseCoin {
10741074
}
10751075

10761076
const bitgoKey = params.bitgoKey.replace(/\s/g, '');
1077-
const isUnsignedSweep = !params.userKey && !params.backupKey && !params.walletPassphrase;
1077+
const isUnsignedSweep = !params.walletPassphrase;
10781078

10791079
// Build the transaction
10801080
const MPC = await EDDSAMethods.getInitializedMpcInstance();
@@ -1575,7 +1575,7 @@ export class Sol extends BaseCoin {
15751575
* @param {string} [params.endingScanIndex] - receive address index to end scanning at. default to startingScanIndex + 20 (exclusive).
15761576
*/
15771577
async recoverConsolidations(params: SolConsolidationRecoveryOptions): Promise<MPCTxs | MPCSweepTxs> {
1578-
const isUnsignedSweep = !params.userKey && !params.backupKey && !params.walletPassphrase;
1578+
const isUnsignedSweep = !params.walletPassphrase;
15791579
const startIdx = params.startingScanIndex || 1;
15801580
const endIdx = params.endingScanIndex || startIdx + DEFAULT_SCAN_FACTOR;
15811581

modules/sdk-coin-sol/test/unit/sol.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2111,16 +2111,6 @@ describe('SOL:', function () {
21112111
})
21122112
.should.rejectedWith('missing backupKey');
21132113

2114-
// missing wallet passphrase
2115-
await basecoin
2116-
.recover({
2117-
userKey: testData.keys.userKey,
2118-
backupKey: testData.keys.backupKey,
2119-
bitgoKey: testData.keys.bitgoKey,
2120-
recoveryDestination: testData.keys.destinationPubKey,
2121-
})
2122-
.should.rejectedWith('missing wallet passphrase');
2123-
21242114
// incorrect wallet passphrase, user key, backup key combination
21252115
await basecoin
21262116
.recover({

modules/sdk-coin-sui/src/sui.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ export class Sui extends BaseCoin {
425425
payment: inputCoins,
426426
});
427427

428-
const isUnsignedSweep = !params.userKey && !params.backupKey && !params.walletPassphrase;
428+
const isUnsignedSweep = !params.walletPassphrase;
429429
if (isUnsignedSweep) {
430430
return this.buildUnsignedSweepTransaction(txBuilder, senderAddress, bitgoKey, idx, derivationPath);
431431
}
@@ -509,7 +509,7 @@ export class Sui extends BaseCoin {
509509
payment: gasObjects,
510510
});
511511

512-
const isUnsignedSweep = !params.userKey && !params.backupKey && !params.walletPassphrase;
512+
const isUnsignedSweep = !params.walletPassphrase;
513513
if (isUnsignedSweep) {
514514
return this.buildUnsignedSweepTransaction(txBuilder, senderAddress, bitgoKey, idx, derivationPath, token);
515515
}
@@ -733,7 +733,7 @@ export class Sui extends BaseCoin {
733733
* @param {string} [params.endingScanIndex] - receive address index to end scanning at. default to startingScanIndex + 20 (exclusive).
734734
*/
735735
async recoverConsolidations(params: MPCConsolidationRecoveryOptions): Promise<MPCTxs | MPCSweepTxs> {
736-
const isUnsignedSweep = !params.userKey && !params.backupKey && !params.walletPassphrase;
736+
const isUnsignedSweep = !params.walletPassphrase;
737737
const startIdx = utils.validateNonNegativeNumber(
738738
1,
739739
'Invalid starting index to scan for addresses',

0 commit comments

Comments
 (0)