-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Add history_blocks to manifest #5032
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -187,6 +187,58 @@ specVersion: 0.0.2 | |
assert_eq!(12345, graft.block); | ||
} | ||
|
||
#[tokio::test] | ||
async fn parse_indexer_hints() { | ||
const YAML: &str = " | ||
dataSources: [] | ||
schema: | ||
file: | ||
/: /ipfs/Qmschema | ||
graft: | ||
base: Qmbase | ||
block: 12345 | ||
specVersion: 0.0.2 | ||
indexerHints: | ||
prune: | ||
historyBlocks: 100 | ||
"; | ||
|
||
let manifest = resolve_manifest(YAML, SPEC_VERSION_0_0_4).await; | ||
|
||
assert_eq!("Qmmanifest", manifest.id.as_str()); | ||
assert_eq!( | ||
manifest | ||
.indexer_hints | ||
.unwrap() | ||
.prune | ||
.unwrap() | ||
.history_blocks | ||
.unwrap(), | ||
100 | ||
); | ||
} | ||
|
||
#[tokio::test] | ||
async fn parse_indexer_hints_prune() { | ||
const YAML: &str = " | ||
dataSources: [] | ||
schema: | ||
file: | ||
/: /ipfs/Qmschema | ||
graft: | ||
base: Qmbase | ||
block: 12345 | ||
specVersion: 0.0.2 | ||
indexerHints: | ||
prune: | ||
"; | ||
|
||
let manifest = resolve_manifest(YAML, SPEC_VERSION_0_0_4).await; | ||
|
||
assert_eq!("Qmmanifest", manifest.id.as_str()); | ||
assert!(manifest.indexer_hints.unwrap().prune.is_some()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand this test - what is this trying to ensure? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh i used that test to test out the indexer_hints parsing is working properly. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will remove it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. its was removed already. merging There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a comment what the intent of the test was would have been fine, too - it was just a bit confusing. |
||
} | ||
|
||
#[test] | ||
fn graft_failed_subgraph() { | ||
const YAML: &str = " | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@leoyvens how does this look? If we have ongoing pruning do we need to the
prune
hint to do the manual pruning?