Skip to content

[move][move-compiler][sui-lint] Add a lint to match the new PTB restrictions - #27767

Open
cgswords wants to merge 1 commit into
mainfrom
cgswords/txcontext-usage-lint-compiler
Open

[move][move-compiler][sui-lint] Add a lint to match the new PTB restrictions#27767
cgswords wants to merge 1 commit into
mainfrom
cgswords/txcontext-usage-lint-compiler

Conversation

@cgswords

@cgswords cgswords commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Description

Follow-up to #27451: the uncallable_function lint already warns on the parameter-side TxContext rules (by-value, duplicate &mut, &mut mixed with &), so this adds the missing return-position rule.

Test plan

New true-positive, true-negative, and suppression cases in the uncallable_functions linter tests.


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • gRPC:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • Indexing Framework:

…tions

The uncallable_function lint already covers the parameter-side TxContext
rules (by-value, duplicate '&mut', '&mut' mixed with '&'). Extend it with
the return-position rule from the PTB signature restrictions
(ptb_tx_context_restrictions): TxContext may never appear in the return
type of a function callable from a transaction, by value or by reference.
Private helpers returning references derived from a TxContext parameter
are unaffected.
@cgswords
cgswords deployed to sui-typescript-aws-kms-test-env August 20, 2026 06:22 — with GitHub Actions Active
@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
sui-docs Ready Ready Preview Aug 20, 2026 6:24am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
multisig-toolkit Ignored Ignored Preview Aug 20, 2026 6:24am
sui-kiosk Ignored Ignored Preview Aug 20, 2026 6:24am

Request Review

@cgswords
cgswords requested a review from tnowacki August 20, 2026 06:30
@cgswords
cgswords marked this pull request as ready for review August 20, 2026 06:32
@cgswords
cgswords deployed to sui-typescript-aws-kms-test-env August 20, 2026 06:32 — with GitHub Actions Active
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.

1 participant