Skip to content

Commit 936dc46

Browse files
committed
Rename some fields for readability
1 parent 41ba946 commit 936dc46

File tree

4 files changed

+10
-17
lines changed

4 files changed

+10
-17
lines changed

types/src/v18/blockchain/into.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ impl ScanTxOutSetUnspent {
9595
txid,
9696
vout: self.vout,
9797
script_pubkey,
98-
desc: Some(self.desc),
98+
desc: Some(self.descriptor),
9999
amount,
100100
coinbase: None,
101101
height: self.height,

types/src/v19/blockchain/into.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ impl ScanTxOutSetStart {
242242
pub fn into_model(self) -> Result<model::ScanTxOutSetStart, ScanTxOutSetError> {
243243
use ScanTxOutSetError as E;
244244

245-
let bestblock = self.bestblock.parse::<BlockHash>().map_err(E::BestBlockHash)?;
245+
let bestblock = self.best_block.parse::<BlockHash>().map_err(E::BestBlockHash)?;
246246

247247
let unspents =
248248
self.unspents.into_iter().map(|u| u.into_model()).collect::<Result<Vec<_>, _>>()?;
@@ -272,7 +272,7 @@ impl ScanTxOutSetUnspent {
272272
txid,
273273
vout: self.vout,
274274
script_pubkey,
275-
desc: Some(self.desc),
275+
desc: Some(self.descriptor),
276276
amount,
277277
coinbase: None,
278278
height: self.height,

types/src/v25/blockchain/into.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl ScanTxOutSetStart {
6767
pub fn into_model(self) -> Result<model::ScanTxOutSetStart, ScanTxOutSetError> {
6868
use ScanTxOutSetError as E;
6969

70-
let bestblock = self.bestblock.parse::<BlockHash>().map_err(E::BestBlockHash)?;
70+
let bestblock = self.best_block.parse::<BlockHash>().map_err(E::BestBlockHash)?;
7171

7272
let unspents =
7373
self.unspents.into_iter().map(|u| u.into_model()).collect::<Result<Vec<_>, _>>()?;
@@ -97,7 +97,7 @@ impl ScanTxOutSetUnspent {
9797
txid,
9898
vout: self.vout,
9999
script_pubkey,
100-
desc: Some(self.desc),
100+
desc: Some(self.descriptor),
101101
amount,
102102
coinbase: Some(self.coinbase),
103103
height: self.height,

types/src/v28/blockchain/into.rs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,10 @@ impl ScanTxOutSetStart {
99
pub fn into_model(self) -> Result<model::ScanTxOutSetStart, ScanTxOutSetError> {
1010
use ScanTxOutSetError as E;
1111

12-
let bestblock = self
13-
.bestblock
14-
.parse::<BlockHash>().map_err(E::BestBlockHash)?;
12+
let bestblock = self.best_block.parse::<BlockHash>().map_err(E::BestBlockHash)?;
1513

16-
let unspents = self
17-
.unspents
18-
.into_iter()
19-
.map(|u| u.into_model())
20-
.collect::<Result<Vec<_>, _>>()?;
14+
let unspents =
15+
self.unspents.into_iter().map(|u| u.into_model()).collect::<Result<Vec<_>, _>>()?;
2116

2217
let total_amount = Amount::from_btc(self.total_amount).map_err(E::TotalAmount)?;
2318

@@ -39,15 +34,13 @@ impl ScanTxOutSetUnspent {
3934
let txid = self.txid.parse::<Txid>().map_err(E::Txid)?;
4035
let amount = Amount::from_btc(self.amount).map_err(E::Amount)?;
4136
let script_pubkey = ScriptBuf::from_hex(&self.script_pubkey).map_err(E::ScriptPubKey)?;
42-
let blockhash = self
43-
.blockhash
44-
.parse::<BlockHash>().map_err(E::BlockHash)?;
37+
let blockhash = self.block_hash.parse::<BlockHash>().map_err(E::BlockHash)?;
4538

4639
Ok(model::ScanTxOutSetUnspent {
4740
txid,
4841
vout: self.vout,
4942
script_pubkey,
50-
desc: Some(self.desc),
43+
desc: Some(self.descriptor),
5144
amount,
5245
coinbase: Some(self.coinbase),
5346
height: self.height,

0 commit comments

Comments
 (0)