Skip to content

Commit

Permalink
use docs.rs links
Browse files Browse the repository at this point in the history
  • Loading branch information
shawntabrizi committed Aug 4, 2024
1 parent 19fb1d0 commit 91f33ff
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion steps/18/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Now that you have learned everything you need to know about `StorageValue`s, it

## Syntax

Declaring a new [`StorageMap`](https://paritytech.github.io/polkadot-sdk/master/frame_support/storage/types/struct.StorageMap.html) is very similar to a `StorageValue`:
Declaring a new [`StorageMap`](https://docs.rs/frame-support/37.0.0/frame_support/storage/types/struct.StorageMap.html) is very similar to a `StorageValue`:

```rust
#[pallet::storage]
Expand Down
2 changes: 1 addition & 1 deletion steps/20/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Check out the [`StorageMap` documentation](https://docs.rs/frame-support/37.0.0/

### Reading Storage

To read the current value of a key in a `StorageMap`, you can simply call the [`get(key)`](https://paritytech.github.io/polkadot-sdk/master/frame_support/storage/types/struct.StorageMap.html#method.get) API:
To read the current value of a key in a `StorageMap`, you can simply call the [`get(key)`](https://docs.rs/frame-support/37.0.0/frame_support/storage/types/struct.StorageMap.html#method.get) API:

```rust
let my_key: [u8; 32] = [0u8; 32];
Expand Down
6 changes: 3 additions & 3 deletions steps/40/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Every blockchain has a cryptocurrency associated with it. Bitcoin has BTC. Ether

For Polkadot, that native token is the DOT token.

Polkadot is built using FRAME and Pallets just like you have been building so far. Included in the `polkadot-sdk` is [`pallet_balances`](https://paritytech.github.io/polkadot-sdk/master/pallet_balances/index.html).
Polkadot is built using FRAME and Pallets just like you have been building so far. Included in the `polkadot-sdk` is [`pallet_balances`](https://docs.rs/pallet-balances/38.0.0/pallet_balances/index.html).

This is a Pallet designed specifically to manage the native balance for users.

Expand Down Expand Up @@ -87,8 +87,8 @@ pub trait Config: frame_system::Config {

You can see we introduce a new associated type called `NativeBalance`. We then require that this type must implement two traits:

- [`fungible::Inspect`](https://paritytech.github.io/polkadot-sdk/master/frame_support/traits/tokens/fungible/trait.Inspect.html): A trait allowing us to read data about a fungible token.
- [`fungible::Mutate`](https://paritytech.github.io/polkadot-sdk/master/frame_support/traits/tokens/fungible/trait.Mutate.html): A trait allowing us to write data about a fungible token.
- [`fungible::Inspect`](https://docs.rs/frame-support/37.0.0/frame_support/traits/tokens/fungible/trait.Inspect.html): A trait allowing us to read data about a fungible token.
- [`fungible::Mutate`](https://docs.rs/frame-support/37.0.0/frame_support/traits/tokens/fungible/trait.Mutate.html): A trait allowing us to write data about a fungible token.

So with this, we are able to access our native balance using APIs like:

Expand Down
4 changes: 2 additions & 2 deletions steps/41/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ pub trait Config: frame_system::Config {

You can see we introduce a new associated type called `NativeBalance`. We then require that this type must implment two traits:

- [`fungible::Inspect`](https://paritytech.github.io/polkadot-sdk/master/frame_support/traits/tokens/fungible/trait.Inspect.html): A trait allowing us to read data about a fungible token.
- [`fungible::Mutate`](https://paritytech.github.io/polkadot-sdk/master/frame_support/traits/tokens/fungible/trait.Mutate.html): A trait allowing us to write data about a fungible token.
- [`fungible::Inspect`](https://docs.rs/frame-support/37.0.0/frame_support/traits/tokens/fungible/trait.Inspect.html): A trait allowing us to read data about a fungible token.
- [`fungible::Mutate`](https://docs.rs/frame-support/37.0.0/frame_support/traits/tokens/fungible/trait.Mutate.html): A trait allowing us to write data about a fungible token.

So with this, we are able to access our native balance using APIs like:

Expand Down
2 changes: 1 addition & 1 deletion steps/42/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ fn add_one(input: BalanceOf<T>) -> BalanceOf<T> {

Even if we don't include `u128`, we cannot write the line above. This is because that line assumes that `input` must be some specific number type, and in that code, it is simply generic.

However, `BalanceOf<T>` [does have traits](https://paritytech.github.io/polkadot-sdk/master/frame_support/traits/tokens/trait.Balance.html) that we can use to interact with it. The key one being [`AtLeast32BitUnsigned`](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_frame/arithmetic/trait.AtLeast32BitUnsigned.html).
However, `BalanceOf<T>` [does have traits](https://docs.rs/frame-support/37.0.0/frame_support/traits/tokens/trait.Balance.html) that we can use to interact with it. The key one being [`AtLeast32BitUnsigned`](https://docs.rs/polkadot-sdk-frame/0.6.0/polkadot_sdk_frame/arithmetic/trait.AtLeast32BitUnsigned.html).

This means our `BalanceOf<T>` must be an unsigned integer, and must be at least `u32`. So it could be `u32`, `u64`, `u128`, or even bigger if you import other crates with those larger unsigned types.

Expand Down
2 changes: 1 addition & 1 deletion steps/43/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ fn add_one(input: BalanceOf<T>) -> BalanceOf<T> {

Even if we don't include `u128`, we cannot write the line above. This is because that line assumes that `input` must be some specific number type, and in that code, it is simply generic.

However, `BalanceOf<T>` [does have traits](https://paritytech.github.io/polkadot-sdk/master/frame_support/traits/tokens/trait.Balance.html) that we can use to interact with it. The key one being [`AtLeast32BitUnsigned`](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_frame/arithmetic/trait.AtLeast32BitUnsigned.html).
However, `BalanceOf<T>` [does have traits](https://docs.rs/frame-support/37.0.0/frame_support/traits/tokens/trait.Balance.html) that we can use to interact with it. The key one being [`AtLeast32BitUnsigned`](https://docs.rs/polkadot-sdk-frame/0.6.0/polkadot_sdk_frame/arithmetic/trait.AtLeast32BitUnsigned.html).

This means our `BalanceOf<T>` must be an unsigned integer, and must be at least `u32`. So it could be `u32`, `u64`, `u128`, or even bigger if you import other crates with those larger unsigned types.

Expand Down
2 changes: 1 addition & 1 deletion steps/50/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ To execute a purchase, we need to transfer two things:

### Transfer the Native Balance

To transfer the `NativeBalance`, you can use the [`transfer`](https://paritytech.github.io/polkadot-sdk/master/frame_support/traits/tokens/fungible/trait.Mutate.html#method.transfer) API which is included in the `fungible::Mutate` trait.
To transfer the `NativeBalance`, you can use the [`transfer`](https://docs.rs/frame-support/37.0.0/frame_support/traits/tokens/fungible/trait.Mutate.html#method.transfer) API which is included in the `fungible::Mutate` trait.

```rust
fn transfer(
Expand Down

0 comments on commit 91f33ff

Please sign in to comment.