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

chore(dips): add rpc and db feature flags to indexer-dips crate #636

Merged
merged 1 commit into from
Feb 17, 2025

Conversation

LNSD
Copy link
Contributor

@LNSD LNSD commented Feb 17, 2025

This pull request includes various changes to the crates/dips package to introduce feature flags and improve modularity. The key changes involve adding feature flags for optional dependencies, modifying the build script to conditionally compile based on features, and updating imports and module definitions accordingly.

Feature Flags and Dependencies:

  • Added feature flags rpc and db in Cargo.toml to conditionally include dependencies ([crates/dips/Cargo.tomlR6-R35](https://github.com/graphprotocol/indexer-rs/pull/636/files#diff-271b41f6df2e65a887a3a18cd20536fb075df359339939c77d15843c117a070cR6-R35)).
  • Updated dependencies in Cargo.toml to be optional based on the feature flags ([crates/dips/Cargo.tomlR6-R35](https://github.com/graphprotocol/indexer-rs/pull/636/files#diff-271b41f6df2e65a887a3a18cd20536fb075df359339939c77d15843c117a070cR6-R35)).

Build Script:

  • Modified build.rs to conditionally compile proto files if the rpc feature is enabled ([[1]](https://github.com/graphprotocol/indexer-rs/pull/636/files#diff-708ee7d06e2e6e35b9419c852e467adcc59e77d759acd12bcd6988aab627dba7R5-R8), [[2]](https://github.com/graphprotocol/indexer-rs/pull/636/files#diff-708ee7d06e2e6e35b9419c852e467adcc59e77d759acd12bcd6988aab627dba7R23)).

Codebase Updates:

  • Updated imports in database.rs and ipfs.rs to use async_trait from the async_trait crate instead of axum or tonic ([[1]](https://github.com/graphprotocol/indexer-rs/pull/636/files#diff-c8af91422fb1ed010565eac4fda150897bfbdba657084c76787d871da0fd27faL6-R6), [[2]](https://github.com/graphprotocol/indexer-rs/pull/636/files#diff-ca88c155ef694ceb70a734514fba168b1bd873c4efc481be50c7b8dab0b59aaaR6-L11)).
  • Conditionally included modules database, proto, and server in lib.rs based on feature flags ([crates/dips/src/lib.rsR16-R22](https://github.com/graphprotocol/indexer-rs/pull/636/files#diff-43049e4db6e400dbf78fe60574626cb162e14dbb774b13f92bc9b05b68d08830R16-R22)).
  • Added a conditional implementation of From<DipsError> for tonic::Status if the rpc feature is enabled ([crates/dips/src/lib.rsR171](https://github.com/graphprotocol/indexer-rs/pull/636/files#diff-43049e4db6e400dbf78fe60574626cb162e14dbb774b13f92bc9b05b68d08830R171)).

@LNSD LNSD self-assigned this Feb 17, 2025
@mangas mangas merged commit e9f7d1a into graphprotocol:main Feb 17, 2025
10 checks passed
@LNSD LNSD deleted the feat-dips-add-feature-flags branch February 18, 2025 08:43
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.

2 participants