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

Codegen assumes presence of frame_system::AccountData #348

Closed
ascjones opened this issue Dec 2, 2021 · 1 comment
Closed

Codegen assumes presence of frame_system::AccountData #348

ascjones opened this issue Dec 2, 2021 · 1 comment

Comments

@ascjones
Copy link
Contributor

ascjones commented Dec 2, 2021

Currently the AccountData storage type is hardcoded:

pub type DefaultAccountData = self::system::storage::Account;
impl ::subxt::AccountData<::subxt::DefaultConfig> for DefaultAccountData {
fn nonce(result: &<Self as ::subxt::StorageEntry>::Value) -> <::subxt::DefaultConfig as ::subxt::Config>::Index {
result.nonce
}
fn storage_entry(account_id: <::subxt::DefaultConfig as ::subxt::Config>::AccountId) -> Self {
Self(account_id)
}
}

which is required for fetching the nonce for constructing the Extra data for an Extrinsic. It assumes the presence of the system pallet and that the AccountData type has a nonce field. So we should consider whether this should be made configurable, or at least detect if the system pallet is not present with that Storage entry. Currently we are assuming it is always there. https://github.com/paritytech/subxt

From #309

@Xanewok
Copy link
Contributor

Xanewok commented Oct 26, 2022

I understand that #409 fixed this; let's reopen this it's still relevant.

@Xanewok Xanewok closed this as completed Oct 26, 2022
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

No branches or pull requests

2 participants