feat: show transactions from and to intelligent contracts#1010
feat: show transactions from and to intelligent contracts#1010
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1010 +/- ##
==========================================
- Coverage 16.80% 16.73% -0.08%
==========================================
Files 127 127
Lines 10119 10164 +45
Branches 253 253
==========================================
Hits 1701 1701
- Misses 8333 8378 +45
Partials 85 85 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
| tx_processor = TransactionsProcessor(request_session) | ||
| multi_contract_trigger = [] | ||
| for tx in current_contract: | ||
| tx_data = tx_processor.get_transaction_by_hash(tx.hash) |
There was a problem hiding this comment.
why is this needed? tx is already the tx_data.
| .filter( | ||
| Transactions.type == TransactionType.RUN_CONTRACT, | ||
| Transactions.to_address == address, | ||
| Transactions.from_address.in_(contract_addresses), |
There was a problem hiding this comment.
Why do we need this check? Can't you write from_address or to_address == address?
There was a problem hiding this comment.
we probably do not need the transactiontype check, that can be taken out, I think it helps readability when it is explicit
| if (!contractAddress) return; | ||
|
|
||
| try { | ||
| const response = await rpcClient.call({ |
There was a problem hiding this comment.
the RPC call should be moved to a dedicated service layer.
| .filter( | ||
| Transactions.type == TransactionType.RUN_CONTRACT, | ||
| Transactions.to_address == address, | ||
| Transactions.from_address.in_(contract_addresses), |
There was a problem hiding this comment.
In the terminal I see this warning. Can you solve this?
/app/backend/protocol_rpc/endpoints.py:747: SAWarning: Coercing Subquery object into a select() for use in IN(); please pass a select() construct explicitly
Transactions.from_address.in_(contract_addresses),
| }, | ||
| (newAddress) => { | ||
| if (newAddress) { | ||
| fetchRelatedTransactions(newAddress); |
There was a problem hiding this comment.
I see the related transactions in the transactions list when I switch to another contract and back. Is this expected? I thought it would show it without pressing on another gpy file.
| } | ||
|
|
||
|
|
||
| def get_transactions_by_related_contract( |
There was a problem hiding this comment.
@Henadek this method includes too many things that are not the responsibility of the endpoints layer. Here, we should only do validations and calls to the other services and processors.


Fixes #988
What
Why
Testing done
Decisions made
Checks
Reviewing tips
User facing release notes