Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

RPC account_nextIndex name is confusing #7429

Open
xlc opened this issue Oct 27, 2020 · 4 comments
Open

RPC account_nextIndex name is confusing #7429

xlc opened this issue Oct 27, 2020 · 4 comments
Labels
J0-enhancement An additional feature request.

Comments

@xlc
Copy link
Contributor

xlc commented Oct 27, 2020

We have RPC system_accountNextIndex / account_nextIndex, but the method is returning nonce.

#[rpc(name = "system_accountNextIndex", alias("account_nextIndex"))]
fn nonce(&self, account: AccountId) -> FutureResult<Index>;

And we have another AccountIndex

/// The type for looking up accounts. We don't expect more than 4 billion of them.
pub type AccountIndex = u32;

IMO account_nextIndex means give me the next AccountIndex, not the next account nonce.

Feel free to close this if I am the only one found this confusing.

@bkchr
Copy link
Member

bkchr commented Oct 27, 2020

So you mean it should be renamed to system_accountNextNonce?

@xlc
Copy link
Contributor Author

xlc commented Oct 27, 2020

Yes that's a better name to me.

@bkchr bkchr added the J0-enhancement An additional feature request. label Oct 28, 2020
@jaxter03
Copy link
Contributor

@bkchr can I pick this?

@bkchr
Copy link
Member

bkchr commented Nov 19, 2020

You can do this if you want. Make sure the old rpc name is still available.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
J0-enhancement An additional feature request.
Projects
None yet
Development

No branches or pull requests

3 participants