Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
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
2 changes: 1 addition & 1 deletion .maintain/frame-weight-template.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub trait WeightInfo {

/// Weights for {{pallet}} using the Substrate node and recommended hardware.
pub struct SubstrateWeight<T>(PhantomData<T>);
impl<T: frame_system::Trait> WeightInfo for SubstrateWeight<T> {
impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
{{~#each benchmarks as |benchmark|}}
fn {{benchmark.name~}}
(
Expand Down
6 changes: 3 additions & 3 deletions bin/node-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Review the [FRAME runtime implementation](./runtime/src/lib.rs) included in this
the following:

- This file configures several pallets to include in the runtime. Each pallet configuration is
defined by a code block that begins with `impl $PALLET_NAME::Trait for Runtime`.
defined by a code block that begins with `impl $PALLET_NAME::Config for Runtime`.
- The pallets are composed into a single runtime by way of the
[`construct_runtime!`](https://crates.parity.io/frame_support/macro.construct_runtime.html)
macro, which is part of the core
Expand All @@ -181,8 +181,8 @@ A FRAME pallet is compromised of a number of blockchain primitives:
- Events: Substrate uses [events](https://substrate.dev/docs/en/knowledgebase/runtime/events) to
notify users of important changes in the runtime.
- Errors: When a dispatchable fails, it returns an error.
- Trait: The `Trait` configuration interface is used to define the types and parameters upon which
a FRAME pallet depends.
- Config: The `Config` configuration interface is used to define the types and parameters upon
which a FRAME pallet depends.

## Generate a Custom Node Template

Expand Down
8 changes: 4 additions & 4 deletions frame/assets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ with a fixed supply, including:
* Asset Transfer
* Asset Destruction

To use it in your runtime, you need to implement the assets [`Trait`](https://docs.rs/pallet-assets/latest/pallet_assets/trait.Trait.html).
To use it in your runtime, you need to implement the assets [`Config`](https://docs.rs/pallet-assets/latest/pallet_assets/trait.Config.html).

The supported dispatchable functions are documented in the [`Call`](https://docs.rs/pallet-assets/latest/pallet_assets/enum.Call.html) enum.

Expand Down Expand Up @@ -72,10 +72,10 @@ use pallet_assets as assets;
use frame_support::{decl_module, dispatch, ensure};
use frame_system::ensure_signed;

pub trait Trait: assets::Trait { }
pub trait Config: assets::Config { }

decl_module! {
pub struct Module<T: Trait> for enum Call where origin: T::Origin {
pub struct Module<T: Config> for enum Call where origin: T::Origin {
pub fn issue_token_airdrop(origin) -> dispatch::DispatchResult {
let sender = ensure_signed(origin).map_err(|e| e.as_str())?;

Expand Down Expand Up @@ -106,7 +106,7 @@ Below are assumptions that must be held when using this module. If any of
them are violated, the behavior of this module is undefined.

* The total count of assets should be less than
`Trait::AssetId::max_value()`.
`Config::AssetId::max_value()`.

## Related Modules

Expand Down
2 changes: 1 addition & 1 deletion frame/atomic-swap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

A module for atomically sending funds.

- [`atomic_swap::Trait`](https://docs.rs/pallet-atomic-swap/latest/pallet_atomic_swap/trait.Trait.html)
- [`atomic_swap::Config`](https://docs.rs/pallet-atomic-swap/latest/pallet_atomic_swap/trait.Config.html)
- [`Call`](https://docs.rs/pallet-atomic-swap/latest/pallet_atomic_swap/enum.Call.html)
- [`Module`](https://docs.rs/pallet-atomic-swap/latest/pallet_atomic_swap/struct.Module.html)

Expand Down
2 changes: 1 addition & 1 deletion frame/aura/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Aura Module

- [`aura::Trait`](https://docs.rs/pallet-aura/latest/pallet_aura/trait.Trait.html)
- [`aura::Config`](https://docs.rs/pallet-aura/latest/pallet_aura/trait.Config.html)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are triggering the CI error

Copy link
Contributor Author

@gui1117 gui1117 Nov 30, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes but I think it is more correct than before

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These readme files are/should be regnerated on the next release. So it should not be required that you change this manually.

- [`Module`](https://docs.rs/pallet-aura/latest/pallet_aura/struct.Module.html)

## Overview
Expand Down
12 changes: 6 additions & 6 deletions frame/balances/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The Balances module provides functionality for handling accounts and balances.

- [`balances::Trait`](https://docs.rs/pallet-balances/latest/pallet_balances/trait.Trait.html)
- [`balances::Config`](https://docs.rs/pallet-balances/latest/pallet_balances/trait.Config.html)
- [`Call`](https://docs.rs/pallet-balances/latest/pallet_balances/enum.Call.html)
- [`Module`](https://docs.rs/pallet-balances/latest/pallet_balances/struct.Module.html)

Expand Down Expand Up @@ -83,8 +83,8 @@ The Contract module uses the `Currency` trait to handle gas payment, and its typ
```rust
use frame_support::traits::Currency;

pub type BalanceOf<T> = <<T as Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::Balance;
pub type NegativeImbalanceOf<T> = <<T as Trait>::Currency as Currency<<T as frame_system::Trait>::AccountId>>::NegativeImbalance;
pub type BalanceOf<T> = <<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::Balance;
pub type NegativeImbalanceOf<T> = <<T as Config>::Currency as Currency<<T as frame_system::Config>::AccountId>>::NegativeImbalance;

```

Expand All @@ -93,11 +93,11 @@ The Staking module uses the `LockableCurrency` trait to lock a stash account's f
```rust
use frame_support::traits::{WithdrawReasons, LockableCurrency};
use sp_runtime::traits::Bounded;
pub trait Trait: frame_system::Trait {
pub trait Config: frame_system::Config {
type Currency: LockableCurrency<Self::AccountId, Moment=Self::BlockNumber>;
}

fn update_ledger<T: Trait>(
fn update_ledger<T: Config>(
controller: &T::AccountId,
ledger: &StakingLedger<T>
) {
Expand All @@ -117,6 +117,6 @@ The Balances module depends on the [`GenesisConfig`](https://docs.rs/pallet-bala

## Assumptions

* Total issued balanced of all accounts should be less than `Trait::Balance::max_value()`.
* Total issued balanced of all accounts should be less than `Config::Balance::max_value()`.

License: Apache-2.0
12 changes: 6 additions & 6 deletions frame/benchmarking/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ use frame_system::{RawOrigin, ensure_signed, ensure_none};

decl_storage! {
trait Store for Module<T: Config> as Test where
<T as OtherTrait>::OtherEvent: Into<<T as Config>::Event>
<T as OtherConfig>::OtherEvent: Into<<T as Config>::Event>
{
Value get(fn value): Option<u32>;
}
}

decl_module! {
pub struct Module<T: Config> for enum Call where
origin: T::Origin, <T as OtherTrait>::OtherEvent: Into<<T as Config>::Event>
origin: T::Origin, <T as OtherConfig>::OtherEvent: Into<<T as Config>::Event>
{
#[weight = 0]
fn set_value(origin, n: u32) -> DispatchResult {
Expand All @@ -59,11 +59,11 @@ impl_outer_origin! {
pub enum Origin for Test where system = frame_system {}
}

pub trait OtherTrait {
pub trait OtherConfig {
type OtherEvent;
}

pub trait Config: frame_system::Config + OtherTrait
pub trait Config: frame_system::Config + OtherConfig
where Self::OtherEvent: Into<<Self as Config>::Event>
{
type Event;
Expand Down Expand Up @@ -104,7 +104,7 @@ impl Config for Test {
type Event = ();
}

impl OtherTrait for Test {
impl OtherConfig for Test {
type OtherEvent = ();
}

Expand All @@ -113,7 +113,7 @@ fn new_test_ext() -> sp_io::TestExternalities {
}

benchmarks!{
where_clause { where <T as OtherTrait>::OtherEvent: Into<<T as Config>::Event> }
where_clause { where <T as OtherConfig>::OtherEvent: Into<<T as Config>::Event> }

_ {
// Define a common range for `b`.
Expand Down
2 changes: 1 addition & 1 deletion frame/contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The Contract module provides functionality for the runtime to deploy and execute WebAssembly smart-contracts.

- [`contract::Trait`](https://docs.rs/pallet-contracts/latest/pallet_contracts/trait.Trait.html)
- [`contract::Config`](https://docs.rs/pallet-contracts/latest/pallet_contracts/trait.Config.html)
- [`Call`](https://docs.rs/pallet-contracts/latest/pallet_contracts/enum.Call.html)

## Overview
Expand Down
2 changes: 1 addition & 1 deletion frame/democracy/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Democracy Pallet

- [`democracy::Trait`](https://docs.rs/pallet-democracy/latest/pallet_democracy/trait.Trait.html)
- [`democracy::Config`](https://docs.rs/pallet-democracy/latest/pallet_democracy/trait.Config.html)
- [`Call`](https://docs.rs/pallet-democracy/latest/pallet_democracy/enum.Call.html)

## Overview
Expand Down
2 changes: 1 addition & 1 deletion frame/elections-phragmen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ being re-elected at the end of each round.

### Module Information

- [`election_sp_phragmen::Trait`](https://docs.rs/pallet-elections-phragmen/latest/pallet_elections_phragmen/trait.Trait.html)
- [`election_sp_phragmen::Config`](https://docs.rs/pallet-elections-phragmen/latest/pallet_elections_phragmen/trait.Config.html)
- [`Call`](https://docs.rs/pallet-elections-phragmen/latest/pallet_elections_phragmen/enum.Call.html)
- [`Module`](https://docs.rs/pallet-elections-phragmen/latest/pallet_elections_phragmen/struct.Module.html)

Expand Down
2 changes: 1 addition & 1 deletion frame/example-offchain-worker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ concepts, APIs and structures common to most offchain workers.
Run `cargo doc --package pallet-example-offchain-worker --open` to view this module's
documentation.

- [`pallet_example_offchain_worker::Trait`](./trait.Trait.html)
- [`pallet_example_offchain_worker::Config`](./trait.Config.html)
- [`Call`](./enum.Call.html)
- [`Module`](./struct.Module.html)

Expand Down
4 changes: 2 additions & 2 deletions frame/example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Copy and paste this template from frame/example/src/lib.rs into file
// Include the following links that shows what trait needs to be implemented to use the pallet
// and the supported dispatchables that are documented in the Call enum.

- \[`<INSERT_CUSTOM_PALLET_NAME>::Trait`](https://docs.rs/pallet-example/latest/pallet_example/trait.Trait.html)
- \[`<INSERT_CUSTOM_PALLET_NAME>::Config`](https://docs.rs/pallet-example/latest/pallet_example/trait.Config.html)
- \[`Call`](https://docs.rs/pallet-example/latest/pallet_example/enum.Call.html)
- \[`Module`](https://docs.rs/pallet-example/latest/pallet_example/struct.Module.html)

Expand Down Expand Up @@ -195,7 +195,7 @@ Copy and paste this template from frame/example/src/lib.rs into file
\```rust
use <INSERT_CUSTOM_PALLET_NAME>;

pub trait Trait: <INSERT_CUSTOM_PALLET_NAME>::Trait { }
pub trait Config: <INSERT_CUSTOM_PALLET_NAME>::Config { }
\```

\### Simple Code Snippet
Expand Down
4 changes: 2 additions & 2 deletions frame/identity/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Identity Module

- [`identity::Trait`](https://docs.rs/pallet-identity/latest/pallet_identity/trait.Trait.html)
- [`identity::Config`](https://docs.rs/pallet-identity/latest/pallet_identity/trait.Config.html)
- [`Call`](https://docs.rs/pallet-identity/latest/pallet_identity/enum.Call.html)

## Overview
Expand Down Expand Up @@ -51,6 +51,6 @@ no state-bloat attack is viable.
* `kill_identity` - Forcibly remove the associated identity; the deposit is lost.

[`Call`]: ./enum.Call.html
[`Trait`]: ./trait.Trait.html
[`Config`]: ./trait.Config.html

License: Apache-2.0
6 changes: 3 additions & 3 deletions frame/im-online/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ and includes the recent best block number of the local validators chain as well
as the `NetworkState`.
It is submitted as an Unsigned Transaction via off-chain workers.

- [`im_online::Trait`](https://docs.rs/pallet-im-online/latest/pallet_im_online/trait.Trait.html)
- [`im_online::Config`](https://docs.rs/pallet-im-online/latest/pallet_im_online/trait.Config.html)
- [`Call`](https://docs.rs/pallet-im-online/latest/pallet_im_online/enum.Call.html)
- [`Module`](https://docs.rs/pallet-im-online/latest/pallet_im_online/struct.Module.html)

Expand All @@ -30,10 +30,10 @@ use frame_support::{decl_module, dispatch};
use frame_system::ensure_signed;
use pallet_im_online::{self as im_online};

pub trait Trait: im_online::Trait {}
pub trait Config: im_online::Config {}

decl_module! {
pub struct Module<T: Trait> for enum Call where origin: T::Origin {
pub struct Module<T: Config> for enum Call where origin: T::Origin {
#[weight = 0]
pub fn is_online(origin, authority_index: u32) -> dispatch::DispatchResult {
let _sender = ensure_signed(origin)?;
Expand Down
4 changes: 2 additions & 2 deletions frame/multisig/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Multisig Module
A module for doing multisig dispatch.

- [`multisig::Trait`](https://docs.rs/pallet-multisig/latest/pallet_multisig/trait.Trait.html)
- [`multisig::Config`](https://docs.rs/pallet-multisig/latest/pallet_multisig/trait.Config.html)
- [`Call`](https://docs.rs/pallet-multisig/latest/pallet_multisig/enum.Call.html)

## Overview
Expand All @@ -24,6 +24,6 @@ not available or desired.
* `cancel_as_multi` - Cancel a call from a composite origin.

[`Call`]: ./enum.Call.html
[`Trait`]: ./trait.Trait.html
[`Config`]: ./trait.Config.html

License: Apache-2.0
4 changes: 2 additions & 2 deletions frame/nicks/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Nicks Module

- [`nicks::Trait`](https://docs.rs/pallet-nicks/latest/pallet_nicks/trait.Trait.html)
- [`nicks::Config`](https://docs.rs/pallet-nicks/latest/pallet_nicks/trait.Config.html)
- [`Call`](https://docs.rs/pallet-nicks/latest/pallet_nicks/enum.Call.html)

## Overview
Expand All @@ -20,6 +20,6 @@ have not been designed to be economically secure. Do not use this pallet as-is i
* `kill_name` - Forcibly remove the associated name; the deposit is lost.

[`Call`]: ./enum.Call.html
[`Trait`]: ./trait.Trait.html
[`Config`]: ./trait.Config.html

License: Apache-2.0
Loading