From 458ae7b6bf1b9bcd18984afd57154b5ab596b9d4 Mon Sep 17 00:00:00 2001 From: Nic Vyncke <95428380+nvy-0x@users.noreply.github.com> Date: Sat, 9 Nov 2024 11:19:07 -0500 Subject: [PATCH] feat(docs): finish docs for transaction.py (#93) Co-authored-by: BobTheBuidler --- eth_portfolio/_loaders/transaction.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/eth_portfolio/_loaders/transaction.py b/eth_portfolio/_loaders/transaction.py index 218fa200..aa3a349a 100644 --- a/eth_portfolio/_loaders/transaction.py +++ b/eth_portfolio/_loaders/transaction.py @@ -163,7 +163,7 @@ async def get_transaction_by_nonce_and_block( 2. Gnosis Safe deployments where the transaction's 'to' field is a specific address. Args: - address: The addresses of the accounts involved in the transaction. + address: The addresses of the accounts that sent the transaction. nonce: The nonce associated with the transaction creator. block: The block number from which to retrieve the transactions. @@ -287,6 +287,16 @@ async def _get_block_transactions(block: Block) -> List[evmspec.Transaction]: num_workers=1_000, name=f"{__name__}.get_block_transactions", ) +""" +A smart processing queue that retrieves transactions from blocks with managable concurrency. + +This queue processes the retrieval of block transactions using a limited number of workers to handle potentially overwhelming volume of transactions. +It wraps the _get_block_transactions function to provide efficient concurrent processing. + +Example: + >>> transactions = await get_block_transactions.process(block=12345678) + >>> [print(tx['hash']) for tx in transactions] +""" def _get_num_chunks(range_size: int) -> int: