From 0c70e24f18f24c148a81770f7ac92ba6f07d3558 Mon Sep 17 00:00:00 2001 From: scx1332 Date: Mon, 25 Mar 2024 22:24:07 +0100 Subject: [PATCH] f --- crates/erc20_payment_lib/src/transaction.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/crates/erc20_payment_lib/src/transaction.rs b/crates/erc20_payment_lib/src/transaction.rs index 6ecbb125..a0c3d4f0 100644 --- a/crates/erc20_payment_lib/src/transaction.rs +++ b/crates/erc20_payment_lib/src/transaction.rs @@ -940,11 +940,12 @@ pub async fn find_receipt_extended( chain_tx_dao.priority_fee = tx.max_priority_fee_per_gas.map(|x| x.to_string()); chain_tx_dao.fee_paid = (gas_used * effective_gas_price).to_string(); - chain_tx_dao.method = "N/A".to_string(); - if tx.input.0.len() >= 4 { + chain_tx_dao.method = if tx.input.0.len() >= 4 { // extract method - chain_tx_dao.method = format!("0x{}", hex::encode(&tx.input.0[0..4])); - } + format!("0x{}", hex::encode(&tx.input.0[0..4])) + } else { + "N/A".to_string() + }; //todo: move to lazy static let erc20_transfer_event_signature: H256 =