Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 424aa1f

Browse files
author
Jorge Olivero
committed
subgraph validation: fix counting error for number of block handlers
1 parent e869d40 commit 424aa1f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

core/src/subgraph/validation.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use graph::prelude::*;
33
pub fn validate_manifest(
44
manifest: SubgraphManifest,
55
) -> Result<SubgraphManifest, SubgraphRegistrarError> {
6-
let mut validation_errs: Vec<SubgraphManifestValidationError> = Vec::new();
7-
6+
let mut validation_errs: Vec<SubgraphManifestValidationError> = Vec::new();
7+
88
// Validate that the manifest has a `source` address in each data source
99
// which has call or block handlers
1010
let has_invalid_data_source = manifest.data_sources.iter().any(|data_source| {
@@ -32,8 +32,9 @@ pub fn validate_manifest(
3232
.for_each(|block_handler| {
3333
if block_handler.filter.is_none() {
3434
non_filtered_block_handler_count += 1
35+
} else {
36+
call_filtered_block_handler_count += 1
3537
}
36-
call_filtered_block_handler_count += 1
3738
});
3839
return non_filtered_block_handler_count > 1 || call_filtered_block_handler_count > 1;
3940
});
@@ -42,7 +43,9 @@ pub fn validate_manifest(
4243
}
4344

4445
if validation_errs.is_empty() {
45-
return Ok(manifest)
46+
return Ok(manifest);
4647
}
47-
return Err(SubgraphRegistrarError::ManifestValidationError(validation_errs))
48+
return Err(SubgraphRegistrarError::ManifestValidationError(
49+
validation_errs,
50+
));
4851
}

0 commit comments

Comments
 (0)