fix(tokengen): inject the public params into the chaincode package - #2208
Merged
Conversation
AkramBitar
force-pushed
the
tokengen
branch
3 times, most recently
from
August 12, 2026 17:25
f11dfbe to
5de7190
Compare
GeneratePackage matched the suffix
github.com/LFDT-Panurus/panurus/token/tcc/params.go
but the file holding the public parameters lives at
token/services/network/fabric/tcc/params.go
(the token/tcc layout is a leftover of the token-sdk move). The packager
passes the absolute path of every file it packages, so the replacer never
fired and `tokengen ... --cc` produced a package still carrying the
placeholder `var Params = ``', i.e. a token chaincode without public
parameters.
The integration harness got this right, so the two definitions had
silently drifted apart. Move the chaincode import path, the params file
suffix and the params template into a single package in the root module,
shared by tokengen and by the harness, and use it on both sides.
Cover the replacer with a test that fails on the old suffix.
Signed-off-by: Marcus Brandenburger <bur@zurich.ibm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GeneratePackage matched the suffix
but the file holding the public parameters lives at
(the token/tcc layout is a leftover of the token-sdk move). The packager passes the absolute path of every file it packages, so the replacer never fired and
tokengen ... --ccproduced a package still carrying the placeholder `var Params = ``', i.e. a token chaincode without public parameters.The integration harness got this right, so the two definitions had silently drifted apart. Move the chaincode import path, the params file suffix and the params template into a single package in the root module, shared by tokengen and by the harness, and use it on both sides.
Cover the replacer with a test that fails on the old suffix.
Fixes #2202