@@ -72,7 +72,7 @@ describe('Lightning wallets', function () {
7272 passphrase : 'pass123' ,
7373 enterprise : 'ent123' ,
7474 passcodeEncryptionCode : 'code123' ,
75- type : 'custodial ' ,
75+ subType : 'lightningCustody ' ,
7676 } )
7777 . should . be . rejectedWith (
7878 "error(s) parsing generate lightning wallet request params: Invalid value 'undefined' supplied to GenerateLightningWalletOptions.label, expected string."
@@ -83,7 +83,7 @@ describe('Lightning wallets', function () {
8383 label : 'my ln wallet' ,
8484 enterprise : 'ent123' ,
8585 passcodeEncryptionCode : 'code123' ,
86- type : 'custodial ' ,
86+ subType : 'lightningCustody ' ,
8787 } )
8888 . should . be . rejectedWith (
8989 "error(s) parsing generate lightning wallet request params: Invalid value 'undefined' supplied to GenerateLightningWalletOptions.passphrase, expected string."
@@ -94,7 +94,7 @@ describe('Lightning wallets', function () {
9494 label : 'my ln wallet' ,
9595 passphrase : 'pass123' ,
9696 passcodeEncryptionCode : 'code123' ,
97- type : 'custodial ' ,
97+ subType : 'lightningCustody ' ,
9898 } )
9999 . should . be . rejectedWith (
100100 "error(s) parsing generate lightning wallet request params: Invalid value 'undefined' supplied to GenerateLightningWalletOptions.enterprise, expected string."
@@ -105,7 +105,7 @@ describe('Lightning wallets', function () {
105105 label : 'my ln wallet' ,
106106 passphrase : 'pass123' ,
107107 enterprise : 'ent123' ,
108- type : 'custodial ' ,
108+ subType : 'lightningCustody ' ,
109109 } )
110110 . should . be . rejectedWith (
111111 "error(s) parsing generate lightning wallet request params: Invalid value 'undefined' supplied to GenerateLightningWalletOptions.passcodeEncryptionCode, expected string."
@@ -117,7 +117,7 @@ describe('Lightning wallets', function () {
117117 passphrase : 'pass123' ,
118118 enterprise : 'ent123' ,
119119 passcodeEncryptionCode : 'code123' ,
120- type : 'custodial ' ,
120+ subType : 'lightningCustody ' ,
121121 } )
122122 . should . be . rejectedWith (
123123 "error(s) parsing generate lightning wallet request params: Invalid value '123' supplied to GenerateLightningWalletOptions.label, expected string."
@@ -129,7 +129,7 @@ describe('Lightning wallets', function () {
129129 passphrase : 123 as any ,
130130 enterprise : 'ent123' ,
131131 passcodeEncryptionCode : 'code123' ,
132- type : 'custodial ' ,
132+ subType : 'lightningCustody ' ,
133133 } )
134134 . should . be . rejectedWith (
135135 "error(s) parsing generate lightning wallet request params: Invalid value '123' supplied to GenerateLightningWalletOptions.passphrase, expected string."
@@ -141,7 +141,7 @@ describe('Lightning wallets', function () {
141141 passphrase : 'pass123' ,
142142 enterprise : 123 as any ,
143143 passcodeEncryptionCode : 'code123' ,
144- type : 'custodial ' ,
144+ subType : 'lightningCustody ' ,
145145 } )
146146 . should . be . rejectedWith (
147147 "error(s) parsing generate lightning wallet request params: Invalid value '123' supplied to GenerateLightningWalletOptions.enterprise, expected string."
@@ -153,34 +153,21 @@ describe('Lightning wallets', function () {
153153 passphrase : 'pass123' ,
154154 enterprise : 'ent123' ,
155155 passcodeEncryptionCode : 123 as any ,
156- type : 'custodial ' ,
156+ subType : 'lightningCustody ' ,
157157 } )
158158 . should . be . rejectedWith (
159159 "error(s) parsing generate lightning wallet request params: Invalid value '123' supplied to GenerateLightningWalletOptions.passcodeEncryptionCode, expected string."
160160 ) ;
161-
162- await wallets
163- . generateWallet ( {
164- label : 'my ln wallet' ,
165- passphrase : 'pass123' ,
166- enterprise : 'ent123' ,
167- passcodeEncryptionCode : 'code123' ,
168- type : 'cold' ,
169- } )
170- . should . be . rejectedWith (
171- 'error(s) parsing generate lightning wallet request params: Invalid value \'"cold"\' supplied to GenerateLightningWalletOptions.type.0, expected "custodial".\n' +
172- 'Invalid value \'"cold"\' supplied to GenerateLightningWalletOptions.type.1, expected "hot".'
173- ) ;
174161 } ) ;
175162
176- for ( const type of [ 'hot ' , 'custodial ' ] as const ) {
177- it ( `should generate ${ type } lightning wallet` , async function ( ) {
163+ for ( const subType of [ 'lightningCustody ' , 'lightningSelfCustody ' ] as const ) {
164+ it ( `should generate ${ subType } lightning wallet` , async function ( ) {
178165 const params : GenerateLightningWalletOptions = {
179166 label : 'my ln wallet' ,
180167 passphrase : 'pass123' ,
181168 enterprise : 'ent123' ,
182169 passcodeEncryptionCode : 'code123' ,
183- type ,
170+ subType : subType as 'lightningCustody' | 'lightningSelfCustody' ,
184171 } ;
185172
186173 const validateKeyRequest = ( body ) => {
@@ -203,7 +190,8 @@ describe('Lightning wallets', function () {
203190 body . label === 'my ln wallet' &&
204191 body . m === 1 &&
205192 body . n === 1 &&
206- body . type === type &&
193+ body . type === 'hot' &&
194+ body . subType === subType &&
207195 body . enterprise === 'ent123' &&
208196 Array . isArray ( body . keys ) &&
209197 body . keys . length === 1 &&
@@ -247,7 +235,12 @@ describe('Lightning wallets', function () {
247235 let wallet : LightningWallet ;
248236 beforeEach ( function ( ) {
249237 wallet = getLightningWallet (
250- new Wallet ( bitgo , basecoin , { id : 'walletId' , coin : 'tlnbtc' , coinSpecific : { keys : [ 'def' , 'ghi' ] } } )
238+ new Wallet ( bitgo , basecoin , {
239+ id : 'walletId' ,
240+ coin : 'tlnbtc' ,
241+ subType : 'lightningCustody' ,
242+ coinSpecific : { keys : [ 'def' , 'ghi' ] } ,
243+ } )
251244 ) as LightningWallet ;
252245 } ) ;
253246
@@ -476,6 +469,7 @@ describe('Lightning wallets', function () {
476469 coin : coinName ,
477470 keys : [ 'abc' ] ,
478471 coinSpecific : { keys : [ 'def' , 'ghi' ] } ,
472+ subType : 'lightningCustody' ,
479473 } ;
480474
481475 const userKeyData = {
@@ -588,6 +582,7 @@ describe('Lightning wallets', function () {
588582 coin : coinName ,
589583 keys : [ 'abc' ] ,
590584 coinSpecific : { keys : [ 'def' , 'ghi' ] } ,
585+ subType : 'lightningSelfCustody' ,
591586 } ;
592587
593588 const watchOnlyAccounts = {
0 commit comments