Skip to content

Commit 7db7e20

Browse files
committed
gnd: (WIP) tentative fix for integration test failure
Still need to clean up the Manifest.subgraph_sources vs data_sources mess Eventually fixup 'gnd: Extract shared manifest and watch modules'
1 parent 827f120 commit 7db7e20

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

gnd/src/manifest.rs

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ pub struct SubgraphSource {
6969

7070
impl Manifest {
7171
/// Returns the total count of all data sources (regular + subgraph).
72+
/// Note: Subgraph data sources are included in `data_sources`.
7273
pub fn total_source_count(&self) -> usize {
73-
self.data_sources.len() + self.subgraph_sources.len()
74+
self.data_sources.len()
7475
}
7576
}
7677

@@ -141,7 +142,7 @@ pub fn load_manifest(path: &Path) -> Result<Manifest> {
141142
.unwrap_or("ethereum/contract");
142143

143144
if kind == "subgraph" {
144-
// Subgraph data source - extract the name and IPFS address
145+
// Subgraph data source - extract for codegen
145146
let name = ds
146147
.get("name")
147148
.and_then(|n| n.as_str())
@@ -158,6 +159,10 @@ pub fn load_manifest(path: &Path) -> Result<Manifest> {
158159
address: address.to_string(),
159160
});
160161
}
162+
// Also include in data_sources for the build command
163+
if let Some(parsed) = parse_data_source(ds, kind) {
164+
data_sources.push(parsed);
165+
}
161166
} else {
162167
// Regular data source (ethereum/contract, etc.)
163168
if let Some(parsed) = parse_data_source(ds, kind) {
@@ -448,8 +453,11 @@ dataSources:
448453
fs::write(&manifest_path, manifest_content).unwrap();
449454

450455
let manifest = load_manifest(&manifest_path).unwrap();
451-
assert_eq!(manifest.data_sources.len(), 1);
452-
assert_eq!(manifest.data_sources[0].name, "Token");
456+
// Subgraph sources are included in both data_sources and subgraph_sources
457+
assert_eq!(manifest.data_sources.len(), 2);
458+
assert_eq!(manifest.data_sources[0].name, "SourceSubgraph");
459+
assert_eq!(manifest.data_sources[0].kind, "subgraph");
460+
assert_eq!(manifest.data_sources[1].name, "Token");
453461
assert_eq!(manifest.subgraph_sources.len(), 1);
454462
assert_eq!(manifest.subgraph_sources[0].name, "SourceSubgraph");
455463
assert_eq!(manifest.subgraph_sources[0].address, "QmSourceHash123");

0 commit comments

Comments
 (0)