Skip to content

Commit c286f72

Browse files
committed
f
1 parent fd31d52 commit c286f72

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

lightning-transaction-sync/tests/integration_tests.rs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,13 @@ pub fn setup_bitcoind_and_electrsd() -> (BitcoinD, ElectrsD) {
4747
}
4848

4949
pub fn generate_blocks_and_wait(bitcoind: &BitcoinD, electrsd: &ElectrsD, num: usize) {
50-
let cur_height = bitcoind.client.get_block_count().expect("failed to get current block height");
50+
let cur_height = bitcoind.client.get_block_count().expect("failed to get current block height").into_model().unwrap().0;
5151
let address = bitcoind
5252
.client
53-
.get_new_address(Some("test"), Some(AddressType::Legacy))
54-
.expect("failed to get new address")
55-
.assume_checked();
53+
.new_address()
54+
.expect("failed to get new address");
5655
// TODO: expect this Result once the WouldBlock issue is resolved upstream.
57-
let _block_hashes_res = bitcoind.client.generate_to_address(num as u64, &address);
56+
let _block_hashes_res = bitcoind.client.generate_to_address(num, &address);
5857
wait_for_block(electrsd, cur_height as usize + num);
5958
}
6059

@@ -177,9 +176,8 @@ macro_rules! test_syncing {
177176
// Check registered confirmed transactions are marked confirmed
178177
let new_address = $bitcoind
179178
.client
180-
.get_new_address(Some("test"), Some(AddressType::Legacy))
181-
.unwrap()
182-
.assume_checked();
179+
.new_address()
180+
.unwrap();
183181
let txid = $bitcoind
184182
.client
185183
.send_to_address(&new_address, Amount::from_sat(5000))
@@ -212,16 +210,16 @@ macro_rules! test_syncing {
212210
assert!($confirmable.unconfirmed_txs.lock().unwrap().is_empty());
213211

214212
// Now take an arbitrary output of the second transaction and check we'll confirm its spend.
215-
let tx_res = $bitcoind.client.get_transaction(&second_txid, None).unwrap();
216-
let block_hash = tx_res.info.blockhash.unwrap();
217-
let tx = tx_res.transaction().unwrap();
213+
let tx_res = $bitcoind.client.get_transaction(second_txid).unwrap().into_model().unwrap();
214+
let block_hash = tx_res.block_hash.unwrap();
215+
let tx = tx_res.tx;
218216
let prev_outpoint = tx.input.first().unwrap().previous_output;
219217
let prev_tx = $bitcoind
220218
.client
221-
.get_transaction(&prev_outpoint.txid, None)
219+
.get_transaction(prev_outpoint.txid)
222220
.unwrap()
223-
.transaction()
224-
.unwrap();
221+
.into_model()
222+
.unwrap().tx;
225223
let prev_script_pubkey = prev_tx.output[prev_outpoint.vout as usize].script_pubkey.clone();
226224
let output = WatchedOutput {
227225
block_hash: Some(block_hash),

0 commit comments

Comments
 (0)