Skip to content

Commit

Permalink
Do not manually map numeric error
Browse files Browse the repository at this point in the history
  • Loading branch information
tcharding committed Nov 27, 2024
1 parent 8174e21 commit 93af3a8
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions types/src/v17/wallet/into.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,8 @@ impl GetAddressInfo {
.map_err(E::Pubkeys)
})
.transpose()?;
let sigs_required = self
.sigs_required
.map(|s| crate::to_u32(s, "sigs_required"))
.transpose()
.map_err(E::Numeric)?;
let sigs_required =
self.sigs_required.map(|s| crate::to_u32(s, "sigs_required")).transpose()?;
let pubkey = self.pubkey.map(|s| s.parse::<PublicKey>()).transpose().map_err(E::Pubkey)?;
let embedded =
self.embedded.map(|embedded| embedded.into_model()).transpose().map_err(E::Embedded)?;
Expand Down Expand Up @@ -254,11 +251,8 @@ impl GetAddressInfoEmbedded {
.map(|s| s.parse::<PublicKey>())
.collect::<Result<Vec<_>, _>>()
.map_err(E::Pubkeys)?;
let sigs_required = self
.sigs_required
.map(|s| crate::to_u32(s, "sigs_required"))
.transpose()
.map_err(E::Numeric)?;
let sigs_required =
self.sigs_required.map(|s| crate::to_u32(s, "sigs_required")).transpose()?;
let pubkey = self.pubkey.map(|s| s.parse::<PublicKey>()).transpose().map_err(E::Pubkey)?;
let labels = self.labels.into_iter().map(|label| label.into_model()).collect();

Expand Down

0 comments on commit 93af3a8

Please sign in to comment.