Skip to content
Snippets Groups Projects
Select Git revision
  • master
  • feature/types-bundle
2 results

benchmarking.rs

Blame
  • Forked from nodes / rust / Duniter v2S
    641 commits behind, 7 commits ahead of the upstream repository.
    benchmarking.rs 1.25 KiB
    // Copyright 2021 Axiom-Team
    //
    // This file is part of Substrate-Libre-Currency.
    //
    // Substrate-Libre-Currency is free software: you can redistribute it and/or modify
    // it under the terms of the GNU Affero General Public License as published by
    // the Free Software Foundation, version 3 of the License.
    //
    // Substrate-Libre-Currency 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 Affero General Public License for more details.
    //
    // You should have received a copy of the GNU Affero General Public License
    // along with Substrate-Libre-Currency. If not, see <https://www.gnu.org/licenses/>.
    
    //! Benchmarking setup for pallet-template
    
    use super::*;
    
    #[allow(unused)]
    use crate::Pallet as Template;
    use frame_benchmarking::{benchmarks, impl_benchmark_test_suite, whitelisted_caller};
    use frame_system::RawOrigin;
    
    benchmarks! {
        do_something {
            let s in 0 .. 100;
            let caller: T::AccountId = whitelisted_caller();
        }: _(RawOrigin::Signed(caller), s)
        verify {
            assert_eq!(Something::<T>::get(), Some(s));
        }
    }
    
    impl_benchmark_test_suite!(Template, crate::mock::new_test_ext(), crate::mock::Test,);