Skip to content

Commit 8822fd0

Browse files
committed
Implement lockunspent method and test
1 parent 857cfb6 commit 8822fd0

File tree

42 files changed

+91
-39
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+91
-39
lines changed

client/src/client_sync/v17/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ crate::impl_client_v17__list_transactions!();
142142
crate::impl_client_v17__list_unspent!();
143143
crate::impl_client_v17__list_wallets!();
144144
crate::impl_client_v17__load_wallet!();
145+
crate::impl_client_v17__lock_unspent!();
145146
crate::impl_client_v17__rescan_blockchain!();
146147
crate::impl_client_v17__send_many!();
147148
crate::impl_client_v17__send_to_address!();

client/src/client_sync/v17/wallet.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,18 @@ macro_rules! impl_client_v17__load_wallet {
483483
};
484484
}
485485

486+
/// Implements Bitcoin Core JSON-RPC API method `loadwallet`.
487+
#[macro_export]
488+
macro_rules! impl_client_v17__lock_unspent {
489+
() => {
490+
impl Client {
491+
pub fn lock_unspent(&self, unlock: bool) -> Result<LockUnspent> {
492+
self.call("lockunspent", &[into_json(unlock)?])
493+
}
494+
}
495+
};
496+
}
497+
486498
/// Implements Bitcoin Core JSON-RPC API method `rescanblockchain`.
487499
#[macro_export]
488500
macro_rules! impl_client_v17__rescan_blockchain {

client/src/client_sync/v18/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ crate::impl_client_v17__list_unspent!();
159159
crate::impl_client_v17__list_wallets!();
160160
crate::impl_client_v18__list_wallet_dir!();
161161
crate::impl_client_v17__load_wallet!();
162+
crate::impl_client_v17__lock_unspent!();
162163
crate::impl_client_v17__rescan_blockchain!();
163164
crate::impl_client_v17__send_many!();
164165
crate::impl_client_v17__send_to_address!();

client/src/client_sync/v19/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ crate::impl_client_v17__list_unspent!();
155155
crate::impl_client_v18__list_wallet_dir!();
156156
crate::impl_client_v17__list_wallets!();
157157
crate::impl_client_v17__load_wallet!();
158+
crate::impl_client_v17__lock_unspent!();
158159
crate::impl_client_v17__rescan_blockchain!();
159160
crate::impl_client_v17__send_many!();
160161
crate::impl_client_v17__send_to_address!();

client/src/client_sync/v20/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ crate::impl_client_v17__list_unspent!();
152152
crate::impl_client_v18__list_wallet_dir!();
153153
crate::impl_client_v17__list_wallets!();
154154
crate::impl_client_v17__load_wallet!();
155+
crate::impl_client_v17__lock_unspent!();
155156
crate::impl_client_v17__rescan_blockchain!();
156157
crate::impl_client_v17__send_many!();
157158
crate::impl_client_v17__send_to_address!();

client/src/client_sync/v21/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ crate::impl_client_v17__list_unspent!();
154154
crate::impl_client_v18__list_wallet_dir!();
155155
crate::impl_client_v17__list_wallets!();
156156
crate::impl_client_v17__load_wallet!();
157+
crate::impl_client_v17__lock_unspent!();
157158
crate::impl_client_v17__rescan_blockchain!();
158159
crate::impl_client_v17__send_many!();
159160
crate::impl_client_v17__send_to_address!();

client/src/client_sync/v22/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ crate::impl_client_v17__list_unspent!();
154154
crate::impl_client_v18__list_wallet_dir!();
155155
crate::impl_client_v17__list_wallets!();
156156
crate::impl_client_v17__load_wallet!();
157+
crate::impl_client_v17__lock_unspent!();
157158
crate::impl_client_v17__rescan_blockchain!();
158159
crate::impl_client_v17__send_many!();
159160
crate::impl_client_v17__send_to_address!();

client/src/client_sync/v23/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@ crate::impl_client_v17__list_unspent!();
156156
crate::impl_client_v18__list_wallet_dir!();
157157
crate::impl_client_v17__list_wallets!();
158158
crate::impl_client_v22__load_wallet!();
159+
crate::impl_client_v17__lock_unspent!();
159160
crate::impl_client_v17__rescan_blockchain!();
160161
crate::impl_client_v17__send_many!();
161162
crate::impl_client_v17__send_to_address!();

client/src/client_sync/v24/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ crate::impl_client_v17__list_unspent!();
153153
crate::impl_client_v18__list_wallet_dir!();
154154
crate::impl_client_v17__list_wallets!();
155155
crate::impl_client_v22__load_wallet!();
156+
crate::impl_client_v17__lock_unspent!();
156157
crate::impl_client_v17__rescan_blockchain!();
157158
crate::impl_client_v17__send_many!();
158159
crate::impl_client_v17__send_to_address!();

client/src/client_sync/v25/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ crate::impl_client_v17__list_unspent!();
153153
crate::impl_client_v18__list_wallet_dir!();
154154
crate::impl_client_v17__list_wallets!();
155155
crate::impl_client_v22__load_wallet!();
156+
crate::impl_client_v17__lock_unspent!();
156157
crate::impl_client_v17__rescan_blockchain!();
157158
crate::impl_client_v17__send_many!();
158159
crate::impl_client_v17__send_to_address!();

0 commit comments

Comments
 (0)