Skip to content

Commit

Permalink
Add banners and warnings (#2069)
Browse files Browse the repository at this point in the history
* add warning to pallet macros section

* add warning about genesis configuration

* remove custom weight guides

* remove landing pg links for deleted weight guides

* fix broken links

* update warning styles

---------

Co-authored-by: jonnysmillie <[email protected]>
  • Loading branch information
Sacha Lansky and jonnysmillie authored Oct 6, 2023
1 parent df7ccad commit fe89449
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 255 deletions.
5 changes: 5 additions & 0 deletions content/md/en/docs/build/genesis-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ description:
keywords:
---

<div class="warning">
<strong>⚠️ WARNING:</strong> This page contains outdated information. Please refer to the <a href="https://paritytech.github.io/polkadot-sdk/master/frame_support/pallet_macros/attr.genesis_build.html">Rust docs</a> for the most up-to-date documentation on this topic.
</div>


The first block produced by any blockchain is referred to as the genesis block.
The hash associated with this block is the top-level parent of all blocks produced after that first block.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ A few of the key benefits include:

You can use Substrate Connect to connect to any Substrate-based blockchain.
However, you must specify the correct name of the chain that you want to connect to.
There are a few well-known chain names that are defined for the [`WellKnownChain`](https://paritytech.github.io/substrate-connect/api/enums/connect_src.WellKnownChain.html) enumeration type.
There are a few well-known chain names that are defined for the [`WellKnownChain`](https://paritytech.github.io/substrate-connect/api/enums/_substrate_connect.WellKnownChain.html) enumeration type.

You can connect to the following public blockchain networks using the name listed:

Expand Down
9 changes: 6 additions & 3 deletions content/md/en/docs/reference/frame-macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ title: FRAME macros
description:
keywords:
---
<div class="warning">
<strong>⚠️ WARNING:</strong> This section contains outdated information. Please refer to the <a href="https://paritytech.github.io/polkadot-sdk/master/frame_support/attr.pallet.html">Rust docs</a> for the most up-to-date documentation on this topic.
</div>

Substrate uses customized [Rust macros](https://doc.rust-lang.org/book/ch19-06-macros.html) to generate code and aggregate the logic from the pallets you implement for a runtime.
These runtime macros allow you to focus on your runtime logic rather than spending time on encoding and decoding on-chain variables or duplicating the code required for [basic blockchain development](/learn/runtime-development#core-primitives).
Expand Down Expand Up @@ -391,9 +394,9 @@ $vis type $StorageName<$some_generic> $optional_where_clause

For more information, see the Rust documentation for [pallet::storage](https://paritytech.github.io/substrate/master/frame_support/attr.pallet.html#storage-palletstorage-optional) and the following storage data structures:

- [StorageDoubleMap](https://paritytech.github.io/substrate/master/frame_support/pallet_prelude/struct.StorageDoubleMap.html)
- [StorageMap](https://paritytech.github.io/substrate/master/frame_support/pallet_prelude/struct.StorageMap.html#implementations)
- [StorageValue](https://paritytech.github.io/substrate/master/frame_support/pallet_prelude/struct.StorageValue.html)
- [StorageDoubleMap](https://paritytech.github.io/polkadot-sdk/master/frame_support/storage/types/struct.StorageDoubleMap.html)
- [StorageMap](https://paritytech.github.io/polkadot-sdk/master/frame_support/storage/types/struct.StorageMap.html)
- [StorageValue](https://paritytech.github.io/polkadot-sdk/master/frame_support/storage/types/struct.StorageValue.html)

### #[pallet::type_value]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Customize the consensus mechanisms of a Substrate chain.
We begin by creating the block import for Grandpa.
In addition to the block import itself, we get back a `grandpa_link`.
This link is a channel over which the block import can communicate with the background task that actually casts Grandpa votes.
The [details of the Grandpa protocol](https://research.web3.foundation/en/latest/polkadot/finality.html) are beyond the scope of this guide.
The [details of the Grandpa protocol](https://research.web3.foundation/Polkadot/protocols/finality) are beyond the scope of this guide.

In `node/src/service.rs`, create the Grandpa block import:

Expand Down
2 changes: 0 additions & 2 deletions content/md/en/docs/reference/how-to-guides/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ See the following guides for help with benchmarking and weight configurations.

- [Calculate fees](/reference/how-to-guides/weights/calculate-fees/)
- [Add benchmarks](/reference/how-to-guides/weights/add-benchmarks/)
- [Use custom weights](/reference/how-to-guides/weights/use-custom-weights/)
- [Use conditional weights](/reference/how-to-guides/weights/use-conditional-weights/)

## Testing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ keywords:
---

This guide shows you how to write a pallet that allows users to lock funds for staking and voting.
The [`LockableCurrency`](https://paritytech.github.io/substrate/master/frame_support/traits/trait.LockableCurrency.html) trait is useful in the context of economic systems that enforce accountability by collateralizing fungible resources.
The [`LockableCurrency`](https://paritytech.github.io/polkadot-sdk/master/frame_support/traits/tokens/currency/trait.LockableCurrency.html) trait is useful in the context of economic systems that enforce accountability by collateralizing fungible resources.
You can use the Substrate [staking pallet](https://paritytech.github.io/substrate/master/pallet_staking/index.html) to manage locked funds in time-based increments.

In this guide, we will implement the `set_lock`, `extend_lock` and `remove_lock` methods in our own custom pallet.
Expand All @@ -22,7 +22,7 @@ You can use the template pallet in the [node template](https://github.com/substr

## Declare the necessary dependencies

The methods from [`LockableCurrency`](https://paritytech.github.io/substrate/master/frame_support/traits/trait.LockableCurrency.html) require us to import a few traits from `frame_support`.
The methods from [`LockableCurrency`](https://paritytech.github.io/polkadot-sdk/master/frame_support/traits/tokens/currency/trait.LockableCurrency.html) require us to import a few traits from `frame_support`.

1. Ensure you have the following traits imported in the top section of your pallet:

Expand Down Expand Up @@ -162,5 +162,5 @@ The required methods are:
## Related material

- [Currency trait](https://paritytech.github.io/substrate/master/frame_support/traits/tokens/currency/trait.Currency.html)
- [LockableCurrency](https://paritytech.github.io/substrate/master/frame_support/traits/trait.LockableCurrency.html)
- [LockIdentifier](https://paritytech.github.io/substrate/master/frame_support/traits/type.LockIdentifier.html)
- [LockableCurrency](https://paritytech.github.io/polkadot-sdk/master/frame_support/traits/tokens/currency/trait.LockableCurrency.html)
- [LockIdentifier](https://paritytech.github.io/polkadot-sdk/master/frame_support/traits/tokens/currency/type.LockIdentifier.html)
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ pub const fn deposit(items: u32, bytes: u32) -> Balance {}
You can find this function for each relay chain in the Polkadot repository.
For example:

- [Kusama](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/runtime/kusama/constants/src/lib.rs)
- [Polkadot](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/runtime/polkadot/constants/src/lib.rs)
- [Kusama](https://github.com/polkadot-fellows/runtimes/blob/main/relay/kusama/constants/src/lib.rs)
- [Polkadot](https://github.com/polkadot-fellows/runtimes/blob/main/relay/polkadot/constants/src/lib.rs)
- [Rococo](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/runtime/rococo/constants/src/lib.rs)
- [Westend](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/runtime/westend/constants/src/lib.rs)

Expand Down
2 changes: 0 additions & 2 deletions content/md/en/docs/reference/how-to-guides/weights/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,3 @@ The _How-to_ guides in the _Weights_ category illustrate use benchmarks and weig

- [Calculate fees](/reference/how-to-guides/weights/calculate-fees/)
- [Add benchmarks](/reference/how-to-guides/weights/add-benchmarks/)
- [Use custom weights](/reference/how-to-guides/weights/use-custom-weights/)
- [Use conditional weights](/reference/how-to-guides/weights/use-conditional-weights/)

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ To implement the errors for the proof-of-existence pallet:

To add a new claim to the blockchain, the proof-of-existence pallet requires a storage mechanism.
To address this requirement, you can create a key-value map, where each claim points to the owner and the block number when the claim was made.
To create this key-value map, you can use the FRAME [`StorageMap`](https://paritytech.github.io/substrate/master/frame_support/pallet_prelude/struct.StorageMap.html).
To create this key-value map, you can use the FRAME [`StorageMap`](https://paritytech.github.io/polkadot-sdk/master/frame_support/storage/types/struct.StorageMap.html).

To implement storage for the proof-of-existence pallet:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ If you don't have a preferred IDE, Visual Studio Code is a good choice.
To interact with the blockchain and test your work as you build the Substrate collectibles application, you'll need a browser-based application that can connect to the Substrate node.
For the workshop, you can connect to the node from the [Polkadot/Substrate Portal](https://polkadot.js.org/apps/) if you have Chrome or a Chromium-based browser.

- [ ] [Google Chrome](https://www.google.com/chrome/) or a Chromium-based browser, such as [Brave](https://brave.com/download/), [Microsoft Edge](https://www.microsoft.com/en-us/edge?form=MA13FJ&exp=e00), [Opera](https://www.opera.com/download), or [Vivaldi](https://vivaldi.com/download/).
- [ ] [Google Chrome](https://www.google.com/chrome/) or a Chromium-based browser, such as [Brave](https://brave.com/download/), [Microsoft Edge](https://www.microsoft.com/en-us/edge?ep=79&form=MA13KE&es=23), [Opera](https://www.opera.com/download), or [Vivaldi](https://vivaldi.com/download/).

If you use a more restrictive browser—such as Firefox—you might find that connections between the Polkadot/Substrate Portal and the node are blocked for security or privacy reasons.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ By completing this tutorial, you will accomplish the following objectives:
Before the light client can connect to a network, you must have a web application that specifies the network the light client should connect to, the nodes for it to communicate with, and the consensus-critical state it must have at genesis.
This information is available in the [chain specification](/build/chain-spec/) file for the network.

Substrate Connect is preconfigured to recognize several chains that are defined in the [WellKnownChain](https://paritytech.github.io/substrate-connect/api/enums/connect_src.WellKnownChain.html) enumeration list.
Substrate Connect is preconfigured to recognize several chains that are defined in the [WellKnownChain](https://paritytech.github.io/substrate-connect/api/enums/_substrate_connect.WellKnownChain.html) enumeration list.
These well-known chains are:

- Polkadot identified as `polkadot`
Expand Down
4 changes: 4 additions & 0 deletions src/styles/tailwind-custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -220,3 +220,7 @@ div[aria-label='animation'] {
nav ul li span svg {
@apply dark:text-substrateDarkThemeBlue;
}

.warning {
@apply bg-yellow-100 border-l-4 border-yellow-500 text-yellow-700 p-4 my-4;
}

0 comments on commit fe89449

Please sign in to comment.