Skip to content

Commit 4fe5794

Browse files
committed
Feature-gate individual test cases
.. to allow un-gating them individually going forward
1 parent f1c40b3 commit 4fe5794

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

integration_test/tests/wallet.rs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
//! Tests for methods found under the `== Wallet ==` section of the API docs.
44
5-
#![cfg(any(feature = "0_17_1", feature = "0_18_1"))]
6-
75
#[cfg(feature = "TODO")]
86
use bitcoin::address::{Address, NetworkChecked};
97
use bitcoin::Amount;
@@ -23,6 +21,7 @@ pub fn add_multisig_address() {
2321
assert!(json.into_model().is_ok());
2422
}
2523

24+
#[cfg(any(feature = "0_17_1", feature = "0_18_1"))]
2625
#[test]
2726
pub fn bump_fee() {
2827
let node = Node::with_wallet(Wallet::Default, &[]);
@@ -40,6 +39,7 @@ pub fn bump_fee() {
4039
assert!(json.into_model().is_ok());
4140
}
4241

42+
#[cfg(any(feature = "0_17_1", feature = "0_18_1"))]
4343
#[test]
4444
pub fn create_wallet() {
4545
// Implicitly tests `createwallet` because we create the default wallet.
@@ -49,6 +49,7 @@ pub fn create_wallet() {
4949
// optional `String` to an optional vector of strings in v25. Needs testing.
5050
}
5151

52+
#[cfg(any(feature = "0_17_1", feature = "0_18_1"))]
5253
#[test]
5354
pub fn dump_priv_key() {
5455
let node = Node::with_wallet(Wallet::Default, &[]);
@@ -57,6 +58,7 @@ pub fn dump_priv_key() {
5758
assert!(json.into_model().is_ok());
5859
}
5960

61+
#[cfg(any(feature = "0_17_1", feature = "0_18_1"))]
6062
#[test]
6163
pub fn dump_wallet() {
6264
let node = Node::with_wallet(Wallet::Default, &[]);
@@ -65,6 +67,7 @@ pub fn dump_wallet() {
6567
let _ = json.into_model();
6668
}
6769

70+
#[cfg(any(feature = "0_17_1", feature = "0_18_1"))]
6871
#[test]
6972
pub fn get_addresses_by_label() {
7073
let node = Node::with_wallet(Wallet::Default, &[]);
@@ -76,6 +79,7 @@ pub fn get_addresses_by_label() {
7679
assert!(map.get(&addr).is_some());
7780
}
7881

82+
#[cfg(any(feature = "0_17_1", feature = "0_18_1"))]
7983
#[test]
8084
// TODO: Consider testing a few different address types.
8185
#[cfg(feature = "TODO")]
@@ -86,6 +90,7 @@ pub fn get_address_info() {
8690
assert!(json.into_model().is_ok());
8791
}
8892

93+
#[cfg(any(feature = "0_17_1", feature = "0_18_1"))]
8994
#[test]
9095
fn get_balance() {
9196
let node = Node::with_wallet(Wallet::Default, &[]);
@@ -97,6 +102,7 @@ fn get_balance() {
97102
assert!(json.into_model().is_ok());
98103
}
99104

105+
#[cfg(any(feature = "0_17_1", feature = "0_18_1"))]
100106
#[test]
101107
#[cfg(feature = "v19")]
102108
fn get_balances() {
@@ -108,6 +114,7 @@ fn get_balances() {
108114
assert!(model.mine.trusted > Amount::ZERO);
109115
}
110116

117+
#[cfg(any(feature = "0_17_1", feature = "0_18_1"))]
111118
#[test]
112119
fn get_new_address() {
113120
let node = Node::with_wallet(Wallet::Default, &[]);
@@ -132,13 +139,15 @@ fn get_new_address() {
132139
.unwrap();
133140
}
134141

142+
#[cfg(any(feature = "0_17_1", feature = "0_18_1"))]
135143
#[test]
136144
fn get_raw_change_address() {
137145
let node = Node::with_wallet(Wallet::Default, &[]);
138146
let json = node.client.get_raw_change_address().expect("getrawchangeaddress");
139147
assert!(json.into_model().is_ok());
140148
}
141149

150+
#[cfg(any(feature = "0_17_1", feature = "0_18_1"))]
142151
#[test]
143152
fn get_received_by_address() {
144153
let amount = Amount::from_sat(10_000);
@@ -160,6 +169,7 @@ fn get_received_by_address() {
160169
assert_eq!(model.0, amount);
161170
}
162171

172+
#[cfg(any(feature = "0_17_1", feature = "0_18_1"))]
163173
#[test]
164174
fn get_transaction() {
165175
let node = Node::with_wallet(Wallet::Default, &[]);
@@ -177,12 +187,14 @@ fn get_transaction() {
177187
assert!(json.into_model().is_ok());
178188
}
179189

190+
#[cfg(any(feature = "0_17_1", feature = "0_18_1"))]
180191
#[test]
181192
fn load_wallet() {
182193
// Implicitly test loadwalled because we load the default wallet.
183194
let _ = Node::with_wallet(Wallet::Default, &[]);
184195
}
185196

197+
#[cfg(any(feature = "0_17_1", feature = "0_18_1"))]
186198
#[test]
187199
#[cfg(not(any(feature = "v17", feature = "v18", feature = "v19", feature = "v20")))]
188200
fn unload_wallet() {
@@ -193,6 +205,7 @@ fn unload_wallet() {
193205
assert!(json.into_model().is_ok())
194206
}
195207

208+
#[cfg(any(feature = "0_17_1", feature = "0_18_1"))]
196209
#[test]
197210
fn send_to_address() {
198211
let node = Node::with_wallet(Wallet::Default, &[]);

0 commit comments

Comments
 (0)