diff --git a/cmd/soroban-cli/src/tx/builder.rs b/cmd/soroban-cli/src/tx/builder.rs index 89b7f8a24..be0c49051 100644 --- a/cmd/soroban-cli/src/tx/builder.rs +++ b/cmd/soroban-cli/src/tx/builder.rs @@ -21,4 +21,6 @@ pub use transaction::Transaction; pub enum Error { #[error("Transaction contains too many operations")] TooManyOperations, + #[error(transparent)] + BytesM(#[from] bytesm::Error), } diff --git a/cmd/soroban-cli/src/tx/builder/bytesm.rs b/cmd/soroban-cli/src/tx/builder/bytesm.rs index f416384a4..c3a074cde 100644 --- a/cmd/soroban-cli/src/tx/builder/bytesm.rs +++ b/cmd/soroban-cli/src/tx/builder/bytesm.rs @@ -9,13 +9,15 @@ pub struct Bytes64(pub xdr::BytesM<64>); pub enum Error { #[error(transparent)] Xdr(#[from] xdr::Error), + #[error(transparent)] + Hex(#[from] hex::FromHexError), } impl FromStr for Bytes64 { - type Err = xdr::Error; + type Err = Error; fn from_str(value: &str) -> Result { - Ok(Self(xdr::BytesM::<64>::try_from(value)?)) + Ok(Self(xdr::BytesM::<64>::try_from(&hex::decode(value)?)?)) } }