Skip to content

Commit 5fffba4

Browse files
committed
fix TransactionRequest TryFrom fn
1 parent d35c506 commit 5fffba4

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
@@ -265,7 +265,11 @@ impl TryFrom<&EvmTransactionData> for TransactionRequest {
265265
// .map_err(|_| TransactionError::InvalidType("Invalid gas
266266
// limit".to_string()))?, ),
267267
value: Some(Uint::<256, 4>::from(tx.value)),
268-
input: TransactionInput::from(tx.data.clone().unwrap_or("".to_string()).into_bytes()),
268+
input: TransactionInput::from(
269+
hex::decode(tx.data.clone().unwrap_or("".to_string()).into_bytes()).map_err(
270+
|e| TransactionError::InvalidType(format!("Invalid hex data: {}", e)),
271+
)?,
272+
),
269273
nonce: Some(
270274
Uint::<256, 4>::from(tx.nonce.ok_or_else(|| {
271275
TransactionError::InvalidType("Nonce must be defined".to_string())

0 commit comments

Comments
 (0)