File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,11 @@ pub fn validate_manifest(
5
5
) -> Result < SubgraphManifest , SubgraphRegistrarError > {
6
6
let mut errors: Vec < SubgraphManifestValidationError > = Vec :: new ( ) ;
7
7
8
+ // Validate that the manifest has at least one data source
9
+ if manifest. data_sources . is_empty ( ) {
10
+ errors. push ( SubgraphManifestValidationError :: NoDataSources ) ;
11
+ }
12
+
8
13
// Validate that the manifest has a `source` address in each data source
9
14
// which has call or block handlers
10
15
let has_invalid_data_source = manifest. data_sources . iter ( ) . any ( |data_source| {
Original file line number Diff line number Diff line change @@ -321,6 +321,8 @@ pub enum SubgraphAssignmentProviderEvent {
321
321
322
322
#[ derive( Fail , Debug ) ]
323
323
pub enum SubgraphManifestValidationError {
324
+ #[ fail( display = "subgraph has no data sources" ) ]
325
+ NoDataSources ,
324
326
#[ fail( display = "subgraph source address is required" ) ]
325
327
SourceAddressRequired ,
326
328
#[ fail( display = "subgraph cannot index data from different Ethereum networks" ) ]
You can’t perform that action at this time.
0 commit comments