Skip to content

Commit e6d00b9

Browse files
committed
Implement importprunedfunds and test
Remove redundant code from test
1 parent b2b7c22 commit e6d00b9

File tree

15 files changed

+43
-0
lines changed

15 files changed

+43
-0
lines changed

client/src/client_sync/v17/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ crate::impl_client_v17__get_unconfirmed_balance!();
129129
crate::impl_client_v17__get_wallet_info!();
130130
crate::impl_client_v17__import_address!();
131131
crate::impl_client_v17__import_privkey!();
132+
crate::impl_client_v17__import_pruned_funds!();
132133
crate::impl_client_v17__list_address_groupings!();
133134
crate::impl_client_v17__list_labels!();
134135
crate::impl_client_v17__list_lock_unspent!();

client/src/client_sync/v17/wallet.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,22 @@ macro_rules! impl_client_v17__import_privkey {
314314
};
315315
}
316316

317+
/// Implements Bitcoin Core JSON-RPC API method `importprunedfunds`.
318+
#[macro_export]
319+
macro_rules! impl_client_v17__import_pruned_funds {
320+
() => {
321+
impl Client {
322+
pub fn import_pruned_funds(&self, raw_transaction: &str, tx_out_proof: &str) -> Result<()> {
323+
match self.call("importprunedfunds", &[into_json(raw_transaction)?, into_json(tx_out_proof)?]) {
324+
Ok(serde_json::Value::Null) => Ok(()),
325+
Ok(res) => Err(Error::Returned(res.to_string())),
326+
Err(err) => Err(err.into()),
327+
}
328+
}
329+
}
330+
};
331+
}
332+
317333
/// Implements Bitcoin Core JSON-RPC API method `listaddressgroupings`.
318334
#[macro_export]
319335
macro_rules! impl_client_v17__list_address_groupings {

client/src/client_sync/v18/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ crate::impl_client_v17__get_unconfirmed_balance!();
144144
crate::impl_client_v17__get_wallet_info!();
145145
crate::impl_client_v17__import_address!();
146146
crate::impl_client_v17__import_privkey!();
147+
crate::impl_client_v17__import_pruned_funds!();
147148
crate::impl_client_v17__list_address_groupings!();
148149
crate::impl_client_v17__list_labels!();
149150
crate::impl_client_v17__list_lock_unspent!();

client/src/client_sync/v19/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ crate::impl_client_v17__get_unconfirmed_balance!();
140140
crate::impl_client_v17__get_wallet_info!();
141141
crate::impl_client_v17__import_address!();
142142
crate::impl_client_v17__import_privkey!();
143+
crate::impl_client_v17__import_pruned_funds!();
143144
crate::impl_client_v17__list_address_groupings!();
144145
crate::impl_client_v18__list_received_by_label!();
145146
crate::impl_client_v17__list_labels!();

client/src/client_sync/v20/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ crate::impl_client_v17__get_unconfirmed_balance!();
137137
crate::impl_client_v17__get_wallet_info!();
138138
crate::impl_client_v17__import_address!();
139139
crate::impl_client_v17__import_privkey!();
140+
crate::impl_client_v17__import_pruned_funds!();
140141
crate::impl_client_v17__list_address_groupings!();
141142
crate::impl_client_v17__list_labels!();
142143
crate::impl_client_v18__list_received_by_label!();

client/src/client_sync/v21/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ crate::impl_client_v17__get_unconfirmed_balance!();
139139
crate::impl_client_v17__get_wallet_info!();
140140
crate::impl_client_v17__import_address!();
141141
crate::impl_client_v17__import_privkey!();
142+
crate::impl_client_v17__import_pruned_funds!();
142143
crate::impl_client_v17__list_address_groupings!();
143144
crate::impl_client_v17__list_labels!();
144145
crate::impl_client_v18__list_received_by_label!();

client/src/client_sync/v22/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ crate::impl_client_v17__get_unconfirmed_balance!();
139139
crate::impl_client_v17__get_wallet_info!();
140140
crate::impl_client_v17__import_address!();
141141
crate::impl_client_v17__import_privkey!();
142+
crate::impl_client_v17__import_pruned_funds!();
142143
crate::impl_client_v17__list_address_groupings!();
143144
crate::impl_client_v18__list_received_by_label!();
144145
crate::impl_client_v17__list_labels!();

client/src/client_sync/v23/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ crate::impl_client_v17__get_unconfirmed_balance!();
141141
crate::impl_client_v17__get_wallet_info!();
142142
crate::impl_client_v17__import_address!();
143143
crate::impl_client_v17__import_privkey!();
144+
crate::impl_client_v17__import_pruned_funds!();
144145
crate::impl_client_v17__list_address_groupings!();
145146
crate::impl_client_v18__list_received_by_label!();
146147
crate::impl_client_v17__list_labels!();

client/src/client_sync/v24/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ crate::impl_client_v17__get_unconfirmed_balance!();
138138
crate::impl_client_v17__get_wallet_info!();
139139
crate::impl_client_v17__import_address!();
140140
crate::impl_client_v17__import_privkey!();
141+
crate::impl_client_v17__import_pruned_funds!();
141142
crate::impl_client_v17__list_address_groupings!();
142143
crate::impl_client_v18__list_received_by_label!();
143144
crate::impl_client_v17__list_labels!();

client/src/client_sync/v25/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ crate::impl_client_v17__get_unconfirmed_balance!();
138138
crate::impl_client_v17__get_wallet_info!();
139139
crate::impl_client_v17__import_address!();
140140
crate::impl_client_v17__import_privkey!();
141+
crate::impl_client_v17__import_pruned_funds!();
141142
crate::impl_client_v17__list_address_groupings!();
142143
crate::impl_client_v18__list_received_by_label!();
143144
crate::impl_client_v17__list_labels!();

0 commit comments

Comments
 (0)