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

Update examples and tutorials for deprecated index #2054

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions content/md/en/docs/reference/account-data-structures.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub type Account<T: Config> = StorageMap<
_,
Blake2_128Concat,
T::AccountId,
AccountInfo<T::Index, T::AccountData>,
AccountInfo<T::Nonce, T::AccountData>,
ValueQuery,
>;
```
Expand All @@ -29,7 +29,7 @@ The `StorageMap` for an `Account` consists of the following parameters:

- The first parameter (\_) is used in macro expansion.
- `Blake2_128Concat` specifies the hashing algorithm to use.
- `T::AccountId` is used as the key for over the `AccountInfo<T::Index, T::AccountData>` struct.
- `T::AccountId` is used as the key for over the `AccountInfo<T::Nonce, T::AccountData>` struct.

See [`StorageMap` API](https://paritytech.github.io/substrate/master/frame_support/storage/types/struct.StorageMap.html#impl) for details.

Expand All @@ -39,9 +39,9 @@ The `AccountInfo` for an account is defined in the [`frame_system` pallet](https

```rust
#[derive(Clone, Eq, PartialEq, Default, RuntimeDebug, Encode, Decode)]
pub struct AccountInfo<Index, AccountData> {
pub struct AccountInfo<Nonce, AccountData> {
/// The number of transactions this account has sent.
pub nonce: Index,
pub nonce: Nonce,
/// The number of other modules that currently depend on this account's existence. The account
/// cannot be reaped until this is zero.
pub consumers: RefCount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ To enable offchain workers to send signed transactions:
call: RuntimeCall,
public: <Signature as Verify>::Signer,
account: AccountId,
nonce: Index,
nonce: Nonce,
) -> Option<(RuntimeCall, <UncheckedExtrinsic as traits::Extrinsic>::SignaturePayload)> {
let tip = 0;
// take the biggest period possible.
Expand Down