Repository: unionlabs/union
File: hubble/src/indexer/aptos/fetcher_client.rs (Rust)

Code before:
                Err(err) => return Err(err.into()),
            };

            result.extend(chunk_transactions);
        }

        trace!(
            "fetched transactions for block {} - versions: [{},{}] - transactions: {}",
            block.block_height,
            block.first_version,
            block.last_version,
            result.len()
        );

        Ok(result)
    }

    pub async fn fetch_transactions_one_by_one(
        &self,
        block: &Block,
        chunk_start_inclusive: u64,
        chunk_end_exclusive: u64,
        provider_id: RpcProviderId,
    ) -> Result<Vec<Transaction>, IndexerError> {
        info!(
            "{}: payload to big for chunk - versions: [{}, {}] => fetching one by one",
            block.block_height,
            chunk_start_inclusive,
            chunk_end_exclusive - 1
        );

        let mut result = Vec::with_capacity(self.tx_search_max_page_size as usize);

        for transaction_index in chunk_start_inclusive..chunk_end_exclusive {
            trace!(
                "fetching chunk for block {} - versions: [{},{}] - one by one: {}",
                block.block_height,
                chunk_start_inclusive,
                chunk_end_exclusive - 1,
                transaction_index,
            );

            result.extend(
                self.provider
                    .get_transactions(transaction_index, 1, Some(provider_id))
                    .await?
                    .response
                    .inner()
                    .clone(),
            );
        }

Review comment (suggestion):
```suggestion
            "{}: payload too big for chunk - versions: [{}, {}] => fetching one by one",
```

Code after:
                Err(err) => return Err(err.into()),
            };

            result.extend(chunk_transactions);
        }

        trace!(
            "fetched transactions for block {} - versions: [{},{}] - transactions: {}",
            block.block_height,
            block.first_version,
            block.last_version,
            result.len()
        );

        Ok(result)
    }

    pub async fn fetch_transactions_one_by_one(
        &self,
        block: &Block,
        chunk_start_inclusive: u64,
        chunk_end_exclusive: u64,
        provider_id: RpcProviderId,
    ) -> Result<Vec<Transaction>, IndexerError> {
        info!(
            "{}: payload too big for chunk - versions: [{}, {}] => fetching one by one",
            block.block_height,
            chunk_start_inclusive,
            chunk_end_exclusive - 1
        );

        let mut result = Vec::with_capacity(self.tx_search_max_page_size as usize);

        for transaction_index in chunk_start_inclusive..chunk_end_exclusive {
            trace!(
                "fetching chunk for block {} - versions: [{},{}] - one by one: {}",
                block.block_height,
                chunk_start_inclusive,
                chunk_end_exclusive - 1,
                transaction_index,
            );

            result.extend(
                self.provider
                    .get_transactions(transaction_index, 1, Some(provider_id))
                    .await?
                    .response
                    .inner()
                    .clone(),
            );
        }