This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Move fill_block to RootOffences * docs * new pallet * new line * fix * Update frame/root-testing/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/root-testing/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update bin/node/runtime/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/root-testing/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/root-testing/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * Update frame/root-testing/src/lib.rs Co-authored-by: Bastian Köcher <git@kchr.de> * fixes * problem solved * revert * fix dependency * hopefully making the CI happy * ... * dummy call * remove dummy * fix warning Co-authored-by: Bastian Köcher <git@kchr.de>
- Loading branch information
Showing
16 changed files
with
134 additions
and
33 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# Sudo Offences Pallet | ||
# Root Offences Pallet | ||
|
||
Pallet that allows the root to create an offence. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[package] | ||
name = "pallet-root-testing" | ||
version = "1.0.0-dev" | ||
authors = ["Parity Technologies <admin@parity.io>"] | ||
edition = "2021" | ||
license = "Apache-2.0" | ||
homepage = "https://substrate.io" | ||
repository = "https://github.com/paritytech/substrate/" | ||
description = "FRAME root testing pallet" | ||
readme = "README.md" | ||
|
||
[package.metadata.docs.rs] | ||
targets = ["x86_64-unknown-linux-gnu"] | ||
|
||
[dependencies] | ||
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } | ||
scale-info = { version = "2.1.1", default-features = false, features = ["derive"] } | ||
|
||
frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" } | ||
frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" } | ||
sp-runtime = { version = "6.0.0", default-features = false, path = "../../primitives/runtime" } | ||
|
||
[dev-dependencies] | ||
|
||
[features] | ||
try-runtime = ["frame-support/try-runtime"] | ||
default = ["std"] | ||
std = [ | ||
"codec/std", | ||
"frame-support/std", | ||
"frame-system/std", | ||
"scale-info/std", | ||
"sp-runtime/std", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Root Testing Pallet | ||
|
||
Pallet that contains extrinsics that can be usefull in testing. | ||
|
||
NOTE: This pallet should only be used for testing purposes and should not be used in production runtimes! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// This file is part of Substrate. | ||
|
||
// Copyright (C) 2022 Parity Technologies (UK) Ltd. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
//! # Root Testing Pallet | ||
//! | ||
//! Pallet that contains extrinsics that can be usefull in testing. | ||
//! | ||
//! NOTE: This pallet should only be used for testing purposes and should not be used in production | ||
//! runtimes! | ||
#![cfg_attr(not(feature = "std"), no_std)] | ||
|
||
use frame_support::dispatch::DispatchResult; | ||
use sp_runtime::Perbill; | ||
|
||
pub use pallet::*; | ||
|
||
#[frame_support::pallet] | ||
pub mod pallet { | ||
use super::*; | ||
use frame_support::pallet_prelude::*; | ||
use frame_system::pallet_prelude::*; | ||
|
||
#[pallet::config] | ||
pub trait Config: frame_system::Config {} | ||
|
||
#[pallet::pallet] | ||
#[pallet::generate_store(pub(super) trait Store)] | ||
pub struct Pallet<T>(_); | ||
|
||
#[pallet::call] | ||
impl<T: Config> Pallet<T> { | ||
/// A dispatch that will fill the block weight up to the given ratio. | ||
#[pallet::weight(*_ratio * T::BlockWeights::get().max_block)] | ||
pub fn fill_block(origin: OriginFor<T>, _ratio: Perbill) -> DispatchResult { | ||
ensure_root(origin)?; | ||
Ok(()) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters