- byte[] payment_preimage = new byte[32];
- for (int i = 0; i < 32; i++) payment_preimage[i] = (byte) (i ^ 0x0f);
- byte[] payment_hash = Sha256Hash.hash(payment_preimage);
+ Result_InvoiceNoneZ invoice = UtilMethods.constructor_invoice_from_channelmanager(peer2.chan_manager, peer2.keys_interface, LDKCurrency.LDKCurrency_Bitcoin, Option_u64Z.constructor_none(), new byte[0]);
+ assert invoice instanceof Result_InvoiceNoneZ.Result_InvoiceNoneZ_OK;
+ byte[] payment_hash = ((Result_InvoiceNoneZ.Result_InvoiceNoneZ_OK) invoice).res.payment_hash();
+ byte[] payment_secret = ((Result_InvoiceNoneZ.Result_InvoiceNoneZ_OK) invoice).res.payment_secret();
+