Skip to content

Commit 818e5f2

Browse files
committed
Merge #604: test: make explicit returned stdlib types in tests
60c493d test: add explicit types for methods returning stdlib types (Alexey Gradoboev) Pull request description: Fixes #600 No more primitive return types in tests ``` $ grep -rn 'let _ = .*node\.client' . --exclude-dir=target | awk -F'node.client.' '{print $2}' | awk -F'(' '{print $1}' | sort -u | xargs -I {} grep -rnE 'fn[[:space:]]+{}' . --exclude-dir=target ./client/src/client_sync/v17/hidden.rs:20: pub fn estimate_raw_fee(&self, conf_target: u32) -> Result<EstimateRawFee> { ./client/src/client_sync/v17/generating.rs:17: pub fn generate_to_address( ./client/src/client_sync/v26/mining.rs:17: pub fn get_prioritised_transactions(&self) -> Result<GetPrioritisedTransactions> { ./client/src/client_sync/v18/control.rs:15: pub fn get_rpc_info(&self) -> Result<GetRpcInfo> { self.call("getrpcinfo", &[]) } ./client/src/client_sync/v17/wallet.rs:180: pub fn new_address(&self) -> Result<bitcoin::Address> { ./client/src/client_sync/v17/wallet.rs:187: pub fn new_address_with_type(&self, ty: AddressType) -> Result<bitcoin::Address> { ./client/src/client_sync/v17/wallet.rs:195: pub fn new_address_with_label( ./client/src/client_sync/v17/wallet.rs:195: pub fn new_address_with_label( ./client/src/client_sync/v17/wallet.rs:187: pub fn new_address_with_type(&self, ty: AddressType) -> Result<bitcoin::Address> { ./client/src/client_sync/v17/raw_transactions.rs:180: pub fn send_raw_transaction( ./client/src/client_sync/v17/wallet.rs:579: pub fn send_to_address( ./client/src/client_sync/v17/wallet.rs:589: pub fn send_to_address_rbf( $ ``` ACKs for top commit: jamillambert: ACK 60c493d tcharding: ACK 60c493d Tree-SHA512: 2f524c7e020d40d02f48e4164f6e69bf3634bc19c5b93ec66645bc5ec838beb3154e8e996414b99183d464170969ea9587f5bed0a5c0348bb2d20698dee29a13
2 parents addf46f + 60c493d commit 818e5f2

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

integration_test/tests/blockchain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ fn blockchain__get_tx_out_proof() {
594594
let (_address, tx) = node.create_mined_transaction();
595595
let txid = tx.compute_txid();
596596

597-
let _ = node.client.get_tx_out_proof(&[txid]).expect("gettxoutproof");
597+
let _: String = node.client.get_tx_out_proof(&[txid]).expect("gettxoutproof");
598598
}
599599

600600
#[test]

integration_test/tests/control.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ fn control__get_rpc_info() {
2323
#[test]
2424
fn control__help() {
2525
let node = BitcoinD::with_wallet(Wallet::None, &[]);
26-
let _ = node.client.help().unwrap();
26+
let _: String = node.client.help().unwrap();
2727
}
2828

2929
#[test]
@@ -36,11 +36,11 @@ fn control__logging() {
3636
#[test]
3737
fn control__stop() {
3838
let node = BitcoinD::with_wallet(Wallet::None, &[]);
39-
let _ = node.client.stop().unwrap();
39+
let _: String = node.client.stop().unwrap();
4040
}
4141

4242
#[test]
4343
fn control__uptime() {
4444
let node = BitcoinD::with_wallet(Wallet::None, &[]);
45-
let _ = node.client.uptime().unwrap();
45+
let _: u32 = node.client.uptime().unwrap();
4646
}

0 commit comments

Comments
 (0)