// Because get_funding_txo() returns an OutPoint in a tuple that is a reference to an OutPoint inside the
// ChannelMonitor, its a good test to ensure that the OutPoint isn't freed (or is cloned) before the
// ChannelMonitor is. This used to be broken.
// Because get_funding_txo() returns an OutPoint in a tuple that is a reference to an OutPoint inside the
// ChannelMonitor, its a good test to ensure that the OutPoint isn't freed (or is cloned) before the
// ChannelMonitor is. This used to be broken.
synchronized (monitors) {
String key = Arrays.toString(id.to_channel_id());
assert monitors.put(key, data) == null;
synchronized (monitors) {
String key = Arrays.toString(id.to_channel_id());
assert monitors.put(key, data) == null;
- TwoTuple<OutPoint, byte[]> res = test_mon_roundtrip(data);
- assert Arrays.equals(res.a.get_txid(), id.get_txid());
- assert res.a.get_index() == id.get_index();
+ TwoTuple_OutPointScriptZ res = test_mon_roundtrip(data);
+ assert Arrays.equals(res.get_a().get_txid(), id.get_txid());
+ assert res.get_a().get_index() == id.get_index();
synchronized (monitors) {
String key = Arrays.toString(id.to_channel_id());
assert monitors.put(key, data) != null;
synchronized (monitors) {
String key = Arrays.toString(id.to_channel_id());
assert monitors.put(key, data) != null;
- TwoTuple<OutPoint, byte[]> res = test_mon_roundtrip(data);
- assert Arrays.equals(res.a.get_txid(), id.get_txid());
- assert res.a.get_index() == id.get_index();
+ TwoTuple_OutPointScriptZ res = test_mon_roundtrip(data);
+ assert Arrays.equals(res.get_a().get_txid(), id.get_txid());
+ assert res.get_a().get_index() == id.get_index();
@Override
public Result_TxOutAccessErrorZ get_utxo(byte[] genesis_hash, long short_channel_id) {
// We don't exchange any gossip, so should never actually get called, but providing a Some(Access)
@Override
public Result_TxOutAccessErrorZ get_utxo(byte[] genesis_hash, long short_channel_id) {
// We don't exchange any gossip, so should never actually get called, but providing a Some(Access)
byte[][] bytes;
synchronized (custom_messages_to_send) {
bytes = custom_messages_to_send.toArray(new byte[0][0]);
custom_messages_to_send.clear();
}
byte[][] bytes;
synchronized (custom_messages_to_send) {
bytes = custom_messages_to_send.toArray(new byte[0][0]);
custom_messages_to_send.clear();
}
@Override public short type_id() { return 4096; }
@Override public String debug_str() { return "Custom Java Message"; }
@Override public byte[] write() { return bytes[msg_idx]; }
@Override public short type_id() { return 4096; }
@Override public String debug_str() { return "Custom Java Message"; }
@Override public byte[] write() { return bytes[msg_idx]; }
} else {
byte[] serialized = orig.monitors.values().stream().iterator().next().write();
Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ res =
} else {
byte[] serialized = orig.monitors.values().stream().iterator().next().write();
Result_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ res =
}
byte[] serialized = orig.chan_manager.write();
Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ read_res =
}
byte[] serialized = orig.chan_manager.write();
Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ read_res =
- UtilMethods.BlockHashChannelManagerZ_read(serialized, this.keys_interface, this.fee_estimator, this.chain_watch, this.tx_broadcaster, this.logger, UserConfig.with_default(), monitors);
+ UtilMethods.C2Tuple_BlockHashChannelManagerZ_read(serialized, this.keys_interface, this.fee_estimator, this.chain_watch, this.tx_broadcaster, this.logger, UserConfig.with_default(), monitors);
- this.chan_manager = ((Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_OK) read_res).res.b;
- this.chain_watch.watch_channel(monitors[0].get_funding_txo().a, monitors[0]);
+ this.chan_manager = ((Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ.Result_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_OK) read_res).res.get_b();
+ this.chain_watch.watch_channel(monitors[0].get_funding_txo().get_a(), monitors[0]);
byte[] random_data = keys_interface.get_secure_random_bytes();
this.peer_manager = PeerManager.of(chan_manager.as_ChannelMessageHandler(), router.as_RoutingMessageHandler(), keys_interface.get_node_secret(), random_data, logger, this.custom_message_handler);
if (!break_cross_peer_refs && (use_manual_watch || use_km_wrapper)) {
byte[] random_data = keys_interface.get_secure_random_bytes();
this.peer_manager = PeerManager.of(chan_manager.as_ChannelMessageHandler(), router.as_RoutingMessageHandler(), keys_interface.get_node_secret(), random_data, logger, this.custom_message_handler);
if (!break_cross_peer_refs && (use_manual_watch || use_km_wrapper)) {
- TwoTuple<byte[], TwoTuple<Integer, TxOut>[]>[] connect_block(Block b, int height, long expected_monitor_update_len) {
+ TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] connect_block(Block b, int height, long expected_monitor_update_len) {
- TwoTuple<Long, byte[]> txp = new TwoTuple<>((long) 0, b.getTransactions().get(0).bitcoinSerialize());
- txn = new TwoTuple[]{txp};
+ TwoTuple_usizeTransactionZ txp = TwoTuple_usizeTransactionZ.of((long) 0, b.getTransactions().get(0).bitcoinSerialize());
+ txn = new TwoTuple_usizeTransactionZ[]{txp};
if (chain_monitor != null) {
chan_manager.as_Listen().block_connected(b.bitcoinSerialize(), height);
chain_monitor.as_Listen().block_connected(b.bitcoinSerialize(), height);
if (chain_monitor != null) {
chan_manager.as_Listen().block_connected(b.bitcoinSerialize(), height);
chain_monitor.as_Listen().block_connected(b.bitcoinSerialize(), height);
synchronized (monitors) {
assert monitors.size() == 1;
for (ChannelMonitor mon : monitors.values()) {
synchronized (monitors) {
assert monitors.size() == 1;
for (ChannelMonitor mon : monitors.values()) {
- TwoTuple<byte[], TwoTuple<Integer, TxOut>[]>[] ret = mon.block_connected(header, txn, height, tx_broadcaster, fee_estimator, logger);
+ TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] ret = mon.block_connected(header, txn, height, tx_broadcaster, fee_estimator, logger);
Transaction tx = new Transaction(bitcoinj_net, state.peer1.broadcast_set.getFirst());
Block b = new Block(bitcoinj_net, 2, state.best_blockhash, Sha256Hash.ZERO_HASH, 42, 0, 0,
Arrays.asList(new Transaction[]{tx}));
Transaction tx = new Transaction(bitcoinj_net, state.peer1.broadcast_set.getFirst());
Block b = new Block(bitcoinj_net, 2, state.best_blockhash, Sha256Hash.ZERO_HASH, 42, 0, 0,
Arrays.asList(new Transaction[]{tx}));
- TwoTuple<byte[], TwoTuple<Integer, TxOut>[]>[] watch_outputs = state.peer2.connect_block(b, 10, 1);
+ TwoTuple_TxidCVec_C2Tuple_u32TxOutZZZ[] watch_outputs = state.peer2.connect_block(b, 10, 1);
if (watch_outputs != null) { // We only process watch_outputs manually when we use a manually-build Watch impl
assert watch_outputs.length == 1;
if (watch_outputs != null) { // We only process watch_outputs manually when we use a manually-build Watch impl
assert watch_outputs.length == 1;
- assert Arrays.equals(watch_outputs[0].a, tx.getTxId().getReversedBytes());
- assert watch_outputs[0].b.length == 2;
- assert watch_outputs[0].b[0].a == 0;
- assert watch_outputs[0].b[1].a == 1;
+ assert Arrays.equals(watch_outputs[0].get_a(), tx.getTxId().getReversedBytes());
+ assert watch_outputs[0].get_b().length == 2;
+ assert watch_outputs[0].get_b()[0].get_a() == 0;
+ assert watch_outputs[0].get_b()[1].get_a() == 1;