Skip to content

Conversation

@jribbink
Copy link
Contributor

@jribbink jribbink commented Dec 23, 2025

Closes #2242

Description


For contributor use:

  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@github-actions
Copy link

github-actions bot commented Dec 23, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@codecov-commenter
Copy link

codecov-commenter commented Dec 23, 2025

Codecov Report

❌ Patch coverage is 64.28571% with 15 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/cadence/linter.go 64.28% 10 Missing and 5 partials ⚠️

📢 Thoughts on this report? Let us know!

@chasefleming chasefleming requested a review from Copilot December 29, 2025 21:38
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for the legacy Crypto identifier in the Cadence linter by enabling proper resolution of Crypto contract imports. The implementation follows the same pattern used for other standard library imports like Test and BlockchainHelpers.

  • Adds handling for stdlib.CryptoContractLocation in the import resolver
  • Includes test coverage for Crypto contract imports across different contexts

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
internal/cadence/linter.go Adds case handling for CryptoContractLocation to parse and check the Crypto contract when imported
internal/cadence/lint_test.go Adds test case and test file to verify Crypto import resolution works correctly

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +248 to 260
// Build contract name -> address mapping per network
for _, network := range *networks {
checkerAddr, err := l.state.ContractAddress(checkerContract, network)
if err != nil || checkerAddr == nil {
continue
contractNameToAddress := make(map[string]flowGo.Address)

// Add aliases first
contracts := l.state.Contracts()
if contracts != nil {
for _, contract := range *contracts {
if alias := contract.Aliases.ByNetwork(network.Name); alias != nil {
contractNameToAddress[contract.Name] = alias.Address
}
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This only resolved deployment contract addresses, but did not properly resolve dependencies. Noticed when testing against sample repo.

@jribbink jribbink merged commit f3ac7b9 into master Dec 29, 2025
9 checks passed
@jribbink jribbink deleted the jribbink/fix-crypto branch December 29, 2025 23:19
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.

flow cadence lint missing Crypto identifier

4 participants