From 61290a971bfac7d15e8a12ecac8cd4e18b30452d Mon Sep 17 00:00:00 2001 From: D Date: Tue, 6 Aug 2024 21:47:56 +0500 Subject: [PATCH] added new contract types --- src/handler/evm/utils/listenForLockEvents.ts | 10 +++++----- src/handler/ton/utils/addSelfAsValidator.ts | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/handler/evm/utils/listenForLockEvents.ts b/src/handler/evm/utils/listenForLockEvents.ts index 29c9ca61..93f4d29e 100644 --- a/src/handler/evm/utils/listenForLockEvents.ts +++ b/src/handler/evm/utils/listenForLockEvents.ts @@ -36,12 +36,11 @@ const listenForLockEvents = ( Bridge__factory.createInterface().getEvent("Locked").topicHash, ], }); - + logger.trace( + `From block: ${lastBlock} to: ${latestBlock}. Tx Count ${logs.length}`, + chainIdent, + ); if (!logs.length) { - logger.trace( - `No Transactions found in chain from block: ${lastBlock} to: ${latestBlock}. Waiting for 10 Seconds before looking for new transactions`, - chainIdent, - ); lastBlock = latestBlock + 1; await em.upsert(Block, { chain: chainIdent, @@ -64,6 +63,7 @@ const listenForLockEvents = ( listenerChain: chainIdent, }); if (found) { + logger.info("Transaction already processed"); continue; } await cb( diff --git a/src/handler/ton/utils/addSelfAsValidator.ts b/src/handler/ton/utils/addSelfAsValidator.ts index fe3e3f41..2c313e46 100644 --- a/src/handler/ton/utils/addSelfAsValidator.ts +++ b/src/handler/ton/utils/addSelfAsValidator.ts @@ -79,7 +79,7 @@ export default async function addSelfAsValidator( $$type: "SignerAndSignature", key: signerPublicKeyBigInt, signature: beginCell() - .storeBuffer(Buffer.from(item.signature, "hex")) + .storeBuffer(Buffer.from(item.signature.replace("0x", ""), "hex")) .endCell(), }; sigs.set(BigInt(index), sig); @@ -101,7 +101,7 @@ export default async function addSelfAsValidator( newValidatorAddress: wallet.address, sigs, len: beginCell() - .storeUint(sigs.keys.length, 256) + .storeUint(sigs.size, 256) .endCell() .beginParse() .loadUintBig(256),