Skip to content

Commit

Permalink
Ghali/fix nomination pools (availproject#310)
Browse files Browse the repository at this point in the history
* add nomination pool runtime api

* import nomination pool and fix the rounding issue that wasn't seen in polkadot due to decimals (12 vs 18 for us)

* toml format

* rever client version bump

* revert nomination pools version bump
  • Loading branch information
Leouarz authored Nov 24, 2023
1 parent 3384740 commit 0130a33
Show file tree
Hide file tree
Showing 23 changed files with 14,969 additions and 8 deletions.
14 changes: 12 additions & 2 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ pallet-mmr = { git = "https://github.com/paritytech/substrate.git", branch = "po
pallet-multisig = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }
pallet-child-bounties = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }
pallet-preimage = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }
pallet-nomination-pools = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }
pallet-nomination-pools = { path = "pallets/nomination-pools" }
pallet-nomination-pools-runtime-api = { path = "pallets/nomination-pools/runtime-api" }
pallet-election-provider-support-benchmarking = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }
substrate-wasm-builder = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }
pallet-identity = { git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v1.0.0" }
Expand Down
57 changes: 57 additions & 0 deletions pallets/nomination-pools/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[package]
name = "pallet-nomination-pools"
version = "1.0.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
description = "FRAME nomination pools pallet"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
# parity
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] }
scale-info = { version = "2.5.0", default-features = false, features = ["derive"] }

# FRAME
frame-support = { version = "4.0.0-dev", default-features = false }
frame-system = { version = "4.0.0-dev", default-features = false }
sp-runtime = { version = "24.0.0", default-features = false }
sp-std = { version = "8.0.0", default-features = false }
sp-staking = { version = "4.0.0-dev", default-features = false }
sp-core = { version = "21.0.0", default-features = false }
sp-io = { version = "23.0.0", default-features = false }
log = { version = "0.4.0", default-features = false }

# Optional: use for testing and/or fuzzing
pallet-balances = { version = "4.0.0-dev", optional = true }
sp-tracing = { version = "10.0.0", optional = true }

[dev-dependencies]
pallet-balances = { version = "4.0.0-dev" }
sp-tracing = { version = "10.0.0" }

[features]
default = ["std"]
fuzzing = ["pallet-balances", "sp-tracing"]
std = [
"codec/std",
"scale-info/std",
"frame-support/std",
"frame-system/std",
"sp-runtime/std",
"sp-std/std",
"sp-io/std",
"sp-staking/std",
"sp-core/std",
"log/std",
]
runtime-benchmarks = [
"sp-staking/runtime-benchmarks",
]
try-runtime = [
"frame-support/try-runtime"
]
69 changes: 69 additions & 0 deletions pallets/nomination-pools/benchmarking/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
[package]
name = "pallet-nomination-pools-benchmarking"
version = "1.0.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"
license = "Apache-2.0"
homepage = "https://substrate.io"
repository = "https://github.com/paritytech/substrate/"
description = "FRAME nomination pools pallet benchmarking"
readme = "README.md"

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
# parity
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] }
scale-info = { version = "2.5.0", default-features = false, features = ["derive"] }

# FRAME
frame-benchmarking = { version = "4.0.0-dev", default-features = false }
frame-election-provider-support = { version = "4.0.0-dev", default-features = false }
frame-support = { version = "4.0.0-dev", default-features = false }
frame-system = { version = "4.0.0-dev", default-features = false }
pallet-bags-list = { version = "4.0.0-dev", default-features = false }
pallet-staking = { version = "4.0.0-dev", default-features = false }
pallet-nomination-pools = { version = "1.0.0", default-features = false, path = "../" }

# Substrate Primitives
sp-runtime = { version = "24.0.0", default-features = false }
sp-runtime-interface = { version = "17.0.0", default-features = false }
sp-staking = { version = "4.0.0-dev", default-features = false }
sp-std = { version = "8.0.0", default-features = false }

[dev-dependencies]
pallet-balances = { version = "4.0.0-dev", default-features = false }
pallet-timestamp = { version = "4.0.0-dev" }
pallet-staking-reward-curve = { version = "4.0.0-dev" }
sp-core = { version = "21.0.0" }
sp-io = { version = "23.0.0" }

[features]
default = ["std"]

std = [
"frame-benchmarking/std",
"frame-election-provider-support/std",
"frame-support/std",
"frame-system/std",
"pallet-bags-list/std",
"pallet-staking/std",
"pallet-nomination-pools/std",
"sp-runtime/std",
"sp-runtime-interface/std",
"sp-staking/std",
"sp-std/std",
]

runtime-benchmarks = [
"frame-election-provider-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"sp-staking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"pallet-staking/runtime-benchmarks",
"pallet-nomination-pools/runtime-benchmarks",
"pallet-bags-list/runtime-benchmarks",
]
Empty file.
Loading

0 comments on commit 0130a33

Please sign in to comment.