Skip to content

Commit fe036bd

Browse files
chore: remove openssl usage from mpc recover tests
TICKET: WP-2959
1 parent ceaae14 commit fe036bd

File tree

21 files changed

+297
-477
lines changed

21 files changed

+297
-477
lines changed

modules/abstract-eth/src/abstractEthLikeNewCoins.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,12 @@ interface UnformattedTxInfo {
203203

204204
export type RecoverOptionsWithBytes = {
205205
isTss: true;
206-
openSSLBytes: Uint8Array;
206+
/**
207+
* @deprecated this is no longer used
208+
*/
209+
openSSLBytes?: Uint8Array;
207210
};
211+
208212
export type NonTSSRecoverOptions = {
209213
isTss?: false | undefined;
210214
};

modules/sdk-coin-atom/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
},
5252
"devDependencies": {
5353
"@bitgo/sdk-api": "^1.56.1",
54-
"@bitgo/sdk-opensslbytes": "^2.0.0",
5554
"@bitgo/sdk-test": "^8.0.48",
5655
"@types/lodash": "^4.14.183",
5756
"axios": "^1.3.4"

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

Lines changed: 30 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ import {
2121
} from '../resources/atom';
2222
import should = require('should');
2323

24-
import { loadWebAssembly } from '@bitgo/sdk-opensslbytes';
25-
26-
const openSSLBytes = loadWebAssembly().buffer;
27-
2824
describe('ATOM', function () {
2925
let bitgo: TestBitGoAPI;
3026
let basecoin;
@@ -433,16 +429,13 @@ describe('ATOM', function () {
433429
});
434430

435431
it('should recover funds for non-bitgo recoveries', async function () {
436-
const res = await basecoin.recover(
437-
{
438-
userKey: wrwUser.userKey,
439-
backupKey: wrwUser.backupKey,
440-
bitgoKey: wrwUser.bitgoKey,
441-
walletPassphrase: wrwUser.walletPassphrase,
442-
recoveryDestination: destinationAddress,
443-
},
444-
openSSLBytes
445-
);
432+
const res = await basecoin.recover({
433+
userKey: wrwUser.userKey,
434+
backupKey: wrwUser.backupKey,
435+
bitgoKey: wrwUser.bitgoKey,
436+
walletPassphrase: wrwUser.walletPassphrase,
437+
recoveryDestination: destinationAddress,
438+
});
446439
res.should.not.be.empty();
447440
res.should.hasOwnProperty('serializedTx');
448441
sandBox.assert.calledOnce(basecoin.getAccountBalance);
@@ -460,16 +453,13 @@ describe('ATOM', function () {
460453
});
461454

462455
it('should recover funds for non-bitgo recoveries - DKLS type', async function () {
463-
const res = await basecoin.recover(
464-
{
465-
userKey: wrwUserDkls.userKey,
466-
backupKey: wrwUserDkls.backupKey,
467-
bitgoKey: wrwUserDkls.bitgoKey,
468-
walletPassphrase: wrwUserDkls.walletPassphrase,
469-
recoveryDestination: wrwUserDkls.destinationAddress,
470-
},
471-
openSSLBytes
472-
);
456+
const res = await basecoin.recover({
457+
userKey: wrwUserDkls.userKey,
458+
backupKey: wrwUserDkls.backupKey,
459+
bitgoKey: wrwUserDkls.bitgoKey,
460+
walletPassphrase: wrwUserDkls.walletPassphrase,
461+
recoveryDestination: wrwUserDkls.destinationAddress,
462+
});
473463
res.should.not.be.empty();
474464
res.should.hasOwnProperty('serializedTx');
475465
sandBox.assert.calledOnce(basecoin.getAccountBalance);
@@ -487,18 +477,15 @@ describe('ATOM', function () {
487477
});
488478

489479
it('should redelegate funds to new validator', async function () {
490-
const res = await basecoin.redelegate(
491-
{
492-
userKey: wrwUser.userKey,
493-
backupKey: wrwUser.backupKey,
494-
bitgoKey: wrwUser.bitgoKey,
495-
walletPassphrase: wrwUser.walletPassphrase,
496-
amountToRedelegate: '10000000000000000',
497-
validatorSrcAddress: 'cosmosvaloper1409te27da74uahh6hn0040x7l272hjs2padjuz',
498-
validatorDstAddress: 'cosmosvaloper183aycgtstp67r6s4vd7ts2npp2ckk4xah7rxj6',
499-
},
500-
openSSLBytes
501-
);
480+
const res = await basecoin.redelegate({
481+
userKey: wrwUser.userKey,
482+
backupKey: wrwUser.backupKey,
483+
bitgoKey: wrwUser.bitgoKey,
484+
walletPassphrase: wrwUser.walletPassphrase,
485+
amountToRedelegate: '10000000000000000',
486+
validatorSrcAddress: 'cosmosvaloper1409te27da74uahh6hn0040x7l272hjs2padjuz',
487+
validatorDstAddress: 'cosmosvaloper183aycgtstp67r6s4vd7ts2npp2ckk4xah7rxj6',
488+
});
502489

503490
res.should.not.be.empty();
504491
res.should.hasOwnProperty('serializedTx');
@@ -576,16 +563,13 @@ describe('ATOM', function () {
576563

577564
it('should throw error if there is no balance', async function () {
578565
await basecoin
579-
.recover(
580-
{
581-
userKey: wrwUser.userKey,
582-
backupKey: wrwUser.backupKey,
583-
bitgoKey: wrwUser.bitgoKey,
584-
walletPassphrase: wrwUser.walletPassphrase,
585-
recoveryDestination: destinationAddress,
586-
},
587-
openSSLBytes
588-
)
566+
.recover({
567+
userKey: wrwUser.userKey,
568+
backupKey: wrwUser.backupKey,
569+
bitgoKey: wrwUser.bitgoKey,
570+
walletPassphrase: wrwUser.walletPassphrase,
571+
recoveryDestination: destinationAddress,
572+
})
589573
.should.rejectedWith('Did not have enough funds to recover');
590574
});
591575
});

modules/sdk-coin-bld/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
},
5252
"devDependencies": {
5353
"@bitgo/sdk-api": "^1.56.1",
54-
"@bitgo/sdk-opensslbytes": "^2.0.0",
5554
"@bitgo/sdk-test": "^8.0.48",
5655
"@types/lodash": "^4.14.183"
5756
}

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

Lines changed: 41 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ import {
1919
} from '../resources/bld';
2020
import should = require('should');
2121

22-
import { loadWebAssembly } from '@bitgo/sdk-opensslbytes';
23-
24-
const openSSLBytes = loadWebAssembly().buffer;
25-
2622
describe('BLD', function () {
2723
let bitgo: TestBitGoAPI;
2824
let basecoin;
@@ -378,16 +374,13 @@ describe('BLD', function () {
378374
});
379375

380376
it('should recover funds for non-bitgo recoveries', async function () {
381-
const res = await basecoin.recover(
382-
{
383-
userKey: wrwUser.userPrivateKey,
384-
backupKey: wrwUser.backupPrivateKey,
385-
bitgoKey: wrwUser.bitgoPublicKey,
386-
walletPassphrase: wrwUser.walletPassphrase,
387-
recoveryDestination: destinationAddress,
388-
},
389-
openSSLBytes
390-
);
377+
const res = await basecoin.recover({
378+
userKey: wrwUser.userPrivateKey,
379+
backupKey: wrwUser.backupPrivateKey,
380+
bitgoKey: wrwUser.bitgoPublicKey,
381+
walletPassphrase: wrwUser.walletPassphrase,
382+
recoveryDestination: destinationAddress,
383+
});
391384
res.should.not.be.empty();
392385
res.should.hasOwnProperty('serializedTx');
393386
sandBox.assert.calledOnce(basecoin.getAccountBalance);
@@ -406,18 +399,15 @@ describe('BLD', function () {
406399
});
407400

408401
it('should redelegate funds to new validator', async function () {
409-
const res = await basecoin.redelegate(
410-
{
411-
userKey: wrwUser.userPrivateKey,
412-
backupKey: wrwUser.backupPrivateKey,
413-
bitgoKey: wrwUser.bitgoPublicKey,
414-
walletPassphrase: wrwUser.walletPassphrase,
415-
amountToRedelegate: '10000000000000000',
416-
validatorSrcAddress: 'agoricvaloper1wy3h3gne94xpmnjwfwd3eyaytv9g4nj6yykkkj',
417-
validatorDstAddress: 'agoricvaloper1qd0h2hj7uljjhktw9l3fjnz5u22g0xu74aw38w',
418-
},
419-
openSSLBytes
420-
);
402+
const res = await basecoin.redelegate({
403+
userKey: wrwUser.userPrivateKey,
404+
backupKey: wrwUser.backupPrivateKey,
405+
bitgoKey: wrwUser.bitgoPublicKey,
406+
walletPassphrase: wrwUser.walletPassphrase,
407+
amountToRedelegate: '10000000000000000',
408+
validatorSrcAddress: 'agoricvaloper1wy3h3gne94xpmnjwfwd3eyaytv9g4nj6yykkkj',
409+
validatorDstAddress: 'agoricvaloper1qd0h2hj7uljjhktw9l3fjnz5u22g0xu74aw38w',
410+
});
421411

422412
res.should.not.be.empty();
423413
res.should.hasOwnProperty('serializedTx');
@@ -462,58 +452,46 @@ describe('BLD', function () {
462452

463453
it('should throw error if backupkey is not present', async function () {
464454
await basecoin
465-
.recover(
466-
{
467-
userKey: wrwUser.userPrivateKey,
468-
bitgoKey: wrwUser.bitgoPublicKey,
469-
walletPassphrase: wrwUser.walletPassphrase,
470-
recoveryDestination: destinationAddress,
471-
},
472-
openSSLBytes
473-
)
455+
.recover({
456+
userKey: wrwUser.userPrivateKey,
457+
bitgoKey: wrwUser.bitgoPublicKey,
458+
walletPassphrase: wrwUser.walletPassphrase,
459+
recoveryDestination: destinationAddress,
460+
})
474461
.should.rejectedWith('missing backupKey');
475462
});
476463

477464
it('should throw error if userkey is not present', async function () {
478465
await basecoin
479-
.recover(
480-
{
481-
backupKey: wrwUser.backupPrivateKey,
482-
bitgoKey: wrwUser.bitgoPublicKey,
483-
walletPassphrase: wrwUser.walletPassphrase,
484-
recoveryDestination: destinationAddress,
485-
},
486-
openSSLBytes
487-
)
466+
.recover({
467+
backupKey: wrwUser.backupPrivateKey,
468+
bitgoKey: wrwUser.bitgoPublicKey,
469+
walletPassphrase: wrwUser.walletPassphrase,
470+
recoveryDestination: destinationAddress,
471+
})
488472
.should.rejectedWith('missing userKey');
489473
});
490474

491475
it('should throw error if wallet passphrase is not present', async function () {
492476
await basecoin
493-
.recover(
494-
{
495-
userKey: wrwUser.userPrivateKey,
496-
backupKey: wrwUser.backupPrivateKey,
497-
bitgoKey: wrwUser.bitgoPublicKey,
498-
recoveryDestination: destinationAddress,
499-
},
500-
openSSLBytes
501-
)
477+
.recover({
478+
userKey: wrwUser.userPrivateKey,
479+
backupKey: wrwUser.backupPrivateKey,
480+
bitgoKey: wrwUser.bitgoPublicKey,
481+
recoveryDestination: destinationAddress,
482+
})
502483
.should.rejectedWith('missing wallet passphrase');
503484
});
504485

505486
it('should throw error if there is no balance', async function () {
506487
await basecoin
507-
.recover(
508-
{
509-
userKey: wrwUser.userPrivateKey,
510-
backupKey: wrwUser.backupPrivateKey,
511-
bitgoKey: wrwUser.bitgoPublicKey,
512-
walletPassphrase: wrwUser.walletPassphrase,
513-
recoveryDestination: destinationAddress,
514-
},
515-
openSSLBytes
516-
)
488+
.recover({
489+
userKey: wrwUser.userPrivateKey,
490+
backupKey: wrwUser.backupPrivateKey,
491+
bitgoKey: wrwUser.bitgoPublicKey,
492+
walletPassphrase: wrwUser.walletPassphrase,
493+
recoveryDestination: destinationAddress,
494+
})
517495
.should.rejectedWith('Did not have enough funds to recover');
518496
});
519497
});

modules/sdk-coin-coreum/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
},
5252
"devDependencies": {
5353
"@bitgo/sdk-api": "^1.56.1",
54-
"@bitgo/sdk-opensslbytes": "^2.0.0",
5554
"@bitgo/sdk-test": "^8.0.48"
5655
}
5756
}

0 commit comments

Comments
 (0)