From 44aac0009a04629b6aa34d30c9dc75534e772060 Mon Sep 17 00:00:00 2001 From: Just some guy <3859395+fubuloubu@users.noreply.github.com> Date: Thu, 18 Aug 2022 13:33:56 -0400 Subject: [PATCH] fix(HACK): bypass BlockAPI.transactions requests until #994 --- src/ape_cache/query.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/ape_cache/query.py b/src/ape_cache/query.py index 4ecf1e9157..34712dc887 100644 --- a/src/ape_cache/query.py +++ b/src/ape_cache/query.py @@ -224,9 +224,11 @@ def _compute_estimate_block_transaction_query( query: BlockTransactionQuery, result: CursorResult, ) -> Optional[int]: - if result.scalar() > 0: # type: ignore - # NOTE: Assume 200 msec to get data from database - return 200 + # TODO: Update `transactions` table schema so this query functions properly + # Uncomment below after https://github.com/ApeWorX/ape/issues/994 + # if result.scalar() > 0: # type: ignore + # # NOTE: Assume 200 msec to get data from database + # return 200 # Can't handle this query return None @@ -377,9 +379,11 @@ def _cache_update_clause(self, query: QueryType) -> Insert: def _cache_update_block_clause(self, query: BlockQuery) -> Insert: return insert(Blocks) # type: ignore - @_cache_update_clause.register - def _cache_update_block_txns_clause(self, query: BlockTransactionQuery) -> Insert: - return insert(Transactions) # type: ignore + # TODO: Update `transactions` table schema so we can use `EcosystemAPI.decode_receipt` + # Uncomment below after https://github.com/ApeWorX/ape/issues/994 + # @_cache_update_clause.register + # def _cache_update_block_txns_clause(self, query: BlockTransactionQuery) -> Insert: + # return insert(Transactions) # type: ignore @_cache_update_clause.register def _cache_update_events_clause(self, query: ContractEventQuery) -> Insert: