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

Do not rely on balances pallet or particular type for AccountInfo #3669

Conversation

jflatow
Copy link

@jflatow jflatow commented Jun 17, 2021

No description provided.

@@ -19,9 +19,13 @@ interface Result {
}

function latestNonce (api: ApiInterfaceRx, address: string): Observable<Index> {
return api.derive.balances.account(address).pipe(
Copy link
Member

@jacogr jacogr Jun 18, 2021

Choose a reason for hiding this comment

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

This cannot be dropped - it means others for existing chains are not available anymore. To put this in context, with chains with system.account the nonce is stored there, so basically this PR will always return a zero index in those cases, which means the greater part of deployed chains won't work as-is.

In #3672 the checks are adjusted at the correct level, i.e. adjust the checks correctly with optional chaining and don't assume that when balances.account is not there, balances.freeBalances will be. (Same for system.accountNonce)

@kylezs
Copy link

kylezs commented Jun 18, 2021

Right now I'm encountering an issue that this PR seems to be looking to solve. There's an assumption made by this api client that the chain must use the balances pallet. The same assumption is being made by substrate-subxt, which is what brought me here.

Edit: I checked out this PR and it worked for me, was able to submit an extrinsic to our chain.

@jacogr
Copy link
Member

jacogr commented Oct 7, 2021

Closing. The paymentInfo derive does not rely on balances anymore. Rather the derive.balances.account will detect if the balances module is avilable.

@jacogr jacogr closed this Oct 7, 2021
@polkadot-js-bot
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@polkadot-js polkadot-js locked as resolved and limited conversation to collaborators Oct 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants