From 7a760f1627b3ba60aedb3e03c96233548285df14 Mon Sep 17 00:00:00 2001 From: BobTheBuidler Date: Mon, 8 Apr 2024 23:41:33 +0000 Subject: [PATCH] feat: filter 0 value transfers from treasury export --- scripts/exporters/treasury_transactions.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/exporters/treasury_transactions.py b/scripts/exporters/treasury_transactions.py index 2f51e51cc..011896a6a 100644 --- a/scripts/exporters/treasury_transactions.py +++ b/scripts/exporters/treasury_transactions.py @@ -53,9 +53,11 @@ def main() -> NoReturn: @a_sync(default='sync') async def load_new_txs(start_block: Block, end_block: Block) -> int: - futs = [] - async for entry in treasury.ledger._get_and_yield(start_block, end_block): - futs.append(asyncio.create_task(insert_treasury_tx(entry))) + futs = [ + asyncio.create_task(insert_treasury_tx(entry)) + async for entry in treasury.ledger._get_and_yield(start_block, end_block) + if entry.value + ] return sum(await tqdm_asyncio.gather(*futs, desc="Insert Txs to Postgres"))