Skip to content

Commit

Permalink
fix: tx::manage_data actually use hex to encode bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
willemneal committed Sep 10, 2024
1 parent 47a805c commit 11f2174
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cmd/soroban-cli/src/tx/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ pub use transaction::Transaction;
pub enum Error {
#[error("Transaction contains too many operations")]
TooManyOperations,
#[error(transparent)]
BytesM(#[from] bytesm::Error),
}
6 changes: 4 additions & 2 deletions cmd/soroban-cli/src/tx/builder/bytesm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Self, Self::Err> {
Ok(Self(xdr::BytesM::<64>::try_from(value)?))
Ok(Self(xdr::BytesM::<64>::try_from(&hex::decode(value)?)?))
}
}

Expand Down

0 comments on commit 11f2174

Please sign in to comment.