diff --git a/Cargo.lock b/Cargo.lock index a613b7ba03686..d2b6992ef5537 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7362,6 +7362,7 @@ dependencies = [ "sc-service", "sc-telemetry", "sc-tracing", + "sc-utils", "serde", "serde_json", "sp-blockchain", @@ -7370,7 +7371,6 @@ dependencies = [ "sp-keystore", "sp-panic-handler", "sp-runtime", - "sp-utils", "sp-version", "structopt", "tempfile", @@ -7391,6 +7391,7 @@ dependencies = [ "parking_lot 0.11.1", "sc-executor", "sc-transaction-pool-api", + "sc-utils", "sp-api", "sp-blockchain", "sp-consensus", @@ -7403,7 +7404,6 @@ dependencies = [ "sp-storage", "sp-test-primitives", "sp-trie", - "sp-utils", "substrate-prometheus-endpoint", "substrate-test-runtime", "thiserror", @@ -7448,6 +7448,7 @@ dependencies = [ "log 0.4.14", "parking_lot 0.11.1", "sc-client-api", + "sc-utils", "serde", "sp-api", "sp-blockchain", @@ -7456,7 +7457,6 @@ dependencies = [ "sp-runtime", "sp-state-machine", "sp-test-primitives", - "sp-utils", "substrate-prometheus-endpoint", "thiserror", ] @@ -7802,6 +7802,7 @@ dependencies = [ "sc-network-gossip", "sc-network-test", "sc-telemetry", + "sc-utils", "serde_json", "sp-api", "sp-application-crypto", @@ -7814,7 +7815,6 @@ dependencies = [ "sp-keystore", "sp-runtime", "sp-tracing", - "sp-utils", "substrate-prometheus-endpoint", "substrate-test-runtime-client", "tempfile", @@ -7931,6 +7931,7 @@ dependencies = [ "sc-client-api", "sc-consensus", "sc-peerset", + "sc-utils", "serde", "serde_json", "smallvec 1.6.1", @@ -7942,7 +7943,6 @@ dependencies = [ "sp-runtime", "sp-test-primitives", "sp-tracing", - "sp-utils", "substrate-prometheus-endpoint", "substrate-test-runtime", "substrate-test-runtime-client", @@ -8021,13 +8021,13 @@ dependencies = [ "sc-network", "sc-transaction-pool", "sc-transaction-pool-api", + "sc-utils", "sp-api", "sp-consensus", "sp-core", "sp-offchain", "sp-runtime", "sp-tracing", - "sp-utils", "substrate-test-runtime-client", "threadpool", "tokio", @@ -8041,8 +8041,8 @@ dependencies = [ "libp2p", "log 0.4.14", "rand 0.7.3", + "sc-utils", "serde_json", - "sp-utils", "wasm-timer", ] @@ -8075,6 +8075,7 @@ dependencies = [ "sc-tracing", "sc-transaction-pool", "sc-transaction-pool-api", + "sc-utils", "serde_json", "sp-api", "sp-blockchain", @@ -8086,7 +8087,6 @@ dependencies = [ "sp-rpc", "sp-runtime", "sp-session", - "sp-utils", "sp-version", "substrate-test-runtime-client", ] @@ -8179,6 +8179,7 @@ dependencies = [ "sc-tracing", "sc-transaction-pool", "sc-transaction-pool-api", + "sc-utils", "serde", "serde_json", "sp-api", @@ -8198,7 +8199,6 @@ dependencies = [ "sp-transaction-pool", "sp-transaction-storage-proof", "sp-trie", - "sp-utils", "sp-version", "substrate-prometheus-endpoint", "substrate-test-runtime", @@ -8355,6 +8355,7 @@ dependencies = [ "sc-block-builder", "sc-client-api", "sc-transaction-pool-api", + "sc-utils", "serde", "sp-api", "sp-blockchain", @@ -8363,7 +8364,6 @@ dependencies = [ "sp-runtime", "sp-tracing", "sp-transaction-pool", - "sp-utils", "substrate-prometheus-endpoint", "substrate-test-runtime", "substrate-test-runtime-client", @@ -8384,6 +8384,16 @@ dependencies = [ "thiserror", ] +[[package]] +name = "sc-utils" +version = "4.0.0-dev" +dependencies = [ + "futures 0.3.16", + "futures-timer 3.0.2", + "lazy_static", + "prometheus", +] + [[package]] name = "schannel" version = "0.1.19" @@ -9529,16 +9539,6 @@ dependencies = [ "trie-standardmap", ] -[[package]] -name = "sp-utils" -version = "4.0.0-dev" -dependencies = [ - "futures 0.3.16", - "futures-timer 3.0.2", - "lazy_static", - "prometheus", -] - [[package]] name = "sp-version" version = "4.0.0-dev" diff --git a/Cargo.toml b/Cargo.toml index f583c2b087c0c..64cbbf38966c3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -61,6 +61,7 @@ members = [ "client/tracing/proc-macro", "client/transaction-pool", "client/transaction-pool/api", + "client/utils", "frame/assets", "frame/atomic-swap", "frame/aura", @@ -180,7 +181,6 @@ members = [ "primitives/transaction-pool", "primitives/transaction-storage-proof", "primitives/trie", - "primitives/utils", "primitives/version", "primitives/version/proc-macro", "primitives/wasm-interface", diff --git a/client/api/Cargo.toml b/client/api/Cargo.toml index 06acc33bd20cd..772f22e822eb2 100644 --- a/client/api/Cargo.toml +++ b/client/api/Cargo.toml @@ -30,7 +30,7 @@ sp-database = { version = "4.0.0-dev", path = "../../primitives/database" } sp-core = { version = "4.0.0-dev", default-features = false, path = "../../primitives/core" } sp-keystore = { version = "0.10.0-dev", default-features = false, path = "../../primitives/keystore" } sp-api = { version = "4.0.0-dev", path = "../../primitives/api" } -sp-utils = { version = "4.0.0-dev", path = "../../primitives/utils" } +sc-utils = { version = "4.0.0-dev", path = "../utils" } sp-runtime = { version = "4.0.0-dev", default-features = false, path = "../../primitives/runtime" } sp-state-machine = { version = "0.10.0-dev", path = "../../primitives/state-machine" } sp-trie = { version = "4.0.0-dev", path = "../../primitives/trie" } diff --git a/client/api/src/client.rs b/client/api/src/client.rs index 69c89f1aa5f6f..21f8aecad0536 100644 --- a/client/api/src/client.rs +++ b/client/api/src/client.rs @@ -29,8 +29,8 @@ use std::{collections::HashSet, convert::TryFrom, fmt, sync::Arc}; use crate::{blockchain::Info, notifications::StorageEventStream}; use sc_transaction_pool_api::ChainEvent; +use sc_utils::mpsc::TracingUnboundedReceiver; use sp_blockchain; -use sp_utils::mpsc::TracingUnboundedReceiver; /// Type that implements `futures::Stream` of block import events. pub type ImportNotifications = TracingUnboundedReceiver>; diff --git a/client/api/src/notifications.rs b/client/api/src/notifications.rs index 3532568f9bd5d..1346afd5e54d2 100644 --- a/client/api/src/notifications.rs +++ b/client/api/src/notifications.rs @@ -25,9 +25,9 @@ use std::{ use fnv::{FnvHashMap, FnvHashSet}; use prometheus_endpoint::{register, CounterVec, Opts, Registry, U64}; +use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use sp_core::storage::{StorageData, StorageKey}; use sp_runtime::traits::Block as BlockT; -use sp_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; /// Storage change set #[derive(Debug)] diff --git a/client/cli/Cargo.toml b/client/cli/Cargo.toml index e2d27b95eca23..7798507e529f4 100644 --- a/client/cli/Cargo.toml +++ b/client/cli/Cargo.toml @@ -30,7 +30,7 @@ sc-client-api = { version = "4.0.0-dev", path = "../api" } sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" } sc-network = { version = "0.10.0-dev", path = "../network" } sp-runtime = { version = "4.0.0-dev", path = "../../primitives/runtime" } -sp-utils = { version = "4.0.0-dev", path = "../../primitives/utils" } +sc-utils = { version = "4.0.0-dev", path = "../utils" } sp-version = { version = "4.0.0-dev", path = "../../primitives/version" } sp-core = { version = "4.0.0-dev", path = "../../primitives/core" } sp-keystore = { version = "0.10.0-dev", path = "../../primitives/keystore" } diff --git a/client/cli/src/runner.rs b/client/cli/src/runner.rs index 686b6b3c05fe4..2ec200d9285b1 100644 --- a/client/cli/src/runner.rs +++ b/client/cli/src/runner.rs @@ -21,7 +21,7 @@ use chrono::prelude::*; use futures::{future, future::FutureExt, pin_mut, select, Future}; use log::info; use sc_service::{Configuration, Error as ServiceError, TaskManager, TaskType}; -use sp_utils::metrics::{TOKIO_THREADS_ALIVE, TOKIO_THREADS_TOTAL}; +use sc_utils::metrics::{TOKIO_THREADS_ALIVE, TOKIO_THREADS_TOTAL}; use std::marker::PhantomData; #[cfg(target_family = "unix")] diff --git a/client/consensus/common/Cargo.toml b/client/consensus/common/Cargo.toml index 7e47e157b98dc..6829bd2c6d8b5 100644 --- a/client/consensus/common/Cargo.toml +++ b/client/consensus/common/Cargo.toml @@ -24,7 +24,7 @@ sp-core = { path = "../../../primitives/core", version = "4.0.0-dev" } sp-consensus = { path = "../../../primitives/consensus/common", version = "0.10.0-dev" } sp-state-machine = { version = "0.10.0-dev", path = "../../../primitives/state-machine" } sp-runtime = { version = "4.0.0-dev", path = "../../../primitives/runtime" } -sp-utils = { version = "4.0.0-dev", path = "../../../primitives/utils" } +sc-utils = { version = "4.0.0-dev", path = "../../utils" } sp-api = { version = "4.0.0-dev", path = "../../../primitives/api" } parking_lot = "0.11.1" serde = { version = "1.0", features = ["derive"] } diff --git a/client/consensus/common/src/block_import.rs b/client/consensus/common/src/block_import.rs index d16d71aec9263..6d411dd9afbf1 100644 --- a/client/consensus/common/src/block_import.rs +++ b/client/consensus/common/src/block_import.rs @@ -1,19 +1,20 @@ // This file is part of Substrate. // Copyright (C) 2017-2021 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. +// 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 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. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . //! Block import helpers. diff --git a/client/consensus/common/src/import_queue.rs b/client/consensus/common/src/import_queue.rs index 5117a8fd202de..3f2126ccadf66 100644 --- a/client/consensus/common/src/import_queue.rs +++ b/client/consensus/common/src/import_queue.rs @@ -1,19 +1,20 @@ // This file is part of Substrate. // Copyright (C) 2017-2021 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. +// 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 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. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . //! Import Queue primitive: something which can verify and import blocks. //! diff --git a/client/consensus/common/src/import_queue/basic_queue.rs b/client/consensus/common/src/import_queue/basic_queue.rs index a898e268fc3d6..9042c8798be4f 100644 --- a/client/consensus/common/src/import_queue/basic_queue.rs +++ b/client/consensus/common/src/import_queue/basic_queue.rs @@ -1,19 +1,20 @@ // This file is part of Substrate. // Copyright (C) 2017-2021 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. +// 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 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. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . use futures::{ prelude::*, task::{Context, Poll}, @@ -21,12 +22,12 @@ use futures::{ use futures_timer::Delay; use log::{debug, trace}; use prometheus_endpoint::Registry; +use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use sp_consensus::BlockOrigin; use sp_runtime::{ traits::{Block as BlockT, Header as HeaderT, NumberFor}, Justification, Justifications, }; -use sp_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use std::{marker::PhantomData, pin::Pin, time::Duration}; use crate::{ diff --git a/client/consensus/common/src/import_queue/buffered_link.rs b/client/consensus/common/src/import_queue/buffered_link.rs index 45aaf706ee1bd..87ea6dde5c473 100644 --- a/client/consensus/common/src/import_queue/buffered_link.rs +++ b/client/consensus/common/src/import_queue/buffered_link.rs @@ -1,19 +1,20 @@ // This file is part of Substrate. // Copyright (C) 2017-2021 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. +// 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 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. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . //! Provides the `buffered_link` utility. //! @@ -39,8 +40,8 @@ use crate::import_queue::{Link, Origin}; use futures::prelude::*; +use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use sp_runtime::traits::{Block as BlockT, NumberFor}; -use sp_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use std::{ pin::Pin, task::{Context, Poll}, diff --git a/client/consensus/common/src/metrics.rs b/client/consensus/common/src/metrics.rs index e9af41914a6e6..ade45e3ffb687 100644 --- a/client/consensus/common/src/metrics.rs +++ b/client/consensus/common/src/metrics.rs @@ -1,19 +1,20 @@ // This file is part of Substrate. // Copyright (C) 2020-2021 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-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. +// 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 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. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . //! Metering tools for consensus diff --git a/client/finality-grandpa/Cargo.toml b/client/finality-grandpa/Cargo.toml index 63a8c9aff225d..40385a2faea57 100644 --- a/client/finality-grandpa/Cargo.toml +++ b/client/finality-grandpa/Cargo.toml @@ -27,7 +27,7 @@ parity-scale-codec = { version = "2.0.0", features = ["derive"] } sp-application-crypto = { version = "4.0.0-dev", path = "../../primitives/application-crypto" } sp-arithmetic = { version = "4.0.0-dev", path = "../../primitives/arithmetic" } sp-runtime = { version = "4.0.0-dev", path = "../../primitives/runtime" } -sp-utils = { version = "4.0.0-dev", path = "../../primitives/utils" } +sc-utils = { version = "4.0.0-dev", path = "../utils" } sp-consensus = { version = "0.10.0-dev", path = "../../primitives/consensus/common" } sc-consensus = { version = "0.10.0-dev", path = "../consensus/common" } sp-core = { version = "4.0.0-dev", path = "../../primitives/core" } diff --git a/client/finality-grandpa/src/communication/gossip.rs b/client/finality-grandpa/src/communication/gossip.rs index bec824bc0b816..d64c7421afa69 100644 --- a/client/finality-grandpa/src/communication/gossip.rs +++ b/client/finality-grandpa/src/communication/gossip.rs @@ -94,7 +94,7 @@ use log::{debug, trace}; use prometheus_endpoint::{register, CounterVec, Opts, PrometheusError, Registry, U64}; use rand::seq::SliceRandom; use sc_telemetry::{telemetry, TelemetryHandle, CONSENSUS_DEBUG}; -use sp_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; +use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use super::{benefit, cost, Round, SetId}; use crate::{environment, CatchUp, CompactCommit, SignedMessage}; diff --git a/client/finality-grandpa/src/communication/mod.rs b/client/finality-grandpa/src/communication/mod.rs index a4d85e443ab69..c370e1d642d7d 100644 --- a/client/finality-grandpa/src/communication/mod.rs +++ b/client/finality-grandpa/src/communication/mod.rs @@ -58,8 +58,8 @@ use crate::{ use gossip::{ FullCatchUpMessage, FullCommitMessage, GossipMessage, GossipValidator, PeerReport, VoteMessage, }; +use sc_utils::mpsc::TracingUnboundedReceiver; use sp_finality_grandpa::{AuthorityId, AuthoritySignature, RoundNumber, SetId as SetIdNumber}; -use sp_utils::mpsc::TracingUnboundedReceiver; pub mod gossip; mod periodic; diff --git a/client/finality-grandpa/src/communication/periodic.rs b/client/finality-grandpa/src/communication/periodic.rs index a3c7b9380b25f..77e55ad652f6c 100644 --- a/client/finality-grandpa/src/communication/periodic.rs +++ b/client/finality-grandpa/src/communication/periodic.rs @@ -21,7 +21,7 @@ use futures::{future::FutureExt as _, prelude::*, ready, stream::Stream}; use futures_timer::Delay; use log::debug; -use sp_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; +use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use std::{ pin::Pin, task::{Context, Poll}, diff --git a/client/finality-grandpa/src/communication/tests.rs b/client/finality-grandpa/src/communication/tests.rs index ab72494ee8536..1fac0230b2a84 100644 --- a/client/finality-grandpa/src/communication/tests.rs +++ b/client/finality-grandpa/src/communication/tests.rs @@ -28,10 +28,10 @@ use parity_scale_codec::Encode; use sc_network::{config::Role, Event as NetworkEvent, ObservedRole, PeerId}; use sc_network_gossip::Validator; use sc_network_test::{Block, Hash}; +use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use sp_finality_grandpa::AuthorityList; use sp_keyring::Ed25519Keyring; use sp_runtime::traits::NumberFor; -use sp_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use std::{ borrow::Cow, pin::Pin, diff --git a/client/finality-grandpa/src/import.rs b/client/finality-grandpa/src/import.rs index c6bdbc00323d4..f663bfe94afdf 100644 --- a/client/finality-grandpa/src/import.rs +++ b/client/finality-grandpa/src/import.rs @@ -27,6 +27,7 @@ use sc_consensus::{ BlockCheckParams, BlockImport, BlockImportParams, ImportResult, JustificationImport, }; use sc_telemetry::TelemetryHandle; +use sc_utils::mpsc::TracingUnboundedSender; use sp_api::{Core, RuntimeApiInfo, TransactionFor}; use sp_blockchain::{well_known_cache_keys, BlockStatus}; use sp_consensus::{BlockOrigin, Error as ConsensusError, SelectChain}; @@ -37,7 +38,6 @@ use sp_runtime::{ traits::{Block as BlockT, DigestFor, Header as HeaderT, NumberFor, Zero}, Justification, }; -use sp_utils::mpsc::TracingUnboundedSender; use crate::{ authorities::{AuthoritySet, DelayKind, PendingChange, SharedAuthoritySet}, diff --git a/client/finality-grandpa/src/lib.rs b/client/finality-grandpa/src/lib.rs index 2a10dfc0d50d8..452659ced6a70 100644 --- a/client/finality-grandpa/src/lib.rs +++ b/client/finality-grandpa/src/lib.rs @@ -68,6 +68,7 @@ use sc_client_api::{ }; use sc_consensus::BlockImport; use sc_telemetry::{telemetry, TelemetryHandle, CONSENSUS_DEBUG, CONSENSUS_INFO}; +use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver}; use sp_api::ProvideRuntimeApi; use sp_application_crypto::AppKey; use sp_blockchain::{Error as ClientError, HeaderBackend, HeaderMetadata}; @@ -78,7 +79,6 @@ use sp_runtime::{ generic::BlockId, traits::{Block as BlockT, DigestFor, NumberFor, Zero}, }; -use sp_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver}; pub use finality_grandpa::BlockNumberOps; use finality_grandpa::{voter, voter_set::VoterSet, Error as GrandpaError}; diff --git a/client/finality-grandpa/src/notification.rs b/client/finality-grandpa/src/notification.rs index f0b0b1669dc95..85d581bd5065e 100644 --- a/client/finality-grandpa/src/notification.rs +++ b/client/finality-grandpa/src/notification.rs @@ -19,8 +19,8 @@ use parking_lot::Mutex; use std::sync::Arc; +use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use sp_runtime::traits::Block as BlockT; -use sp_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use crate::{justification::GrandpaJustification, Error}; diff --git a/client/finality-grandpa/src/observer.rs b/client/finality-grandpa/src/observer.rs index 91779daf39416..70a94cd504726 100644 --- a/client/finality-grandpa/src/observer.rs +++ b/client/finality-grandpa/src/observer.rs @@ -29,12 +29,12 @@ use log::{debug, info, warn}; use sc_client_api::backend::Backend; use sc_telemetry::TelemetryHandle; +use sc_utils::mpsc::TracingUnboundedReceiver; use sp_blockchain::HeaderMetadata; use sp_consensus::SelectChain; use sp_finality_grandpa::AuthorityId; use sp_keystore::SyncCryptoStorePtr; use sp_runtime::traits::{Block as BlockT, NumberFor}; -use sp_utils::mpsc::TracingUnboundedReceiver; use crate::{ authorities::SharedAuthoritySet, @@ -403,8 +403,8 @@ mod tests { }; use assert_matches::assert_matches; use sc_network::PeerId; + use sc_utils::mpsc::tracing_unbounded; use sp_blockchain::HeaderBackend as _; - use sp_utils::mpsc::tracing_unbounded; use substrate_test_runtime_client::{TestClientBuilder, TestClientBuilderExt}; use futures::executor; diff --git a/client/finality-grandpa/src/until_imported.rs b/client/finality-grandpa/src/until_imported.rs index 8edf818e0d45a..deb6577264347 100644 --- a/client/finality-grandpa/src/until_imported.rs +++ b/client/finality-grandpa/src/until_imported.rs @@ -37,9 +37,9 @@ use log::{debug, warn}; use parking_lot::Mutex; use prometheus_endpoint::{register, Gauge, PrometheusError, Registry, U64}; use sc_client_api::{BlockImportNotification, ImportNotifications}; +use sc_utils::mpsc::TracingUnboundedReceiver; use sp_finality_grandpa::AuthorityId; use sp_runtime::traits::{Block as BlockT, Header as HeaderT, NumberFor}; -use sp_utils::mpsc::TracingUnboundedReceiver; use std::{ collections::{HashMap, VecDeque}, @@ -561,8 +561,8 @@ mod tests { use futures::future::Either; use futures_timer::Delay; use sc_client_api::BlockImportNotification; + use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedSender}; use sp_consensus::BlockOrigin; - use sp_utils::mpsc::{tracing_unbounded, TracingUnboundedSender}; use substrate_test_runtime_client::runtime::{Block, Hash, Header}; #[derive(Clone)] diff --git a/client/network/Cargo.toml b/client/network/Cargo.toml index 34c2b6972eecd..8ae5d7f837f45 100644 --- a/client/network/Cargo.toml +++ b/client/network/Cargo.toml @@ -55,7 +55,7 @@ sp-consensus = { version = "0.10.0-dev", path = "../../primitives/consensus/comm sc-consensus = { version = "0.10.0-dev", path = "../consensus/common" } sp-core = { version = "4.0.0-dev", path = "../../primitives/core" } sp-runtime = { version = "4.0.0-dev", path = "../../primitives/runtime" } -sp-utils = { version = "4.0.0-dev", path = "../../primitives/utils" } +sc-utils = { version = "4.0.0-dev", path = "../utils" } sp-finality-grandpa = { version = "4.0.0-dev", path = "../../primitives/finality-grandpa" } thiserror = "1" unsigned-varint = { version = "0.6.0", features = [ diff --git a/client/network/src/on_demand_layer.rs b/client/network/src/on_demand_layer.rs index ebcf012c0faef..5bac05c7aefad 100644 --- a/client/network/src/on_demand_layer.rs +++ b/client/network/src/on_demand_layer.rs @@ -27,9 +27,9 @@ use sc_client_api::{ RemoteChangesRequest, RemoteHeaderRequest, RemoteReadChildRequest, RemoteReadRequest, StorageProof, }; +use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use sp_blockchain::Error as ClientError; use sp_runtime::traits::{Block as BlockT, Header as HeaderT, NumberFor}; -use sp_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use std::{ collections::HashMap, pin::Pin, diff --git a/client/network/src/service.rs b/client/network/src/service.rs index 069223c2ff396..6b2928510760c 100644 --- a/client/network/src/service.rs +++ b/client/network/src/service.rs @@ -70,8 +70,8 @@ use metrics::{Histogram, HistogramVec, MetricSources, Metrics}; use parking_lot::Mutex; use sc_consensus::{BlockImportError, BlockImportStatus, ImportQueue, Link}; use sc_peerset::PeersetHandle; +use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use sp_runtime::traits::{Block as BlockT, NumberFor}; -use sp_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use std::{ borrow::Cow, cmp, diff --git a/client/offchain/Cargo.toml b/client/offchain/Cargo.toml index 65737765d513e..a7ff572e9b0b7 100644 --- a/client/offchain/Cargo.toml +++ b/client/offchain/Cargo.toml @@ -29,7 +29,7 @@ sp-api = { version = "4.0.0-dev", path = "../../primitives/api" } sp-core = { version = "4.0.0-dev", path = "../../primitives/core" } sp-offchain = { version = "4.0.0-dev", path = "../../primitives/offchain" } sp-runtime = { version = "4.0.0-dev", path = "../../primitives/runtime" } -sp-utils = { version = "4.0.0-dev", path = "../../primitives/utils" } +sc-utils = { version = "4.0.0-dev", path = "../utils" } threadpool = "1.7" [target.'cfg(not(target_os = "unknown"))'.dependencies] diff --git a/client/offchain/src/api/http.rs b/client/offchain/src/api/http.rs index 5bc120c213717..ce9fb298d1b0c 100644 --- a/client/offchain/src/api/http.rs +++ b/client/offchain/src/api/http.rs @@ -34,8 +34,8 @@ use futures::{channel::mpsc, future, prelude::*}; use hyper::{client, Body, Client as HyperClient}; use hyper_rustls::HttpsConnector; use log::error; +use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use sp_core::offchain::{HttpError, HttpRequestId, HttpRequestStatus, Timestamp}; -use sp_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use std::{ convert::TryFrom, fmt, diff --git a/client/peerset/Cargo.toml b/client/peerset/Cargo.toml index b4e48332d62f7..9e83ede675d02 100644 --- a/client/peerset/Cargo.toml +++ b/client/peerset/Cargo.toml @@ -17,7 +17,7 @@ targets = ["x86_64-unknown-linux-gnu"] [dependencies] futures = "0.3.9" libp2p = { version = "0.39.1", default-features = false } -sp-utils = { version = "4.0.0-dev", path = "../../primitives/utils"} +sc-utils = { version = "4.0.0-dev", path = "../utils"} log = "0.4.8" serde_json = "1.0.41" wasm-timer = "0.2" diff --git a/client/peerset/src/lib.rs b/client/peerset/src/lib.rs index 838f4c411c9cc..ecaa1d9f576f1 100644 --- a/client/peerset/src/lib.rs +++ b/client/peerset/src/lib.rs @@ -36,8 +36,8 @@ mod peersstate; use futures::prelude::*; use log::{debug, error, trace}; +use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use serde_json::json; -use sp_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use std::{ collections::{HashMap, HashSet, VecDeque}, pin::Pin, diff --git a/client/rpc/Cargo.toml b/client/rpc/Cargo.toml index 453ff6e57daac..9957bc999a8bb 100644 --- a/client/rpc/Cargo.toml +++ b/client/rpc/Cargo.toml @@ -27,7 +27,7 @@ serde_json = "1.0.41" sp-session = { version = "4.0.0-dev", path = "../../primitives/session" } sp-offchain = { version = "4.0.0-dev", path = "../../primitives/offchain" } sp-runtime = { version = "4.0.0-dev", path = "../../primitives/runtime" } -sp-utils = { version = "4.0.0-dev", path = "../../primitives/utils" } +sc-utils = { version = "4.0.0-dev", path = "../utils" } sp-rpc = { version = "4.0.0-dev", path = "../../primitives/rpc" } sp-keystore = { version = "0.10.0-dev", path = "../../primitives/keystore" } sc-chain-spec = { version = "4.0.0-dev", path = "../chain-spec" } diff --git a/client/rpc/src/system/mod.rs b/client/rpc/src/system/mod.rs index 798f3f035ad50..f99994e41a1be 100644 --- a/client/rpc/src/system/mod.rs +++ b/client/rpc/src/system/mod.rs @@ -22,8 +22,8 @@ use self::error::Result; use futures::{channel::oneshot, FutureExt}; use sc_rpc_api::{DenyUnsafe, Receiver}; use sc_tracing::logging; +use sc_utils::mpsc::TracingUnboundedSender; use sp_runtime::traits::{self, Header as HeaderT}; -use sp_utils::mpsc::TracingUnboundedSender; pub use self::{ gen_client::Client as SystemClient, diff --git a/client/rpc/src/system/tests.rs b/client/rpc/src/system/tests.rs index 15b53c3ff462c..cc794b884f066 100644 --- a/client/rpc/src/system/tests.rs +++ b/client/rpc/src/system/tests.rs @@ -21,7 +21,7 @@ use super::*; use assert_matches::assert_matches; use futures::{executor, prelude::*}; use sc_network::{self, config::Role, PeerId}; -use sp_utils::mpsc::tracing_unbounded; +use sc_utils::mpsc::tracing_unbounded; use std::{ env, io::{BufRead, BufReader, Write}, diff --git a/client/service/Cargo.toml b/client/service/Cargo.toml index 94be302ca2708..b79e95fbb0912 100644 --- a/client/service/Cargo.toml +++ b/client/service/Cargo.toml @@ -39,7 +39,7 @@ sc-keystore = { version = "4.0.0-dev", path = "../keystore" } sp-runtime = { version = "4.0.0-dev", path = "../../primitives/runtime" } sp-trie = { version = "4.0.0-dev", path = "../../primitives/trie" } sp-externalities = { version = "0.10.0-dev", path = "../../primitives/externalities" } -sp-utils = { version = "4.0.0-dev", path = "../../primitives/utils" } +sc-utils = { version = "4.0.0-dev", path = "../utils" } sp-version = { version = "4.0.0-dev", path = "../../primitives/version" } sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" } sp-core = { version = "4.0.0-dev", path = "../../primitives/core" } diff --git a/client/service/src/builder.rs b/client/service/src/builder.rs index a1fb1b909773f..f0c037aee232f 100644 --- a/client/service/src/builder.rs +++ b/client/service/src/builder.rs @@ -49,6 +49,7 @@ use sc_network::{ }; use sc_telemetry::{telemetry, ConnectionMessage, Telemetry, TelemetryHandle, SUBSTRATE_INFO}; use sc_transaction_pool_api::MaintainedTransactionPool; +use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedSender}; use sp_api::{CallApiAt, ProvideRuntimeApi}; use sp_blockchain::{HeaderBackend, HeaderMetadata}; use sp_consensus::block_validation::{ @@ -61,7 +62,6 @@ use sp_runtime::{ traits::{Block as BlockT, BlockIdTo, HashFor, Zero}, BuildStorage, }; -use sp_utils::mpsc::{tracing_unbounded, TracingUnboundedSender}; use std::{str::FromStr, sync::Arc, time::SystemTime}; /// A utility trait for building an RPC extension given a `DenyUnsafe` instance. diff --git a/client/service/src/client/client.rs b/client/service/src/client/client.rs index 9439a06a5af95..f7d93d036a3fa 100644 --- a/client/service/src/client/client.rs +++ b/client/service/src/client/client.rs @@ -61,6 +61,7 @@ use sp_blockchain::{ }; use sp_consensus::{BlockOrigin, BlockStatus, Error as ConsensusError}; +use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedSender}; use sp_core::{ convert_hash, storage::{well_known_keys, ChildInfo, PrefixedStorageKey, StorageData, StorageKey}, @@ -82,7 +83,6 @@ use sp_state_machine::{ ChangesTrieConfigurationRange, ChangesTrieRootsStorage, ChangesTrieStorage, DBValue, }; use sp_trie::StorageProof; -use sp_utils::mpsc::{tracing_unbounded, TracingUnboundedSender}; use std::{ collections::{BTreeMap, HashMap, HashSet}, marker::PhantomData, diff --git a/client/service/src/lib.rs b/client/service/src/lib.rs index c8d5a9af35653..ede6f01a4539e 100644 --- a/client/service/src/lib.rs +++ b/client/service/src/lib.rs @@ -41,11 +41,11 @@ use futures::{stream, Future, FutureExt, Stream, StreamExt}; use log::{debug, error, warn}; use parity_util_mem::MallocSizeOf; use sc_network::PeerId; +use sc_utils::mpsc::TracingUnboundedReceiver; use sp_runtime::{ generic::BlockId, traits::{Block as BlockT, Header as HeaderT}, }; -use sp_utils::mpsc::TracingUnboundedReceiver; pub use self::{ builder::{ diff --git a/client/service/src/metrics.rs b/client/service/src/metrics.rs index e3ad9e9cce193..4d3c6df92fee7 100644 --- a/client/service/src/metrics.rs +++ b/client/service/src/metrics.rs @@ -25,9 +25,9 @@ use sc_client_api::{ClientInfo, UsageProvider}; use sc_network::{config::Role, NetworkService, NetworkStatus}; use sc_telemetry::{telemetry, TelemetryHandle, SUBSTRATE_INFO}; use sc_transaction_pool_api::{MaintainedTransactionPool, PoolStatus}; +use sc_utils::metrics::register_globals; use sp_api::ProvideRuntimeApi; use sp_runtime::traits::{Block, NumberFor, SaturatedConversion, UniqueSaturatedInto}; -use sp_utils::metrics::register_globals; use std::{ sync::Arc, time::{Duration, Instant}, diff --git a/client/service/src/task_manager/mod.rs b/client/service/src/task_manager/mod.rs index 25b08b37a3a10..7842acdf0455a 100644 --- a/client/service/src/task_manager/mod.rs +++ b/client/service/src/task_manager/mod.rs @@ -33,7 +33,7 @@ use prometheus_endpoint::{ exponential_buckets, register, CounterVec, HistogramOpts, HistogramVec, Opts, PrometheusError, Registry, U64, }; -use sp_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; +use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use std::{panic, pin::Pin, result::Result}; use tracing_futures::Instrument; diff --git a/client/transaction-pool/Cargo.toml b/client/transaction-pool/Cargo.toml index e2858a41d5073..2184af819adf7 100644 --- a/client/transaction-pool/Cargo.toml +++ b/client/transaction-pool/Cargo.toml @@ -29,7 +29,7 @@ sp-tracing = { version = "4.0.0-dev", path = "../../primitives/tracing" } sp-transaction-pool = { version = "4.0.0-dev", path = "../../primitives/transaction-pool" } sc-transaction-pool-api = { version = "4.0.0-dev", path = "./api" } sp-blockchain = { version = "4.0.0-dev", path = "../../primitives/blockchain" } -sp-utils = { version = "4.0.0-dev", path = "../../primitives/utils" } +sc-utils = { version = "4.0.0-dev", path = "../utils" } serde = { version = "1.0.126", features = ["derive"] } linked-hash-map = "0.5.4" retain_mut = "0.1.3" diff --git a/client/transaction-pool/api/src/error.rs b/client/transaction-pool/api/src/error.rs index 365d6a28d6b9b..feee3b0a949c2 100644 --- a/client/transaction-pool/api/src/error.rs +++ b/client/transaction-pool/api/src/error.rs @@ -1,19 +1,20 @@ // This file is part of Substrate. // Copyright (C) 2018-2021 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. +// 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 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. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . //! Transaction pool errors. diff --git a/client/transaction-pool/api/src/lib.rs b/client/transaction-pool/api/src/lib.rs index 4a083ad2e15a2..a6252f1373c5d 100644 --- a/client/transaction-pool/api/src/lib.rs +++ b/client/transaction-pool/api/src/lib.rs @@ -1,19 +1,20 @@ // This file is part of Substrate. // Copyright (C) 2019-2021 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. +// 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 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. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . //! Transaction pool client facing API. #![warn(missing_docs)] diff --git a/client/transaction-pool/graph/Cargo.toml b/client/transaction-pool/graph/Cargo.toml index aa4000f7c0762..b49cadc51c33c 100644 --- a/client/transaction-pool/graph/Cargo.toml +++ b/client/transaction-pool/graph/Cargo.toml @@ -20,7 +20,7 @@ log = "0.4.8" parking_lot = "0.11.1" serde = { version = "1.0.101", features = ["derive"] } sp-blockchain = { version = "4.0.0-dev", path = "../../../primitives/blockchain" } -sp-utils = { version = "4.0.0-dev", path = "../../../primitives/utils" } +sc-utils = { version = "4.0.0-dev", path = "../../utils" } sp-core = { version = "4.0.0-dev", path = "../../../primitives/core" } sp-runtime = { version = "4.0.0-dev", path = "../../../primitives/runtime" } sp-transaction-pool = { version = "4.0.0-dev", path = "../../../primitives/transaction-pool" } diff --git a/client/transaction-pool/src/graph/watcher.rs b/client/transaction-pool/src/graph/watcher.rs index 91777117efe94..975ee6608886b 100644 --- a/client/transaction-pool/src/graph/watcher.rs +++ b/client/transaction-pool/src/graph/watcher.rs @@ -20,7 +20,7 @@ use futures::Stream; use sc_transaction_pool_api::TransactionStatus; -use sp_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; +use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; /// Extrinsic watcher. /// diff --git a/client/transaction-pool/src/revalidation.rs b/client/transaction-pool/src/revalidation.rs index 9f15185694d0a..a8b2c1d32036a 100644 --- a/client/transaction-pool/src/revalidation.rs +++ b/client/transaction-pool/src/revalidation.rs @@ -25,12 +25,12 @@ use std::{ }; use crate::graph::{ChainApi, ExtrinsicHash, NumberFor, Pool, ValidatedTransaction}; +use sc_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use sp_runtime::{ generic::BlockId, traits::{SaturatedConversion, Zero}, transaction_validity::TransactionValidityError, }; -use sp_utils::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use futures::prelude::*; use std::time::Duration; diff --git a/primitives/utils/Cargo.toml b/client/utils/Cargo.toml similarity index 96% rename from primitives/utils/Cargo.toml rename to client/utils/Cargo.toml index d72df03af8cc1..99765dd501dd5 100644 --- a/primitives/utils/Cargo.toml +++ b/client/utils/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "sp-utils" +name = "sc-utils" version = "4.0.0-dev" authors = ["Parity Technologies "] edition = "2018" diff --git a/primitives/utils/README.md b/client/utils/README.md similarity index 100% rename from primitives/utils/README.md rename to client/utils/README.md diff --git a/primitives/utils/src/lib.rs b/client/utils/src/lib.rs similarity index 58% rename from primitives/utils/src/lib.rs rename to client/utils/src/lib.rs index 693b05a8b998c..b49cd60d67b13 100644 --- a/primitives/utils/src/lib.rs +++ b/client/utils/src/lib.rs @@ -1,19 +1,20 @@ // This file is part of Substrate. // Copyright (C) 2020-2021 Parity Technologies (UK) Ltd. -// SPDX-License-Identifier: Apache-2.0 +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-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. +// 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 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. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . //! Utilities Primitives for Substrate //! diff --git a/primitives/utils/src/metrics.rs b/client/utils/src/metrics.rs similarity index 67% rename from primitives/utils/src/metrics.rs rename to client/utils/src/metrics.rs index 45d8b3b7311d7..8df8e65962474 100644 --- a/primitives/utils/src/metrics.rs +++ b/client/utils/src/metrics.rs @@ -1,19 +1,21 @@ // This file is part of Substrate. // Copyright (C) 2020-2021 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. +// 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 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. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + //! Metering primitives and globals diff --git a/primitives/utils/src/mpsc.rs b/client/utils/src/mpsc.rs similarity index 89% rename from primitives/utils/src/mpsc.rs rename to client/utils/src/mpsc.rs index 27e15cbe2ef2b..1739af5e9015c 100644 --- a/primitives/utils/src/mpsc.rs +++ b/client/utils/src/mpsc.rs @@ -1,19 +1,20 @@ // This file is part of Substrate. // Copyright (C) 2020-2021 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. +// 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 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. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . //! Features to meter unbounded channels diff --git a/primitives/utils/src/status_sinks.rs b/client/utils/src/status_sinks.rs similarity index 87% rename from primitives/utils/src/status_sinks.rs rename to client/utils/src/status_sinks.rs index b8e05781611c6..a87f0e0ad6e8f 100644 --- a/primitives/utils/src/status_sinks.rs +++ b/client/utils/src/status_sinks.rs @@ -1,19 +1,20 @@ // This file is part of Substrate. // Copyright (C) 2019-2021 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. +// 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 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. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . use crate::mpsc::{tracing_unbounded, TracingUnboundedReceiver, TracingUnboundedSender}; use futures::{lock::Mutex, prelude::*};