Skip to content

Commit 4fcbef1

Browse files
committed
Unify test version feature gate placement
There is a variation in placing the version feature gate above or below the test attribute. Change them all to be consistent.
1 parent eeb4f30 commit 4fcbef1

File tree

6 files changed

+20
-22
lines changed

6 files changed

+20
-22
lines changed

integration_test/tests/blockchain.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,8 @@ fn blockchain__savemempool() {
479479
}
480480
}
481481

482-
#[cfg(not(feature = "v24_and_below"))]
483482
#[test]
483+
#[cfg(not(feature = "v24_and_below"))]
484484
fn blockchain__scan_blocks_modelled() {
485485
let node = Node::with_wallet(Wallet::None, &["-blockfilterindex=1"]);
486486

integration_test/tests/control.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ fn control__get_memory_info() {
1313
let _: GetMemoryInfoStats = node.client.get_memory_info().unwrap();
1414
}
1515

16-
#[cfg(not(feature = "v17"))]
1716
#[test]
17+
#[cfg(not(feature = "v17"))]
1818
fn control__get_rpc_info() {
1919
let node = Node::with_wallet(Wallet::None, &[]);
2020
let _ = node.client.get_rpc_info().unwrap();

integration_test/tests/generating.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use integration_test::{Node, NodeExt as _, Wallet};
99
use node::vtype::*; // All the version specific types.
1010
use node::mtype;
1111

12-
#[cfg(not(feature = "v20_and_below"))]
1312
#[test]
13+
#[cfg(not(feature = "v20_and_below"))]
1414
fn generating__generate_block__modelled() {
1515
let node = Node::with_wallet(Wallet::Default, &[]);
1616
node.fund_wallet();
@@ -44,7 +44,6 @@ fn generating__generate_block__modelled() {
4444
}
4545

4646
#[test]
47-
// The `generate` method was deprecated in Core v0.18 and was removed in v0.19.
4847
#[cfg(feature = "v17")]
4948
fn generating__generate__modelled() {
5049
const NBLOCKS: usize = 10;
@@ -69,8 +68,8 @@ fn generating__generate_to_address__modelled() {
6968
model.unwrap();
7069
}
7170

72-
#[cfg(not(feature = "v19_and_below"))]
7371
#[test]
72+
#[cfg(not(feature = "v19_and_below"))]
7473
fn generating__generate_to_descriptor__modelled() {
7574
const NBLOCKS: usize = 1;
7675

integration_test/tests/mining.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ fn mining__get_network_hash_ps() {
6262
}
6363

6464
#[test]
65-
// Core version 26 onwards.
6665
#[cfg(not(feature = "v25_and_below"))]
6766
fn mining__get_prioritised_transactions() {
6867
let node = Node::with_wallet(Wallet::Default, &[]);
@@ -212,8 +211,8 @@ fn mining__submit_block_with_dummy_coinbase(node: &Node, bt: &mtype::GetBlockTem
212211
let _: () = node.client.submit_block(&block).expect("submitblock");
213212
}
214213

215-
#[cfg(not(feature = "v17"))]
216214
#[test]
215+
#[cfg(not(feature = "v17"))]
217216
fn mining__submit_header() {
218217
let node = Node::with_wallet(Wallet::Default, &[]);
219218
node.fund_wallet();

integration_test/tests/util.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ fn util__create_multisig__modelled() {
3131
model.unwrap();
3232
}
3333

34-
#[cfg(not(feature = "v17"))]
3534
#[test]
35+
#[cfg(not(feature = "v17"))]
3636
fn util__derive_addresses__modelled() {
3737
let node = Node::with_wallet(Wallet::Default, &[]);
3838

@@ -72,8 +72,8 @@ fn util__estimate_smart_fee__modelled() {
7272
model.unwrap();
7373
}
7474

75-
#[cfg(not(feature = "v17"))]
7675
#[test]
76+
#[cfg(not(feature = "v17"))]
7777
fn util__get_descriptor_info() {
7878
let node = Node::with_wallet(Wallet::Default, &[]);
7979

@@ -82,8 +82,8 @@ fn util__get_descriptor_info() {
8282
let _: GetDescriptorInfo = node.client.get_descriptor_info(descriptor).expect("getdescriptorinfo");
8383
}
8484

85-
#[cfg(not(feature = "v20_and_below"))]
8685
#[test]
86+
#[cfg(not(feature = "v20_and_below"))]
8787
fn util__get_index_info() {
8888
let node = Node::with_wallet(Wallet::Default, &["-txindex"]);
8989
let index_info: GetIndexInfo = node.client.get_index_info().expect("getindexinfo");

integration_test/tests/wallet.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@ fn wallet__get_received_by_address__modelled() {
348348
assert_eq!(received_by_address.0, amount);
349349
}
350350

351-
#[cfg(not(feature = "v17"))]
352351
#[test]
352+
#[cfg(not(feature = "v17"))]
353353
fn wallet__get_received_by_label__modelled() {
354354
let node = Node::with_wallet(Wallet::Default, &[]);
355355
node.fund_wallet();
@@ -560,8 +560,8 @@ fn wallet__list_labels__modelled() {
560560
assert!(json.0.iter().any(|s| s == label));
561561
}
562562

563-
#[cfg(not(feature = "v17"))]
564563
#[test]
564+
#[cfg(not(feature = "v17"))]
565565
fn wallet__list_received_by_label__modelled() {
566566
let node = Node::with_wallet(Wallet::Default, &[]);
567567
node.fund_wallet();
@@ -787,8 +787,8 @@ fn wallet__list_unspent__modelled() {
787787
model.unwrap();
788788
}
789789

790-
#[cfg(not(feature = "v17"))]
791790
#[test]
791+
#[cfg(not(feature = "v17"))]
792792
fn wallet__list_wallet_dir() {
793793
let wallet_name = "test-wallet";
794794
let node = Node::with_wallet(Wallet::None, &[]);
@@ -837,8 +837,8 @@ fn wallet__lock_unspent() {
837837
assert!(unlocked.0, "unlock_unspent");
838838
}
839839

840-
#[cfg(not(feature = "v23_and_below"))]
841840
#[test]
841+
#[cfg(not(feature = "v23_and_below"))]
842842
fn wallet__migrate_wallet() {
843843
let node = Node::with_wallet(Wallet::None, &["-deprecatedrpc=create_bdb"]);
844844
let wallet_name = "legacy_wallet";
@@ -849,16 +849,16 @@ fn wallet__migrate_wallet() {
849849
assert_eq!(json.wallet_name, wallet_name);
850850
}
851851

852-
#[cfg(not(feature = "v22_and_below"))]
853852
#[test]
853+
#[cfg(not(feature = "v22_and_below"))]
854854
fn wallet__new_keypool() {
855855
let node = Node::with_wallet(Wallet::None, &["-deprecatedrpc=create_bdb"]);
856856
node.client.create_legacy_wallet("legacy_wallet").expect("createlegacywallet");
857857
let _: () = node.client.new_keypool().expect("newkeypool");
858858
}
859859

860-
#[cfg(not(feature = "v20_and_below"))]
861860
#[test]
861+
#[cfg(not(feature = "v20_and_below"))]
862862
fn wallet__psbt_bump_fee__modelled() {
863863
let node = Node::with_wallet(Wallet::Default, &[]);
864864
let address = node.client.new_address().expect("failed to create new address");
@@ -907,8 +907,8 @@ fn wallet__rescan_blockchain__modelled() {
907907
}
908908

909909
// This is tested in `backup_and_restore_wallet()`, called by wallet__backup_wallet()
910-
#[cfg(not(feature = "v22_and_below"))]
911910
#[test]
911+
#[cfg(not(feature = "v22_and_below"))]
912912
fn wallet__restore_wallet() {}
913913

914914
// This is tested in raw_transactions.rs `create_sign_send()`.
@@ -948,8 +948,8 @@ fn wallet__send_many__modelled() {
948948
}
949949
}
950950

951-
#[cfg(not(feature = "v20_and_below"))]
952951
#[test]
952+
#[cfg(not(feature = "v20_and_below"))]
953953
fn wallet__send__modelled() {
954954
use std::collections::BTreeMap;
955955

@@ -965,8 +965,8 @@ fn wallet__send__modelled() {
965965
model.unwrap();
966966
}
967967

968-
#[cfg(not(feature = "v23_and_below"))]
969968
#[test]
969+
#[cfg(not(feature = "v23_and_below"))]
970970
fn wallet__send_all__modelled() {
971971
let node = Node::with_wallet(Wallet::Default, &[]);
972972
node.fund_wallet();
@@ -998,8 +998,8 @@ fn wallet__set_tx_fee() {
998998
assert!(json.0);
999999
}
10001000

1001-
#[cfg(not(feature = "v18_and_below"))]
10021001
#[test]
1002+
#[cfg(not(feature = "v18_and_below"))]
10031003
fn wallet__set_wallet_flag() {
10041004
let node = Node::with_wallet(Wallet::Default, &[]);
10051005

@@ -1043,8 +1043,8 @@ fn wallet__sign_message__modelled() {
10431043
model.unwrap();
10441044
}
10451045

1046-
#[cfg(not(feature = "v23_and_below"))]
10471046
#[test]
1047+
#[cfg(not(feature = "v23_and_below"))]
10481048
fn wallet__simulate_raw_transaction() {
10491049
let node = Node::with_wallet(Wallet::Default, &[]);
10501050
node.fund_wallet();
@@ -1180,8 +1180,8 @@ fn create_load_unload_wallet() {
11801180
let _: LoadWallet = node.client.load_wallet(&wallet).expect("loadwallet");
11811181
}
11821182

1183-
#[cfg(not(feature = "v20_and_below"))]
11841183
#[test]
1184+
#[cfg(not(feature = "v20_and_below"))]
11851185
fn wallet__upgrade_wallet() {
11861186
let node = Node::with_wallet(Wallet::Default, &[]);
11871187

0 commit comments

Comments
 (0)