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: BlockchainDbMeta builder #22

Merged
merged 7 commits into from
Sep 26, 2024
Merged

feat: BlockchainDbMeta builder #22

merged 7 commits into from
Sep 26, 2024

Conversation

yash-atreya
Copy link
Member

@yash-atreya yash-atreya commented Sep 26, 2024

Motivation

Ref #21

Solution

Adds builder methods to instantiate BlockchainDbMeta

 let block =
        provider.get_block(BlockId::latest(), BlockTransactionsKind::Hashes).await?.unwrap();

 let meta = BlockchainDbMeta::default()
        .with_chain_id(31337)
        .with_block(block.inner)
        .with_url(anvil.endpoint());

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

@yash-atreya
Copy link
Member Author

yash-atreya commented Sep 26, 2024

This is not breaking, keeping the BlockchainDbMeta::new() method as is.

Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

type nits

src/cache.rs Outdated Show resolved Hide resolved
src/cache.rs Outdated Show resolved Hide resolved
yash-atreya and others added 3 commits September 26, 2024 14:11
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
@mattsse

This comment was marked as resolved.

@mattsse mattsse merged commit 58b7ce2 into main Sep 26, 2024
16 checks passed
@mattsse mattsse deleted the yash/blockchain-db-builder branch September 26, 2024 14:26
src/backend.rs Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants