From e24a24a45e981ef368bf90cafcf715c0b58961cb Mon Sep 17 00:00:00 2001 From: ponyjackal Date: Wed, 29 Nov 2023 12:20:48 -0800 Subject: [PATCH] fix: eth transfer --- src/heuristics/ethTransfer.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/heuristics/ethTransfer.ts b/src/heuristics/ethTransfer.ts index 0990cd9b..f55d67b4 100644 --- a/src/heuristics/ethTransfer.ts +++ b/src/heuristics/ethTransfer.ts @@ -1,15 +1,15 @@ import { Transaction } from '../types'; -export async function ethTransferContextualizer( +export function ethTransferContextualizer( transaction: Transaction, -): Promise { - const isEthTransfer = await detectETHTransfer(transaction); +): Transaction { + const isEthTransfer = detectETHTransfer(transaction); if (!isEthTransfer) return transaction; return generateETHTransferContext(transaction); } -async function detectETHTransfer(transaction: Transaction): Promise { +export function detectETHTransfer(transaction: Transaction): boolean { // TODO; check logs from transaction if ( (transaction.input === '0x' || transaction.input === '') && @@ -22,7 +22,9 @@ async function detectETHTransfer(transaction: Transaction): Promise { return false; } -function generateETHTransferContext(transaction: Transaction): Transaction { +export function generateETHTransferContext( + transaction: Transaction, +): Transaction { transaction.context = { variables: { sender: {