Skip to content

Commit 4c0d8c7

Browse files
committed
Format code
1 parent 1bcfa84 commit 4c0d8c7

File tree

22 files changed

+138
-163
lines changed

22 files changed

+138
-163
lines changed

client/src/client_sync/v28/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ crate::impl_client_v17__scan_tx_out_set!();
5555
crate::impl_client_v17__verify_chain!();
5656
crate::impl_client_v17__verify_tx_out_proof!();
5757

58-
5958
// == Control ==
6059
crate::impl_client_v17__get_memory_info!();
6160
crate::impl_client_v18__get_rpc_info!();

types/src/model/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ pub use self::{
2828
GetDescriptorActivity, GetDifficulty, GetMempoolAncestors, GetMempoolAncestorsVerbose,
2929
GetMempoolDescendants, GetMempoolDescendantsVerbose, GetMempoolEntry, GetMempoolInfo,
3030
GetRawMempool, GetRawMempoolVerbose, GetTxOut, GetTxOutSetInfo, MempoolEntry,
31-
MempoolEntryFees, ReceiveActivity, Softfork, SoftforkType, SpendActivity, VerifyTxOutProof, ScanTxOutSet, ScanTxOutSetStart, ScanTxOutSetStatus, ScanTxOutSetUnspent,
31+
MempoolEntryFees, ReceiveActivity, ScanTxOutSet, ScanTxOutSetStart, ScanTxOutSetStatus,
32+
ScanTxOutSetUnspent, Softfork, SoftforkType, SpendActivity, VerifyTxOutProof,
3233
},
3334
generating::{Generate, GenerateBlock, GenerateToAddress, GenerateToDescriptor},
3435
mining::{

types/src/v17/blockchain/error.rs

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -590,20 +590,13 @@ impl fmt::Display for ScanTxOutSetError {
590590
use ScanTxOutSetError::*;
591591

592592
match self {
593-
BestBlockHash(e) =>
594-
write_err!(f, "conversion of the `bestblock` field failed"; e),
595-
BlockHash(e) =>
596-
write_err!(f, "conversion of the `blockhash` field failed"; e),
597-
Txid(e) =>
598-
write_err!(f, "conversion of the `txid` field failed"; e),
599-
ScriptPubKey(e) =>
600-
write_err!(f, "conversion of the `scriptPubKey` field failed"; e),
601-
TotalAmount(e) =>
602-
write_err!(f, "conversion of the `total_amount` field failed"; e),
603-
Amount(e) =>
604-
write_err!(f, "conversion of the `amount` field failed"; e),
605-
Numeric(e) =>
606-
write_err!(f, "numeric"; e),
593+
BestBlockHash(e) => write_err!(f, "conversion of the `bestblock` field failed"; e),
594+
BlockHash(e) => write_err!(f, "conversion of the `blockhash` field failed"; e),
595+
Txid(e) => write_err!(f, "conversion of the `txid` field failed"; e),
596+
ScriptPubKey(e) => write_err!(f, "conversion of the `scriptPubKey` field failed"; e),
597+
TotalAmount(e) => write_err!(f, "conversion of the `total_amount` field failed"; e),
598+
Amount(e) => write_err!(f, "conversion of the `amount` field failed"; e),
599+
Numeric(e) => write_err!(f, "numeric"; e),
607600
}
608601
}
609602
}

types/src/v17/blockchain/into.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: CC0-1.0
22

33
use bitcoin::consensus::encode;
4-
use bitcoin::{block, hex, Block, BlockHash, CompactTarget, Txid, Weight, Work, ScriptBuf};
4+
use bitcoin::{block, hex, Block, BlockHash, CompactTarget, ScriptBuf, Txid, Weight, Work};
55

66
// TODO: Use explicit imports?
77
use super::*;
@@ -553,7 +553,6 @@ impl GetTxOutSetInfo {
553553
impl ScanTxOutSet {
554554
/// Converts version-specific `ScanTxOutSet` response into version-agnostic model type.
555555
pub fn into_model(self) -> Result<model::ScanTxOutSet, ScanTxOutSetError> {
556-
557556
match self {
558557
Self::Start(start) => Ok(model::ScanTxOutSet::Start(start.into_model()?)),
559558
Self::Abort(b) => Ok(model::ScanTxOutSet::Abort(b)),
@@ -566,11 +565,8 @@ impl ScanTxOutSetStart {
566565
pub fn into_model(self) -> Result<model::ScanTxOutSetStart, ScanTxOutSetError> {
567566
use ScanTxOutSetError as E;
568567

569-
let unspents = self
570-
.unspents
571-
.into_iter()
572-
.map(|u| u.into_model())
573-
.collect::<Result<Vec<_>, _>>()?;
568+
let unspents =
569+
self.unspents.into_iter().map(|u| u.into_model()).collect::<Result<Vec<_>, _>>()?;
574570

575571
let total_amount = Amount::from_btc(self.total_amount).map_err(E::TotalAmount)?;
576572

@@ -609,9 +605,7 @@ impl ScanTxOutSetUnspent {
609605

610606
impl ScanTxOutSetStatus {
611607
pub fn into_model(self) -> model::ScanTxOutSetStatus {
612-
model::ScanTxOutSetStatus {
613-
progress: self.progress,
614-
}
608+
model::ScanTxOutSetStatus { progress: self.progress }
615609
}
616610
}
617611

types/src/v17/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,9 @@ pub use self::{
243243
GetMempoolDescendantsVerbose, GetMempoolEntry, GetMempoolInfo, GetMempoolInfoError,
244244
GetRawMempool, GetRawMempoolVerbose, GetTxOut, GetTxOutError, GetTxOutSetInfo,
245245
GetTxOutSetInfoError, MapMempoolEntryError, MempoolEntry, MempoolEntryError,
246-
MempoolEntryFees, MempoolEntryFeesError, PruneBlockchain, ScanTxOutSet, ScanTxOutSetStart,
247-
ScanTxOutSetStatus, ScanTxOutSetUnspent, Softfork, SoftforkReject, VerifyChain,
248-
VerifyTxOutProof, ScanTxOutSetError,
246+
MempoolEntryFees, MempoolEntryFeesError, PruneBlockchain, ScanTxOutSet, ScanTxOutSetError,
247+
ScanTxOutSetStart, ScanTxOutSetStatus, ScanTxOutSetUnspent, Softfork, SoftforkReject,
248+
VerifyChain, VerifyTxOutProof,
249249
},
250250
control::{GetMemoryInfoStats, Locked, Logging},
251251
generating::{Generate, GenerateToAddress},

types/src/v18/blockchain/into.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
use bitcoin::{Amount, ScriptBuf, Txid, Wtxid};
44

5-
use super::{GetMempoolEntry, MempoolEntry, MempoolEntryError, ScanTxOutSet, ScanTxOutSetStart, ScanTxOutSetStatus, ScanTxOutSetUnspent, ScanTxOutSetError};
5+
use super::{
6+
GetMempoolEntry, MempoolEntry, MempoolEntryError, ScanTxOutSet, ScanTxOutSetError,
7+
ScanTxOutSetStart, ScanTxOutSetStatus, ScanTxOutSetUnspent,
8+
};
69
use crate::model;
710

811
impl GetMempoolEntry {
@@ -63,7 +66,6 @@ impl MempoolEntry {
6366
impl ScanTxOutSet {
6467
/// Converts version-specific `ScanTxOutSet` response into version-agnostic model type.
6568
pub fn into_model(self) -> Result<model::ScanTxOutSet, ScanTxOutSetError> {
66-
6769
match self {
6870
Self::Start(start) => Ok(model::ScanTxOutSet::Start(start.into_model()?)),
6971
Self::Abort(b) => Ok(model::ScanTxOutSet::Abort(b)),
@@ -76,11 +78,8 @@ impl ScanTxOutSetStart {
7678
pub fn into_model(self) -> Result<model::ScanTxOutSetStart, ScanTxOutSetError> {
7779
use ScanTxOutSetError as E;
7880

79-
let unspents = self
80-
.unspents
81-
.into_iter()
82-
.map(|u| u.into_model())
83-
.collect::<Result<Vec<_>, _>>()?;
81+
let unspents =
82+
self.unspents.into_iter().map(|u| u.into_model()).collect::<Result<Vec<_>, _>>()?;
8483

8584
let total_amount = Amount::from_btc(self.total_amount).map_err(E::TotalAmount)?;
8685

@@ -119,8 +118,6 @@ impl ScanTxOutSetUnspent {
119118

120119
impl ScanTxOutSetStatus {
121120
pub fn into_model(self) -> model::ScanTxOutSetStatus {
122-
model::ScanTxOutSetStatus {
123-
progress: self.progress,
124-
}
121+
model::ScanTxOutSetStatus { progress: self.progress }
125122
}
126123
}

types/src/v18/mod.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,10 @@ mod wallet;
233233

234234
#[doc(inline)]
235235
pub use self::{
236-
blockchain::{GetMempoolEntry, MempoolEntry, ScanTxOutSet, ScanTxOutSetStart, ScanTxOutSetStatus, ScanTxOutSetUnspent},
236+
blockchain::{
237+
GetMempoolEntry, MempoolEntry, ScanTxOutSet, ScanTxOutSetStart, ScanTxOutSetStatus,
238+
ScanTxOutSetUnspent,
239+
},
237240
control::{ActiveCommand, GetRpcInfo},
238241
network::{GetNodeAddresses, GetPeerInfo, NodeAddress, PeerInfo},
239242
raw_transactions::{
@@ -277,10 +280,11 @@ pub use crate::v17::{
277280
ListTransactionsItemError, ListUnspentItemError, ListWallets, LoadWallet, LockUnspent, Locked,
278281
Logging, MapMempoolEntryError, MempoolAcceptance, MempoolEntryError, MempoolEntryFees,
279282
MempoolEntryFeesError, PruneBlockchain, PsbtInput, PsbtOutput, PsbtScript, RawTransaction,
280-
RawTransactionError, RawTransactionInput, RawTransactionOutput, RescanBlockchain, SendMany,
281-
SendRawTransaction, SendToAddress, SetNetworkActive, SetTxFee, SignFail, SignFailError,
282-
SignMessage, SignMessageWithPrivKey, SignRawTransaction, SignRawTransactionError, Softfork,
283-
SoftforkReject, TestMempoolAccept, TransactionCategory, UploadTarget, ValidateAddress,
284-
ValidateAddressError, VerifyChain, VerifyMessage, VerifyTxOutProof, WalletCreateFundedPsbt,
285-
WalletCreateFundedPsbtError, WalletProcessPsbt, WitnessUtxo, ScanTxOutSetError,
283+
RawTransactionError, RawTransactionInput, RawTransactionOutput, RescanBlockchain,
284+
ScanTxOutSetError, SendMany, SendRawTransaction, SendToAddress, SetNetworkActive, SetTxFee,
285+
SignFail, SignFailError, SignMessage, SignMessageWithPrivKey, SignRawTransaction,
286+
SignRawTransactionError, Softfork, SoftforkReject, TestMempoolAccept, TransactionCategory,
287+
UploadTarget, ValidateAddress, ValidateAddressError, VerifyChain, VerifyMessage,
288+
VerifyTxOutProof, WalletCreateFundedPsbt, WalletCreateFundedPsbtError, WalletProcessPsbt,
289+
WitnessUtxo,
286290
};

types/src/v19/blockchain/into.rs

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ use super::error::{
1212
use super::{
1313
GetBlockFilter, GetBlockchainInfo, GetChainTxStats, GetChainTxStatsError, GetMempoolAncestors,
1414
GetMempoolAncestorsVerbose, GetMempoolDescendants, GetMempoolDescendantsVerbose,
15-
GetMempoolEntry, GetMempoolInfo, GetMempoolInfoError, MempoolEntry, MempoolEntryFees, ScanTxOutSet, ScanTxOutSetStart, ScanTxOutSetStatus, ScanTxOutSetUnspent, ScanTxOutSetError,
15+
GetMempoolEntry, GetMempoolInfo, GetMempoolInfoError, MempoolEntry, MempoolEntryFees,
16+
ScanTxOutSet, ScanTxOutSetError, ScanTxOutSetStart, ScanTxOutSetStatus, ScanTxOutSetUnspent,
1617
};
1718
use crate::model;
1819

@@ -240,7 +241,6 @@ impl GetMempoolInfo {
240241
impl ScanTxOutSet {
241242
/// Converts version-specific `ScanTxOutSet` response into version-agnostic model type.
242243
pub fn into_model(self) -> Result<model::ScanTxOutSet, ScanTxOutSetError> {
243-
244244
match self {
245245
Self::Start(start) => Ok(model::ScanTxOutSet::Start(start.into_model()?)),
246246
Self::Abort(b) => Ok(model::ScanTxOutSet::Abort(b)),
@@ -253,15 +253,10 @@ impl ScanTxOutSetStart {
253253
pub fn into_model(self) -> Result<model::ScanTxOutSetStart, ScanTxOutSetError> {
254254
use ScanTxOutSetError as E;
255255

256-
let bestblock = self
257-
.bestblock
258-
.parse::<BlockHash>().map_err(E::BestBlockHash)?;
256+
let bestblock = self.bestblock.parse::<BlockHash>().map_err(E::BestBlockHash)?;
259257

260-
let unspents = self
261-
.unspents
262-
.into_iter()
263-
.map(|u| u.into_model())
264-
.collect::<Result<Vec<_>, _>>()?;
258+
let unspents =
259+
self.unspents.into_iter().map(|u| u.into_model()).collect::<Result<Vec<_>, _>>()?;
265260

266261
let total_amount = Amount::from_btc(self.total_amount).map_err(E::TotalAmount)?;
267262

@@ -300,8 +295,6 @@ impl ScanTxOutSetUnspent {
300295

301296
impl ScanTxOutSetStatus {
302297
pub fn into_model(self) -> model::ScanTxOutSetStatus {
303-
model::ScanTxOutSetStatus {
304-
progress: self.progress,
305-
}
298+
model::ScanTxOutSetStatus { progress: self.progress }
306299
}
307300
}

types/src/v19/mod.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,8 +238,8 @@ pub use self::{
238238
GetBlockFilterError, GetBlockchainInfo, GetBlockchainInfoError, GetChainTxStats,
239239
GetMempoolAncestors, GetMempoolAncestorsVerbose, GetMempoolDescendants,
240240
GetMempoolDescendantsVerbose, GetMempoolEntry, GetMempoolInfo, MapMempoolEntryError,
241-
MempoolEntry, MempoolEntryError, MempoolEntryFees, MempoolEntryFeesError, Softfork,
242-
SoftforkType, ScanTxOutSet, ScanTxOutSetStart, ScanTxOutSetStatus, ScanTxOutSetUnspent,
241+
MempoolEntry, MempoolEntryError, MempoolEntryFees, MempoolEntryFeesError, ScanTxOutSet,
242+
ScanTxOutSetStart, ScanTxOutSetStatus, ScanTxOutSetUnspent, Softfork, SoftforkType,
243243
},
244244
control::GetRpcInfo,
245245
network::{GetNetworkInfo, GetPeerInfo, PeerInfo},
@@ -276,11 +276,12 @@ pub use crate::v17::{
276276
ListSinceBlockTransaction, ListSinceBlockTransactionError, ListTransactions,
277277
ListTransactionsItem, ListTransactionsItemError, ListUnspentItemError, ListWallets, LoadWallet,
278278
LockUnspent, Locked, Logging, PruneBlockchain, RawTransactionError, RawTransactionInput,
279-
RawTransactionOutput, RescanBlockchain, SendMany, SendRawTransaction, SendToAddress,
280-
SetNetworkActive, SetTxFee, SignMessage, SignMessageWithPrivKey, SignRawTransaction,
281-
SignRawTransactionError, SoftforkReject, TestMempoolAccept, TransactionCategory, UploadTarget,
282-
ValidateAddress, ValidateAddressError, VerifyChain, VerifyMessage, VerifyTxOutProof,
283-
WalletCreateFundedPsbt, WalletCreateFundedPsbtError, WalletProcessPsbt, WitnessUtxo, ScanTxOutSetError,
279+
RawTransactionOutput, RescanBlockchain, ScanTxOutSetError, SendMany, SendRawTransaction,
280+
SendToAddress, SetNetworkActive, SetTxFee, SignMessage, SignMessageWithPrivKey,
281+
SignRawTransaction, SignRawTransactionError, SoftforkReject, TestMempoolAccept,
282+
TransactionCategory, UploadTarget, ValidateAddress, ValidateAddressError, VerifyChain,
283+
VerifyMessage, VerifyTxOutProof, WalletCreateFundedPsbt, WalletCreateFundedPsbtError,
284+
WalletProcessPsbt, WitnessUtxo,
284285
};
285286
#[doc(inline)]
286287
pub use crate::v18::{

types/src/v20/mod.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,12 @@ pub use crate::{
268268
ListSinceBlockTransaction, ListSinceBlockTransactionError, ListTransactions,
269269
ListTransactionsItem, ListTransactionsItemError, ListUnspentItemError, ListWallets,
270270
LoadWallet, LockUnspent, Locked, PruneBlockchain, RawTransactionError, RawTransactionInput,
271-
RawTransactionOutput, RescanBlockchain, SendMany, SendRawTransaction, SendToAddress,
272-
SetNetworkActive, SetTxFee, SignMessage, SignMessageWithPrivKey, SignRawTransaction,
273-
SignRawTransactionError, SoftforkReject, TestMempoolAccept, TransactionCategory,
274-
UploadTarget, ValidateAddress, ValidateAddressError, VerifyChain, VerifyMessage,
275-
VerifyTxOutProof, WalletCreateFundedPsbt, WalletCreateFundedPsbtError, WalletProcessPsbt,
276-
WitnessUtxo, ScanTxOutSetError,
271+
RawTransactionOutput, RescanBlockchain, ScanTxOutSetError, SendMany, SendRawTransaction,
272+
SendToAddress, SetNetworkActive, SetTxFee, SignMessage, SignMessageWithPrivKey,
273+
SignRawTransaction, SignRawTransactionError, SoftforkReject, TestMempoolAccept,
274+
TransactionCategory, UploadTarget, ValidateAddress, ValidateAddressError, VerifyChain,
275+
VerifyMessage, VerifyTxOutProof, WalletCreateFundedPsbt, WalletCreateFundedPsbtError,
276+
WalletProcessPsbt, WitnessUtxo,
277277
},
278278
v18::{
279279
ActiveCommand, AnalyzePsbt, AnalyzePsbtError, AnalyzePsbtInput, AnalyzePsbtInputMissing,
@@ -289,6 +289,7 @@ pub use crate::{
289289
GetDescriptorInfo, GetMempoolAncestors, GetMempoolAncestorsVerbose, GetMempoolDescendants,
290290
GetMempoolDescendantsVerbose, GetMempoolEntry, GetMempoolInfo, GetNetworkInfo, GetPeerInfo,
291291
GetRpcInfo, MapMempoolEntryError, MempoolEntry, MempoolEntryError, MempoolEntryFees,
292-
MempoolEntryFeesError, PeerInfo, SetWalletFlag, Softfork, SoftforkType, ScanTxOutSet, ScanTxOutSetStart, ScanTxOutSetStatus, ScanTxOutSetUnspent,
292+
MempoolEntryFeesError, PeerInfo, ScanTxOutSet, ScanTxOutSetStart, ScanTxOutSetStatus,
293+
ScanTxOutSetUnspent, SetWalletFlag, Softfork, SoftforkType,
293294
},
294295
};

0 commit comments

Comments
 (0)