Skip to content

Commit 0e5e832

Browse files
authored
Update examples and tutorials for deprecated index (#2054)
* updates examples * updated the code samples, index to nonce * updated the sample code
1 parent ce7a798 commit 0e5e832

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

content/md/en/docs/reference/account-data-structures.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub type Account<T: Config> = StorageMap<
2020
_,
2121
Blake2_128Concat,
2222
T::AccountId,
23-
AccountInfo<T::Index, T::AccountData>,
23+
AccountInfo<T::Nonce, T::AccountData>,
2424
ValueQuery,
2525
>;
2626
```
@@ -29,7 +29,7 @@ The `StorageMap` for an `Account` consists of the following parameters:
2929

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

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

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

4040
```rust
4141
#[derive(Clone, Eq, PartialEq, Default, RuntimeDebug, Encode, Decode)]
42-
pub struct AccountInfo<Index, AccountData> {
42+
pub struct AccountInfo<Nonce, AccountData> {
4343
/// The number of transactions this account has sent.
44-
pub nonce: Index,
44+
pub nonce: Nonce,
4545
/// The number of other modules that currently depend on this account's existence. The account
4646
/// cannot be reaped until this is zero.
4747
pub consumers: RefCount,

content/md/en/docs/tutorials/build-application-logic/add-offchain-workers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ To enable offchain workers to send signed transactions:
243243
call: RuntimeCall,
244244
public: <Signature as Verify>::Signer,
245245
account: AccountId,
246-
nonce: Index,
246+
nonce: Nonce,
247247
) -> Option<(RuntimeCall, <UncheckedExtrinsic as traits::Extrinsic>::SignaturePayload)> {
248248
let tip = 0;
249249
// take the biggest period possible.

0 commit comments

Comments
 (0)