-
Notifications
You must be signed in to change notification settings - Fork 0
chore(deps): update module github.com/hyperledger/fabric-contract-api-go to v2 #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ toolchain go1.25.5 | |
|
|
||
| require ( | ||
| github.com/hyperledger/fabric-chaincode-go v0.0.0-20230731094759-d626e9ab09b9 | ||
| github.com/hyperledger/fabric-contract-api-go v1.2.2 | ||
| github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0 | ||
| github.com/hyperledger/fabric-contract-api-go/v2 v2.2.0 | ||
|
Comment on lines
+9
to
10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bug: The 🔍 Detailed AnalysisThe 💡 Suggested FixRemove one of the duplicate lines for 🤖 Prompt for AI AgentDid we get this right? 👍 / 👎 to inform future reviews. |
||
| github.com/hyperledger/fabric-protos-go v0.3.7 | ||
| github.com/stretchr/testify v1.11.1 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: The Go module was updated to v2 in
go.mod, but the import paths in.gofiles were not updated with the required/v2suffix, which will cause a build failure.Severity: CRITICAL | Confidence: High
🔍 Detailed Analysis
The
go.modfile was updated to use version 2 of thefabric-contract-api-godependency, but the import paths in the source code were not updated accordingly. Go's Semantic Import Versioning requires that for major versions v2 and above, the import path must include the version suffix (e.g.,/v2). The current code imports from the v1 path (github.com/hyperledger/fabric-contract-api-go/contractapi) while thego.modfile specifies the v2 module. This mismatch will cause a build failure because the compiler cannot resolve the specified imports.💡 Suggested Fix
Update the import paths in
src/assetTransfer.go,src/chaincode/smartcontract.go, andsrc/chaincode/smartcontract_test.gofrom"github.com/hyperledger/fabric-contract-api-go/contractapi"to"github.com/hyperledger/fabric-contract-api-go/v2/contractapi"to match the module version.🤖 Prompt for AI Agent
Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID:
7530241