Skip to content

[lint] Allow building for WASM, and add support for the Crypto contract - #649

Merged
turbolent merged 3 commits into
masterfrom
bastian/lint-wasm-and-crypto
Aug 24, 2026
Merged

turbolent merged 3 commits into
masterfrom
bastian/lint-wasm-and-crypto

Conversation

@turbolent

Copy link
Copy Markdown
Member

Description

The linter can no longer be built for WASM: AnalyzeAccount and AnalyzeTransaction use the Flow Go SDK's gRPC access client, which depends on github.com/onflow/crypto, which dropped its non-cgo build mode.

This blocks the language server, which links the linter, in #648.

  • Move the SDK-based functionality into network.go, which is not built for WASM. The API is unchanged for all other targets.

  • Add support for the Crypto contract: the analysis now provides the contract's code, so programs which import it can be analyzed. Before, analyzing such a program failed with cannot find crypto contract.

    The code is a copy of the contract in flow-core-contracts, lint/Crypto.cdc, because the flow-core-contracts Go package depends on the Flow Go SDK again.

    TestCryptoContractCode checks that the copy stays identical to the original. It is exported as CryptoContractCode, for the language server's WASM build.


  • 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

@turbolent turbolent self-assigned this Aug 24, 2026
@turbolent
turbolent requested a review from a team as a code owner August 24, 2026 20:46
@turbolent turbolent added the Improvement Technical work without new features, refactoring, improving tests label Aug 24, 2026
@turbolent
turbolent force-pushed the bastian/lint-wasm-and-crypto branch from 34a6c6a to 62aa1d8 Compare August 24, 2026 20:51
@turbolent
turbolent enabled auto-merge August 24, 2026 20:53

@SupunS SupunS left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good idea!

@turbolent
turbolent merged commit 9d6ba69 into master Aug 24, 2026
20 checks passed
@turbolent
turbolent deleted the bastian/lint-wasm-and-crypto branch August 24, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Improvement Technical work without new features, refactoring, improving tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants