+ // Do a trivial test of constructing a phantom invoice
+ Result_InvoiceSignOrCreationErrorZ phantom_invoice = UtilMethods.create_phantom_invoice(
+ Option_u64Z.some(42000),
+ new byte[32], // TODO: This needs to be an option/null, not interpreting all-0s as None
+ "Phantom Invoice", 7200,
+ new PhantomRouteHints[]{ peer2.chan_manager.get_phantom_route_hints() },
+ peer2.entropy_source,
+ PhantomKeysManager.of(peer2.key_seed, 42, 42, new byte[32]).as_NodeSigner(),
+ peer2.logger, Currency.LDKCurrency_Bitcoin, Option_u16Z.none(),
+ System.currentTimeMillis() / 1000);
+ assert phantom_invoice.is_ok();
+ RouteHint[] hints = ((Result_InvoiceSignOrCreationErrorZ.Result_InvoiceSignOrCreationErrorZ_OK)phantom_invoice).res.route_hints();
+ assert hints.length == 1;
+ RouteHintHop[] val = hints[0].get_a();
+ assert hints[0].get_a().length == 1; // Our one channel is public so we should just have a single-hop hint
+