From 1739e8593399e6e3cb80479f9004eb43b8a301a8 Mon Sep 17 00:00:00 2001 From: BobTheBuidler <70677534+BobTheBuidler@users.noreply.github.com> Date: Mon, 8 Apr 2024 19:45:31 -0400 Subject: [PATCH] feat: filter 0 value transfers from treasury export (#702) --- 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"))