Skip to content
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

feat(queries): Transaction and block predicates #5025

Merged

Conversation

DCNick3
Copy link
Contributor

@DCNick3 DCNick3 commented Sep 2, 2024

Context

Closes #5017, Closes #4985.

Solution

With the new predicates, you can now filter blocks by their hash and transactions:

  • by their hash
  • by hash of their block
  • by the account id of the transaction submitter

Or any boolean combination of the above.

This removes FindTransactionsByAccountId, FindTransactionByHash and FindBlockHeaderByHash.

Migration Guide

  • FindTransactionsByAccountId:
query(FindTransactions::new()).filter_with(|tx| tx.transaction.value.authority.eq(needle_account_id))
  • FindTransactionByHash:
query(FindTransactions::new()).filter_with(|tx| tx.transaction.value.hash.eq(needle_hash))
  • FindBlockHeaderByHash:
query(FindBlockHeaders::new()).filter_with(|header| header.hash.eq(needle_hash))

Checklist

@github-actions github-actions bot added the api-changes Changes in the API for client libraries label Sep 2, 2024
@DCNick3 DCNick3 self-assigned this Sep 3, 2024
@Erigara Erigara self-assigned this Sep 3, 2024
@DCNick3 DCNick3 added the queries label Sep 3, 2024
@DCNick3 DCNick3 force-pushed the transaction-and-block-predicates branch from 97a47de to 5b63359 Compare September 4, 2024 06:36
- based on the hash of the transaction
- based on the hash of the block
- based on whether it has finished with an error

Signed-off-by: ⭐️NINIKA⭐️ <[email protected]>
…, update tests, regenerate schema

Signed-off-by: ⭐️NINIKA⭐️ <[email protected]>
@mversic mversic force-pushed the transaction-and-block-predicates branch from 5b63359 to bff9350 Compare September 5, 2024 05:44
@mversic mversic merged commit 8bc3064 into hyperledger-iroha:main Sep 5, 2024
13 of 14 checks passed
@alexstroke1 alexstroke1 self-assigned this Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-changes Changes in the API for client libraries queries
Projects
None yet
4 participants