File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -28,17 +28,15 @@ export async function testSendPayment ({ mnemonic }, { signal }) {
28
28
paymentMethod : { type : 'sparkAddress' }
29
29
} )
30
30
31
- // check and register lightning address here so we can test it in the next step
31
+ // check and register lightning address here
32
+ // if we haven't already so we can test it in the next step
32
33
// https://sdk-doc-spark.breez.technology/guide/receive_lnurl_pay.html
33
34
const username = getUsername ( sparkAddress )
34
35
35
- // TODO(spark): don't check lightning address again if we already registered it
36
36
const available = await sdk . checkLightningAddressAvailable ( { username } )
37
- if ( ! available ) {
38
- // TODO(spark): better error message for user? but this should never happen with randomly generated mnemonics, right?
39
- throw new WalletValidationError ( 'lightning address unavailable' )
37
+ if ( available ) {
38
+ await sdk . registerLightningAddress ( { username, description : 'Running Spark SDK' } )
40
39
}
41
- await sdk . registerLightningAddress ( { username, description : 'Running Spark SDK' } )
42
40
43
41
sdk . disconnect ( )
44
42
You can’t perform that action at this time.
0 commit comments