Skip to content

fix(tokengen): inject the public params into the chaincode package - #2208

Merged
AkramBitar merged 1 commit into
LFDT-Panurus:mainfrom
mbrandenburger:tokengen
Aug 13, 2026
Merged

fix(tokengen): inject the public params into the chaincode package#2208
AkramBitar merged 1 commit into
LFDT-Panurus:mainfrom
mbrandenburger:tokengen

Conversation

@mbrandenburger

Copy link
Copy Markdown
Contributor

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.

Fixes #2202

@AkramBitar AkramBitar added this to the Q3/26 milestone Aug 12, 2026

@AkramBitar AkramBitar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@AkramBitar
AkramBitar force-pushed the tokengen branch 3 times, most recently from f11dfbe to 5de7190 Compare August 12, 2026 17:25
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>
@AkramBitar
AkramBitar merged commit 5a3ac10 into LFDT-Panurus:main Aug 13, 2026
150 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: tokengen --cc produces a chaincode package with empty public parameters

2 participants