It seems that elements::hex::Error is missing std::error::Error implementation, which makes it difficult to work with dynamic-error crates (like eyre or anyhow), as there default ::from method requires that.
For example,
let bytes_res = Vec::<u8>::from_hex(&raw_tx).map_err(eyre::Report::from);
doesn't compile, as eyre::Report::from requires T: std::error::Error, but:
let bytes_res = Vec::<u8>::from_hex(&raw_tx).map_err(|e| eyre::eyre!(e));
works, as it does some black-magic under the hood with the value. So still from implementation is preferable
It seems that
elements::hex::Erroris missingstd::error::Errorimplementation, which makes it difficult to work with dynamic-error crates (likeeyreoranyhow), as there default::frommethod requires that.For example,
doesn't compile, as
eyre::Report::fromrequiresT: std::error::Error, but:works, as it does some black-magic under the hood with the value. So still
fromimplementation is preferable