Skip to content

cli(ptb): pure type inference looks through references#25405

Merged
amnn merged 1 commit intomainfrom
amnn/cli-ptb-pure-ref
Feb 10, 2026
Merged

cli(ptb): pure type inference looks through references#25405
amnn merged 1 commit intomainfrom
amnn/cli-ptb-pure-ref

Conversation

@amnn
Copy link
Copy Markdown
Contributor

@amnn amnn commented Feb 10, 2026

Description

Add support to the CLI to look "through" reference types when checking whether an argument is a pure type.

Test plan

The following invocation would have failed before, and now it succeeds:

$ cargo run --bin sui -- client ptb \
    --move-call 0x3::sui_system::validator_address_by_pool_id @0x5 @0x0cf0a8d13f56cb4c675a74f9f8e646dc7c3e00c5e50da0d6c076b291f57f617f \
    --dev-inspect

It failed previously because the argument was an &ID, but now the CLI can understand that and still serialize it as an address.


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: Fix an issue where the CLI would fail to infer the type of a primitive argument to a Move call if that argument was accessed by reference or by mutable reference.
  • Rust SDK:
  • Indexing Framework:

## Description

Add support to the CLI to look "through" reference types when checking
whether an argument is a pure type.

## Test plan

The following invocation would have failed before, and now it succeeds:

```
$ cargo run --bin sui -- client ptb \
    --move-call 0x3::sui_system::validator_address_by_pool_id @0x5 @0x0cf0a8d13f56cb4c675a74f9f8e646dc7c3e00c5e50da0d6c076b291f57f617f \
    --dev-inspect
```

It failed previously because the argument was an `&ID`, but now the CLI
can understand that and still serialize it as an `address`.
@amnn amnn requested review from a team and tzakian February 10, 2026 20:37
@amnn amnn self-assigned this Feb 10, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 10, 2026

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

Project Deployment Actions Updated (UTC)
sui-docs Ready Ready Preview, Comment Feb 10, 2026 8:40pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
multisig-toolkit Ignored Ignored Feb 10, 2026 8:40pm
sui-kiosk Ignored Ignored Feb 10, 2026 8:40pm

Request Review

@stefan-mysten
Copy link
Copy Markdown
Contributor

@amnn is this working now because sui client ptb uses sui-json under the hood? I was expecting that everything is migrated to gRPC, but maybe that still relies on sui-json?

@amnn
Copy link
Copy Markdown
Contributor Author

amnn commented Feb 10, 2026

No I don't think so, unless I'm missing something, sui-json usage is limited to some of the transaction building APIs for JSON-RPC, and it should stay that way, it does some pretty whacky stuff, IIRC.

@amnn amnn merged commit ac69424 into main Feb 10, 2026
59 checks passed
@amnn amnn deleted the amnn/cli-ptb-pure-ref branch February 10, 2026 22:42
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.

4 participants