Skip to content
Snippets Groups Projects
Select Git revision
  • fa15bf1e8f351382253d82ed145c1deddbeaa131
  • master default protected
  • Vivakvo/cesium-patch-8
  • issue_4
  • issue_780
  • gitlab_migration_1
  • dev
  • rml8
  • v1.4.3
  • v1.4.1
  • v1.4.0
  • v1.3.11
  • v1.3.10
  • v1.3.9
  • v1.3.8
  • v1.3.7
  • v1.3.6
  • v1.3.5
  • v1.3.4
  • v1.3.3
  • v1.3.2
  • v1.3.1
  • v1.3.0
  • v1.2.10
  • v1.2.9
  • v1.2.8
  • v1.2.7
  • v1.2.6
28 results

bma-services.js

Blame
  • Forked from clients / Cesium-grp / Cesium
    Source project has a limited visibility.
    command.rs 17.91 KiB
    // 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.
    
    pub mod key;
    pub mod utils;
    
    use crate::cli::{Cli, Subcommand};
    #[cfg(feature = "g1")]
    use crate::service::G1Executor;
    #[cfg(feature = "gdev")]
    use crate::service::GDevExecutor;
    #[cfg(feature = "gtest")]
    use crate::service::GTestExecutor;
    use crate::service::{IdentifyRuntimeType, RuntimeType};
    use crate::{chain_spec, service};
    use clap::CommandFactory;
    use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE};
    use sc_cli::{ChainSpec, RuntimeVersion, SubstrateCli};
    
    // TODO: create our own reference hardware
    /*
    lazy_static! {
        /// The hardware requirements as measured on reference hardware.
        pub static ref REFERENCE_HARDWARE: Requirements = {
            let raw = include_bytes!("reference_hardware.json").as_slice();
            serde_json::from_slice(raw).expect("Hardcoded data is known good; qed")
        };
    }*/
    
    /// Unwraps a [`crate::client::Client`] into the concrete runtime client.
    macro_rules! unwrap_client {
        (
    		$client:ident,
    		$code:expr
    	) => {
            match $client.as_ref() {
                #[cfg(feature = "g1")]
                crate::service::client::Client::G1($client) => $code,
                #[cfg(feature = "gtest")]
                crate::service::client::Client::GTest($client) => $code,
                #[cfg(feature = "gdev")]
                crate::service::client::Client::GDev($client) => $code,
                #[allow(unreachable_patterns)]
                _ => panic!("unknown runtime"),
            }
        };
    }
    
    impl SubstrateCli for Cli {
        fn impl_name() -> String {
            "Duniter".into()
        }
    
        fn impl_version() -> String {
            env!("SUBSTRATE_CLI_IMPL_VERSION").into()
        }