Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Migrate pallet-tips to the new pallet attribute macro (#9711)
Browse files Browse the repository at this point in the history
* Migrate pallet-tips to the new pallet attribute macro

Signed-off-by: koushiro <[email protected]>

* Fix migration

Signed-off-by: koushiro <[email protected]>
  • Loading branch information
koushiro authored Sep 14, 2021
1 parent 9d19a24 commit 630422d
Show file tree
Hide file tree
Showing 8 changed files with 522 additions and 238 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 13 additions & 6 deletions frame/tips/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,36 @@ readme = "README.md"
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
serde = { version = "1.0.126", optional = true, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
sp-std = { version = "4.0.0-dev", default-features = false, path = "../../primitives/std" }
log = { version = "0.4.0", default-features = false }
serde = { version = "1.0.126", features = ["derive"], optional = true }

sp-core = { version = "4.0.0-dev", default-features = false, path = "../../primitives/core" }
sp-io = { version = "4.0.0-dev", default-features = false, path = "../../primitives/io" }
sp-runtime = { version = "4.0.0-dev", default-features = false, path = "../../primitives/runtime" }
sp-std = { version = "4.0.0-dev", default-features = false, path = "../../primitives/std" }

frame-support = { version = "4.0.0-dev", default-features = false, path = "../support" }
frame-system = { version = "4.0.0-dev", default-features = false, path = "../system" }
pallet-treasury = { version = "4.0.0-dev", default-features = false, path = "../treasury" }

frame-benchmarking = { version = "4.0.0-dev", default-features = false, path = "../benchmarking", optional = true }

[dev-dependencies]
sp-io ={ version = "4.0.0-dev", path = "../../primitives/io" }
sp-core = { version = "4.0.0-dev", path = "../../primitives/core" }
sp-storage = { version = "4.0.0-dev", path = "../../primitives/storage" }
pallet-balances = { version = "4.0.0-dev", path = "../balances" }

[features]
default = ["std"]
std = [
"serde",
"codec/std",
"sp-std/std",
"log/std",
"serde",

"sp-core/std",
"sp-io/std",
"sp-runtime/std",
"sp-std/std",
"frame-support/std",
"frame-system/std",
"pallet-treasury/std",
Expand Down
4 changes: 2 additions & 2 deletions frame/tips/README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Tipping Module ( pallet-tips )
# Tipping Pallet ( pallet-tips )

**Note :: This pallet is tightly coupled to pallet-treasury**

A subsystem to allow for an agile "tipping" process, whereby a reward may be given without first
having a pre-determined stakeholder group come to consensus on how much should be paid.

A group of `Tippers` is determined through the config `Trait`. After half of these have declared
A group of `Tippers` is determined through the config `Config`. After half of these have declared
some amount that they believe a particular reported reason deserves, then a countdown period is
entered where any remaining members can declare their tip amounts also. After the close of the
countdown period, the median of all declared tips is paid to the reported beneficiary, along with
Expand Down
6 changes: 3 additions & 3 deletions frame/tips/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@

#![cfg(feature = "runtime-benchmarks")]

use super::*;

use frame_benchmarking::{account, benchmarks, impl_benchmark_test_suite, whitelisted_caller};
use frame_support::ensure;
use frame_system::RawOrigin;
use sp_runtime::traits::Saturating;

use crate::Module as TipsMod;
use super::*;
use crate::Pallet as TipsMod;

const SEED: u32 = 0;

Expand Down
Loading

0 comments on commit 630422d

Please sign in to comment.