-
Notifications
You must be signed in to change notification settings - Fork 316
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 (#4936)
## Describe your changes This adds two flags: ``` --indexing-denom <INDEXING_DENOM> The denom to use for indexing related components, of the form passet1... [default: passet1w6e7fvgxsy6ccy3m8q0eqcuyw6mh3yzqu3uq9h58nu8m8mku359spvulf6 ``` for setting the denom used for indexing (instead of USDC) and ``` --dex-ex-min-liquidity <DEX_EX_MIN_LIQUIDITY> The minimum liquidity for the indexing denom in the dex explorer app view [default: 100000000] ``` for overriding the minimum liquidity in terms of that asset for a pair to be considered in the aggregate dex explorer summary. Closes #4920. For testing, we can try running this against the testnet with different values. ## Checklist before requesting a review - [x] I have added guiding text to explain how a reviewer should test these changes. - [x] If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. Otherwise, I declare my belief that there are not consensus-breaking changes, for the following reason: > indexing
- Loading branch information
1 parent
41c9a80
commit 8ef6294
Showing
4 changed files
with
30 additions
and
22 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
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_sdk_asset::asset::Id::from_str( | ||
// USDC | ||
"passet1w6e7fvgxsy6ccy3m8q0eqcuyw6mh3yzqu3uq9h58nu8m8mku359spvulf6", | ||
) | ||
.expect("should be able to parse passet"), | ||
1000.0 * 1_000_000.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_sdk_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