@@ -1461,9 +1461,13 @@ describe('V2 Wallet:', function () {
1461
1461
} ) ;
1462
1462
} ) ;
1463
1463
1464
- describe ( 'maxNumInputsToUse verification' , function ( ) {
1464
+ describe ( 'fanout input maxNumInputsToUse and unspents verification' , function ( ) {
1465
1465
const address = '5b34252f1bf349930e34020a' ;
1466
1466
const maxNumInputsToUse = 2 ;
1467
+ const unspents = [
1468
+ 'cc30565750e2aeb818625aaedaf89db5c614e5977b9645cee1d7289f616fb1d8:0' ,
1469
+ '8c45164787a954ab07864af9b05b34fbde3a8e430a8c65b0e60e4e543d8e1b6c:2' ,
1470
+ ] ;
1467
1471
let basecoin ;
1468
1472
let wallet ;
1469
1473
@@ -1492,8 +1496,42 @@ describe('V2 Wallet:', function () {
1492
1496
1493
1497
response . isDone ( ) . should . be . true ( ) ;
1494
1498
} ) ;
1499
+
1500
+ it ( 'should pass unspents parameter when calling fanout unspents' , async function ( ) {
1501
+ const path = `/api/v2/${ wallet . coin ( ) } /wallet/${ wallet . id ( ) } /fanoutUnspents` ;
1502
+ const response = nock ( bgUrl )
1503
+ . post ( path , _ . matches ( { unspents } ) ) // use _.matches to do a partial match on request body object instead of strict matching
1504
+ . reply ( 200 ) ;
1505
+
1506
+ try {
1507
+ await wallet . fanoutUnspents ( { address, unspents } ) ;
1508
+ } catch ( e ) {
1509
+ // the fanoutUnspents method will probably throw an exception for not having all of the correct nocks
1510
+ // we only care about /fanoutUnspents and whether unspents is an allowed parameter
1511
+ }
1512
+
1513
+ response . isDone ( ) . should . be . true ( ) ;
1514
+ } ) ;
1495
1515
} ) ;
1496
1516
1517
+ // describe('fanout specific unspents param verification', function () {
1518
+ // const address = '5b34252f1bf349930e34020a';
1519
+
1520
+ // let basecoin;
1521
+ // let wallet;
1522
+
1523
+ // before(async function () {
1524
+ // basecoin = bitgo.coin('tbtc');
1525
+ // const walletData = {
1526
+ // id: '5b34252f1bf349930e34020a',
1527
+ // coin: 'tbtc',
1528
+ // keys: ['5b3424f91bf349930e340175'],
1529
+ // };
1530
+ // wallet = new Wallet(bitgo, basecoin, walletData);
1531
+ // });
1532
+
1533
+ // });
1534
+
1497
1535
describe ( 'manage unspents' , function ( ) {
1498
1536
let rootWalletKey ;
1499
1537
let walletPassphrase ;
0 commit comments