-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
splitCoins can not iterator #20642
Comments
The sdk currently returns an infinite iterator for any result type. This is because the result type is shared between commands like splitCoins and the moveCall command. For move calls we don't actually know the number of nested results are unknown until after the transaction executes. For splitCoins specifically, we should be able to know the number of coins created, but currently we haven't special-cased this, so it returns the same infinite iterator used by the moveCall command. |
the iterator of split return , it's length can be known from the param 'amounts' . so this can be fixed , am i right ? |
Yes, this is something that can be fixed |
…e size (#20665) ## 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:
const sps = txb.splitCoins(coin, amounts);
for (const item of sps) {
.... ....
}
the 'for' loop can not be ended , why ? 'sps' with unlimited length ?
The text was updated successfully, but these errors were encountered: