Skip to content

Commit 193cf89

Browse files
committed
fix TransactionRequest TryFrom fn
1 parent b33d853 commit 193cf89

File tree

1 file changed

+5
-1
lines changed
  • src/services/provider/evm

1 file changed

+5
-1
lines changed

src/services/provider/evm/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,11 @@ impl TryFrom<&EvmTransactionData> for TransactionRequest {
450450
// .map_err(|_| TransactionError::InvalidType("Invalid gas
451451
// limit".to_string()))?, ),
452452
value: Some(Uint::<256, 4>::from(tx.value)),
453-
input: TransactionInput::from(tx.data.clone().unwrap_or("".to_string()).into_bytes()),
453+
input: TransactionInput::from(
454+
hex::decode(tx.data.clone().unwrap_or("".to_string()).into_bytes()).map_err(
455+
|e| TransactionError::InvalidType(format!("Invalid hex data: {}", e)),
456+
)?,
457+
),
454458
nonce: Some(
455459
Uint::<256, 4>::from(tx.nonce.ok_or_else(|| {
456460
TransactionError::InvalidType("Nonce must be defined".to_string())

0 commit comments

Comments
 (0)