fix: trim whitespace when loading hex strings from files closes #720
This commit is contained in:
@@ -34,7 +34,7 @@ pub fn exec(
|
||||
let bytes = if hex {
|
||||
let hex_bytes = std::fs::read_to_string(&input).into_diagnostic()?;
|
||||
|
||||
hex::decode(hex_bytes).into_diagnostic()?
|
||||
hex::decode(hex_bytes.trim()).into_diagnostic()?
|
||||
} else {
|
||||
std::fs::read(&input).into_diagnostic()?
|
||||
};
|
||||
|
||||
@@ -33,7 +33,7 @@ pub fn exec(
|
||||
let mut program = if cbor {
|
||||
let cbor_hex = std::fs::read_to_string(&script).into_diagnostic()?;
|
||||
|
||||
let raw_cbor = hex::decode(cbor_hex).into_diagnostic()?;
|
||||
let raw_cbor = hex::decode(cbor_hex.trim()).into_diagnostic()?;
|
||||
|
||||
let prog = Program::<FakeNamedDeBruijn>::from_cbor(&raw_cbor, &mut Vec::new())
|
||||
.into_diagnostic()?;
|
||||
|
||||
Reference in New Issue
Block a user