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(provider): receipt and transaction by id in BlockchainProvider2 #10281

Merged
merged 8 commits into from
Aug 15, 2024

Conversation

shekhirin
Copy link
Collaborator

@shekhirin shekhirin commented Aug 13, 2024

Addresses #10182 and #10181, but only parts with point queries

@github-actions github-actions bot added A-blockchain-tree Related to sidechains, reorgs and pending blocks A-db Related to the database C-bug An unexpected or incorrect behavior labels Aug 13, 2024
@shekhirin shekhirin force-pushed the alexey/blockchain-provider-receipt-id branch from 3848141 to 270c2eb Compare August 13, 2024 19:57
@shekhirin shekhirin force-pushed the alexey/blockchain-provider-receipt-id branch from 270c2eb to c20bb0e Compare August 13, 2024 20:09
@shekhirin shekhirin changed the title feat(provider): receipt by id in blockchainprovider2 feat(provider): receipt and transaction by id in blockchainprovider2 Aug 13, 2024
@shekhirin shekhirin changed the title feat(provider): receipt and transaction by id in blockchainprovider2 feat(provider): receipt and transaction by id in BlockchainProvider2 Aug 13, 2024
@shekhirin shekhirin marked this pull request as ready for review August 13, 2024 20:18
@shekhirin shekhirin requested review from Rjected and mattsse August 13, 2024 20:18
fn block_number_by_tx_id(
&self,
id: TxNumber,
) -> ProviderResult<Option<(BlockNumber, usize, bool)>> {
Copy link
Collaborator Author

@shekhirin shekhirin Aug 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe an enum is better?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When it is in memory, could we just return the entire BlockState as well as the tx index here, rather than just the block number? That way the calling methods do not need to fetch the state again

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah right, fixed

fn block_number_by_tx_id(
&self,
id: TxNumber,
) -> ProviderResult<Option<(BlockNumber, usize, bool)>> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When it is in memory, could we just return the entire BlockState as well as the tx index here, rather than just the block number? That way the calling methods do not need to fetch the state again

@shekhirin shekhirin requested a review from Rjected August 14, 2024 16:34
@shekhirin shekhirin added C-enhancement New feature or request and removed C-bug An unexpected or incorrect behavior labels Aug 14, 2024
Copy link
Member

@Rjected Rjected left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@shekhirin shekhirin requested a review from fgimenez August 15, 2024 18:18
Copy link
Member

@fgimenez fgimenez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@shekhirin shekhirin added this pull request to the merge queue Aug 15, 2024
Merged via the queue into main with commit 821d3e6 Aug 15, 2024
34 checks passed
@shekhirin shekhirin deleted the alexey/blockchain-provider-receipt-id branch August 15, 2024 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-blockchain-tree Related to sidechains, reorgs and pending blocks A-db Related to the database C-enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants