Skip to content
This repository was archived by the owner on May 21, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 8 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
96 changes: 73 additions & 23 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ tempfile = "3.2.0"
[features]
default = ["with-trappist-runtime"]
runtime-benchmarks = [
"trappist-cli/runtime-benchmarks"
"trappist-cli/runtime-benchmarks",
]
with-trappist-runtime = [
"trappist-service/with-trappist-runtime",
Expand Down
3 changes: 2 additions & 1 deletion node/service/src/chain_spec/trappist.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use cumulus_primitives_core::ParaId;
use hex_literal::hex;
use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup};
use sc_cli::DefaultConfigurationValues;
use sc_service::ChainType;
use serde::{Deserialize, Serialize};
use sp_core::{crypto::UncheckedInto, sr25519, Pair, Public};
Expand Down Expand Up @@ -234,6 +233,7 @@ fn testnet_genesis(
phantom: Default::default(),
},
treasury: Default::default(),
maintenance_mode: Default::default(),
}
}

Expand Down Expand Up @@ -350,5 +350,6 @@ fn trappist_live_genesis(
phantom: Default::default(),
},
treasury: Default::default(),
maintenance_mode: Default::default(),
}
}
77 changes: 77 additions & 0 deletions pallets/maintenance-mode/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
[package]
name = "pallet-maintenance-mode"
version = "0.1.0"
description = "Trappist pallet for setting maintenance mode."
edition = "2021"
license = "Apache-2.0"
repository = "https://github.com/paritytech/trappist"

[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.3.1", default-features = false, features = ["derive"] }
sp-runtime = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.37" }
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "polkadot-v0.9.37" }
frame-benchmarking = { version = "4.0.0-dev", default-features = false, optional = true, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
frame-support = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
frame-system = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37", default-features = false }
pallet-assets = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
pallet-balances = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
log = "0.4.17"
xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.37" }

xcm-primitives = { path = "../../primitives/xcm", default-features = false }

[dev-dependencies]
sp-core = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
sp-io = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
sp-runtime = { version = "7.0.0", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }
pallet-remark = { version = "4.0.0-dev", default-features = false, git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.37" }


xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.37" }
xcm-simulator = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.37" }
xcm-executor = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.37" }
xcm-builder = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.37" }
pallet-xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.37" }
polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.37" }
polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.37" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.37" }

parachain-info = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37", default-features = false }
parachains-common = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37", default-features = false }
cumulus-pallet-dmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37", default-features = false }
cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37", default-features = false }
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.37", default-features = false }

[features]
default = ["std"]
std = [
"codec/std",
"sp-runtime/std",
"sp-std/std",
"pallet-assets/std",
"pallet-balances/std",
"frame-benchmarking/std",
"frame-support/std",
"frame-system/std",
"scale-info/std",
"xcm-primitives/std",
"xcm/std",
"xcm-executor/std",
"xcm-builder/std",
"pallet-xcm/std",
"polkadot-core-primitives/std",
"polkadot-runtime-parachains/std",
"polkadot-parachain/std",
"parachain-info/std",
"parachains-common/std",
"cumulus-pallet-dmp-queue/std",
"cumulus-pallet-xcmp-queue/std",
"cumulus-primitives-core/std",
]
runtime-benchmarks = ["frame-benchmarking/runtime-benchmarks"]
try-runtime = ["frame-support/try-runtime"]
18 changes: 18 additions & 0 deletions pallets/maintenance-mode/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Maintenance Mode Pallet

## Overview

## Configuration

### Types


## Extrinsics


#### Parameters


#### Errors

</details>
32 changes: 32 additions & 0 deletions pallets/maintenance-mode/src/benchmarking.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//! Benchmarking setup for pallet-asset-registry

use super::*;

#[allow(unused)]
use crate::Pallet as MaintenanceMode;
use crate::{ACTIVATED, DEACTIVATEDD};
use frame_benchmarking::benchmarks;
use frame_support::{assert_ok, traits::fungibles::Inspect};
use frame_system::RawOrigin;
use xcm::opaque::latest::{
Junction::{GeneralIndex, PalletInstance, Parachain},
Junctions, MultiLocation,
};

benchmarks! {
activate_maintenance_mode {
MaintenanceMode::<T>::activate_maintenance_mode(RawOrigin::Root.into())?;
}: _(RawOrigin::Root)
verify {
assert_eq!(MaintenanceModeStatus::<T>::get(), ACTIVATED);
}

deactivate_maintenance_mode {
MaintenanceMode::<T>::deactivate_maintenance_mode(RawOrigin::Root.into())?;
}: _(RawOrigin::Root)
verify {
assert_eq!(MaintenanceModeStatus::<T>::get(), DEACTIVATEDD);
}

impl_benchmark_test_suite!(MaintenanceMode, crate::mock::new_test_ext(), crate::mock::Test);
}
Loading