Skip to content

Commit 9bb863c

Browse files
committed
Implement settxfee method and test
1 parent d266d13 commit 9bb863c

File tree

42 files changed

+84
-40
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

+84
-40
lines changed

client/src/client_sync/v17/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ crate::impl_client_v17__remove_pruned_funds!();
148148
crate::impl_client_v17__rescan_blockchain!();
149149
crate::impl_client_v17__send_many!();
150150
crate::impl_client_v17__send_to_address!();
151+
crate::impl_client_v17__set_tx_fee!();
151152
crate::impl_client_v17__sign_message!();
152153
crate::impl_client_v17__sign_raw_transaction_with_wallet!();
153154
crate::impl_client_v17__unload_wallet!();

client/src/client_sync/v17/wallet.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,19 @@ macro_rules! impl_client_v17__send_to_address {
592592
};
593593
}
594594

595+
/// Implements Bitcoin Core JSON-RPC API method `settxfee`
596+
#[macro_export]
597+
macro_rules! impl_client_v17__set_tx_fee {
598+
() => {
599+
impl Client {
600+
pub fn set_tx_fee(&self, fee_rate: bitcoin::FeeRate) -> Result<SetTxFee> {
601+
let fee_rate_btc_kvb = fee_rate.to_sat_per_vb_floor() as f64 / 100_000.0;
602+
self.call("settxfee", &[fee_rate_btc_kvb.into()])
603+
}
604+
}
605+
};
606+
}
607+
595608
/// Implements Bitcoin Core JSON-RPC API method `signmessage`.
596609
#[macro_export]
597610
macro_rules! impl_client_v17__sign_message {

client/src/client_sync/v18/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ crate::impl_client_v17__remove_pruned_funds!();
165165
crate::impl_client_v17__rescan_blockchain!();
166166
crate::impl_client_v17__send_many!();
167167
crate::impl_client_v17__send_to_address!();
168+
crate::impl_client_v17__set_tx_fee!();
168169
crate::impl_client_v17__sign_message!();
169170
crate::impl_client_v17__sign_raw_transaction_with_wallet!();
170171
crate::impl_client_v17__unload_wallet!();

client/src/client_sync/v19/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ crate::impl_client_v17__remove_pruned_funds!();
161161
crate::impl_client_v17__rescan_blockchain!();
162162
crate::impl_client_v17__send_many!();
163163
crate::impl_client_v17__send_to_address!();
164+
crate::impl_client_v17__set_tx_fee!();
164165
crate::impl_client_v19__set_wallet_flag!();
165166
crate::impl_client_v17__sign_message!();
166167
crate::impl_client_v17__sign_raw_transaction_with_wallet!();

client/src/client_sync/v20/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ crate::impl_client_v17__remove_pruned_funds!();
158158
crate::impl_client_v17__rescan_blockchain!();
159159
crate::impl_client_v17__send_many!();
160160
crate::impl_client_v17__send_to_address!();
161+
crate::impl_client_v17__set_tx_fee!();
161162
crate::impl_client_v19__set_wallet_flag!();
162163
crate::impl_client_v17__sign_message!();
163164
crate::impl_client_v17__sign_raw_transaction_with_wallet!();

client/src/client_sync/v21/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ crate::impl_client_v17__remove_pruned_funds!();
160160
crate::impl_client_v17__rescan_blockchain!();
161161
crate::impl_client_v17__send_many!();
162162
crate::impl_client_v17__send_to_address!();
163+
crate::impl_client_v17__set_tx_fee!();
163164
crate::impl_client_v19__set_wallet_flag!();
164165
crate::impl_client_v17__sign_message!();
165166
crate::impl_client_v17__sign_raw_transaction_with_wallet!();

client/src/client_sync/v22/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ crate::impl_client_v17__remove_pruned_funds!();
160160
crate::impl_client_v17__rescan_blockchain!();
161161
crate::impl_client_v17__send_many!();
162162
crate::impl_client_v17__send_to_address!();
163+
crate::impl_client_v17__set_tx_fee!();
163164
crate::impl_client_v19__set_wallet_flag!();
164165
crate::impl_client_v17__sign_message!();
165166
crate::impl_client_v17__sign_raw_transaction_with_wallet!();

client/src/client_sync/v23/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ crate::impl_client_v17__remove_pruned_funds!();
162162
crate::impl_client_v17__rescan_blockchain!();
163163
crate::impl_client_v17__send_many!();
164164
crate::impl_client_v17__send_to_address!();
165+
crate::impl_client_v17__set_tx_fee!();
165166
crate::impl_client_v19__set_wallet_flag!();
166167
crate::impl_client_v17__sign_message!();
167168
crate::impl_client_v17__sign_raw_transaction_with_wallet!();

client/src/client_sync/v24/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ crate::impl_client_v17__remove_pruned_funds!();
159159
crate::impl_client_v17__rescan_blockchain!();
160160
crate::impl_client_v17__send_many!();
161161
crate::impl_client_v17__send_to_address!();
162+
crate::impl_client_v17__set_tx_fee!();
162163
crate::impl_client_v19__set_wallet_flag!();
163164
crate::impl_client_v17__sign_message!();
164165
crate::impl_client_v17__sign_raw_transaction_with_wallet!();

client/src/client_sync/v25/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ crate::impl_client_v17__remove_pruned_funds!();
159159
crate::impl_client_v17__rescan_blockchain!();
160160
crate::impl_client_v17__send_many!();
161161
crate::impl_client_v17__send_to_address!();
162+
crate::impl_client_v17__set_tx_fee!();
162163
crate::impl_client_v19__set_wallet_flag!();
163164
crate::impl_client_v17__sign_message!();
164165
crate::impl_client_v17__sign_raw_transaction_with_wallet!();

0 commit comments

Comments
 (0)