-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated the query to return all relevant transactions #9719
Updated the query to return all relevant transactions #9719
Conversation
Signed-off-by: Harsh Sawarkar <harshsawarkar111@gmail.com>
…evant-Transactions
Signed-off-by: Harsh Sawarkar <harshsawarkar111@gmail.com>
hedera-mirror-rest/transactions.js
Outdated
@@ -344,7 +345,8 @@ const getTransferDistinctTimestampsQuery = ( | |||
|
|||
// the condition to exclude synthetic transactions attached to a user submitted transaction | |||
const transactionByPayerExcludeSyntheticCondition = `${Transaction.getFullName(Transaction.NONCE)} = 0 or | |||
${Transaction.getFullName(Transaction.PARENT_CONSENSUS_TIMESTAMP)} is not null`; | |||
${Transaction.getFullName(Transaction.PARENT_CONSENSUS_TIMESTAMP)} is not null | |||
or ${Transaction.getFullName(Transaction.TYPE)} in (${typesToInclude.map((type) => `'${type}'`).join(', ')})`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once other comments are addressed, .map
can be removed. Also, we should only add condition if array is not empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should update the hedera-mirror-rest/__tests__/specs/transactions/account-id.json
spec test to include these types of transactions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
@@ -41,6 +41,10 @@ hedera: | |||
username: metrics | |||
uriPath: "/swagger" | |||
ipMetrics: false | |||
transactions: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be the protoId of these types. See TransactionType.java
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, should move this config to be under the query
config and change typesToInclude
to precedingTransactionTypes
and add config prop to configuration.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
…lude these transactions, and revised configuration.md. Signed-off-by: Harsh Sawarkar <harshsawarkar111@gmail.com>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9719 +/- ##
=============================================
- Coverage 92.23% 77.13% -15.11%
+ Complexity 7628 819 -6809
=============================================
Files 937 325 -612
Lines 32121 10801 -21320
Branches 4070 1464 -2606
=============================================
- Hits 29626 8331 -21295
- Misses 1542 2154 +612
+ Partials 953 316 -637 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
hedera-mirror-rest/transactions.js
Outdated
@@ -46,6 +46,7 @@ const { | |||
response: { | |||
limit: {default: defaultResponseLimit}, | |||
}, | |||
transactions: {typesToInclude}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
needs to be changed to precedingTransactionTypes
docs/configuration.md
Outdated
@@ -542,6 +542,7 @@ value, it is recommended to only populate overridden properties in the custom `a | |||
| `hedera.mirror.rest.query.maxTransactionsTimestampRange` | 60d | The maximum timestamp range to list transactions. | | |||
| `hedera.mirror.rest.query.strictTimestampParam` | true | Enables strict checking of timestamp query param (currently only effects /api/v1/accounts/{id}?timestamp={timestamp} | | |||
| `hedera.mirror.rest.query.topicMessageLookup` | false | Enables topic message lookup querying | | |||
| 'hedera.mirror.rest.query.transactions.precedingTransactionTypes' | [11, 15] | An array of protoIds that specifies transactions to be prioritized for inclusion in the response | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to: Array of transaction types to be included in transactions by account id response when there is no parent and nonce is non-zero'
hedera-mirror-rest/config.js
Outdated
@@ -188,6 +188,13 @@ const parseNetworkConfig = () => { | |||
} | |||
}; | |||
|
|||
const parseTransactionConfig = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can parse this in parseQueryConfig
Signed-off-by: Harsh Sawarkar <harshsawarkar111@gmail.com>
Signed-off-by: Harsh Sawarkar <harshsawarkar111@gmail.com>
…evant-Transactions Signed-off-by: Harsh Vinod Sawarkar <harshsawarkar111@gmail.com>
Signed-off-by: Harsh Sawarkar <harshsawarkar111@gmail.com>
Signed-off-by: Harsh Sawarkar <harshsawarkar111@gmail.com>
Signed-off-by: Harsh Sawarkar <harshsawarkar111@gmail.com>
…turn-All-Relevant-Transactions' into chore-Transactions-API-Should-Return-All-Relevant-Transactions # Conflicts: # docs/configuration.md
Description:
Modified the query to return all relevant transaction
Related issue(s):
Fixes #9606
Notes for reviewer:
Checklist