From 00f7621775a931a08df5c95641c1b3ebb413e031 Mon Sep 17 00:00:00 2001 From: Valentin Fernandez <33705477+valentinfernandez1@users.noreply.github.com> Date: Wed, 14 Jun 2023 08:52:24 -0300 Subject: [PATCH] [Backport] #220 Apache License and #223 Minor Refactoring (#228) * backport apache license * backport minor refactoring PR #223 * fmt --- node/build.rs | 27 ++++---- node/src/chain_spec/mod.rs | 29 ++++---- node/src/chain_spec/stout.rs | 23 ++++++- node/src/chain_spec/trappist.rs | 46 ++++++++----- node/src/cli.rs | 31 +++++---- node/src/command.rs | 31 +++++---- node/src/main.rs | 29 ++++---- node/src/rpc.rs | 33 +++++---- node/src/service.rs | 69 ++++++++++--------- node/tests/benchmark_storage_works.rs | 17 +++++ node/tests/common.rs | 31 +++++---- node/tests/polkadot_argument_parsing.rs | 31 +++++---- node/tests/polkadot_mdns_issue.rs | 31 +++++---- node/tests/purge_chain_works.rs | 31 +++++---- node/tests/running_the_node_and_interrupt.rs | 31 +++++---- pallets/asset-registry/src/benchmarking.rs | 17 +++++ pallets/asset-registry/src/lib.rs | 17 +++++ pallets/asset-registry/src/mock.rs | 17 +++++ pallets/asset-registry/src/tests.rs | 17 +++++ pallets/asset-registry/src/weights.rs | 17 +++++ pallets/benchmarks/src/benchmarking.rs | 17 +++++ pallets/benchmarks/src/lib.rs | 17 +++++ pallets/benchmarks/src/weights.rs | 17 +++++ pallets/lockdown-mode/src/benchmarking.rs | 17 +++++ pallets/lockdown-mode/src/lib.rs | 25 +++++-- pallets/lockdown-mode/src/mock.rs | 17 +++++ pallets/lockdown-mode/src/tests.rs | 17 +++++ pallets/lockdown-mode/src/weights.rs | 17 +++++ primitives/xcm/src/lib.rs | 17 +++++ runtime/stout/build.rs | 17 +++++ runtime/stout/src/constants.rs | 4 +- runtime/stout/src/contracts.rs | 17 +++++ runtime/stout/src/lib.rs | 27 ++++---- runtime/stout/src/xcm_config.rs | 4 +- runtime/trappist/build.rs | 17 +++++ runtime/trappist/src/constants.rs | 7 +- runtime/trappist/src/contracts.rs | 17 +++++ runtime/trappist/src/impls.rs | 27 ++++---- runtime/trappist/src/lib.rs | 27 ++++---- runtime/trappist/src/weights/mod.rs | 17 +++++ .../weights/trappist_runtime_benchmarks.rs | 16 +++++ runtime/trappist/src/weights/xcm/mod.rs | 27 ++++---- .../xcm/pallet_xcm_benchmarks_fungible.rs | 27 ++++---- .../xcm/pallet_xcm_benchmarks_generic.rs | 27 ++++---- runtime/trappist/src/xcm_config.rs | 4 +- templates/file_header.txt | 16 +++++ 46 files changed, 729 insertions(+), 305 deletions(-) create mode 100644 templates/file_header.txt diff --git a/node/build.rs b/node/build.rs index ae164d6c..fbd3802a 100644 --- a/node/build.rs +++ b/node/build.rs @@ -1,18 +1,19 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of Cumulus. +// This file is part of Trappist. -// Substrate is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 -// Substrate is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Cumulus. If not, see . +// 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. use substrate_build_script_utils::{generate_cargo_keys, rerun_if_git_head_changed}; diff --git a/node/src/chain_spec/mod.rs b/node/src/chain_spec/mod.rs index 36b1b67a..23259ea2 100644 --- a/node/src/chain_spec/mod.rs +++ b/node/src/chain_spec/mod.rs @@ -1,18 +1,19 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of Cumulus. +// This file is part of Trappist. -// Cumulus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 -// Cumulus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Cumulus. If not, see . +// 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. use parachains_common::{AccountId, Signature}; use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup}; @@ -45,7 +46,7 @@ impl Extensions { /// Helper function to generate a crypto pair from seed pub fn get_public_from_seed(seed: &str) -> ::Public { - TPublic::Pair::from_string(&format!("//{}", seed), None) + TPublic::Pair::from_string(&format!("//{seed}"), None) .expect("static values are valid; qed") .public() } diff --git a/node/src/chain_spec/stout.rs b/node/src/chain_spec/stout.rs index e7cfda94..13a6055f 100644 --- a/node/src/chain_spec/stout.rs +++ b/node/src/chain_spec/stout.rs @@ -1,3 +1,20 @@ +// This file is part of Trappist. + +// 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. + use crate::chain_spec::{ get_account_id_from_seed, get_collator_keys_from_seed, Extensions, SAFE_XCM_VERSION, }; @@ -97,11 +114,11 @@ fn testnet_genesis( }, balances: BalancesConfig { // Configure endowed accounts with initial balance of 1 << 60. - balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(), + balances: endowed_accounts.into_iter().map(|k| (k, 1 << 60)).collect(), }, parachain_info: stout_runtime::ParachainInfoConfig { parachain_id: id }, collator_selection: stout_runtime::CollatorSelectionConfig { - invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), + invulnerables: invulnerables.iter().map(|(acc, _)| acc).cloned().collect(), candidacy_bond: EXISTENTIAL_DEPOSIT * 16, ..Default::default() }, @@ -129,7 +146,7 @@ fn testnet_genesis( }, assets: AssetsConfig { assets: vec![], accounts: vec![], metadata: vec![] }, council: CouncilConfig { - members: invulnerables.iter().map(|x| x.0.clone()).collect::>(), + members: invulnerables.into_iter().map(|x| x.0).collect::>(), phantom: Default::default(), }, dex: Default::default(), diff --git a/node/src/chain_spec/trappist.rs b/node/src/chain_spec/trappist.rs index 81c1d6e2..997fcdd0 100644 --- a/node/src/chain_spec/trappist.rs +++ b/node/src/chain_spec/trappist.rs @@ -1,3 +1,20 @@ +// This file is part of Trappist. + +// 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. + use crate::chain_spec::{ get_account_id_from_seed, get_collator_keys_from_seed, Extensions, SAFE_XCM_VERSION, }; @@ -150,11 +167,11 @@ pub fn testnet_genesis( }, balances: BalancesConfig { // Configure endowed accounts with initial balance of 1 << 60. - balances: endowed_accounts.iter().cloned().map(|k| (k, 1 << 60)).collect(), + balances: endowed_accounts.into_iter().map(|k| (k, 1 << 60)).collect(), }, parachain_info: trappist_runtime::ParachainInfoConfig { parachain_id: id }, collator_selection: trappist_runtime::CollatorSelectionConfig { - invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), + invulnerables: invulnerables.iter().map(|(acc, _)| acc).cloned().collect(), candidacy_bond: EXISTENTIAL_DEPOSIT * 16, ..Default::default() }, @@ -185,7 +202,7 @@ pub fn testnet_genesis( }, assets: AssetsConfig { assets: vec![], accounts: vec![], metadata: vec![] }, council: CouncilConfig { - members: invulnerables.iter().map(|x| x.0.clone()).collect::>(), + members: invulnerables.into_iter().map(|x| x.0).collect::>(), phantom: Default::default(), }, treasury: Default::default(), @@ -259,32 +276,25 @@ fn trappist_live_genesis( balances: BalancesConfig { balances: endowed_accounts .iter() - .cloned() - .chain(std::iter::once(root_key.clone())) - .map(|k| { - if k == root_key { - (k, 1_000_000_000_000_000_000) - } else { - (k, 1_500_000_000_000_000_000) - } - }) + .map(|x| (x.clone(), 1_500_000_000_000_000_000)) + .chain(std::iter::once((root_key.clone(), 1_000_000_000_000_000_000))) .collect(), }, parachain_info: trappist_runtime::ParachainInfoConfig { parachain_id: id }, collator_selection: trappist_runtime::CollatorSelectionConfig { - invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(), + invulnerables: invulnerables.iter().map(|(acc, _)| acc).cloned().collect(), candidacy_bond: EXISTENTIAL_DEPOSIT * 16, ..Default::default() }, democracy: Default::default(), session: SessionConfig { keys: invulnerables - .iter() + .into_iter() .map(|(acc, aura)| { ( - acc.clone(), // account id - acc.clone(), // validator id - session_keys(aura.clone()), // session keys + acc.clone(), // account id + acc, // validator id + session_keys(aura), // session keys ) }) .collect(), @@ -302,7 +312,7 @@ fn trappist_live_genesis( assets: AssetsConfig { assets: vec![], accounts: vec![], metadata: vec![] }, council: CouncilConfig { // We set the endowed accounts with balance as members of the council. - members: endowed_accounts.iter().map(|x| x.clone()).collect::>(), + members: endowed_accounts, phantom: Default::default(), }, treasury: Default::default(), diff --git a/node/src/cli.rs b/node/src/cli.rs index 90460095..e8130be3 100644 --- a/node/src/cli.rs +++ b/node/src/cli.rs @@ -1,18 +1,19 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of Cumulus. - -// Cumulus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Cumulus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Cumulus. If not, see . +// This file is part of Trappist. + +// 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. use std::path::PathBuf; diff --git a/node/src/command.rs b/node/src/command.rs index e5d6f6c5..095e7c8e 100644 --- a/node/src/command.rs +++ b/node/src/command.rs @@ -1,18 +1,19 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of Cumulus. - -// Cumulus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Cumulus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Cumulus. If not, see . +// This file is part of Trappist. + +// 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. use crate::{ chain_spec, diff --git a/node/src/main.rs b/node/src/main.rs index d114d2f5..75820fc5 100644 --- a/node/src/main.rs +++ b/node/src/main.rs @@ -1,20 +1,21 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of Cumulus. +// This file is part of Trappist. -// Cumulus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 -// Cumulus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// 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. -// You should have received a copy of the GNU General Public License -// along with Cumulus. If not, see . - -//! Cumulus test parachain collator +//! Trappist Node CLI. #![warn(missing_docs)] #![warn(unused_extern_crates)] diff --git a/node/src/rpc.rs b/node/src/rpc.rs index af794765..5d784b52 100644 --- a/node/src/rpc.rs +++ b/node/src/rpc.rs @@ -1,20 +1,19 @@ -// Copyright 2021 Parity Technologies (UK) Ltd. -// This file is part of Cumulus. - -// Cumulus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Cumulus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Cumulus. If not, see . - -//! Parachain-specific RPCs implementation. +// This file is part of Trappist. + +// 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. #![warn(missing_docs)] diff --git a/node/src/service.rs b/node/src/service.rs index a5fbf28a..3888f241 100644 --- a/node/src/service.rs +++ b/node/src/service.rs @@ -1,18 +1,19 @@ -// Copyright 2019-2021 Parity Technologies (UK) Ltd. -// This file is part of Cumulus. - -// Cumulus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Cumulus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Cumulus. If not, see . +// This file is part of Trappist. + +// 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. use cumulus_client_cli::CollatorOptions; use cumulus_client_consensus_aura::{AuraConsensus, BuildAuraConsensusParams, SlotProportion}; @@ -711,37 +712,41 @@ where <::Pair as Pair>::Signature: TryFrom> + std::hash::Hash + sp_runtime::traits::Member + Codec, { - let client2 = client.clone(); + let aura_verifier = { + let client = client.clone(); - let aura_verifier = move || { - let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client2).unwrap(); + move || { + let slot_duration = + cumulus_client_consensus_aura::slot_duration(client.as_ref()).unwrap(); - Box::new( - cumulus_client_consensus_aura::build_verifier::<::Pair, _, _, _>( - cumulus_client_consensus_aura::BuildVerifierParams { - client: client2.clone(), - create_inherent_data_providers: move |_, _| async move { - let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); + Box::new(cumulus_client_consensus_aura::build_verifier::< + ::Pair, + _, + _, + _, + >(cumulus_client_consensus_aura::BuildVerifierParams { + client, + create_inherent_data_providers: move |_, _| async move { + let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); - let slot = + let slot = sp_consensus_aura::inherents::InherentDataProvider::from_timestamp_and_slot_duration( *timestamp, slot_duration, ); - Ok((slot, timestamp)) - }, - telemetry: telemetry_handle, + Ok((slot, timestamp)) }, - ), - ) as Box<_> + telemetry: telemetry_handle, + })) as Box<_> + } }; let relay_chain_verifier = - Box::new(RelayChainVerifier::new(client.clone(), |_, _| async { Ok(()) })) as Box<_>; + Box::new(RelayChainVerifier::new(client.clone(), |_, _| async { Ok(()) })); let verifier = Verifier { - client: client.clone(), + client, relay_chain_verifier, aura_verifier: BuildOnAccess::Uninitialized(Some(Box::new(aura_verifier))), _phantom: PhantomData, diff --git a/node/tests/benchmark_storage_works.rs b/node/tests/benchmark_storage_works.rs index 916d65c0..8a6ef65a 100644 --- a/node/tests/benchmark_storage_works.rs +++ b/node/tests/benchmark_storage_works.rs @@ -1,3 +1,20 @@ +// This file is part of Trappist. + +// 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. + #![cfg(feature = "runtime-benchmarks")] use assert_cmd::cargo::cargo_bin; diff --git a/node/tests/common.rs b/node/tests/common.rs index 1d3d710c..eb330bd6 100644 --- a/node/tests/common.rs +++ b/node/tests/common.rs @@ -1,18 +1,19 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. -// This file is part of Substrate. - -// Substrate is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Substrate is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Substrate. If not, see . +// This file is part of Trappist. + +// 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. #![cfg(unix)] diff --git a/node/tests/polkadot_argument_parsing.rs b/node/tests/polkadot_argument_parsing.rs index ad91ce0e..e3f133da 100644 --- a/node/tests/polkadot_argument_parsing.rs +++ b/node/tests/polkadot_argument_parsing.rs @@ -1,18 +1,19 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. -// This file is part of Substrate. - -// Substrate is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Substrate is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Substrate. If not, see . +// This file is part of Trappist. + +// 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. use tempfile::tempdir; diff --git a/node/tests/polkadot_mdns_issue.rs b/node/tests/polkadot_mdns_issue.rs index bb492a31..8feaa630 100644 --- a/node/tests/polkadot_mdns_issue.rs +++ b/node/tests/polkadot_mdns_issue.rs @@ -1,18 +1,19 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. -// This file is part of Substrate. - -// Substrate is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Substrate is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Substrate. If not, see . +// This file is part of Trappist. + +// 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. use tempfile::tempdir; diff --git a/node/tests/purge_chain_works.rs b/node/tests/purge_chain_works.rs index 34a51dcf..904330a0 100644 --- a/node/tests/purge_chain_works.rs +++ b/node/tests/purge_chain_works.rs @@ -1,18 +1,19 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. -// This file is part of Substrate. - -// Substrate is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Substrate is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Substrate. If not, see . +// This file is part of Trappist. + +// 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. use assert_cmd::cargo::cargo_bin; use nix::sys::signal::SIGINT; diff --git a/node/tests/running_the_node_and_interrupt.rs b/node/tests/running_the_node_and_interrupt.rs index 6ffa39bd..5df0af24 100644 --- a/node/tests/running_the_node_and_interrupt.rs +++ b/node/tests/running_the_node_and_interrupt.rs @@ -1,18 +1,19 @@ -// Copyright 2020-2021 Parity Technologies (UK) Ltd. -// This file is part of Substrate. - -// Substrate is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Substrate is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Substrate. If not, see . +// This file is part of Trappist. + +// 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. use tempfile::tempdir; diff --git a/pallets/asset-registry/src/benchmarking.rs b/pallets/asset-registry/src/benchmarking.rs index bcd57509..b19a2c4e 100644 --- a/pallets/asset-registry/src/benchmarking.rs +++ b/pallets/asset-registry/src/benchmarking.rs @@ -1,3 +1,20 @@ +// This file is part of Trappist. + +// 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. + //! Benchmarking setup for pallet-asset-registry use super::*; diff --git a/pallets/asset-registry/src/lib.rs b/pallets/asset-registry/src/lib.rs index 2ee81829..67637569 100644 --- a/pallets/asset-registry/src/lib.rs +++ b/pallets/asset-registry/src/lib.rs @@ -1,3 +1,20 @@ +// This file is part of Trappist. + +// 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. + #![cfg_attr(not(feature = "std"), no_std)] /// Edit this file to define custom logic or remove it if it is not needed. diff --git a/pallets/asset-registry/src/mock.rs b/pallets/asset-registry/src/mock.rs index ff8295bc..789b2b9e 100644 --- a/pallets/asset-registry/src/mock.rs +++ b/pallets/asset-registry/src/mock.rs @@ -1,3 +1,20 @@ +// This file is part of Trappist. + +// 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. + use crate as pallet_asset_registry; use frame_support::traits::{AsEnsureOriginWithArg, ConstU16, ConstU64, GenesisBuild}; use frame_system as system; diff --git a/pallets/asset-registry/src/tests.rs b/pallets/asset-registry/src/tests.rs index 2b5271ff..63bfac51 100644 --- a/pallets/asset-registry/src/tests.rs +++ b/pallets/asset-registry/src/tests.rs @@ -1,3 +1,20 @@ +// This file is part of Trappist. + +// 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. + use frame_support::{assert_noop, assert_ok}; use xcm::latest::prelude::*; diff --git a/pallets/asset-registry/src/weights.rs b/pallets/asset-registry/src/weights.rs index 4d429a7b..2b07e424 100644 --- a/pallets/asset-registry/src/weights.rs +++ b/pallets/asset-registry/src/weights.rs @@ -1,3 +1,20 @@ +// This file is part of Trappist. + +// 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. + //! Autogenerated weights for `pallet_asset_registry` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev diff --git a/pallets/benchmarks/src/benchmarking.rs b/pallets/benchmarks/src/benchmarking.rs index 7d6da011..c29c3005 100644 --- a/pallets/benchmarks/src/benchmarking.rs +++ b/pallets/benchmarks/src/benchmarking.rs @@ -1,3 +1,20 @@ +// This file is part of Trappist. + +// 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. + use frame_benchmarking::benchmarks; use sp_runtime::SaturatedConversion; use xcm::prelude::AssetId as XcmAssetId; diff --git a/pallets/benchmarks/src/lib.rs b/pallets/benchmarks/src/lib.rs index b8cb90e1..da3acada 100644 --- a/pallets/benchmarks/src/lib.rs +++ b/pallets/benchmarks/src/lib.rs @@ -1,3 +1,20 @@ +// This file is part of Trappist. + +// 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. + //! Pallet for benchmarking. #![cfg_attr(not(feature = "std"), no_std)] diff --git a/pallets/benchmarks/src/weights.rs b/pallets/benchmarks/src/weights.rs index 411eef76..f726a132 100644 --- a/pallets/benchmarks/src/weights.rs +++ b/pallets/benchmarks/src/weights.rs @@ -1,3 +1,20 @@ +// This file is part of Trappist. + +// 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. + use frame_support::weights::Weight; pub trait WeightInfo { diff --git a/pallets/lockdown-mode/src/benchmarking.rs b/pallets/lockdown-mode/src/benchmarking.rs index 5834ebad..f5196adb 100644 --- a/pallets/lockdown-mode/src/benchmarking.rs +++ b/pallets/lockdown-mode/src/benchmarking.rs @@ -1,3 +1,20 @@ +// This file is part of Trappist. + +// 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. + use super::*; #[allow(unused)] diff --git a/pallets/lockdown-mode/src/lib.rs b/pallets/lockdown-mode/src/lib.rs index de0ce6ba..7c61cd99 100644 --- a/pallets/lockdown-mode/src/lib.rs +++ b/pallets/lockdown-mode/src/lib.rs @@ -1,3 +1,20 @@ +// This file is part of Trappist. + +// 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. + #![cfg_attr(not(feature = "std"), no_std)] /// Edit this file to define custom logic or remove it if it is not needed. @@ -49,7 +66,7 @@ pub mod pallet { #[pallet::genesis_build] impl GenesisBuild for GenesisConfig { fn build(&self) { - LockdownModeStatus::::put(&self.initial_status); + LockdownModeStatus::::put(self.initial_status); } } @@ -131,11 +148,7 @@ pub mod pallet { impl Contains for Pallet { fn contains(call: &T::RuntimeCall) -> bool { - if LockdownModeStatus::::get() { - T::BlackListedCalls::contains(call) - } else { - return true - } + !LockdownModeStatus::::get() || T::BlackListedCalls::contains(call) } } diff --git a/pallets/lockdown-mode/src/mock.rs b/pallets/lockdown-mode/src/mock.rs index 4ec21988..8ad593fa 100644 --- a/pallets/lockdown-mode/src/mock.rs +++ b/pallets/lockdown-mode/src/mock.rs @@ -1,3 +1,20 @@ +// This file is part of Trappist. + +// 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. + use crate as pallet_lockdown_mode; use cumulus_primitives_core::{relay_chain::BlockNumber as RelayBlockNumber, DmpMessageHandler}; use frame_support::{ diff --git a/pallets/lockdown-mode/src/tests.rs b/pallets/lockdown-mode/src/tests.rs index 24b641cb..e490e351 100644 --- a/pallets/lockdown-mode/src/tests.rs +++ b/pallets/lockdown-mode/src/tests.rs @@ -1,3 +1,20 @@ +// This file is part of Trappist. + +// 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. + use super::{GenesisConfig, *}; use crate::{mock::*, Error, ACTIVATED, DEACTIVATED}; use frame_support::{assert_noop, assert_ok, traits::Contains}; diff --git a/pallets/lockdown-mode/src/weights.rs b/pallets/lockdown-mode/src/weights.rs index 937b79d2..0dd0935f 100644 --- a/pallets/lockdown-mode/src/weights.rs +++ b/pallets/lockdown-mode/src/weights.rs @@ -1,3 +1,20 @@ +// This file is part of Trappist. + +// 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. + //! Autogenerated weights for `pallet_lockdown_mode` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev diff --git a/primitives/xcm/src/lib.rs b/primitives/xcm/src/lib.rs index 0a60e2cb..33808744 100644 --- a/primitives/xcm/src/lib.rs +++ b/primitives/xcm/src/lib.rs @@ -1,3 +1,20 @@ +// This file is part of Trappist. + +// 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. + #![cfg_attr(not(feature = "std"), no_std)] use frame_support::{ diff --git a/runtime/stout/build.rs b/runtime/stout/build.rs index 9b53d245..b1994ac4 100644 --- a/runtime/stout/build.rs +++ b/runtime/stout/build.rs @@ -1,3 +1,20 @@ +// This file is part of Trappist. + +// 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. + use substrate_wasm_builder::WasmBuilder; fn main() { diff --git a/runtime/stout/src/constants.rs b/runtime/stout/src/constants.rs index 6148f5eb..a372c08c 100644 --- a/runtime/stout/src/constants.rs +++ b/runtime/stout/src/constants.rs @@ -1,4 +1,6 @@ -// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// This file is part of Trappist. + +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/runtime/stout/src/contracts.rs b/runtime/stout/src/contracts.rs index e006e614..cd494986 100644 --- a/runtime/stout/src/contracts.rs +++ b/runtime/stout/src/contracts.rs @@ -1,3 +1,20 @@ +// This file is part of Trappist. + +// 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. + use crate::{ constants::currency::deposit, Balance, Balances, RandomnessCollectiveFlip, Runtime, RuntimeBlockWeights, RuntimeCall, RuntimeEvent, Timestamp, diff --git a/runtime/stout/src/lib.rs b/runtime/stout/src/lib.rs index 8b23218d..eb2b607f 100644 --- a/runtime/stout/src/lib.rs +++ b/runtime/stout/src/lib.rs @@ -1,18 +1,19 @@ -// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. +// This file is part of Trappist. + +// 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 // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// 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. #![cfg_attr(not(feature = "std"), no_std)] #![recursion_limit = "256"] diff --git a/runtime/stout/src/xcm_config.rs b/runtime/stout/src/xcm_config.rs index 01112320..0ced3959 100644 --- a/runtime/stout/src/xcm_config.rs +++ b/runtime/stout/src/xcm_config.rs @@ -1,4 +1,6 @@ -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// This file is part of Trappist. + +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/runtime/trappist/build.rs b/runtime/trappist/build.rs index 9b53d245..b1994ac4 100644 --- a/runtime/trappist/build.rs +++ b/runtime/trappist/build.rs @@ -1,3 +1,20 @@ +// This file is part of Trappist. + +// 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. + use substrate_wasm_builder::WasmBuilder; fn main() { diff --git a/runtime/trappist/src/constants.rs b/runtime/trappist/src/constants.rs index 116f3a87..8fdb7b30 100644 --- a/runtime/trappist/src/constants.rs +++ b/runtime/trappist/src/constants.rs @@ -1,4 +1,6 @@ -// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// This file is part of Trappist. + +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); @@ -33,7 +35,6 @@ pub mod currency { /// Fee-related. pub mod fee { - use super::currency::CENTS; use frame_support::weights::{ constants::{ExtrinsicBaseWeight, WEIGHT_REF_TIME_PER_SECOND}, WeightToFeeCoefficient, WeightToFeeCoefficients, WeightToFeePolynomial, @@ -42,6 +43,8 @@ pub mod fee { use smallvec::smallvec; pub use sp_runtime::Perbill; + use super::currency::CENTS; + /// The block saturation level. Fees will be updates based on this value. pub const TARGET_BLOCK_FULLNESS: Perbill = Perbill::from_percent(25); diff --git a/runtime/trappist/src/contracts.rs b/runtime/trappist/src/contracts.rs index bf3144eb..a2c22ff6 100644 --- a/runtime/trappist/src/contracts.rs +++ b/runtime/trappist/src/contracts.rs @@ -1,3 +1,20 @@ +// This file is part of Trappist. + +// 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. + use crate::{ constants::currency::deposit, Balance, Balances, RandomnessCollectiveFlip, Runtime, RuntimeBlockWeights, RuntimeCall, RuntimeEvent, Timestamp, diff --git a/runtime/trappist/src/impls.rs b/runtime/trappist/src/impls.rs index 46ddb134..74fbc6ed 100644 --- a/runtime/trappist/src/impls.rs +++ b/runtime/trappist/src/impls.rs @@ -1,4 +1,6 @@ -// Copyright (C) 2021 Parity Technologies (UK) Ltd. +// This file is part of Trappist. + +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); @@ -77,18 +79,17 @@ where pub struct RuntimeBlackListedCalls; impl Contains for RuntimeBlackListedCalls { fn contains(call: &RuntimeCall) -> bool { - match call { - RuntimeCall::Balances(_) => false, - RuntimeCall::Assets(_) => false, - RuntimeCall::Dex(_) => false, - RuntimeCall::PolkadotXcm(_) => false, - RuntimeCall::Treasury(_) => false, - RuntimeCall::Chess(_) => false, - RuntimeCall::Contracts(_) => false, - RuntimeCall::Uniques(_) => false, - RuntimeCall::AssetRegistry(_) => false, - _ => true, - } + !matches!( + call, + RuntimeCall::Balances(_) | + RuntimeCall::Assets(_) | + RuntimeCall::Dex(_) | + RuntimeCall::PolkadotXcm(_) | + RuntimeCall::Treasury(_) | + RuntimeCall::Contracts(_) | + RuntimeCall::Uniques(_) | + RuntimeCall::AssetRegistry(_) + ) } } diff --git a/runtime/trappist/src/lib.rs b/runtime/trappist/src/lib.rs index 8e7e8a95..d91f4176 100644 --- a/runtime/trappist/src/lib.rs +++ b/runtime/trappist/src/lib.rs @@ -1,18 +1,19 @@ -// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. +// This file is part of Trappist. + +// 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 // -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. +// http://www.apache.org/licenses/LICENSE-2.0 // -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . +// 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. #![cfg_attr(not(feature = "std"), no_std)] #![recursion_limit = "256"] diff --git a/runtime/trappist/src/weights/mod.rs b/runtime/trappist/src/weights/mod.rs index 2b60e095..82f39633 100644 --- a/runtime/trappist/src/weights/mod.rs +++ b/runtime/trappist/src/weights/mod.rs @@ -1,3 +1,20 @@ +// This file is part of Trappist. + +// 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. + use ::trappist_runtime_benchmarks::WeightInfo; use xcm_primitives::DropAssetsWeigher; diff --git a/runtime/trappist/src/weights/trappist_runtime_benchmarks.rs b/runtime/trappist/src/weights/trappist_runtime_benchmarks.rs index 49149203..201c4631 100644 --- a/runtime/trappist/src/weights/trappist_runtime_benchmarks.rs +++ b/runtime/trappist/src/weights/trappist_runtime_benchmarks.rs @@ -1,3 +1,19 @@ +// This file is part of Trappist. + +// 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. //! Autogenerated weights for `trappist_runtime_benchmarks` //! diff --git a/runtime/trappist/src/weights/xcm/mod.rs b/runtime/trappist/src/weights/xcm/mod.rs index f5f884d4..09d81d8f 100644 --- a/runtime/trappist/src/weights/xcm/mod.rs +++ b/runtime/trappist/src/weights/xcm/mod.rs @@ -1,18 +1,19 @@ -// Copyright 2022 Parity Technologies (UK) Ltd. -// This file is part of Cumulus. +// This file is part of Trappist. -// Cumulus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 -// Cumulus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Cumulus. If not, see . +// 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. mod pallet_xcm_benchmarks_fungible; mod pallet_xcm_benchmarks_generic; diff --git a/runtime/trappist/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs b/runtime/trappist/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs index e1f2a47e..05117918 100644 --- a/runtime/trappist/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs +++ b/runtime/trappist/src/weights/xcm/pallet_xcm_benchmarks_fungible.rs @@ -1,18 +1,19 @@ -// Copyright Parity Technologies (UK) Ltd. -// This file is part of Cumulus. +// This file is part of Trappist. -// Cumulus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 -// Cumulus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Cumulus. If not, see . +// 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. //! Autogenerated weights for `pallet_xcm_benchmarks::fungible` //! diff --git a/runtime/trappist/src/weights/xcm/pallet_xcm_benchmarks_generic.rs b/runtime/trappist/src/weights/xcm/pallet_xcm_benchmarks_generic.rs index 5d42f228..93ed6f38 100644 --- a/runtime/trappist/src/weights/xcm/pallet_xcm_benchmarks_generic.rs +++ b/runtime/trappist/src/weights/xcm/pallet_xcm_benchmarks_generic.rs @@ -1,18 +1,19 @@ -// Copyright Parity Technologies (UK) Ltd. -// This file is part of Cumulus. +// This file is part of Trappist. -// Cumulus is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. +// Copyright (C) Parity Technologies (UK) Ltd. +// SPDX-License-Identifier: Apache-2.0 -// Cumulus is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Cumulus. If not, see . +// 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. //! Autogenerated weights for `pallet_xcm_benchmarks::generic` //! diff --git a/runtime/trappist/src/xcm_config.rs b/runtime/trappist/src/xcm_config.rs index 6976a18e..32a0059b 100644 --- a/runtime/trappist/src/xcm_config.rs +++ b/runtime/trappist/src/xcm_config.rs @@ -1,4 +1,6 @@ -// Copyright (C) 2022 Parity Technologies (UK) Ltd. +// This file is part of Trappist. + +// Copyright (C) Parity Technologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.0 // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/templates/file_header.txt b/templates/file_header.txt new file mode 100644 index 00000000..cebb54a9 --- /dev/null +++ b/templates/file_header.txt @@ -0,0 +1,16 @@ +// This file is part of Trappist. + +// 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.