Skip to content
Snippets Groups Projects
Commit 8c0a09f5 authored by Hugo Trentesaux's avatar Hugo Trentesaux
Browse files

WIP put pallet in dev mode before benchmarks

parent ee51277f
No related branches found
No related tags found
No related merge requests found
Pipeline #33244 waiting for manual action
...@@ -19,10 +19,12 @@ ...@@ -19,10 +19,12 @@
mod median; mod median;
mod traits; mod traits;
mod types; mod types;
mod weights;
pub use pallet::*; pub use pallet::*;
pub use traits::*; pub use traits::*;
pub use types::*; pub use types::*;
// pub use weights::WeightInfo;
use frame_support::traits::StorageVersion; use frame_support::traits::StorageVersion;
use pallet_authority_members::SessionIndex; use pallet_authority_members::SessionIndex;
...@@ -32,7 +34,7 @@ use sp_std::convert::TryInto; ...@@ -32,7 +34,7 @@ use sp_std::convert::TryInto;
type IdtyIndex = u32; type IdtyIndex = u32;
#[frame_support::pallet] #[frame_support::pallet(dev_mode)] // dev mode while waiting for benchmarks
pub mod pallet { pub mod pallet {
use super::*; use super::*;
use frame_support::{pallet_prelude::*, traits::ReservableCurrency}; use frame_support::{pallet_prelude::*, traits::ReservableCurrency};
...@@ -43,7 +45,7 @@ pub mod pallet { ...@@ -43,7 +45,7 @@ pub mod pallet {
const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); const STORAGE_VERSION: StorageVersion = StorageVersion::new(1);
#[pallet::pallet] #[pallet::pallet]
#[pallet::generate_store(pub(super) trait Store)] // #[pallet::generate_store(pub(super) trait Store)] // deprecated
#[pallet::storage_version(STORAGE_VERSION)] #[pallet::storage_version(STORAGE_VERSION)]
#[pallet::without_storage_info] #[pallet::without_storage_info]
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>); pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
...@@ -70,6 +72,8 @@ pub mod pallet { ...@@ -70,6 +72,8 @@ pub mod pallet {
type MinAccessibleReferees: Get<Perbill>; type MinAccessibleReferees: Get<Perbill>;
/// Number of session to keep a positive evaluation result /// Number of session to keep a positive evaluation result
type ResultExpiration: Get<u32>; type ResultExpiration: Get<u32>;
// /// Type representing the weight of this pallet
// type WeightInfo: WeightInfo;
} }
// STORAGE // // STORAGE //
...@@ -190,7 +194,9 @@ pub mod pallet { ...@@ -190,7 +194,9 @@ pub mod pallet {
#[pallet::call] #[pallet::call]
impl<T: Config<I>, I: 'static> Pallet<T, I> { impl<T: Config<I>, I: 'static> Pallet<T, I> {
/// Request an identity to be evaluated /// Request an identity to be evaluated
#[pallet::weight(1_000_000_000)] #[pallet::call_index(0)]
#[pallet::weight(0)]
// #[pallet::weight(T::WeightInfo::request_distance_evaluation())]
pub fn request_distance_evaluation(origin: OriginFor<T>) -> DispatchResultWithPostInfo { pub fn request_distance_evaluation(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
let who = ensure_signed(origin)?; let who = ensure_signed(origin)?;
...@@ -207,7 +213,9 @@ pub mod pallet { ...@@ -207,7 +213,9 @@ pub mod pallet {
} }
/// (Inherent) Push an evaluation result to the pool /// (Inherent) Push an evaluation result to the pool
#[pallet::weight(1_000_000_000)] #[pallet::call_index(1)]
#[pallet::weight(0)]
// #[pallet::weight(T::WeightInfo::update_evaluation())]
pub fn update_evaluation( pub fn update_evaluation(
origin: OriginFor<T>, origin: OriginFor<T>,
computation_result: ComputationResult, computation_result: ComputationResult,
...@@ -226,7 +234,9 @@ pub mod pallet { ...@@ -226,7 +234,9 @@ pub mod pallet {
} }
/// Push an evaluation result to the pool /// Push an evaluation result to the pool
#[pallet::weight(1_000_000_000)] #[pallet::call_index(2)]
#[pallet::weight(0)]
// #[pallet::weight(T::WeightInfo::force_update_evaluation())]
pub fn force_update_evaluation( pub fn force_update_evaluation(
origin: OriginFor<T>, origin: OriginFor<T>,
evaluator: <T as frame_system::Config>::AccountId, evaluator: <T as frame_system::Config>::AccountId,
...@@ -238,7 +248,9 @@ pub mod pallet { ...@@ -238,7 +248,9 @@ pub mod pallet {
} }
/// Push an evaluation result to the pool /// Push an evaluation result to the pool
#[pallet::weight(1_000_000)] #[pallet::call_index(3)]
#[pallet::weight(0)]
// #[pallet::weight(T::WeightInfo::force_set_distance_status())]
pub fn force_set_distance_status( pub fn force_set_distance_status(
origin: OriginFor<T>, origin: OriginFor<T>,
identity: <T as pallet_certification::Config<I>>::IdtyIndex, identity: <T as pallet_certification::Config<I>>::IdtyIndex,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment