Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relay chain client pallet for AH Staking #6259

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
41 changes: 41 additions & 0 deletions Cargo.lock

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

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,8 @@ members = [
"substrate/frame/session/benchmarking",
"substrate/frame/society",
"substrate/frame/staking",
"substrate/frame/staking/rc-client",
"substrate/frame/staking/rc-client/integration-tests",
"substrate/frame/staking/reward-curve",
"substrate/frame/staking/reward-fn",
"substrate/frame/staking/runtime-api",
Expand Down Expand Up @@ -978,6 +980,8 @@ pallet-session-benchmarking = { path = "substrate/frame/session/benchmarking", d
pallet-skip-feeless-payment = { path = "substrate/frame/transaction-payment/skip-feeless-payment", default-features = false }
pallet-society = { path = "substrate/frame/society", default-features = false }
pallet-staking = { path = "substrate/frame/staking", default-features = false }
pallet-staking-rc-client = { path = "substrate/frame/staking/rc-client", default-features = false }
pallet-staking-rc-client-tests = { path = "substrate/frame/staking/rc-client/integration-tests", default-features = false }
pallet-staking-reward-curve = { path = "substrate/frame/staking/reward-curve", default-features = false }
pallet-staking-reward-fn = { path = "substrate/frame/staking/reward-fn", default-features = false }
pallet-staking-runtime-api = { path = "substrate/frame/staking/runtime-api", default-features = false }
Expand Down
47 changes: 47 additions & 0 deletions substrate/frame/staking/rc-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[package]
name = "pallet-staking-rc-client"
version = "0.0.1"
authors.workspace = true
edition.workspace = true
license = "Apache-2.0"
homepage.workspace = true
repository.workspace = true
description = "FRAME pallet staking relay chain client"

[lints]
workspace = true

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

[dependencies]
codec = { workspace = true }
scale-info = { features = ["derive"], workspace = true }

sp-runtime = { default-features = true, workspace = true }
sp-std = { default-features = true, workspace = true }
sp-staking = { default-features = true, workspace = true }
frame-support = { default-features = true, workspace = true }
frame-system = { default-features = true, workspace = true }
pallet-authorship = { workspace = true }
pallet-session = { workspace = true }
pallet-staking = { workspace = true }

[dev-dependencies]
sp-tracing = { workspace = true }
sp-io = { workspace = true }

[features]
default = ["std"]
std = [
"codec/std",
"scale-info/std",
"sp-runtime/std",
"sp-std/std",
"sp-staking/std",
"frame-support/std",
"frame-system/std",
"pallet-authorship/std",
"pallet-session/std",
"pallet-staking/std",
]
58 changes: 58 additions & 0 deletions substrate/frame/staking/rc-client/integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
[package]
name = "pallet-staking-rc-client-tests"
version = "0.0.1"
authors.workspace = true
edition.workspace = true
license = "Apache-2.0"
homepage.workspace = true
repository.workspace = true
description = "FRAME integration tests for pallet staking relay chain client"
publish = false

[lints]
workspace = true

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

[dependencies]
codec = { workspace = true }
scale-info = { features = ["derive"], workspace = true }

sp-runtime = { default-features = true, workspace = true }
sp-std = { default-features = true, workspace = true }
sp-io = { default-features = true, workspace = true }
sp-core = { default-features = true, workspace = true }
sp-tracing = { default-features = true, workspace = true }
sp-staking = { default-features = true, workspace = true }
frame-support = { default-features = true, workspace = true }
frame-system = { default-features = true, workspace = true }
pallet-session = { workspace = true }
pallet-balances = { workspace = true }
pallet-timestamp = { workspace = true }
pallet-authorship = { workspace = true }
pallet-staking = { workspace = true }
pallet-staking-rc-client = { workspace = true }
frame-election-provider-support = { workspace = true }


[features]
default = ["std"]
std = [
"codec/std",
"scale-info/std",
"sp-runtime/std",
"sp-std/std",
"sp-io/std",
"sp-core/std",
"sp-staking/std",
"frame-support/std",
"frame-system/std",
"pallet-balances/std",
"pallet-timestamp/std",
"pallet-session/std",
"pallet-authorship/std",
"pallet-staking/std",
"pallet-staking-rc-client/std",
"frame-election-provider-support/std",
]
29 changes: 29 additions & 0 deletions substrate/frame/staking/rc-client/integration-tests/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// This file is part of Substrate.

// Copyright (C) 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.

//! # Staking Relay chain client tests

mod mock;

use crate::mock::*;

Check failure on line 22 in substrate/frame/staking/rc-client/integration-tests/src/lib.rs

View workflow job for this annotation

GitHub Actions / cargo-check-all-crate-macos

unused import: `crate::mock::*`

#[test]
fn test_setup_works() {
ExtBuilder::default().build_and_execute(|| {
assert!(true);
})
}
Loading
Loading