Skip to content
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

[sdk] improve typing of splitCoins and make splitCoins have a concrete size #20665

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

hayes-mysten
Copy link
Contributor

@hayes-mysten hayes-mysten commented Dec 18, 2024

Description

fixes #20642

Test plan

How did you test the new or updated feature?


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):
  • Indexer:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:
  • REST API:

@hayes-mysten hayes-mysten requested a review from a team as a code owner December 18, 2024 00:56
Copy link

vercel bot commented Dec 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
multisig-toolkit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 18, 2024 0:58am
sui-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 18, 2024 0:58am
sui-kiosk ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 18, 2024 0:58am
sui-typescript-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 18, 2024 0:58am

@hayes-mysten hayes-mysten temporarily deployed to sui-typescript-aws-kms-test-env December 18, 2024 00:56 — with GitHub Actions Inactive
@hayes-mysten hayes-mysten changed the title [sdk] improve typing of splitCoins and make splitCoins have a concret… [sdk] improve typing of splitCoins and make splitCoins have a concrete size Dec 18, 2024
const index = this.#data.commands.push(command);
return createTransactionResult(index - 1, amounts.length) as Extract<
Argument,
{ Result: unknown }
Copy link
Contributor

Choose a reason for hiding this comment

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

Curious why the unknown on the results and nested results here

Copy link

Choose a reason for hiding this comment

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

Just copied these types from other places. Generally unknown works well with extract, the resulting type will preserve the more specific type without you having to know what it is

@hayes-mysten hayes-mysten merged commit 4f012b9 into main Dec 19, 2024
57 of 59 checks passed
@hayes-mysten hayes-mysten deleted the mh--coins-split-exlicit-length-iterator branch December 19, 2024 20:15
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.

splitCoins can not iterator
3 participants