diff --git a/types/src/v17/blockchain/into.rs b/types/src/v17/blockchain/into.rs index e81b429..c2638b5 100644 --- a/types/src/v17/blockchain/into.rs +++ b/types/src/v17/blockchain/into.rs @@ -41,7 +41,7 @@ impl GetBlockVerbosityOne { let tx = self .tx .iter() - .map(|t| encode::deserialize_hex::(t).map_err(E::Tx)) + .map(|t| t.parse::().map_err(E::Hash)) .collect::, _>>()?; let median_time = self.median_time.map(|t| crate::to_u32(t, "median_time")).transpose()?; let bits = CompactTarget::from_unprefixed_hex(&self.bits).map_err(E::Bits)?; @@ -328,12 +328,8 @@ impl GetDifficulty { impl GetMempoolAncestors { /// Converts version specific type to a version nonspecific, more strongly typed type. - pub fn into_model(self) -> Result { - let v = self - .0 - .iter() - .map(|t| encode::deserialize_hex::(t)) - .collect::, _>>()?; + pub fn into_model(self) -> Result { + let v = self.0.iter().map(|t| t.parse::()).collect::, _>>()?; Ok(model::GetMempoolAncestors(v)) } } @@ -355,12 +351,8 @@ impl GetMempoolAncestorsVerbose { impl GetMempoolDescendants { /// Converts version specific type to a version nonspecific, more strongly typed type. - pub fn into_model(self) -> Result { - let v = self - .0 - .iter() - .map(|t| encode::deserialize_hex::(t)) - .collect::, _>>()?; + pub fn into_model(self) -> Result { + let v = self.0.iter().map(|t| t.parse::()).collect::, _>>()?; Ok(model::GetMempoolDescendants(v)) } } @@ -460,12 +452,8 @@ impl GetMempoolInfo { impl GetRawMempool { /// Converts version specific type to a version nonspecific, more strongly typed type. - pub fn into_model(self) -> Result { - let v = self - .0 - .iter() - .map(|t| encode::deserialize_hex::(t)) - .collect::, _>>()?; + pub fn into_model(self) -> Result { + let v = self.0.iter().map(|t| t.parse::()).collect::, _>>()?; Ok(model::GetRawMempool(v)) } } @@ -551,12 +539,8 @@ impl GetTxOutSetInfo { impl VerifyTxOutProof { /// Converts version specific type to a version nonspecific, more strongly typed type. - pub fn into_model(self) -> Result { - let proofs = self - .0 - .iter() - .map(|t| encode::deserialize_hex::(t)) - .collect::, _>>()?; + pub fn into_model(self) -> Result { + let proofs = self.0.iter().map(|t| t.parse::()).collect::, _>>()?; Ok(model::VerifyTxOutProof(proofs)) } }