Skip to content

Commit 3fa2413

Browse files
committed
fix protogen on imported modules not referenced
1 parent aa11f72 commit 3fa2413

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

docs/release-notes/change-log.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ All notable changes to this project will be documented in this file.
99

1010
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1111

12-
## Unreleased
12+
## v1.17.2
1313

1414
## Server
1515

@@ -27,6 +27,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
2727

2828
* Fixed `substreams init` to correctly showing selected label when selecting from a list of items.
2929

30+
* Fixed `substreams protogen` when params are defined on networks for imported modules that are not dependencies to any local module
31+
3032
### Server
3133

3234
* Fix a panic (nil pointer) when skipping blocks via indexes on stores on tier2

manifest/package.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,20 @@ func removeUnusedImportedModules(pkg *pbsubstreams.Package, manif *Manifest) {
371371
}
372372
}
373373

374+
// also remove unused network parameters and initial blocks
375+
for _, nets := range pkg.Networks {
376+
for mod := range nets.Params {
377+
if !moduleSet[mod] {
378+
delete(nets.Params, mod)
379+
}
380+
}
381+
for mod := range nets.InitialBlocks {
382+
if !moduleSet[mod] {
383+
delete(nets.InitialBlocks, mod)
384+
}
385+
}
386+
}
387+
374388
pkg.Modules.Modules = newModules
375389
pkg.ModuleMeta = newModuleMeta
376390
}

0 commit comments

Comments
 (0)