-
Notifications
You must be signed in to change notification settings - Fork 303
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pindexer: implement override for hardcoded values in app views
- Loading branch information
1 parent
ad95d8c
commit f794074
Showing
3 changed files
with
27 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,23 @@ | ||
use std::str::FromStr; | ||
|
||
pub trait IndexerExt: Sized { | ||
fn with_default_penumbra_app_views(self) -> Self; | ||
fn with_default_penumbra_app_views(self, options: &crate::Options) -> Self; | ||
} | ||
|
||
impl IndexerExt for cometindex::Indexer { | ||
fn with_default_penumbra_app_views(self) -> Self { | ||
fn with_default_penumbra_app_views(self, options: &crate::Options) -> Self { | ||
self.with_index(Box::new(crate::block::Block {})) | ||
.with_index(Box::new(crate::stake::ValidatorSet {})) | ||
.with_index(Box::new(crate::stake::Slashings {})) | ||
.with_index(Box::new(crate::stake::DelegationTxs {})) | ||
.with_index(Box::new(crate::stake::UndelegationTxs {})) | ||
.with_index(Box::new(crate::governance::GovernanceProposals {})) | ||
.with_index(Box::new(crate::dex_ex::Component::new( | ||
penumbra_asset::asset::Id::from_str( | ||
// USDC | ||
"passet1w6e7fvgxsy6ccy3m8q0eqcuyw6mh3yzqu3uq9h58nu8m8mku359spvulf6", | ||
) | ||
.expect("should be able to parse passet"), | ||
100.0 * 1000_0000.0, | ||
options.indexing_denom, | ||
options.dex_ex_min_liquidity as f64, | ||
))) | ||
.with_index(Box::new(crate::supply::Component::new())) | ||
.with_index(Box::new(crate::ibc::Component::new())) | ||
.with_index(Box::new(crate::insights::Component::new( | ||
penumbra_asset::asset::Id::from_str( | ||
// USDC | ||
"passet1w6e7fvgxsy6ccy3m8q0eqcuyw6mh3yzqu3uq9h58nu8m8mku359spvulf6", | ||
) | ||
.ok(), | ||
))) | ||
.with_index(Box::new(crate::insights::Component::new(Some( | ||
options.indexing_denom, | ||
)))) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters