diff --git a/.maintain/frame-weight-template.hbs b/.maintain/frame-weight-template.hbs index 9c9e2978..ecd384a5 100644 --- a/.maintain/frame-weight-template.hbs +++ b/.maintain/frame-weight-template.hbs @@ -1,10 +1,11 @@ {{header}} -//! Autogenerated weights for {{pallet}} +//! Autogenerated weights for `{{pallet}}` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION {{version}} -//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: {{cmd.repeat}}, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}` +//! DATE: {{date}}, STEPS: `{{cmd.steps}}`, REPEAT: `{{cmd.repeat}}`, LOW RANGE: `{{cmd.lowest_range_values}}`, HIGH RANGE: `{{cmd.highest_range_values}}` +//! WORST CASE MAP SIZE: `{{cmd.worst_case_map_values}}` //! HOSTNAME: `{{hostname}}`, CPU: `{{cpuname}}` -//! EXECUTION: {{cmd.execution}}, WASM-EXECUTION: {{cmd.wasm_execution}}, CHAIN: {{cmd.chain}}, DB CACHE: {{cmd.db_cache}} +//! WASM-EXECUTION: `{{cmd.wasm_execution}}`, CHAIN: `{{cmd.chain}}`, DB CACHE: `{{cmd.db_cache}}` // Executed Command: {{#each args as |arg|}} @@ -14,11 +15,12 @@ #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] #![allow(unused_imports)] +#![allow(missing_docs)] use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use sp_std::marker::PhantomData; +use core::marker::PhantomData; -/// Weight functions needed for {{pallet}}. +/// Weight functions needed for `{{pallet}}`. pub trait WeightInfo { {{#each benchmarks as |benchmark|}} fn {{benchmark.name~}} @@ -29,7 +31,7 @@ pub trait WeightInfo { {{/each}} } -/// Weights for {{pallet}} using the Substrate node and recommended hardware. +/// Weights for `{{pallet}}` using the Substrate node and recommended hardware. pub struct SubstrateWeight(PhantomData); {{#if (eq pallet "frame_system")}} impl WeightInfo for SubstrateWeight { @@ -38,7 +40,7 @@ impl WeightInfo for SubstrateWeight { {{/if}} {{#each benchmarks as |benchmark|}} {{#each benchmark.comments as |comment|}} - // {{comment}} + /// {{comment}} {{/each}} {{#each benchmark.component_ranges as |range|}} /// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`. @@ -48,33 +50,39 @@ impl WeightInfo for SubstrateWeight { {{~#each benchmark.components as |c| ~}} {{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}} ) -> Weight { - // Minimum execution time: {{underscore benchmark.min_execution_time}} nanoseconds. - Weight::from_ref_time({{underscore benchmark.base_weight}}) + // Proof Size summary in bytes: + // Measured: `{{benchmark.base_recorded_proof_size}}{{#each benchmark.component_recorded_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}` + // Estimated: `{{benchmark.base_calculated_proof_size}}{{#each benchmark.component_calculated_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}` + // Minimum execution time: {{underscore benchmark.min_execution_time}}_000 picoseconds. + Weight::from_parts({{underscore benchmark.base_weight}}, {{benchmark.base_calculated_proof_size}}) {{#each benchmark.component_weight as |cw|}} // Standard Error: {{underscore cw.error}} - .saturating_add(Weight::from_ref_time({{underscore cw.slope}}).saturating_mul({{cw.name}}.into())) + .saturating_add(Weight::from_parts({{underscore cw.slope}}, 0).saturating_mul({{cw.name}}.into())) {{/each}} {{#if (ne benchmark.base_reads "0")}} - .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}})) + .saturating_add(T::DbWeight::get().reads({{benchmark.base_reads}}_u64)) {{/if}} {{#each benchmark.component_reads as |cr|}} .saturating_add(T::DbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into()))) {{/each}} {{#if (ne benchmark.base_writes "0")}} - .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}})) + .saturating_add(T::DbWeight::get().writes({{benchmark.base_writes}}_u64)) {{/if}} {{#each benchmark.component_writes as |cw|}} .saturating_add(T::DbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into()))) {{/each}} + {{#each benchmark.component_calculated_proof_size as |cp|}} + .saturating_add(Weight::from_parts(0, {{cp.slope}}).saturating_mul({{cp.name}}.into())) + {{/each}} } {{/each}} } -// For backwards compatibility and tests +// For backwards compatibility and tests. impl WeightInfo for () { {{#each benchmarks as |benchmark|}} {{#each benchmark.comments as |comment|}} - // {{comment}} + /// {{comment}} {{/each}} {{#each benchmark.component_ranges as |range|}} /// The range of component `{{range.name}}` is `[{{range.min}}, {{range.max}}]`. @@ -84,24 +92,30 @@ impl WeightInfo for () { {{~#each benchmark.components as |c| ~}} {{~#if (not c.is_used)}}_{{/if}}{{c.name}}: u32, {{/each~}} ) -> Weight { - // Minimum execution time: {{underscore benchmark.min_execution_time}} nanoseconds. - Weight::from_ref_time({{underscore benchmark.base_weight}}) + // Proof Size summary in bytes: + // Measured: `{{benchmark.base_recorded_proof_size}}{{#each benchmark.component_recorded_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}` + // Estimated: `{{benchmark.base_calculated_proof_size}}{{#each benchmark.component_calculated_proof_size as |cp|}} + {{cp.name}} * ({{cp.slope}} ±{{underscore cp.error}}){{/each}}` + // Minimum execution time: {{underscore benchmark.min_execution_time}}_000 picoseconds. + Weight::from_parts({{underscore benchmark.base_weight}}, {{benchmark.base_calculated_proof_size}}) {{#each benchmark.component_weight as |cw|}} // Standard Error: {{underscore cw.error}} - .saturating_add(Weight::from_ref_time({{underscore cw.slope}}).saturating_mul({{cw.name}}.into())) + .saturating_add(Weight::from_parts({{underscore cw.slope}}, 0).saturating_mul({{cw.name}}.into())) {{/each}} {{#if (ne benchmark.base_reads "0")}} - .saturating_add(RocksDbWeight::get().reads({{benchmark.base_reads}})) + .saturating_add(RocksDbWeight::get().reads({{benchmark.base_reads}}_u64)) {{/if}} {{#each benchmark.component_reads as |cr|}} .saturating_add(RocksDbWeight::get().reads(({{cr.slope}}_u64).saturating_mul({{cr.name}}.into()))) {{/each}} {{#if (ne benchmark.base_writes "0")}} - .saturating_add(RocksDbWeight::get().writes({{benchmark.base_writes}})) + .saturating_add(RocksDbWeight::get().writes({{benchmark.base_writes}}_u64)) {{/if}} {{#each benchmark.component_writes as |cw|}} .saturating_add(RocksDbWeight::get().writes(({{cw.slope}}_u64).saturating_mul({{cw.name}}.into()))) {{/each}} + {{#each benchmark.component_calculated_proof_size as |cp|}} + .saturating_add(Weight::from_parts(0, {{cp.slope}}).saturating_mul({{cp.name}}.into())) + {{/each}} } {{/each}} } diff --git a/.vscode/settings.json b/.vscode/settings.json index 60cb534e..8b4656d9 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,9 +1,9 @@ { - "rust-analyzer.linkedProjects": [ - "./pallets/afloat/Cargo.toml", - "./pallets/rbac/Cargo.toml", - "./pallets/gated-marketplace/Cargo.toml", - "./pallets/fruniques/Cargo.toml", - ], - "rust-analyzer.showUnlinkedFileNotification": false + "rust-analyzer.linkedProjects": [ + "./pallets/afloat/Cargo.toml", + "./pallets/rbac/Cargo.toml", + "./pallets/gated-marketplace/Cargo.toml", + "./pallets/fruniques/Cargo.toml", + ], + "rust-analyzer.showUnlinkedFileNotification": false } \ No newline at end of file diff --git a/pallets/afloat/src/benchmarking.rs b/pallets/afloat/src/benchmarking.rs index bedfd41c..09d5aa83 100644 --- a/pallets/afloat/src/benchmarking.rs +++ b/pallets/afloat/src/benchmarking.rs @@ -11,13 +11,12 @@ use frame_support::{ use frame_system::{Config as SystemConfig, RawOrigin}; use pallet_fruniques::types::{Attributes, ParentInfo}; use scale_info::prelude::{vec::Vec, *}; -use sp_runtime::{traits::Bounded, Permill}; +use sp_runtime::{sp_std::cmp, traits::Bounded, Permill}; use pallet_fruniques::Pallet as Fruniques; use pallet_gated_marketplace::Pallet as GatedMarketplace; use pallet_rbac::types::{IdOrVec, RoleBasedAccessControl, RoleId}; use sp_io::hashing::blake2_256; -use std::cmp; type DepositBalanceOf = <::Currency as Currency< ::AccountId, @@ -52,111 +51,6 @@ fn generate_id(item: Vec) -> [u8; 32] { item.using_encoded(blake2_256) } -fn set_rbac_assign_role_to_user_worst_case( - user: ::AccountId, - num_roles_available_user: u32, - inital_setup: bool, - pallet_ids: Vec, -) -> Result<(), sp_runtime::DispatchError> { - // Leave only one Scope available for the pallet - let max_scopes = - <::Rbac as RoleBasedAccessControl>::MaxScopesPerPallet::get( - ) - 1; - - let afloat_pallet_id = Afloat::::pallet_id().to_id(); - let afloat_scope_id = Afloat::::scope_id(); - let fruniques_pallet_id = Fruniques::::pallet_id().to_id(); - let fruniques_scope_id = Afloat::::collection_id() - .unwrap_or(T::AfloatBenchHelper::collection(0)) - .using_encoded(blake2_256); - let gm_pallet_id = GatedMarketplace::::pallet_id().to_id(); - let gm_scope_id = Afloat::::marketplace_id().unwrap_or(0.using_encoded(blake2_256)); - - for pallet_id in pallet_ids { - let mut scope_ids = Vec::new(); - for s in 0..max_scopes { - let scope = generate_scope_sized(s, 10); - let scope_id = generate_id(scope); - assert_ok!( - <::Rbac as RoleBasedAccessControl>::create_scope( - pallet_id.clone(), - scope_id - ) - ); - scope_ids.push(scope_id); - } - - let max_roles = <::Rbac as RoleBasedAccessControl>::MaxRolesPerPallet::get(); - let num_roles = match pallet_id.clone().to_id() { - v if v == afloat_pallet_id => max_roles - NUM_AFLOAT_ROLES, - v if v == gm_pallet_id => max_roles - NUM_GM_ROLES, - v if v == fruniques_pallet_id => max_roles - NUM_FRUNIQUES_ROLES, - _ => max_roles, - }; - - let size = - <::Rbac as RoleBasedAccessControl>::RoleMaxLen::get( - ); - - let roles = generate_roles_sized(1, num_roles, size); - - assert_ok!( - <::Rbac as RoleBasedAccessControl>::create_and_set_roles( - pallet_id.clone(), - roles.clone() - )); - - if !inital_setup { - let role_ids: Vec = roles.into_iter().map(|role| generate_id(role)).collect(); - let l = role_ids.len(); - let r = l - num_roles_available_user as usize; - let n = cmp::min(l, r); - let role_ids = &role_ids[0..n]; - let scope_id = match pallet_id.clone().to_id() { - v if v == afloat_pallet_id => afloat_scope_id, - v if v == fruniques_pallet_id => fruniques_scope_id, - v if v == gm_pallet_id => gm_scope_id, - _ => scope_ids[0], - }; - for role_id in role_ids { - assert_ok!(<::Rbac as RoleBasedAccessControl>::assign_role_to_user( - user.clone(), - pallet_id.clone(), - &scope_id, - role_id.clone() - )); - } - } - } - - Ok(()) -} - -fn set_start_take_sell_offer_worst_case( - user: ::AccountId, - offer_id: [u8; 32], -) -> Result<(), sp_runtime::DispatchError> -where - ::ItemId: From, - ::CollectionId: From, -{ - let max_trxs = TransactionBoundedVec::bound(); - let num_trxs = max_trxs - 1; - - for _ in 0..num_trxs { - Afloat::::start_take_sell_order( - RawOrigin::Signed(user.clone()).into(), - offer_id, - T::AfloatBenchHelper::balance(99), - )?; - } - let offer = AfloatOffers::::get(offer_id).unwrap(); - let offer_trxs = offer.transactions.clone(); - assert_eq!(offer.status, OfferStatus::CREATED); - assert_eq!(offer_trxs.len(), num_trxs); - Ok(()) -} - fn add_max_afloat_balance(user: T::AccountId) -> Result<(), sp_runtime::DispatchError> where ::ItemId: From, @@ -187,41 +81,6 @@ where ) } -fn set_gm_do_enlist_sell_offer_worst_case( - owner: T::AccountId, -) -> Result<(), sp_runtime::DispatchError> -where - ::ItemId: From, - ::CollectionId: From, -{ - // MaxOffersPerMarket is the limit for OffersByAccount, OffersByMarket and OffersByItem - // add_confirm_sell_transaction() populates those StorageMaps - // we need to create different accounts and different fruniques since the uniqueness of the - // item_id (created and checked by gm) relies on the use of a timestamp that doesn't work for - // the benchmark - - let max_offers_by_market = - ::MaxOffersPerMarket::get() - 1; - - for i in 0..max_offers_by_market { - let acc: T::AccountId = account("acc", 0, i + 1); - assert_ok!(register_user::(acc.clone(), "acc")); - assert_ok!(set_max_balance::(acc.clone())); - assert_ok!(add_max_afloat_balance::(acc.clone())); - let item_id = add_tax_credit::(owner.clone()).unwrap(); - let offer_id = add_sell_order::(owner.clone(), item_id).unwrap(); - let trx_id = add_start_take_sell_order::(acc.clone(), offer_id.clone()).unwrap(); - assert_ok!(add_confirm_sell_transaction::(owner.clone(), trx_id.clone())); - assert_ok!(set_afloat_balance_to_zero::(acc.clone())); - assert_ok!(Afloat::::update_user_info( - RawOrigin::Signed(account("admin", 0, SEED)).into(), - acc.clone(), - UpdateUserArgs::Delete - )); - } - Ok(()) -} - fn set_max_balance(account: T::AccountId) -> Result<(), sp_runtime::DispatchError> { let max_balance = DepositBalanceOf::::max_value(); ::Currency::make_free_balance_be(&account, max_balance); @@ -423,17 +282,6 @@ mod benchmarks { let creator: T::AccountId = account("creator", 0, SEED); assert_ok!(set_max_balance::(admin.clone())); assert_ok!(set_max_balance::(creator.clone())); - let pallet_ids = vec![ - Afloat::::pallet_id(), - Fruniques::::pallet_id(), - GatedMarketplace::::pallet_id(), - ]; - assert_ok!(set_rbac_assign_role_to_user_worst_case::( - admin.clone(), - 0, - true, - pallet_ids - )); let asset_id: T::AssetId = T::AfloatBenchHelper::asset(0); let min_balance: T::Balance = T::AfloatBenchHelper::balance(1); let asset: CreateAsset = CreateAsset::New { asset_id, min_balance }; @@ -469,19 +317,7 @@ mod benchmarks { let sign_up_args = SignUpArgs::BuyerOrSeller { cid: cid.clone(), cid_creator, group }; let user: T::AccountId = account("user", 0, SEED); - let pallet_ids = vec![ - Afloat::::pallet_id(), - Fruniques::::pallet_id(), - // GatedMarketplace::::pallet_id(), if the user already has *any* role in GM, - // sign_up fails because of a validation in gm's self_enroll() - ]; assert_ok!(init::()); - assert_ok!(set_rbac_assign_role_to_user_worst_case::( - user.clone(), - 1, - false, - pallet_ids - )); #[extrinsic_call] _(RawOrigin::Signed(user.clone()), sign_up_args); @@ -505,13 +341,6 @@ mod benchmarks { GatedMarketplace::::pallet_id(), ]; - assert_ok!(set_rbac_assign_role_to_user_worst_case::( - user.clone(), - 1, - false, - pallet_ids - )); - let admin: T::AccountId = account("admin", 0, SEED); #[extrinsic_call] _(RawOrigin::Signed(admin.clone()), user.clone(), update_user_info_args); @@ -573,13 +402,7 @@ mod benchmarks { assert_eq!(offer.status, OfferStatus::CREATED); assert!(offer_trxs.is_empty()); let admin: T::AccountId = account("admin", 0, SEED); - let _ = Afloat::::set_afloat_balance( - RawOrigin::Signed(admin).into(), - other_user.clone(), - T::Balance::max_value().into(), - ); - - assert_ok!(set_start_take_sell_offer_worst_case::(other_user.clone(), offer_id.clone())); + assert_ok!(add_max_afloat_balance::(other_user.clone())); #[extrinsic_call] _(RawOrigin::Signed(other_user), offer_id, MAX_U32.into()); @@ -587,7 +410,7 @@ mod benchmarks { let offer = AfloatOffers::::get(offer_id).unwrap(); let offer_trxs = offer.transactions.clone(); assert_eq!(offer.status, OfferStatus::CREATED); - assert_eq!(offer_trxs.len() as u32, 100); + assert_eq!(offer_trxs.len() as u32, 1); } #[benchmark] @@ -600,7 +423,6 @@ mod benchmarks { assert_ok!(register_user::(user.clone(), "user")); assert_ok!(register_user::(other_user.clone(), "other_user")); assert_ok!(add_tax_credit::(user.clone())); - assert_ok!(set_gm_do_enlist_sell_offer_worst_case::(user.clone())); let offer_id = add_sell_order::(user.clone(), T::AfloatBenchHelper::item(0)).unwrap(); assert_ok!(add_max_afloat_balance::(other_user.clone())); let transaction_id = add_start_take_sell_order::(other_user.clone(), offer_id).unwrap(); @@ -627,8 +449,6 @@ mod benchmarks { let offer_id = add_sell_order::(user.clone(), T::AfloatBenchHelper::item(0)).unwrap(); assert_ok!(add_max_afloat_balance::(other_user.clone())); let transaction_id = add_start_take_sell_order::(other_user.clone(), offer_id).unwrap(); - // used internally by gm do_take_sell_offer when tax credit amount < 100 - assert_ok!(set_up_fruniques_do_spawn_worst_case::(other_user.clone())); assert_ok!(add_confirm_sell_transaction::(user.clone(), transaction_id)); let transaction = AfloatTransactions::::get(transaction_id).unwrap(); assert_eq!(transaction.completed, false); @@ -676,19 +496,8 @@ mod benchmarks { fn add_afloat_admin() { let user: T::AccountId = account("user", 0, SEED); let admin: T::AccountId = account("admin", 0, SEED); - let pallet_ids = vec![ - Afloat::::pallet_id(), - Fruniques::::pallet_id(), - GatedMarketplace::::pallet_id(), - ]; assert_ok!(init::()); assert_ok!(register_user::(user.clone(), "user")); - assert_ok!(set_rbac_assign_role_to_user_worst_case::( - user.clone(), - 2, - false, - pallet_ids - )); assert!(!Afloat::::is_admin(user.clone()).unwrap()); #[extrinsic_call] _(RawOrigin::Signed(admin.clone()), user.clone()); @@ -699,19 +508,8 @@ mod benchmarks { fn assign_user_to_role() { let user: T::AccountId = account("user", 0, SEED); let admin: T::AccountId = account("admin", 0, SEED); - let pallet_ids = vec![ - Afloat::::pallet_id(), - Fruniques::::pallet_id(), - GatedMarketplace::::pallet_id(), - ]; assert_ok!(init::()); assert_ok!(register_user::(user.clone(), "user")); - assert_ok!(set_rbac_assign_role_to_user_worst_case::( - user.clone(), - 2, - false, - pallet_ids - )); let role: AfloatRole = AfloatRole::CPA; assert!(!Afloat::::is_cpa(user.clone()).unwrap()); #[extrinsic_call] diff --git a/pallets/fund-admin/src/benchmarking.rs b/pallets/fund-admin/src/benchmarking.rs new file mode 100644 index 00000000..62ec7f60 --- /dev/null +++ b/pallets/fund-admin/src/benchmarking.rs @@ -0,0 +1,979 @@ +//! Fund Admin pallet benchmarking. + +#![cfg(feature = "runtime-benchmarks")] + +use super::*; +use crate::{types::*, Pallet as FundAdmin}; +use scale_info::prelude::{vec::Vec, *}; + +use frame_benchmarking::v2::*; +use frame_support::{ + assert_ok, + pallet_prelude::*, + traits::{Currency, Get}, +}; +use frame_system::RawOrigin; + +const SEED: u32 = 0; +const MAX_FIELD_NAME_SIZE: u32 = 100; +const MAX_FIELD_DESC_SIZE: u32 = 400; + +pub fn generate_vector(values: u8, size: u32) -> Vec { + assert!(size > 0, "vector size must be greater than 0"); + let v = vec![values; size as usize]; + v +} + +pub fn generate_field_name(values: u8, size: u32) -> FieldName { + generate_vector(values, size).try_into().unwrap() +} + +pub fn generate_field_description(values: u8, size: u32) -> FieldDescription { + generate_vector(values, size).try_into().unwrap() +} + +pub fn generate_user( + user_account: T::AccountId, + role: ProxyRole, + action: CUDAction, +) -> Result, DispatchError> { + let field_name = generate_field_name(1, MAX_FIELD_NAME_SIZE); + let user = (user_account, Some(field_name), Some(role), action); + let mut users_vec: Users = BoundedVec::new(); + users_vec.try_push(user).unwrap(); + Ok(users_vec) +} + +pub fn create_array_users(num_users: u32, role: ProxyRole) -> Users { + let mut users_vec: Users = BoundedVec::new(); + for i in 0..num_users { + let user_account: T::AccountId = account("user", i, SEED); + let action = CUDAction::Create; + let field_name = generate_field_name(i as u8, MAX_FIELD_NAME_SIZE); + let user = (user_account, Some(field_name), Some(role), action); + users_vec.try_push(user).unwrap(); + } + + users_vec +} + +pub fn create_array_documents(num_documents: u32) -> Documents { + let mut documents_vec: Documents = BoundedVec::new(); + for _i in 0..num_documents { + let field_name = generate_field_name(1, MAX_FIELD_NAME_SIZE); + let cid = generate_field_name(1, MAX_FIELD_NAME_SIZE); + let document = (field_name, cid); + documents_vec.try_push(document).unwrap(); + } + + documents_vec +} + +pub fn generate_banks(num_banks: u32) -> Banks { + let mut banks_vec: Banks = BoundedVec::new(); + for _i in 0..num_banks { + let bank_name = generate_field_name(1, MAX_FIELD_NAME_SIZE); + let bank_address = generate_field_name(1, MAX_FIELD_NAME_SIZE); + let bank = (bank_name, bank_address); + banks_vec.try_push(bank).unwrap(); + } + + banks_vec +} + +pub fn create_array_expenditures( + num_expenditures: u32, + expenditure_type: ExpenditureType, +) -> Expenditures { + let mut expenditures_vec: Expenditures = BoundedVec::new(); + for i in 0..num_expenditures { + let mut name = generate_field_name(1, MAX_FIELD_NAME_SIZE); + name[0] = i as u8; + let naics_code = generate_field_description(1, MAX_FIELD_DESC_SIZE); + let expenditure = ( + Some(name), + Some(expenditure_type), + Some(u64::MAX), + Some(naics_code), + Some(u32::MAX), + CUDAction::Create, + None, + ); + expenditures_vec.try_push(expenditure).unwrap(); + } + + expenditures_vec +} + +pub fn create_array_job_eligibles(num_job_eligibles: u32, id: u8) -> JobEligibles { + let mut job_eligibles_vec: JobEligibles = BoundedVec::new(); + for i in 0..num_job_eligibles { + let mut name = generate_field_name(1, MAX_FIELD_NAME_SIZE); + name[0] = id; + let naics_code = generate_field_description(1, MAX_FIELD_DESC_SIZE); + let job_eligible = + (Some(name), Some(i as u64), Some(naics_code), Some(u32::MAX), CUDAction::Create, None); + job_eligibles_vec.try_push(job_eligible).unwrap(); + } + + job_eligibles_vec +} + +pub fn create_array_users_assignations( + num_users: u32, + role: ProxyRole, + id: u32, +) -> UsersAssignation { + let mut users_vec: UsersAssignation = BoundedVec::new(); + for i in 0..num_users { + let user_account: T::AccountId = account("ua", i, id + i); + let action = AssignAction::Assign; + let user = (user_account, role, action); + users_vec.try_push(user).unwrap(); + } + + users_vec +} + +pub fn register_users( + admin: T::AccountId, + users_assignation: UsersAssignation, +) -> Result<(), DispatchError> { + let mut users_array: Users = BoundedVec::new(); + for (user, role, _) in users_assignation.iter() { + let name = generate_field_name(1, MAX_FIELD_NAME_SIZE); + let user_info = (user.clone(), Some(name), Some(role.clone()), CUDAction::Create); + users_array.try_push(user_info).unwrap(); + } + + assert_ok!(FundAdmin::::users(RawOrigin::Signed(admin.clone()).into(), users_array.clone())); + + Ok(()) +} + +fn get_drawdown_id( + project_id: ProjectId, + drawdown_type: DrawdownType, + drawdown_number: DrawdownNumber, +) -> DrawdownId { + let mut drawdown_id: DrawdownId = [0; 32]; + let drawdonws_by_project = >::get(project_id); + + for i in 0..drawdonws_by_project.len() { + let drawdown_data = >::get(drawdonws_by_project[i]).unwrap(); + if drawdown_data.drawdown_type == drawdown_type && + drawdown_data.drawdown_number == drawdown_number + { + drawdown_id = drawdonws_by_project[i]; + } + } + drawdown_id +} + +pub fn create_array_transactions( + num_transactions: u32, + expenditure_id: [u8; 32], +) -> Transactions { + let mut transactions_vec: Transactions = BoundedVec::new(); + let documents = create_array_documents::(T::MaxDocuments::get()); + for i in 0..num_transactions { + let transaction = ( + Some(expenditure_id), + Some(i as u64), + Some(documents.clone()), + CUDAction::Create, + None, + ); + transactions_vec.try_push(transaction).unwrap(); + } + + transactions_vec +} + +pub fn initialize_pallet() -> T::AccountId +where + T: Config, + <::Currency as Currency>::Balance: From, +{ + assert_ok!(FundAdmin::::initial_setup(RawOrigin::Root.into())); + let admin: T::AccountId = account("admin", 0, SEED); + let field_name = generate_field_name(1, MAX_FIELD_NAME_SIZE); + + assert_ok!(FundAdmin::::sudo_add_administrator( + RawOrigin::Root.into(), + admin.clone(), + field_name.clone(), + )); + + let admin_info = >::get(admin.clone()).unwrap(); + assert!(admin_info.role == ProxyRole::Administrator); + assert_eq!(admin_info.name, field_name); + T::Currency::make_free_balance_be(&admin, u64::MAX.into()); + + admin +} +pub fn create_full_project(admin: T::AccountId) -> Result<[u8; 32], DispatchError> { + let title = generate_field_name(1, MAX_FIELD_NAME_SIZE); + let description = generate_field_description(1, MAX_FIELD_DESC_SIZE); + let image = generate_field_name(1, MAX_FIELD_NAME_SIZE); + let address = generate_field_name(1, MAX_FIELD_NAME_SIZE); + let banks = generate_banks::(1); + let creation_date = u64::MAX - 1; + let completion_date = u64::MAX; + let expenditures = + create_array_expenditures::(T::MaxRegistrationsAtTime::get(), ExpenditureType::HardCost); + let job_eligibles = create_array_job_eligibles::(T::MaxRegistrationsAtTime::get(), 33); + let users_assignation = create_array_users_assignations::( + T::MaxRegistrationsAtTime::get(), + ProxyRole::Builder, + 1000, + ); + assert_ok!(register_users::(admin.clone(), users_assignation.clone())); + + let private_group_id = generate_field_description(1, MAX_FIELD_NAME_SIZE); + + assert_ok!(FundAdmin::::projects_create_project( + RawOrigin::Signed(admin.clone()).into(), + title.clone(), + description.clone(), + Some(image.clone()), + address.clone(), + Some(banks.clone()), + creation_date, + completion_date, + expenditures.clone(), + Some(job_eligibles.clone()), + Some(users_assignation.clone()), + private_group_id.clone(), + )); + + let project_id = >::iter_keys().next(); + assert!(project_id.is_some()); + + Ok(project_id.unwrap()) +} + +pub fn create_array_transactions_feedback( + transaction_ids: Vec<[u8; 32]>, +) -> TransactionsFeedback { + let mut transactions_feedback_vec: TransactionsFeedback = BoundedVec::new(); + for i in 0..transaction_ids.len() { + let description = generate_field_description(1, MAX_FIELD_DESC_SIZE); + let transaction_feedback = (transaction_ids[i], description); + transactions_feedback_vec.try_push(transaction_feedback).unwrap(); + } + + transactions_feedback_vec +} + +pub fn create_array_inflation_rate( + num_inflation_rates: u32, + project_id: [u8; 32], +) -> Result, DispatchError> { + let mut inflation_rate_vec: ProjectsInflation = BoundedVec::new(); + for _i in 0..num_inflation_rates { + let inflation_rate = (project_id, Some(u32::MAX), CUDAction::Update); + inflation_rate_vec.try_push(inflation_rate).unwrap() + } + + inflation_rate_vec[0].2 = CUDAction::Create; + + Ok(inflation_rate_vec) +} + +fn create_array_revenue_transactions( + num_transactions: u32, + job_eligible_id: [u8; 32], +) -> Result, DispatchError> { + let mut transactions_vec: RevenueTransactions = BoundedVec::new(); + let documents = create_array_documents::(T::MaxDocuments::get()); + for i in 0..num_transactions { + let transaction = ( + Some(job_eligible_id), + Some(i as u64), + Some(documents.clone()), + CUDAction::Create, + None, + ); + transactions_vec.try_push(transaction).unwrap(); + } + + Ok(transactions_vec) +} + +#[benchmarks(where T: Config, <::Currency as Currency>::Balance: From)] +mod benchmarks { + use super::*; + + #[benchmark] + fn initial_setup() { + #[extrinsic_call] + _(RawOrigin::Root); + + let global_scope = >::get(); + assert_ne!(global_scope, [0u8; 32]); + } + + #[benchmark] + fn sudo_add_administrator() { + assert_ok!(FundAdmin::::initial_setup(RawOrigin::Root.into())); + let admin: T::AccountId = account("admin", 0, SEED); + let field_name = generate_field_name(1, MAX_FIELD_NAME_SIZE); + + #[extrinsic_call] + _(RawOrigin::Root, admin.clone(), field_name.clone()); + + assert!(>::get(admin).is_some()); + } + + #[benchmark] + fn sudo_remove_administrator() { + assert_ok!(FundAdmin::::initial_setup(RawOrigin::Root.into())); + let admin: T::AccountId = account("admin", 0, SEED); + let field_name = generate_field_name(1, MAX_FIELD_NAME_SIZE); + assert_ok!(FundAdmin::::sudo_add_administrator( + RawOrigin::Root.into(), + admin.clone(), + field_name.clone(), + )); + + #[extrinsic_call] + _(RawOrigin::Root, admin.clone()); + + assert!(>::get(admin).is_none()); + } + + #[benchmark] + fn users(x: Linear<1, { T::MaxRegistrationsAtTime::get() }>) { + let admin = initialize_pallet::(); + + let users_array = create_array_users::(x, ProxyRole::Administrator); + + #[extrinsic_call] + _(RawOrigin::Signed(admin), users_array.clone()); + + for user in users_array.iter() { + assert!(>::get(user.0.clone()).is_some()); + } + } + + #[benchmark] + fn users_edit_user(d: Linear<1, { T::MaxDocuments::get() }>) { + let admin = initialize_pallet::(); + + let investor_account: T::AccountId = account("user", 1, SEED); + let investor_payload = + generate_user::(investor_account.clone(), ProxyRole::Investor, CUDAction::Create) + .unwrap(); + assert_ok!(FundAdmin::::users( + RawOrigin::Signed(admin.clone()).into(), + investor_payload.clone() + )); + let investor_info = >::get(investor_account.clone()); + assert!(investor_info.is_some()); + + let name = generate_field_name(1, MAX_FIELD_NAME_SIZE); + let image = generate_field_name(1, MAX_FIELD_NAME_SIZE); + let email = generate_field_name(1, MAX_FIELD_NAME_SIZE); + let documents = create_array_documents::(d); + + #[extrinsic_call] + _( + RawOrigin::Signed(investor_account.clone()), + Some(name.clone()), + Some(image.clone()), + Some(email.clone()), + Some(documents.clone()), + ); + + let user_info = >::get(investor_account.clone()); + assert!(user_info.clone().unwrap().name == name); + assert!(user_info.clone().unwrap().image == image); + assert!(user_info.clone().unwrap().email == email); + assert!(user_info.clone().unwrap().documents == Some(documents)); + } + + #[benchmark] + fn projects_create_project( + b: Linear<1, { T::MaxBanksPerProject::get() }>, + e: Linear<1, { T::MaxRegistrationsAtTime::get() }>, + j: Linear<1, { T::MaxRegistrationsAtTime::get() }>, + u: Linear<1, { T::MaxRegistrationsAtTime::get() }>, + ) { + let admin = initialize_pallet::(); + + let title = generate_field_name(1, MAX_FIELD_NAME_SIZE); + let description = generate_field_description(1, MAX_FIELD_DESC_SIZE); + let image = generate_field_name(1, MAX_FIELD_NAME_SIZE); + let address = generate_field_name(1, MAX_FIELD_NAME_SIZE); + let banks = generate_banks::(b); + let creation_date = u64::MAX - 1; + let completion_date = u64::MAX; + let expenditures = create_array_expenditures::(e, ExpenditureType::HardCost); + let job_eligibles = create_array_job_eligibles::(j, 11); + let users_assignation = create_array_users_assignations::(u, ProxyRole::Builder, 50); + assert_ok!(register_users::(admin.clone(), users_assignation.clone())); + + let private_group_id = generate_field_description(1, MAX_FIELD_DESC_SIZE); + + #[extrinsic_call] + _( + RawOrigin::Signed(admin.clone()), + title.clone(), + description.clone(), + Some(image.clone()), + address.clone(), + Some(banks.clone()), + creation_date, + completion_date, + expenditures.clone(), + Some(job_eligibles.clone()), + Some(users_assignation.clone()), + private_group_id.clone(), + ); + + let project_id = >::iter_keys().next(); + assert!(project_id.is_some()); + } + + #[benchmark] + fn projects_edit_project(b: Linear<1, { T::MaxBanksPerProject::get() }>) { + let admin = initialize_pallet::(); + let project_id = create_full_project::(admin.clone()).unwrap(); + + let title = generate_field_name(1, MAX_FIELD_NAME_SIZE); + let description = generate_field_description(1, MAX_FIELD_DESC_SIZE); + let image = generate_field_name(1, MAX_FIELD_NAME_SIZE); + let banks = generate_banks::(b); + let address = generate_field_name(1, MAX_FIELD_NAME_SIZE); + let creation_date = u64::MAX - 1; + let completion_date = u64::MAX; + + #[extrinsic_call] + _( + RawOrigin::Signed(admin.clone()), + project_id.clone(), + Some(title.clone()), + Some(description.clone()), + Some(image.clone()), + Some(address.clone()), + Some(banks.clone()), + Some(creation_date), + Some(completion_date), + ); + + let project_info = >::get(project_id.clone()); + assert!(project_info.clone().unwrap().title == title); + assert!(project_info.clone().unwrap().description == description); + assert!(project_info.clone().unwrap().image == Some(image)); + assert!(project_info.clone().unwrap().address == address); + assert!(project_info.clone().unwrap().creation_date == creation_date); + assert!(project_info.clone().unwrap().completion_date == completion_date); + assert!(project_info.clone().unwrap().banks == Some(banks)); + } + + #[benchmark] + fn projects_delete_project() { + let admin = initialize_pallet::(); + let project_id = create_full_project::(admin.clone()).unwrap(); + + #[extrinsic_call] + _(RawOrigin::Signed(admin.clone()), project_id.clone()); + + let project_info = >::get(project_id.clone()); + assert!(project_info.is_none()); + } + + #[benchmark] + fn projects_assign_user(a: Linear<1, { T::MaxRegistrationsAtTime::get() }>) { + let admin = initialize_pallet::(); + let project_id = create_full_project::(admin.clone()).unwrap(); + + let users_assignation = create_array_users_assignations::(a, ProxyRole::Builder, 0); + assert_ok!(register_users::(admin.clone(), users_assignation.clone())); + + #[extrinsic_call] + _(RawOrigin::Signed(admin.clone()), project_id.clone(), users_assignation.clone()); + + for (user, _role, _) in users_assignation.iter() { + let user_info = >::get(user.clone()); + assert!(user_info.is_some()); + let project_info = >::get(project_id.clone()); + assert!(project_info.unwrap().builder.unwrap().iter().any(|x| x == user)); + } + } + + #[benchmark] + fn expenditures_and_job_eligibles( + e: Linear<1, { T::MaxRegistrationsAtTime::get() }>, + j: Linear<1, { T::MaxRegistrationsAtTime::get() }>, + ) { + let admin = initialize_pallet::(); + let project_id = create_full_project::(admin.clone()).unwrap(); + + let expenditures = create_array_expenditures::(e, ExpenditureType::SoftCost); + let job_eligibles = create_array_job_eligibles::(j, 22); + + #[extrinsic_call] + _( + RawOrigin::Signed(admin.clone()), + project_id.clone(), + Some(expenditures.clone()), + Some(job_eligibles.clone()), + ); + + >::iter().for_each(|(_key, value)| { + assert!(value.project_id == project_id); + }); + + >::iter().for_each(|(_key, value)| { + assert!(value.project_id == project_id); + }); + } + + #[benchmark] + fn submit_drawdown(a: Linear<1, { T::MaxRegistrationsAtTime::get() }>) { + let admin = initialize_pallet::(); + let project_id = create_full_project::(admin.clone()).unwrap(); + let drawdown_type = DrawdownType::EB5; + let drawdown_number = 1 as u32; + let drawdown_id = get_drawdown_id::(project_id.clone(), drawdown_type, drawdown_number); + let expenditure_id = >::iter_keys().next(); + assert!(expenditure_id.is_some()); + let transactions = create_array_transactions::(a, expenditure_id.unwrap()); + + #[extrinsic_call] + _( + RawOrigin::Signed(admin.clone()), + project_id.clone(), + drawdown_id.clone(), + Some(transactions.clone()), + true, + ); + + let drawdown_info = >::get(drawdown_id.clone()); + assert!(drawdown_info.is_some()); + assert_eq!(drawdown_info.unwrap().status, DrawdownStatus::Submitted); + } + + #[benchmark] + fn approve_drawdown(t: Linear<1, { T::MaxRegistrationsAtTime::get() }>) { + let admin = initialize_pallet::(); + let project_id = create_full_project::(admin.clone()).unwrap(); + let drawdown_type = DrawdownType::EB5; + let drawdown_number = 1 as u32; + let drawdown_id = get_drawdown_id::(project_id.clone(), drawdown_type, drawdown_number); + let expenditure_id = >::iter_keys().next(); + assert!(expenditure_id.is_some()); + let transactions = create_array_transactions::( + T::MaxRegistrationsAtTime::get(), + expenditure_id.unwrap(), + ); + assert_ok!(FundAdmin::::submit_drawdown( + RawOrigin::Signed(admin.clone()).into(), + project_id.clone(), + drawdown_id.clone(), + Some(transactions.clone()), + false, + )); + + let last_expenditure_id = >::iter_keys().last(); + let bulkupload_transactions = + create_array_transactions::(t, last_expenditure_id.unwrap()); + + #[extrinsic_call] + _( + RawOrigin::Signed(admin.clone()), + project_id.clone(), + drawdown_id.clone(), + Some(true), + Some(bulkupload_transactions.clone()), + ); + + let drawdown_info = >::get(drawdown_id.clone()); + assert!(drawdown_info.is_some()); + assert_eq!(drawdown_info.unwrap().status, DrawdownStatus::Approved); + } + + #[benchmark] + fn reject_drawdown() { + let admin = initialize_pallet::(); + let project_id = create_full_project::(admin.clone()).unwrap(); + let drawdown_type = DrawdownType::EB5; + let drawdown_number = 1 as u32; + let drawdown_id = get_drawdown_id::(project_id.clone(), drawdown_type, drawdown_number); + let expenditure_id = >::iter_keys().next(); + assert!(expenditure_id.is_some()); + let transactions = create_array_transactions::( + T::MaxRegistrationsAtTime::get(), + expenditure_id.unwrap(), + ); + assert_ok!(FundAdmin::::submit_drawdown( + RawOrigin::Signed(admin.clone()).into(), + project_id.clone(), + drawdown_id.clone(), + Some(transactions.clone()), + true, + )); + + let transaction_ids = + >::get(project_id.clone(), drawdown_id.clone()).to_vec(); + let transactions_feedback = + create_array_transactions_feedback::(transaction_ids.clone()); + let drawdown_feedback = generate_field_description(1, MAX_FIELD_DESC_SIZE); + + #[extrinsic_call] + _( + RawOrigin::Signed(admin.clone()), + project_id.clone(), + drawdown_id.clone(), + Some(transactions_feedback.clone()), + Some(drawdown_feedback.clone()), + ); + + let drawdown_info = >::get(drawdown_id.clone()); + assert!(drawdown_info.is_some()); + assert_eq!(drawdown_info.unwrap().status, DrawdownStatus::Rejected); + } + + #[benchmark] + fn up_bulkupload(d: Linear<1, { T::MaxDocuments::get() }>) { + let admin = initialize_pallet::(); + let project_id = create_full_project::(admin.clone()).unwrap(); + let drawdown_type = DrawdownType::DeveloperEquity; + let drawdown_number = 1 as u32; + let drawdown_id = get_drawdown_id::(project_id.clone(), drawdown_type, drawdown_number); + let description = generate_field_description(1, MAX_FIELD_NAME_SIZE); + let total_amount = u64::MAX; + let documents = create_array_documents::(d); + + #[extrinsic_call] + _( + RawOrigin::Signed(admin.clone()), + project_id.clone(), + drawdown_id.clone(), + description.clone(), + total_amount.clone(), + documents.clone(), + ); + + let drawdown_info = >::get(drawdown_id.clone()); + assert!(drawdown_info.is_some()); + assert_eq!(drawdown_info.unwrap().status, DrawdownStatus::Submitted); + } + + #[benchmark] + fn inflation_rate(p: Linear<1, { T::MaxRegistrationsAtTime::get() }>) { + let admin = initialize_pallet::(); + let project_id = create_full_project::(admin.clone()).unwrap(); + let inflation_projects = create_array_inflation_rate::(p, project_id).unwrap(); + + #[extrinsic_call] + _(RawOrigin::Signed(admin.clone()), inflation_projects.clone()); + + for (project_id, rate, _) in inflation_projects.iter() { + let project_info = >::get(project_id.clone()); + assert!(project_info.is_some()); + assert_eq!(project_info.unwrap().inflation_rate, *rate); + } + } + + #[benchmark] + fn submit_revenue(t: Linear<1, { T::MaxRegistrationsAtTime::get() }>) { + let admin = initialize_pallet::(); + let project_id = create_full_project::(admin.clone()).unwrap(); + let revenue_id = >::iter_keys().next(); + let job_eligible_id = >::iter_keys().next(); + assert!(job_eligible_id.is_some()); + let transactions = + create_array_revenue_transactions::(t, job_eligible_id.unwrap()).unwrap(); + + #[extrinsic_call] + _( + RawOrigin::Signed(admin.clone()), + project_id.clone(), + revenue_id.clone().unwrap(), + Some(transactions.clone()), + true, + ); + + let revenue_info = >::get(revenue_id.clone().unwrap()); + assert!(revenue_info.is_some()); + assert_eq!(revenue_info.unwrap().status, RevenueStatus::Submitted); + } + + #[benchmark] + fn approve_revenue() { + let admin = initialize_pallet::(); + let project_id = create_full_project::(admin.clone()).unwrap(); + let revenue_id = >::iter_keys().next(); + let job_eligible_id = >::iter_keys().next(); + assert!(job_eligible_id.is_some()); + let transactions = create_array_revenue_transactions::( + T::MaxRegistrationsAtTime::get(), + job_eligible_id.unwrap(), + ) + .unwrap(); + assert_ok!(FundAdmin::::submit_revenue( + RawOrigin::Signed(admin.clone()).into(), + project_id.clone(), + revenue_id.clone().unwrap(), + Some(transactions.clone()), + true, + )); + + #[extrinsic_call] + _(RawOrigin::Signed(admin.clone()), project_id.clone(), revenue_id.clone().unwrap()); + + let revenue_info = >::get(revenue_id.clone().unwrap()); + assert!(revenue_info.is_some()); + assert_eq!(revenue_info.unwrap().status, RevenueStatus::Approved); + } + + #[benchmark] + fn reject_revenue() { + let admin = initialize_pallet::(); + let project_id = create_full_project::(admin.clone()).unwrap(); + let revenue_id = >::iter_keys().next(); + let job_eligible_id = >::iter_keys().next(); + assert!(job_eligible_id.is_some()); + let transactions = create_array_revenue_transactions::( + T::MaxRegistrationsAtTime::get(), + job_eligible_id.unwrap(), + ) + .unwrap(); + assert_ok!(FundAdmin::::submit_revenue( + RawOrigin::Signed(admin.clone()).into(), + project_id.clone(), + revenue_id.clone().unwrap(), + Some(transactions.clone()), + true, + )); + + let transaction_ids = + >::get(project_id.clone(), revenue_id.clone().unwrap()) + .to_vec(); + let transactions_feedback = + create_array_transactions_feedback::(transaction_ids.clone()); + + #[extrinsic_call] + _( + RawOrigin::Signed(admin.clone()), + project_id.clone(), + revenue_id.clone().unwrap(), + transactions_feedback.clone(), + ); + + let revenue_info = >::get(revenue_id.clone().unwrap()); + assert!(revenue_info.is_some()); + assert_eq!(revenue_info.unwrap().status, RevenueStatus::Rejected); + } + + #[benchmark] + fn bank_confirming_documents(a: Linear<1, { T::MaxDocuments::get() }>) { + let admin = initialize_pallet::(); + let project_id = create_full_project::(admin.clone()).unwrap(); + let drawdown_type = DrawdownType::EB5; + let drawdown_number = 1 as u32; + let drawdown_id = get_drawdown_id::(project_id.clone(), drawdown_type, drawdown_number); + let expenditure_id = >::iter_keys().next(); + assert!(expenditure_id.is_some()); + let transactions = create_array_transactions::( + T::MaxRegistrationsAtTime::get(), + expenditure_id.unwrap(), + ); + assert_ok!(FundAdmin::::submit_drawdown( + RawOrigin::Signed(admin.clone()).into(), + project_id.clone(), + drawdown_id.clone(), + Some(transactions.clone()), + true, + )); + assert_ok!(FundAdmin::::approve_drawdown( + RawOrigin::Signed(admin.clone()).into(), + project_id.clone(), + drawdown_id.clone(), + None, + None, + )); + + let confirming_documents = create_array_documents::(a); + + #[extrinsic_call] + _( + RawOrigin::Signed(admin.clone()), + project_id.clone(), + drawdown_id.clone(), + Some(confirming_documents.clone()), + CUDAction::Create, + ); + + let drawdown_info = >::get(drawdown_id.clone()); + assert!(drawdown_info.is_some()); + assert_eq!(drawdown_info.unwrap().status, DrawdownStatus::Confirmed); + } + + #[benchmark] + fn reset_drawdown() { + let admin = initialize_pallet::(); + let project_id = create_full_project::(admin.clone()).unwrap(); + let drawdown_type = DrawdownType::EB5; + let drawdown_number = 1 as u32; + let drawdown_id = get_drawdown_id::(project_id.clone(), drawdown_type, drawdown_number); + let expenditure_id = >::iter_keys().next(); + assert!(expenditure_id.is_some()); + let transactions = create_array_transactions::( + T::MaxRegistrationsAtTime::get(), + expenditure_id.unwrap(), + ); + assert_ok!(FundAdmin::::submit_drawdown( + RawOrigin::Signed(admin.clone()).into(), + project_id.clone(), + drawdown_id.clone(), + Some(transactions.clone()), + true, + )); + assert_eq!( + >::get(drawdown_id.clone()).unwrap().status, + DrawdownStatus::Submitted + ); + + #[extrinsic_call] + _(RawOrigin::Signed(admin.clone()), project_id.clone(), drawdown_id.clone()); + + let drawdown_info = >::get(drawdown_id.clone()); + assert!(drawdown_info.is_some()); + assert_eq!(drawdown_info.unwrap().status, DrawdownStatus::Draft); + } + + #[benchmark] + fn recovery_drawdown(a: Linear<1, { T::MaxRegistrationsAtTime::get() }>) { + let admin = initialize_pallet::(); + let project_id = create_full_project::(admin.clone()).unwrap(); + let drawdown_type = DrawdownType::EB5; + let drawdown_number = 1 as u32; + let drawdown_id = get_drawdown_id::(project_id.clone(), drawdown_type, drawdown_number); + let expenditure_id = >::iter_keys().next(); + let last_expenditure_id = >::iter_keys().last(); + assert!(expenditure_id.is_some()); + assert!(last_expenditure_id.is_some()); + let transactions = create_array_transactions::( + T::MaxRegistrationsAtTime::get(), + expenditure_id.unwrap(), + ); + + assert_ok!(FundAdmin::::submit_drawdown( + RawOrigin::Signed(admin.clone()).into(), + project_id.clone(), + drawdown_id.clone(), + Some(transactions.clone()), + true, + )); + assert_ok!(FundAdmin::::approve_drawdown( + RawOrigin::Signed(admin.clone()).into(), + project_id.clone(), + drawdown_id.clone(), + None, + None, + )); + + let recovery_transactions = create_array_transactions::(a, last_expenditure_id.unwrap()); + + #[extrinsic_call] + _( + RawOrigin::Signed(admin.clone()), + project_id.clone(), + drawdown_id.clone(), + recovery_transactions.clone(), + ); + + let drawdown_info = >::get(drawdown_id.clone()); + assert!(drawdown_info.is_some()); + assert_eq!(drawdown_info.unwrap().status, DrawdownStatus::Approved); + let transactions_by_drawdown = + >::get(project_id.clone(), drawdown_id.clone()); + assert_eq!( + transactions_by_drawdown.len(), + transactions.len() + recovery_transactions.len() + ); + } + + #[benchmark] + fn recovery_revenue(a: Linear<1, { T::MaxRegistrationsAtTime::get() }>) { + let admin = initialize_pallet::(); + let project_id = create_full_project::(admin.clone()).unwrap(); + let revenue_id = >::iter_keys().next(); + let job_eligible_id = >::iter_keys().next(); + let last_job_eligible_id = >::iter_keys().last(); + assert!(job_eligible_id.is_some()); + assert!(last_job_eligible_id.is_some()); + let transactions = create_array_revenue_transactions::( + T::MaxRegistrationsAtTime::get(), + job_eligible_id.unwrap(), + ) + .unwrap(); + assert_ok!(FundAdmin::::submit_revenue( + RawOrigin::Signed(admin.clone()).into(), + project_id.clone(), + revenue_id.clone().unwrap(), + Some(transactions.clone()), + true, + )); + assert_ok!(FundAdmin::::approve_revenue( + RawOrigin::Signed(admin.clone()).into(), + project_id.clone(), + revenue_id.clone().unwrap(), + )); + + let recovery_transactions = + create_array_revenue_transactions::(a, last_job_eligible_id.unwrap()).unwrap(); + + #[extrinsic_call] + _( + RawOrigin::Signed(admin.clone()), + project_id.clone(), + revenue_id.clone().unwrap(), + recovery_transactions.clone(), + ); + + let revenue_info = >::get(revenue_id.clone().unwrap()); + assert!(revenue_info.is_some()); + assert_eq!(revenue_info.unwrap().status, RevenueStatus::Approved); + let transactions_by_revenue = + >::get(project_id.clone(), revenue_id.clone().unwrap()); + assert_eq!(transactions_by_revenue.len(), transactions.len() + recovery_transactions.len()); + } + + #[benchmark] + fn kill_storage() { + let admin = initialize_pallet::(); + assert_ok!(create_full_project::(admin.clone())); + + #[extrinsic_call] + _(RawOrigin::Root); + + assert_eq!(>::exists(), false); + assert_eq!(>::iter().count(), 0); + assert_eq!(>::iter().count(), 0); + assert_eq!(>::iter().count(), 0); + assert_eq!(>::iter().count(), 0); + assert_eq!(>::iter().count(), 0); + assert_eq!(>::iter().count(), 0); + assert_eq!(>::iter().count(), 0); + assert_eq!(>::iter().count(), 0); + assert_eq!(>::iter().count(), 0); + assert_eq!(>::iter().count(), 0); + assert_eq!(>::iter().count(), 0); + assert_eq!(>::iter().count(), 0); + assert_eq!(>::iter().count(), 0); + assert_eq!(>::iter().count(), 0); + assert_eq!(>::iter().count(), 0); + assert_eq!(>::iter().count(), 0); + } + + impl_benchmark_test_suite! { + FundAdmin, + crate::mock::new_test_ext(), + crate::mock::Test, + } +} diff --git a/pallets/fund-admin/src/functions.rs b/pallets/fund-admin/src/functions.rs index a867f444..9fefb590 100644 --- a/pallets/fund-admin/src/functions.rs +++ b/pallets/fund-admin/src/functions.rs @@ -1804,7 +1804,7 @@ impl Pallet { // Create job eligible id let job_eligible_id: JobEligibleId = - (project_id, name.clone(), timestamp).using_encoded(blake2_256); + (project_id, name.clone(), timestamp, job_eligible_amount, naics_code.clone(), jobs_multiplier).using_encoded(blake2_256); // Create job eligible data let job_eligible_data = diff --git a/pallets/fund-admin/src/lib.rs b/pallets/fund-admin/src/lib.rs index 66ec3600..67a45f86 100644 --- a/pallets/fund-admin/src/lib.rs +++ b/pallets/fund-admin/src/lib.rs @@ -2,6 +2,8 @@ pub use pallet::*; +mod benchmarking; + #[cfg(test)] mod mock; @@ -11,8 +13,11 @@ mod tests; mod functions; pub mod migration; mod types; +pub mod weights; +use weights::WeightInfo; #[frame_support::pallet] pub mod pallet { + use super::*; use frame_support::{ pallet_prelude::{ValueQuery, *}, traits::{Currency, Time}, @@ -20,7 +25,7 @@ pub mod pallet { }; use frame_system::pallet_prelude::*; use scale_info::prelude::vec; - use sp_runtime::{sp_std::vec::Vec, traits::Scale}; + use sp_runtime::traits::Scale; const STORAGE_VERSION: StorageVersion = StorageVersion::new(1); use crate::types::*; @@ -48,6 +53,8 @@ pub mod pallet { type Currency: Currency; + type WeightInfo: WeightInfo; + #[pallet::constant] type MaxDocuments: Get; @@ -711,7 +718,7 @@ pub mod pallet { /// - This function can only be called once /// - This function can only be called usinf the sudo pallet #[pallet::call_index(1)] - #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] + #[pallet::weight(T::WeightInfo::initial_setup())] pub fn initial_setup(origin: OriginFor) -> DispatchResult { T::RemoveOrigin::ensure_origin(origin.clone())?; Self::do_initial_setup()?; @@ -733,7 +740,7 @@ pub mod pallet { /// - This function grants administrator permissions to the user from the rbac pallet /// - administrator role have global scope permissions #[pallet::call_index(2)] - #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] + #[pallet::weight(T::WeightInfo::sudo_add_administrator())] pub fn sudo_add_administrator( origin: OriginFor, admin: T::AccountId, @@ -760,7 +767,7 @@ pub mod pallet { /// WARNING: Administrators can remove themselves from the site, /// but they can add themselves back #[pallet::call_index(3)] - #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] + #[pallet::weight(T::WeightInfo::sudo_remove_administrator())] pub fn sudo_remove_administrator( origin: OriginFor, admin: T::AccountId, @@ -807,7 +814,7 @@ pub mod pallet { /// unassigning /// a user from a selected project. #[pallet::call_index(4)] - #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] + #[pallet::weight(T::WeightInfo::users(users.len() as u32))] pub fn users(origin: OriginFor, users: Users) -> DispatchResult { let who = ensure_signed(origin)?; // origin need to be an admin @@ -831,7 +838,7 @@ pub mod pallet { /// - ALL parameters are optional because depends on what is being edited /// - ONLY the investor role can edit or update the documents #[pallet::call_index(5)] - #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] + #[pallet::weight(T::WeightInfo::users_edit_user(documents.clone().unwrap_or_default().len() as u32))] pub fn users_edit_user( origin: OriginFor, name: Option, @@ -898,7 +905,7 @@ pub mod pallet { /// WARNING: If users are provided, the function will assign the users to the project, /// granting them permissions in the rbac pallet. #[pallet::call_index(6)] - #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] + #[pallet::weight(T::WeightInfo::projects_create_project(banks.clone().unwrap_or_default().len() as u32, expenditures.len() as u32, job_eligibles.clone().unwrap_or_default().len() as u32, users.clone().unwrap_or_default().len() as u32))] pub fn projects_create_project( origin: OriginFor, title: FieldName, @@ -956,7 +963,7 @@ pub mod pallet { /// - Project can only be edited in the Started status /// - Completion date must be greater than creation date #[pallet::call_index(7)] - #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] + #[pallet::weight(T::WeightInfo::projects_edit_project(banks.clone().unwrap_or_default().len() as u32))] pub fn projects_edit_project( origin: OriginFor, project_id: ProjectId, @@ -1000,7 +1007,7 @@ pub mod pallet { /// the project. /// BE CAREFUL. #[pallet::call_index(8)] - #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] + #[pallet::weight(T::WeightInfo::projects_delete_project())] pub fn projects_delete_project( origin: OriginFor, project_id: ProjectId, @@ -1047,7 +1054,7 @@ pub mod pallet { /// - Warning: Do not perform multiple actions over the same user in the same call, it could /// result in an unexpected behavior. #[pallet::call_index(9)] - #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] + #[pallet::weight(T::WeightInfo::projects_assign_user(users.len() as u32))] pub fn projects_assign_user( origin: OriginFor, project_id: ProjectId, @@ -1102,7 +1109,7 @@ pub mod pallet { /// - Do not perform multiple actions over the same expenditure in the same call, it could /// result in an unexpected behavior. #[pallet::call_index(10)] - #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] + #[pallet::weight(T::WeightInfo::expenditures_and_job_eligibles(expenditures.clone().unwrap_or_default().len() as u32, job_eligibles.clone().unwrap_or_default().len() as u32))] pub fn expenditures_and_job_eligibles( origin: OriginFor, project_id: ProjectId, @@ -1166,7 +1173,7 @@ pub mod pallet { /// - After a drawdown is rejected, builders will use again this extrinsic to update the /// transactions associated to a given drawdown. #[pallet::call_index(11)] - #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] + #[pallet::weight(T::WeightInfo::submit_drawdown(transactions.clone().unwrap_or_default().len() as u32))] pub fn submit_drawdown( origin: OriginFor, project_id: ProjectId, @@ -1257,7 +1264,7 @@ pub mod pallet { /// the /// new drawdown version uploaded by the builder. #[pallet::call_index(12)] - #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] + #[pallet::weight(T::WeightInfo::approve_drawdown(transactions.clone().unwrap_or_default().len() as u32))] pub fn approve_drawdown( origin: OriginFor, project_id: ProjectId, @@ -1358,7 +1365,7 @@ pub mod pallet { /// drawdown. /// There is no way to reject a single transaction. #[pallet::call_index(13)] - #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] + #[pallet::weight(T::WeightInfo::reject_drawdown())] pub fn reject_drawdown( origin: OriginFor, project_id: ProjectId, @@ -1399,7 +1406,7 @@ pub mod pallet { /// - After a builder uploads a drawdown, the administrator will have to /// insert each transaction manually. #[pallet::call_index(14)] - #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] + #[pallet::weight(T::WeightInfo::up_bulkupload(documents.len() as u32))] pub fn up_bulkupload( origin: OriginFor, project_id: ProjectId, @@ -1442,7 +1449,7 @@ pub mod pallet { /// * **Delete**: The inflation rate will be deleted. Project id and action are required. /// - The inflation rate can only be modified if the project is in the "started" status. #[pallet::call_index(15)] - #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] + #[pallet::weight(T::WeightInfo::inflation_rate(projects.len() as u32))] pub fn inflation_rate( origin: OriginFor, projects: ProjectsInflation, @@ -1498,7 +1505,7 @@ pub mod pallet { /// - After a revenue is rejected, builders will use again this extrinsic to update the /// transactions associated to a given revenue. #[pallet::call_index(16)] - #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] + #[pallet::weight(T::WeightInfo::submit_revenue(revenue_transactions.clone().unwrap_or_default().len() as u32))] pub fn submit_revenue( origin: OriginFor, project_id: ProjectId, @@ -1562,7 +1569,7 @@ pub mod pallet { /// new revenue version uploaded by the builder. /// - The revenue status will be updated to Approved. #[pallet::call_index(17)] - #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] + #[pallet::weight(T::WeightInfo::approve_revenue())] pub fn approve_revenue( origin: OriginFor, project_id: ProjectId, @@ -1595,7 +1602,7 @@ pub mod pallet { /// revenue. /// There is no way to reject a single revenue transaction. #[pallet::call_index(18)] - #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] + #[pallet::weight(T::WeightInfo::reject_revenue())] pub fn reject_revenue( origin: OriginFor, project_id: ProjectId, @@ -1632,7 +1639,7 @@ pub mod pallet { /// drawdown status to "Approved" and the status of all of its transactions to "Approved". /// It does a rollback of the drawdown. #[pallet::call_index(19)] - #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] + #[pallet::weight(T::WeightInfo::bank_confirming_documents(confirming_documents.clone().unwrap_or_default().len() as u32))] pub fn bank_confirming_documents( origin: OriginFor, project_id: ProjectId, @@ -1664,7 +1671,7 @@ pub mod pallet { /// - All of its transactions will be deleted. /// - The whole drawdown will be reset to its initial state, so be careful when using this #[pallet::call_index(20)] - #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] + #[pallet::weight(T::WeightInfo::reset_drawdown())] pub fn reset_drawdown( origin: OriginFor, project_id: ProjectId, @@ -1697,7 +1704,7 @@ pub mod pallet { /// - This function is only callable by an administrator role account /// - The drawdown status won't be changed #[pallet::call_index(21)] - #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] + #[pallet::weight(T::WeightInfo::recovery_drawdown(transactions.clone().len() as u32))] pub fn recovery_drawdown( origin: OriginFor, project_id: ProjectId, @@ -1728,7 +1735,7 @@ pub mod pallet { /// - This function is only callable by an administrator role account /// - The revenue status won't be changed #[pallet::call_index(22)] - #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] + #[pallet::weight(T::WeightInfo::recovery_revenue(transactions.clone().len() as u32))] pub fn recovery_revenue( origin: OriginFor, project_id: ProjectId, @@ -1751,7 +1758,7 @@ pub mod pallet { /// ### Considerations: /// - This function is only available to the `admin` with sudo access. #[pallet::call_index(23)] - #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] + #[pallet::weight(T::WeightInfo::kill_storage())] pub fn kill_storage(origin: OriginFor) -> DispatchResult { T::RemoveOrigin::ensure_origin(origin.clone())?; let _ = >::kill(); @@ -1775,30 +1782,5 @@ pub mod pallet { T::Rbac::remove_pallet_storage(Self::pallet_id())?; Ok(()) } - - #[pallet::call_index(24)] - #[pallet::weight(Weight::from_parts(10_000,0) + T::DbWeight::get().writes(10))] - pub fn set_new_admin_permissions(origin: OriginFor) -> DispatchResult { - T::RemoveOrigin::ensure_origin(origin.clone())?; - // New permissions for fund admin administrator role - let admin_id: [u8; 32] = ProxyRole::Administrator.id(); - let pallet_id = Self::pallet_id(); - - let new_admin_permissions: Vec> = vec![ - ProxyPermission::RecoveryDrawdown.to_vec(), - ProxyPermission::RecoveryRevenue.to_vec(), - ProxyPermission::RecoveryTransaction.to_vec(), - ProxyPermission::RecoveryRevenueTransaction.to_vec(), - ProxyPermission::BulkUploadTransaction.to_vec(), - ]; - - T::Rbac::create_and_set_permissions( - pallet_id.clone(), - admin_id, - new_admin_permissions, - )?; - - Ok(()) - } } } diff --git a/pallets/fund-admin/src/mock.rs b/pallets/fund-admin/src/mock.rs index 826f5645..f073c233 100644 --- a/pallets/fund-admin/src/mock.rs +++ b/pallets/fund-admin/src/mock.rs @@ -101,7 +101,7 @@ impl pallet_fund_admin::Config for Test { type Timestamp = Timestamp; type Moment = u64; type Rbac = RBAC; - type Currency = Balances; + type Currency = pallet_balances::Pallet; type MaxDocuments = MaxDocuments; type MaxProjectsPerUser = MaxProjectsPerUser; @@ -124,6 +124,7 @@ impl pallet_fund_admin::Config for Test { type MaxRecoveryChanges = MaxRecoveryChanges; type MinAdminBalance = MinAdminBalance; type TransferAmount = TransferAmount; + type WeightInfo = (); } impl pallet_timestamp::Config for Test { @@ -159,10 +160,12 @@ impl pallet_rbac::Config for Test { pub fn new_test_ext() -> sp_io::TestExternalities { let balance_amount = InitialAdminBalance::get(); let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); - pallet_balances::GenesisConfig:: { balances: vec![(1, balance_amount)] } - .assimilate_storage(&mut t) - .expect("assimilate_storage failed"); + pallet_balances::GenesisConfig:: { + balances: vec![(0, balance_amount), (1, balance_amount)], + } + .assimilate_storage(&mut t) + .expect("assimilate_storage failed"); let mut t: sp_io::TestExternalities = t.into(); - t.execute_with(|| FundAdmin::do_initial_setup().expect("Error on configuring initial setup")); + t.execute_with(|| {}); t } diff --git a/pallets/fund-admin/src/tests.rs b/pallets/fund-admin/src/tests.rs index 143eac3f..280d6506 100644 --- a/pallets/fund-admin/src/tests.rs +++ b/pallets/fund-admin/src/tests.rs @@ -10,7 +10,7 @@ use frame_support::{ traits::{ tokens::{ fungible::Mutate, - Preservation::{Expendable, Preserve, Protect}, + Preservation::Expendable, }, ConstU32, }, @@ -484,6 +484,7 @@ fn get_revenue_transaction_id( #[test] fn global_scope_is_created_after_pallet_initialization() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert!(GlobalScope::::exists()); }); } @@ -491,6 +492,7 @@ fn global_scope_is_created_after_pallet_initialization() { #[test] fn cannon_initialize_pallet_twice_shouldnt_work() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_noop!(FundAdmin::initial_setup(RuntimeOrigin::root()), RbacErr::ScopeAlreadyExists); }); } @@ -498,6 +500,7 @@ fn cannon_initialize_pallet_twice_shouldnt_work() { #[test] fn sudo_register_administrator_account_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); let alice_name = make_field_name("Alice Keys"); assert_ok!(FundAdmin::sudo_add_administrator(RuntimeOrigin::root(), 2, alice_name.clone())); assert!(UsersInfo::::contains_key(2)); @@ -507,6 +510,7 @@ fn sudo_register_administrator_account_works() { #[test] fn sudo_a_non_sudo_user_cannot_register_administrator_account_shouldnt_work() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); let alice_name = make_field_name("Alice Keys"); assert_noop!( FundAdmin::sudo_add_administrator(RuntimeOrigin::signed(1), 2, alice_name.clone()), @@ -518,6 +522,7 @@ fn sudo_a_non_sudo_user_cannot_register_administrator_account_shouldnt_work() { #[test] fn sudo_cannot_register_an_administrator_account_twice_shouldnt_work() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); let alice_name = make_field_name("Alice Keys"); assert_ok!(FundAdmin::sudo_add_administrator(RuntimeOrigin::root(), 2, alice_name.clone())); assert_noop!( @@ -530,6 +535,7 @@ fn sudo_cannot_register_an_administrator_account_twice_shouldnt_work() { #[test] fn sudo_delete_administrator_account_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); let alice_name = make_field_name("Alice Keys"); assert_ok!(FundAdmin::sudo_add_administrator(RuntimeOrigin::root(), 2, alice_name.clone())); assert!(FundAdmin::users_info(2).is_some()); @@ -542,6 +548,7 @@ fn sudo_delete_administrator_account_works() { #[test] fn sudo_cannot_delete_an_administrator_account_that_doesnt_exist_shouldnt_work() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_noop!( FundAdmin::sudo_remove_administrator(RuntimeOrigin::root(), 2), Error::::UserNotRegistered @@ -552,6 +559,7 @@ fn sudo_cannot_delete_an_administrator_account_that_doesnt_exist_shouldnt_work() #[test] fn sudo_administrator_can_remove_another_administrator_account_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(FundAdmin::sudo_add_administrator( RuntimeOrigin::root(), 2, @@ -574,6 +582,7 @@ fn sudo_administrator_can_remove_another_administrator_account_works() { #[test] fn sudo_administrator_can_remove_themselves_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(FundAdmin::sudo_add_administrator( RuntimeOrigin::root(), 2, @@ -591,6 +600,7 @@ fn sudo_administrator_can_remove_themselves_works() { #[test] fn balances_main_account_has_an_initial_balance_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); // Get administrator free balance let free_balance = Balances::free_balance(1); assert_eq!(free_balance, InitialAdminBalance::get()); @@ -600,6 +610,7 @@ fn balances_main_account_has_an_initial_balance_works() { #[test] fn balances_any_other_account_should_have_a_zero_balance_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); // Get non-registered user free balance let free_balance = Balances::free_balance(1); let free_balance_2 = Balances::free_balance(2); @@ -614,6 +625,7 @@ fn balances_any_other_account_should_have_a_zero_balance_works() { #[test] fn balances_a_new_registered_user_should_have_a_initial_balance_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_ok!(FundAdmin::users( @@ -639,6 +651,7 @@ fn balances_a_new_registered_user_should_have_a_initial_balance_works() { #[test] fn balances_an_administrator_goes_out_of_balance_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_ok!(FundAdmin::users( @@ -675,6 +688,7 @@ fn balances_an_administrator_goes_out_of_balance_should_fail() { #[test] fn balances_an_administrator_does_not_have_anough_free_balance_to_perform_a_user_registration() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_ok!(FundAdmin::users( @@ -712,6 +726,7 @@ fn balances_an_administrator_does_not_have_anough_free_balance_to_perform_a_user #[test] fn users_register_administrator_account_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_ok!(FundAdmin::users( @@ -731,6 +746,7 @@ fn users_register_administrator_account_works() { #[test] fn users_register_builder_account_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_ok!(FundAdmin::users( @@ -750,6 +766,7 @@ fn users_register_builder_account_works() { #[test] fn users_register_investor_account_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_ok!(FundAdmin::users( @@ -769,6 +786,7 @@ fn users_register_investor_account_works() { #[test] fn users_register_issuer_account_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_ok!(FundAdmin::users( @@ -788,6 +806,7 @@ fn users_register_issuer_account_works() { #[test] fn users_register_regional_center_account_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_ok!(FundAdmin::users( @@ -807,6 +826,7 @@ fn users_register_regional_center_account_works() { #[test] fn users_register_multiple_accounts_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_ok!(FundAdmin::users(RuntimeOrigin::signed(1), make_default_users())); @@ -821,6 +841,7 @@ fn users_register_multiple_accounts_works() { #[test] fn users_a_non_registered_admin_tries_to_register_an_account_shouldnt_work() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_noop!( FundAdmin::users( RuntimeOrigin::signed(1), @@ -839,6 +860,7 @@ fn users_a_non_registered_admin_tries_to_register_an_account_shouldnt_work() { #[test] fn users_a_registered_admin_tries_to_register_an_account_twice_shouldnt_work() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_ok!(FundAdmin::users( @@ -869,6 +891,7 @@ fn users_a_registered_admin_tries_to_register_an_account_twice_shouldnt_work() { #[test] fn users_update_a_registered_account_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_ok!(FundAdmin::users( @@ -901,6 +924,7 @@ fn users_update_a_registered_account_works() { #[test] fn users_admnistrator_updates_role_of_a_registered_account_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_ok!(FundAdmin::users( @@ -932,6 +956,7 @@ fn users_admnistrator_updates_role_of_a_registered_account_works() { #[test] fn users_update_a_non_registered_account_shouldnt_work() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_noop!( @@ -952,6 +977,7 @@ fn users_update_a_non_registered_account_shouldnt_work() { #[test] fn users_delete_a_registered_account_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_ok!(FundAdmin::users( @@ -976,6 +1002,7 @@ fn users_delete_a_registered_account_works() { #[test] fn users_delete_a_non_registered_account_shouldnt_work() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_noop!( @@ -988,6 +1015,7 @@ fn users_delete_a_non_registered_account_shouldnt_work() { #[test] fn users_user_updates_their_own_account_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_ok!(FundAdmin::users( @@ -1024,6 +1052,7 @@ fn users_user_updates_their_own_account_works() { #[test] fn users_only_investors_can_upload_documentation_to_their_account_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_ok!(FundAdmin::users( @@ -1053,6 +1082,7 @@ fn users_only_investors_can_upload_documentation_to_their_account_works() { #[test] fn projects_register_a_project_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_ok!(FundAdmin::projects_create_project( @@ -1112,6 +1142,7 @@ fn projects_register_a_project_works() { #[test] fn projects_register_a_project_with_job_eligibles_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_ok!(FundAdmin::projects_create_project( @@ -1147,6 +1178,7 @@ fn projects_register_a_project_with_job_eligibles_works() { #[test] fn projects_register_a_project_with_assigned_users_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_ok!(FundAdmin::users(RuntimeOrigin::signed(1), make_default_users(),)); @@ -1182,6 +1214,7 @@ fn projects_register_a_project_with_assigned_users_works() { #[test] fn projects_register_a_project_with_allowed_banks_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_ok!(FundAdmin::projects_create_project( @@ -1212,6 +1245,7 @@ fn projects_register_a_project_with_allowed_banks_works() { #[test] fn projects_register_a_project_without_a_group_id_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_noop!( @@ -1237,6 +1271,7 @@ fn projects_register_a_project_without_a_group_id_should_fail() { #[test] fn projects_a_non_authorized_user_registers_a_project_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_ok!(FundAdmin::users(RuntimeOrigin::signed(1), make_default_users(),)); @@ -1268,6 +1303,7 @@ fn projects_a_non_authorized_user_registers_a_project_should_fail() { #[test] fn projects_investors_can_be_only_assigned_to_one_project_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_ok!(FundAdmin::users(RuntimeOrigin::signed(1), make_default_users(),)); @@ -1312,6 +1348,7 @@ fn projects_investors_can_be_only_assigned_to_one_project_should_fail() { #[test] fn projects_edit_a_project_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(register_administrator()); assert_ok!(FundAdmin::users(RuntimeOrigin::signed(1), make_default_users(),)); @@ -1356,6 +1393,7 @@ fn projects_edit_a_project_works() { #[test] fn projects_delete_project_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); assert_eq!(ProjectsInfo::::iter_values().count(), 1); @@ -1398,6 +1436,7 @@ fn projects_delete_project_works() { #[test] fn projects_assign_a_builder_to_a_project_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let builder_data = make_user( @@ -1427,6 +1466,7 @@ fn projects_assign_a_builder_to_a_project_works() { #[test] fn projects_assign_an_investor_to_a_project_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let investor_data = make_user( @@ -1457,6 +1497,7 @@ fn projects_assign_an_investor_to_a_project_works() { #[test] fn projects_assign_an_issuer_to_a_project_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let issuer_data = make_user( @@ -1486,6 +1527,7 @@ fn projects_assign_an_issuer_to_a_project_works() { #[test] fn projects_assign_a_regional_center_to_a_project_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let regional_center_data = make_user( @@ -1516,6 +1558,7 @@ fn projects_assign_a_regional_center_to_a_project_works() { #[test] fn projects_unassign_a_builder_from_a_project_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let builder_data = make_user( @@ -1557,6 +1600,7 @@ fn projects_unassign_a_builder_from_a_project_works() { #[test] fn projects_unassign_an_investor_from_a_project_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let investor_data = make_user( @@ -1599,6 +1643,7 @@ fn projects_unassign_an_investor_from_a_project_works() { #[test] fn projects_unassign_an_issuer_from_a_project_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let issuer_data = make_user( @@ -1640,6 +1685,7 @@ fn projects_unassign_an_issuer_from_a_project_works() { #[test] fn projects_unassign_a_regional_center_from_a_project_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let regional_center_data = make_user( @@ -1682,6 +1728,7 @@ fn projects_unassign_a_regional_center_from_a_project_works() { #[test] fn projects_cannot_assign_a_user_to_a_project_twice_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let builder_data = make_user( @@ -1720,6 +1767,7 @@ fn projects_cannot_assign_a_user_to_a_project_twice_should_fail() { #[test] fn user_cannot_be_assigned_to_a_project_with_a_different_role_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let builder_data = make_user( @@ -1750,6 +1798,7 @@ fn user_cannot_be_assigned_to_a_project_with_a_different_role_should_fail() { #[test] fn projects_a_user_cannot_have_more_than_one_role_in_a_project_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let builder_data = make_user( @@ -1788,6 +1837,7 @@ fn projects_a_user_cannot_have_more_than_one_role_in_a_project_should_fail() { #[test] fn projects_cannot_delete_a_user_who_has_assigned_projects_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let builder_data = make_user( @@ -1822,6 +1872,7 @@ fn projects_cannot_delete_a_user_who_has_assigned_projects_should_fail() { #[test] fn users_cannot_update_user_role_from_an_account_with_assigned_projects_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let builder_data = make_user( @@ -1863,6 +1914,7 @@ fn users_cannot_update_user_role_from_an_account_with_assigned_projects_should_f #[test] fn expenditures_add_a_hard_cost_budget_expenditure_for_a_given_project_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -1924,6 +1976,7 @@ fn expenditures_add_a_hard_cost_budget_expenditure_for_a_given_project_works() { #[test] fn expenditures_add_a_softcost_budget_expenditure_for_a_given_project_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -1985,6 +2038,7 @@ fn expenditures_add_a_softcost_budget_expenditure_for_a_given_project_works() { #[test] fn expenditures_add_an_operational_budget_expenditure_for_a_given_project_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -2046,6 +2100,7 @@ fn expenditures_add_an_operational_budget_expenditure_for_a_given_project_works( #[test] fn expenditures_add_an_others_budget_expenditure_for_a_given_project_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -2107,6 +2162,7 @@ fn expenditures_add_an_others_budget_expenditure_for_a_given_project_works() { #[test] fn expenditures_cannot_send_an_empty_array_of_expenditures_for_a_given_project_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -2128,6 +2184,7 @@ fn expenditures_cannot_send_an_empty_array_of_expenditures_for_a_given_project_s #[test] fn expenditures_cannot_create_a_budget_expenditure_without_a_name_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -2157,6 +2214,7 @@ fn expenditures_cannot_create_a_budget_expenditure_without_a_name_should_fail() #[test] fn expenditures_cannot_create_a_budget_without_expenditure_type_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -2186,6 +2244,7 @@ fn expenditures_cannot_create_a_budget_without_expenditure_type_should_fail() { #[test] fn expenditures_cannot_create_a_budget_expenditute_without_an_amount_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -2215,6 +2274,7 @@ fn expenditures_cannot_create_a_budget_expenditute_without_an_amount_should_fail #[test] fn expenditures_cannot_create_a_budget_expenditure_with_an_empty_name_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -2244,6 +2304,7 @@ fn expenditures_cannot_create_a_budget_expenditure_with_an_empty_name_should_fai #[test] fn expenditures_edit_a_given_expenditure_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -2323,6 +2384,7 @@ fn expenditures_edit_a_given_expenditure_works() { #[test] fn expenditures_edit_a_given_expenditure_from_another_project_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); assert_ok!(FundAdmin::projects_create_project( @@ -2372,6 +2434,7 @@ fn expenditures_edit_a_given_expenditure_from_another_project_should_fail() { #[test] fn expenditures_expenditure_id_is_required_while_editing_a_given_expenditure_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -2418,6 +2481,7 @@ fn expenditures_expenditure_id_is_required_while_editing_a_given_expenditure_sho #[test] fn expenditures_admnistrator_tries_to_update_a_non_existent_expenditure_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -2496,6 +2560,7 @@ fn expenditures_admnistrator_tries_to_update_a_non_existent_expenditure_should_f #[test] fn expenditures_delete_a_selected_expenditure_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -2554,6 +2619,7 @@ fn expenditures_delete_a_selected_expenditure_works() { #[test] fn expenditures_expenditure_id_es_required_to_delete_an_expenditure() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -2601,6 +2667,7 @@ fn expenditures_expenditure_id_es_required_to_delete_an_expenditure() { fn expenditures_an_admin_can_delete_an_expenditure_containing_transactions_with_zero_amount_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -2644,6 +2711,7 @@ fn expenditures_an_admin_can_delete_an_expenditure_containing_transactions_with_ fn expenditures_an_administrator_deletes_an_expenditure_given_a_drawdown_with_multiple_expenditures_work( ) { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -2706,6 +2774,7 @@ fn expenditures_an_administrator_deletes_an_expenditure_given_a_drawdown_with_mu #[test] fn expenditures_an_admin_deletes_all_expenditures_for_a_given_project_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -2792,6 +2861,7 @@ fn expenditures_an_admin_deletes_all_expenditures_for_a_given_project_works() { #[test] fn expenditures_an_admin_cannot_delete_a_expenditure_that_is_being_used_draft_status_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -2833,6 +2903,7 @@ fn expenditures_an_admin_cannot_delete_a_expenditure_that_is_being_used_draft_st #[test] fn expenditures_an_admin_cannot_delete_a_expenditure_that_is_in_use_submitted_status_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -2877,6 +2948,7 @@ fn expenditures_an_admin_cannot_delete_a_expenditure_that_is_in_use_submitted_st #[test] fn expenditures_an_admin_cannot_delete_a_expenditure_that_is_in_use_approved_status_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -2929,6 +3001,7 @@ fn expenditures_an_admin_cannot_delete_a_expenditure_that_is_in_use_approved_sta #[test] fn expenditures_an_admin_cannot_delete_a_expenditure_that_is_in_use_confirmed_status_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -2993,6 +3066,7 @@ fn expenditures_an_admin_cannot_delete_a_expenditure_that_is_in_use_confirmed_st #[test] fn job_eligibles_create_a_job_eligible_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -3039,6 +3113,7 @@ fn job_eligibles_create_a_job_eligible_works() { #[test] fn job_eligibles_cannot_send_an_empty_array_of_job_eligibles_for_a_given_project() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -3060,6 +3135,7 @@ fn job_eligibles_cannot_send_an_empty_array_of_job_eligibles_for_a_given_project #[test] fn job_eligibles_cannot_create_a_job_eligible_without_a_name_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -3088,6 +3164,7 @@ fn job_eligibles_cannot_create_a_job_eligible_without_a_name_should_fail() { #[test] fn job_eligibles_cannot_create_a_job_eligible_without_an_amount_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -3116,6 +3193,7 @@ fn job_eligibles_cannot_create_a_job_eligible_without_an_amount_should_fail() { #[test] fn job_eligibles_cannot_create_a_job_eligible_with_an_empty_name_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -3144,6 +3222,7 @@ fn job_eligibles_cannot_create_a_job_eligible_with_an_empty_name_should_fail() { #[test] fn job_eligibles_edit_a_job_eligible_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -3206,6 +3285,7 @@ fn job_eligibles_edit_a_job_eligible_works() { #[test] fn job_eligibles_edit_a_given_job_eligible_from_another_project_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); assert_ok!(FundAdmin::projects_create_project( @@ -3286,6 +3366,7 @@ fn job_eligibles_edit_a_given_job_eligible_from_another_project_should_fail() { #[test] fn job_eligibles_edit_a_given_job_eligible_with_an_invalid_id_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -3330,6 +3411,7 @@ fn job_eligibles_edit_a_given_job_eligible_with_an_invalid_id_should_fail() { #[test] fn job_eligibles_job_eligible_id_is_required_to_update_a_given_job_eligible_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -3374,6 +3456,7 @@ fn job_eligibles_job_eligible_id_is_required_to_update_a_given_job_eligible_shou #[test] fn job_eligibles_delete_a_given_job_eligible_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -3414,6 +3497,7 @@ fn job_eligibles_delete_a_given_job_eligible_works() { #[test] fn job_eligibles_delete_a_given_job_eligible_with_an_invalid_id_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -3452,6 +3536,7 @@ fn job_eligibles_delete_a_given_job_eligible_with_an_invalid_id_should_fail() { #[test] fn job_eligibles_deleting_a_job_eligible_requires_a_job_eligible_id_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -3491,6 +3576,7 @@ fn job_eligibles_deleting_a_job_eligible_requires_a_job_eligible_id_should_fail( // fn job_eligibles_admin_cannot_delete_a_job_eligible_if_has_non_zero_transactions_should_fail() fn job_eligibles_admin_can_delete_a_job_eligible_if_has_non_zero_transactions_draft_status_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -3527,6 +3613,7 @@ fn job_eligibles_admin_can_delete_a_job_eligible_if_has_non_zero_transactions_dr fn job_eligibles_admin_cannnot_delete_a_job_eligible_if_has_non_zero_transactions_draft_status_should_fail( ) { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -3566,6 +3653,7 @@ fn job_eligibles_admin_cannnot_delete_a_job_eligible_if_has_non_zero_transaction fn job_eligibles_an_administrator_deletes_a_job_eligible_given_a_revenue_with_multiple_job_eligibles_works( ) { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -3637,6 +3725,7 @@ fn job_eligibles_an_administrator_deletes_a_job_eligible_given_a_revenue_with_mu fn job_eligibles_an_admin_cannot_delete_a_job_eligible_that_is_being_used_draft_status_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -3676,6 +3765,7 @@ fn job_eligibles_an_admin_cannot_delete_a_job_eligible_that_is_being_used_draft_ fn job_eligibles_an_admin_cannot_delete_a_job_eligible_that_is_being_used_submitted_status_should_fail( ) { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -3716,6 +3806,7 @@ fn job_eligibles_an_admin_cannot_delete_a_job_eligible_that_is_being_used_submit fn job_eligibles_an_admin_cannot_delete_a_job_eligible_that_is_being_used_approved_status_should_fail( ) { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -3758,6 +3849,7 @@ fn job_eligibles_an_admin_cannot_delete_a_job_eligible_that_is_being_used_approv #[test] fn drawdowns_drawdowns_are_initialized_correctly_after_a_project_is_created_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_simple_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -3783,6 +3875,7 @@ fn drawdowns_drawdowns_are_initialized_correctly_after_a_project_is_created_work #[test] fn drawdowns_a_builder_saves_a_drawdown_as_a_draft_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -3827,6 +3920,7 @@ fn drawdowns_a_builder_saves_a_drawdown_as_a_draft_works() { #[test] fn drawdowns_a_user_modifies_a_transaction_in_draft_status_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -3875,6 +3969,7 @@ fn drawdowns_a_user_modifies_a_transaction_in_draft_status_works() { #[test] fn drawdowns_a_builder_cannot_submit_a_drawdown_twice_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -3928,6 +4023,7 @@ fn drawdowns_a_builder_cannot_submit_a_drawdown_twice_should_fail() { #[test] fn drawdowns_a_user_deletes_a_transaction_in_draft_status_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -3970,6 +4066,7 @@ fn drawdowns_a_user_deletes_a_transaction_in_draft_status_works() { fn drawdowns_a_user_cannot_save_transactions_as_draft_if_transactions_are_not_provided_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -3992,6 +4089,7 @@ fn drawdowns_a_user_cannot_save_transactions_as_draft_if_transactions_are_not_pr fn drawdowns_a_user_cannot_send_an_empty_array_of_transactions_when_saving_as_a_draft_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4015,6 +4113,7 @@ fn drawdowns_a_user_cannot_send_an_empty_array_of_transactions_when_saving_as_a_ #[test] fn drawdowns_a_user_cannot_send_a_transaction_without_the_expenditure_id_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4038,6 +4137,7 @@ fn drawdowns_a_user_cannot_send_a_transaction_without_the_expenditure_id_should_ #[test] fn drawdowns_a_user_cannot_create_a_transaction_without_an_amount_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4067,6 +4167,7 @@ fn drawdowns_a_user_cannot_create_a_transaction_without_an_amount_should_fail() #[test] fn drawdowns_transaction_id_is_required_when_editing_a_transaction_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4107,6 +4208,7 @@ fn drawdowns_transaction_id_is_required_when_editing_a_transaction_should_fail() #[test] fn drawdowns_transaction_id_is_required_when_deleting_a_transaction_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4146,6 +4248,7 @@ fn drawdowns_transaction_id_is_required_when_deleting_a_transaction_should_fail( #[test] fn drawdowns_a_user_submits_a_drawdown_for_approval_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4177,6 +4280,7 @@ fn drawdowns_a_user_submits_a_drawdown_for_approval_works() { #[test] fn replicate_overflow_for_a_drawdown_submission() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4221,6 +4325,7 @@ fn replicate_overflow_for_a_drawdown_submission() { #[test] fn drawdowns_a_user_submits_a_draft_drawdown_for_approval_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4263,6 +4368,7 @@ fn drawdowns_a_user_submits_a_draft_drawdown_for_approval_works() { fn drawdowns_a_user_tries_to_add_transactions_using_an_empty_array_before_submitting_the_drawdown_should_fail( ) { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4286,6 +4392,7 @@ fn drawdowns_a_user_tries_to_add_transactions_using_an_empty_array_before_submit #[test] fn drawdowns_a_drawdown_cannot_be_submitted_if_has_no_transactions_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4307,6 +4414,7 @@ fn drawdowns_a_drawdown_cannot_be_submitted_if_has_no_transactions_should_fail() #[test] fn drawdowns_a_builder_deletes_all_transactions_while_submitting_a_drawdown_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4351,6 +4459,7 @@ fn drawdowns_a_builder_deletes_all_transactions_while_submitting_a_drawdown_shou #[test] fn drawdowns_after_a_drawdown_is_submitted_the_status_is_updated_in_project_data_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4382,6 +4491,7 @@ fn drawdowns_after_a_drawdown_is_submitted_the_status_is_updated_in_project_data #[test] fn drawdowns_an_administrators_approves_a_submitted_drawdown_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4421,6 +4531,7 @@ fn drawdowns_an_administrators_approves_a_submitted_drawdown_works() { #[test] fn drawdowns_an_administrator_cannot_aproves_a_drawdown_that_is_not_submitted_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4458,6 +4569,7 @@ fn drawdowns_an_administrator_cannot_aproves_a_drawdown_that_is_not_submitted_sh #[test] fn drawdowns_after_a_drawdown_is_approved_the_next_one_is_generated_autoamtically_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4499,6 +4611,7 @@ fn drawdowns_after_a_drawdown_is_approved_the_next_one_is_generated_autoamticall #[test] fn drawdowns_an_administrator_rejects_a_given_drawdown_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4549,6 +4662,7 @@ fn drawdowns_an_administrator_rejects_a_given_drawdown_works() { #[test] fn drawdowns_an_administrator_cannot_rejects_a_drawdown_that_is_not_submitted_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4591,6 +4705,7 @@ fn drawdowns_an_administrator_cannot_rejects_a_drawdown_that_is_not_submitted_sh #[test] fn drawdowns_an_administrator_cannot_rejects_a_drawdown_without_a_feedback_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4628,6 +4743,7 @@ fn drawdowns_an_administrator_cannot_rejects_a_drawdown_without_a_feedback_shoul #[test] fn drawdowns_an_administrator_rejects_a_eb5_drawdown_with_an_empty_feedback_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4669,6 +4785,7 @@ fn drawdowns_an_administrator_rejects_a_eb5_drawdown_with_an_empty_feedback_shou #[test] fn bulkupload_a_builder_submits_a_construction_loan_drawdown_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4706,6 +4823,7 @@ fn bulkupload_a_builder_submits_a_construction_loan_drawdown_works() { #[test] fn bulkupload_a_builder_submits_a_developer_equity_drawdown_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4743,6 +4861,7 @@ fn bulkupload_a_builder_submits_a_developer_equity_drawdown_works() { #[test] fn bulkupload_a_builder_submits_a_eb5_drawdown_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4770,6 +4889,7 @@ fn bulkupload_a_builder_submits_a_eb5_drawdown_should_fail() { fn bulkupload_a_builder_submits_an_empty_array_of_documents_for_a_construction_loan_drawdown_should_fail( ) { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4797,6 +4917,7 @@ fn bulkupload_a_builder_submits_an_empty_array_of_documents_for_a_construction_l fn bulkupload_a_builder_submits_an_empty_adescription_for_a_construction_loan_drawdown_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4824,6 +4945,7 @@ fn bulkupload_a_builder_submits_an_empty_adescription_for_a_construction_loan_dr fn bulkupload_after_a_contruction_loan_is_submitted_their_status_is_updated_in_project_data_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4853,6 +4975,7 @@ fn bulkupload_after_a_contruction_loan_is_submitted_their_status_is_updated_in_p fn bulkupload_after_a_developer_equity_is_submitted_their_status_is_updated_in_project_data_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4882,6 +5005,7 @@ fn bulkupload_after_a_developer_equity_is_submitted_their_status_is_updated_in_p fn bulkupload_an_administrator_saves_transactions_without_approving_the_drawdown_pseudo_draft_works( ) { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4928,6 +5052,7 @@ fn bulkupload_an_administrator_saves_transactions_without_approving_the_drawdown #[test] fn bulkupload_an_administrator_saves_transactions_and_approves_the_drawdown_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -4975,6 +5100,7 @@ fn bulkupload_an_administrator_saves_transactions_and_approves_the_drawdown_work fn bulkupload_an_array_of_transactions_is_required_to_save_transactions_as_a_pseudo_draft_should_fail( ) { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5006,6 +5132,7 @@ fn bulkupload_an_array_of_transactions_is_required_to_save_transactions_as_a_pse fn bulkupload_an_administrator_sends_an_empty_array_of_transactions_as_a_pseudo_draft_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5038,6 +5165,7 @@ fn bulkupload_an_administrator_sends_an_empty_array_of_transactions_as_a_pseudo_ #[test] fn bulkupload_an_administrator_sends_an_empty_array_while_approving_a_drawdown_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5070,6 +5198,7 @@ fn bulkupload_an_administrator_sends_an_empty_array_while_approving_a_drawdown_s #[test] fn bulkupload_an_administrator_rejects_a_contruction_loan_drawdown_with_a_feedback_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5108,6 +5237,7 @@ fn bulkupload_an_administrator_rejects_a_contruction_loan_drawdown_with_a_feedba #[test] fn bulkupload_an_administrator_rejects_a_developer_equity_drawdown_with_a_feedback_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5146,6 +5276,7 @@ fn bulkupload_an_administrator_rejects_a_developer_equity_drawdown_with_a_feedba #[test] fn bulkupload_an_administrator_rejects_a_bulkupload_drawdown_without_a_feedback_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5176,6 +5307,7 @@ fn bulkupload_an_administrator_rejects_a_bulkupload_drawdown_without_a_feedback_ #[test] fn bulkupload_an_administrator_rejects_a_bulkupload_drawdown_with_an_empty_feedback_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5211,6 +5343,7 @@ fn bulkupload_an_administrator_rejects_a_bulkupload_drawdown_with_an_empty_feedb #[test] fn revenues_are_initialized_correctly_after_a_project_is_created_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5228,6 +5361,7 @@ fn revenues_are_initialized_correctly_after_a_project_is_created_works() { #[test] fn revenues_a_builder_saves_a_revenue_as_draft_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5291,6 +5425,7 @@ fn revenues_a_builder_saves_a_revenue_as_draft_works() { #[test] fn revenues_a_builder_modifies_a_transaction_in_draft_status_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5336,6 +5471,7 @@ fn revenues_a_builder_modifies_a_transaction_in_draft_status_works() { #[test] fn revenues_a_user_deletes_a_transaction_in_draft_status_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5374,6 +5510,7 @@ fn revenues_a_user_deletes_a_transaction_in_draft_status_works() { #[test] fn revenues_a_builder_cannot_submit_a_revenue_if_there_is_no_revenue_transaction_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5396,6 +5533,7 @@ fn revenues_a_builder_cannot_submit_a_revenue_if_there_is_no_revenue_transaction fn revenues_a_user_cannot_submit_a_revenue_as_draft_with_an_empty_array_of_transactions_should_fail( ) { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5419,6 +5557,7 @@ fn revenues_a_user_cannot_submit_a_revenue_as_draft_with_an_empty_array_of_trans #[test] fn revenues_a_user_cannot_create_a_revenue_transaction_with_no_job_eligible_id_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5443,6 +5582,7 @@ fn revenues_a_user_cannot_create_a_revenue_transaction_with_no_job_eligible_id_s #[test] fn revenues_a_user_cannot_create_a_revenue_transaction_with_no_amount_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5468,6 +5608,7 @@ fn revenues_a_user_cannot_create_a_revenue_transaction_with_no_amount_should_fai #[test] fn revenues_transaction_id_is_required_for_updating_a_transaction_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5504,6 +5645,7 @@ fn revenues_transaction_id_is_required_for_updating_a_transaction_should_fail() #[test] fn revenues_transaction_id_is_required_for_deleting_a_transaction_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5540,6 +5682,7 @@ fn revenues_transaction_id_is_required_for_deleting_a_transaction_should_fail() #[test] fn revenues_a_builder_submits_a_revenue_for_approval_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5567,6 +5710,7 @@ fn revenues_a_builder_submits_a_revenue_for_approval_works() { #[test] fn revenues_a_builder_submits_a_draft_revenue_for_approval_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5601,6 +5745,7 @@ fn revenues_a_builder_submits_a_draft_revenue_for_approval_works() { #[test] fn revenues_a_user_tries_to_submit_a_revenue_for_approval_without_being_a_builder_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5626,6 +5771,7 @@ fn revenues_a_user_tries_to_submit_a_revenue_for_approval_without_being_a_builde #[test] fn revenues_a_revenue_cannot_be_submitted_for_approval_if_it_is_already_submitted_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5659,6 +5805,7 @@ fn revenues_a_revenue_cannot_be_submitted_for_approval_if_it_is_already_submitte #[test] fn revenues_a_revenue_cannot_be_submitted_if_has_no_transactions_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5674,6 +5821,7 @@ fn revenues_a_revenue_cannot_be_submitted_if_has_no_transactions_should_fail() { #[test] fn revenues_a_builder_deletes_all_transactions_while_submitting_a_revenue_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5716,6 +5864,7 @@ fn revenues_a_builder_deletes_all_transactions_while_submitting_a_revenue_should #[test] fn revenues_a_builder_tries_to_submit_a_revenue_with_an_empty_array_of_transactions_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5738,6 +5887,7 @@ fn revenues_a_builder_tries_to_submit_a_revenue_with_an_empty_array_of_transacti #[test] fn revenues_after_a_revenue_is_submitted_the_status_is_updated_in_project_data_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5765,6 +5915,7 @@ fn revenues_after_a_revenue_is_submitted_the_status_is_updated_in_project_data_w #[test] fn revenues_an_administrator_approves_a_submitted_revenue_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5791,6 +5942,7 @@ fn revenues_an_administrator_approves_a_submitted_revenue_works() { #[test] fn revenues_an_administrator_cannot_approve_a_revenue_if_it_is_not_submitted_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5806,6 +5958,7 @@ fn revenues_an_administrator_cannot_approve_a_revenue_if_it_is_not_submitted_sho #[test] fn revenues_after_a_revenue_is_submitted_the_next_one_is_generated_automaticaly_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5837,6 +5990,7 @@ fn revenues_after_a_revenue_is_submitted_the_next_one_is_generated_automaticaly_ #[test] fn replicate_overflow_for_a_revenue_submission() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5877,6 +6031,7 @@ fn replicate_overflow_for_a_revenue_submission() { #[test] fn revenues_an_administrator_rejects_a_given_revenue_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5924,6 +6079,7 @@ fn revenues_an_administrator_rejects_a_given_revenue_works() { #[test] fn revenues_an_administrator_cannot_reject_a_revenue_if_it_is_not_submitted_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5962,6 +6118,7 @@ fn revenues_an_administrator_cannot_reject_a_revenue_if_it_is_not_submitted_shou #[test] fn revenues_an_administrator_cannot_reject_a_revenue_with_an_empty_array_of_feedback_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -5996,6 +6153,7 @@ fn revenues_an_administrator_cannot_reject_a_revenue_with_an_empty_array_of_feed #[test] fn revenues_after_a_revenue_is_rejected_the_status_is_updated_in_project_data_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6038,6 +6196,7 @@ fn revenues_after_a_revenue_is_rejected_the_status_is_updated_in_project_data_wo #[test] fn inflation_rate_an_administrator_can_set_the_inflation_rate_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6057,6 +6216,7 @@ fn inflation_rate_an_administrator_can_set_the_inflation_rate_works() { #[test] fn inflation_rate_an_administrator_cannot_submit_an_empty_array_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let inflation_rate_data: ProjectsInflation = bounded_vec![]; @@ -6071,6 +6231,7 @@ fn inflation_rate_an_administrator_cannot_submit_an_empty_array_should_fail() { #[test] fn inflation_rate_an_administrator_cannot_set_the_inflation_rate_without_a_value_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6087,6 +6248,7 @@ fn inflation_rate_an_administrator_cannot_set_the_inflation_rate_without_a_value fn inflation_rate_an_administrator_cannot_set_the_inflation_rate_if_it_is_already_set_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6109,6 +6271,7 @@ fn inflation_rate_an_administrator_cannot_set_the_inflation_rate_if_it_is_alread #[test] fn inflation_rate_an_administrator_updates_the_inflation_rate_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6137,6 +6300,7 @@ fn inflation_rate_an_administrator_updates_the_inflation_rate_works() { #[test] fn inflation_rate_an_administrator_cannot_update_the_inflation_rate_if_it_is_not_set_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6154,6 +6318,7 @@ fn inflation_rate_an_administrator_cannot_update_the_inflation_rate_if_it_is_not #[test] fn inflation_rate_inflation_value_is_required_while_updating_the_inflation_rate_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6178,6 +6343,7 @@ fn inflation_rate_inflation_value_is_required_while_updating_the_inflation_rate_ #[test] fn inflation_rate_an_administrator_deletes_the_inflation_rate_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6201,6 +6367,7 @@ fn inflation_rate_an_administrator_deletes_the_inflation_rate_works() { #[test] fn inflation_rate_an_administrator_cannot_delete_the_inflation_rate_if_it_is_not_set_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6218,6 +6385,7 @@ fn inflation_rate_an_administrator_cannot_delete_the_inflation_rate_if_it_is_not #[test] fn bank_documents_an_administrator_uploads_bank_documents_for_a_given_eb5_drawdown_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6271,6 +6439,7 @@ fn bank_documents_an_administrator_uploads_bank_documents_for_a_given_eb5_drawdo #[test] fn bank_documents_cannot_upload_documents_for_a_contruction_loan_drawdown_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6318,6 +6487,7 @@ fn bank_documents_cannot_upload_documents_for_a_contruction_loan_drawdown_should #[test] fn bank_documents_cannot_upload_documents_for_a_developer_equity_drawdown_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6365,6 +6535,7 @@ fn bank_documents_cannot_upload_documents_for_a_developer_equity_drawdown_should #[test] fn bank_documents_cannot_upload_documents_without_an_array_of_documents_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6410,6 +6581,7 @@ fn bank_documents_cannot_upload_documents_without_an_array_of_documents_should_f #[test] fn bank_documents_cannot_upload_documents_with_an_empty_array_of_documents_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6457,6 +6629,7 @@ fn bank_documents_cannot_upload_documents_with_an_empty_array_of_documents_shoul #[test] fn bank_documents_cannot_upload_documents_if_the_drawdown_is_not_approved_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6496,6 +6669,7 @@ fn bank_documents_cannot_upload_documents_if_the_drawdown_is_not_approved_should #[test] fn bank_documents_cannot_upload_documents_twice_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6551,6 +6725,7 @@ fn bank_documents_cannot_upload_documents_twice_should_fail() { #[test] fn bank_documents_an_administrator_updates_the_bank_documents_should_work() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6610,6 +6785,7 @@ fn bank_documents_an_administrator_updates_the_bank_documents_should_work() { #[test] fn bank_documents_cannot_update_documents_without_uploading_documents_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6665,6 +6841,7 @@ fn bank_documents_cannot_update_documents_without_uploading_documents_should_fai #[test] fn bank_documents_cannot_update_documents_with_an_empty_array_of_documents_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6722,6 +6899,7 @@ fn bank_documents_cannot_update_documents_with_an_empty_array_of_documents_shoul #[test] fn bank_documents_cannot_update_bank_documents_if_the_drawdown_is_not_confirmed_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6761,6 +6939,7 @@ fn bank_documents_cannot_update_bank_documents_if_the_drawdown_is_not_confirmed_ #[test] fn bank_documents_an_administrator_deletes_bank_documents_should_work() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6819,6 +6998,7 @@ fn bank_documents_an_administrator_deletes_bank_documents_should_work() { #[test] fn bank_documents_cannot_delete_documents_if_the_drawdown_is_not_confirmed_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6858,6 +7038,7 @@ fn bank_documents_cannot_delete_documents_if_the_drawdown_is_not_confirmed_shoul #[test] fn reset_drawdown_a_builder_resets_a_eb5_drawdown_should_work() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6903,6 +7084,7 @@ fn reset_drawdown_a_builder_resets_a_eb5_drawdown_should_work() { #[test] fn reset_drawdown_a_builder_resets_a_construction_loan_drawdown_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6939,6 +7121,7 @@ fn reset_drawdown_a_builder_resets_a_construction_loan_drawdown_works() { #[test] fn reset_drawdown_a_builder_resets_a_developer_equity_drawdown_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6975,6 +7158,7 @@ fn reset_drawdown_a_builder_resets_a_developer_equity_drawdown_works() { #[test] fn reset_drawdown_a_builder_cannot_reset_a_drawdown_if_it_is_not_submitted_should_fail() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -6990,6 +7174,7 @@ fn reset_drawdown_a_builder_cannot_reset_a_drawdown_if_it_is_not_submitted_shoul #[test] fn reset_drawdown_a_builder_cannot_reset_an_approved_drawdown() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -7031,6 +7216,7 @@ fn reset_drawdown_a_builder_cannot_reset_an_approved_drawdown() { #[test] fn an_administrators_updates_a_transaction_for_an_approved_drawdown_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); let drawdown_id = get_drawdown_id(project_id, DrawdownType::EB5, 1); @@ -7120,6 +7306,7 @@ fn an_administrators_updates_a_transaction_for_an_approved_drawdown_works() { #[test] fn an_administrators_adds_a_new_transaction_to_an_approved_drawdown_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); let drawdown_id = get_drawdown_id(project_id, DrawdownType::EB5, 1); @@ -7218,6 +7405,7 @@ fn an_administrators_adds_a_new_transaction_to_an_approved_drawdown_works() { #[test] fn an_administrators_deletes_a_transaction_for_an_approved_drawdown_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); let drawdown_id = get_drawdown_id(project_id, DrawdownType::EB5, 1); @@ -7301,6 +7489,7 @@ fn an_administrators_deletes_a_transaction_for_an_approved_drawdown_works() { #[test] fn an_administrators_updates_a_transaction_for_a_confirmed_drawdown_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); let drawdown_id = get_drawdown_id(project_id, DrawdownType::EB5, 1); @@ -7411,6 +7600,7 @@ fn an_administrators_updates_a_transaction_for_a_confirmed_drawdown_works() { #[test] fn an_administrators_adds_a_new_transaction_to_a_confirmed_drawdown_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); let drawdown_id = get_drawdown_id(project_id, DrawdownType::EB5, 1); @@ -7526,6 +7716,7 @@ fn an_administrators_adds_a_new_transaction_to_a_confirmed_drawdown_works() { #[test] fn an_administrators_deletes_a_transaction_for_a_confirmed_drawdown_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); let drawdown_id = get_drawdown_id(project_id, DrawdownType::EB5, 1); @@ -7630,6 +7821,7 @@ fn an_administrators_deletes_a_transaction_for_a_confirmed_drawdown_works() { #[test] fn an_administrators_updates_a_transaction_for_an_approved_revenue_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -7695,6 +7887,7 @@ fn an_administrators_updates_a_transaction_for_an_approved_revenue_works() { #[test] fn an_administrators_adds_a_transaction_for_an_approved_revenue_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); @@ -7782,6 +7975,7 @@ fn an_administrators_adds_a_transaction_for_an_approved_revenue_works() { #[test] fn an_administrators_deletes_a_transaction_for_an_approved_revenue_works() { new_test_ext().execute_with(|| { + assert_ok!(FundAdmin::initial_setup(RuntimeOrigin::root())); assert_ok!(make_default_full_project()); let project_id = ProjectsInfo::::iter_keys().next().unwrap(); diff --git a/pallets/fund-admin/src/weights.rs b/pallets/fund-admin/src/weights.rs new file mode 100644 index 00000000..148e2b80 --- /dev/null +++ b/pallets/fund-admin/src/weights.rs @@ -0,0 +1,1665 @@ + +//! Autogenerated weights for `pallet_fund_admin` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2024-04-19, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `armando-hashed`, CPU: `AMD Ryzen 5 4600H with Radeon Graphics` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: `1024` + +// Executed Command: +// ./target/release/hashed-parachain +// benchmark +// pallet +// --chain +// dev +// --pallet +// pallet_fund_admin +// --extrinsic +// * +// --steps +// 50 +// --repeat +// 20 +// --output +// /home/armando/Desktop/hashed-pallets/pallets/fund-admin/src/weights.rs +// --template +// /home/armando/Desktop/hashed-pallets/.maintain/frame-weight-template.hbs + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; +use core::marker::PhantomData; + +/// Weight functions needed for `pallet_fund_admin`. +pub trait WeightInfo { + fn initial_setup() -> Weight; + fn sudo_add_administrator() -> Weight; + fn sudo_remove_administrator() -> Weight; + fn users(x: u32, ) -> Weight; + fn users_edit_user(d: u32, ) -> Weight; + fn projects_create_project(b: u32, e: u32, j: u32, u: u32, ) -> Weight; + fn projects_edit_project(b: u32, ) -> Weight; + fn projects_delete_project() -> Weight; + fn projects_assign_user(a: u32, ) -> Weight; + fn expenditures_and_job_eligibles(e: u32, j: u32, ) -> Weight; + fn submit_drawdown(a: u32, ) -> Weight; + fn approve_drawdown(a: u32, ) -> Weight; + fn reject_drawdown() -> Weight; + fn up_bulkupload(d: u32, ) -> Weight; + fn inflation_rate(a: u32, ) -> Weight; + fn submit_revenue(a: u32, ) -> Weight; + fn approve_revenue() -> Weight; + fn reject_revenue() -> Weight; + fn bank_confirming_documents(a: u32, ) -> Weight; + fn reset_drawdown() -> Weight; + fn recovery_drawdown(a: u32, ) -> Weight; + fn recovery_revenue(a: u32, ) -> Weight; + fn kill_storage() -> Weight; +} + +/// Weights for `pallet_fund_admin` using the Substrate node and recommended hardware. +pub struct SubstrateWeight(PhantomData); +impl WeightInfo for SubstrateWeight { + /// Storage: `RBAC::Scopes` (r:1 w:1) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Roles` (r:5 w:5) + /// Proof: `RBAC::Roles` (`max_values`: None, `max_size`: Some(83), added: 2558, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PalletRoles` (r:1 w:1) + /// Proof: `RBAC::PalletRoles` (`max_values`: None, `max_size`: Some(1633), added: 4108, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:25 w:25) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:5 w:5) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:0 w:1) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + fn initial_setup() -> Weight { + // Proof Size summary in bytes: + // Measured: `42` + // Estimated: `65740` + // Minimum execution time: 368_275_000 picoseconds. + Weight::from_parts(377_843_000, 65740) + .saturating_add(T::DbWeight::get().reads(37_u64)) + .saturating_add(T::DbWeight::get().writes(38_u64)) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:1) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PalletRoles` (r:1 w:0) + /// Proof: `RBAC::PalletRoles` (`max_values`: None, `max_size`: Some(1633), added: 4108, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:1) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::UsersByScope` (r:1 w:1) + /// Proof: `RBAC::UsersByScope` (`max_values`: None, `max_size`: Some(80098), added: 82573, mode: `MaxEncodedLen`) + fn sudo_add_administrator() -> Weight { + // Proof Size summary in bytes: + // Measured: `515` + // Estimated: `83563` + // Minimum execution time: 53_359_000 picoseconds. + Weight::from_parts(59_086_000, 83563) + .saturating_add(T::DbWeight::get().reads(7_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:1) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:1) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::UsersByScope` (r:1 w:1) + /// Proof: `RBAC::UsersByScope` (`max_values`: None, `max_size`: Some(80098), added: 82573, mode: `MaxEncodedLen`) + fn sudo_remove_administrator() -> Weight { + // Proof Size summary in bytes: + // Measured: `695` + // Estimated: `83563` + // Minimum execution time: 50_077_000 picoseconds. + Weight::from_parts(52_381_000, 83563) + .saturating_add(T::DbWeight::get().reads(4_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) + } + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::UsersInfo` (r:101 w:100) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:1 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:101 w:100) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PalletRoles` (r:1 w:0) + /// Proof: `RBAC::PalletRoles` (`max_values`: None, `max_size`: Some(1633), added: 4108, mode: `MaxEncodedLen`) + /// Storage: `RBAC::UsersByScope` (r:1 w:1) + /// Proof: `RBAC::UsersByScope` (`max_values`: None, `max_size`: Some(80098), added: 82573, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:101 w:101) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// The range of component `x` is `[1, 100]`. + fn users(x: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `2977 + x * (2 ±0)` + // Estimated: `83563 + x * (23241 ±0)` + // Minimum execution time: 165_804_000 picoseconds. + Weight::from_parts(172_091_000, 83563) + // Standard Error: 225_062 + .saturating_add(Weight::from_parts(97_520_036, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(10_u64)) + .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(x.into()))) + .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(T::DbWeight::get().writes((3_u64).saturating_mul(x.into()))) + .saturating_add(Weight::from_parts(0, 23241).saturating_mul(x.into())) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:1) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// The range of component `d` is `[1, 100]`. + fn users_edit_user(d: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `266` + // Estimated: `24231` + // Minimum execution time: 28_635_000 picoseconds. + Weight::from_parts(37_740_439, 24231) + // Standard Error: 10_782 + .saturating_add(Weight::from_parts(610_507, 0).saturating_mul(d.into())) + .saturating_add(T::DbWeight::get().reads(1_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::UsersInfo` (r:101 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:1) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:4 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:101 w:100) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ExpendituresInfo` (r:100 w:100) + /// Proof: `FundAdmin::ExpendituresInfo` (`max_values`: None, `max_size`: Some(583), added: 3058, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ExpendituresByProject` (r:1 w:1) + /// Proof: `FundAdmin::ExpendituresByProject` (`max_values`: None, `max_size`: Some(3200036), added: 3202511, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::JobEligiblesInfo` (r:100 w:100) + /// Proof: `FundAdmin::JobEligiblesInfo` (`max_values`: None, `max_size`: Some(582), added: 3057, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::JobEligiblesByProject` (r:1 w:1) + /// Proof: `FundAdmin::JobEligiblesByProject` (`max_values`: None, `max_size`: Some(3200036), added: 3202511, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::UsersByProject` (r:1 w:1) + /// Proof: `FundAdmin::UsersByProject` (`max_values`: None, `max_size`: Some(3200036), added: 3202511, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsByUser` (r:100 w:100) + /// Proof: `FundAdmin::ProjectsByUser` (`max_values`: None, `max_size`: Some(320050), added: 322525, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PalletRoles` (r:1 w:0) + /// Proof: `RBAC::PalletRoles` (`max_values`: None, `max_size`: Some(1633), added: 4108, mode: `MaxEncodedLen`) + /// Storage: `RBAC::UsersByScope` (r:1 w:1) + /// Proof: `RBAC::UsersByScope` (`max_values`: None, `max_size`: Some(80098), added: 82573, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsInfo` (r:3 w:3) + /// Proof: `FundAdmin::DrawdownsInfo` (`max_values`: None, `max_size`: Some(90710), added: 93185, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsByProject` (r:1 w:1) + /// Proof: `FundAdmin::DrawdownsByProject` (`max_values`: None, `max_size`: Some(320034), added: 322509, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenuesInfo` (r:1 w:1) + /// Proof: `FundAdmin::RevenuesInfo` (`max_values`: None, `max_size`: Some(49097), added: 51572, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenuesByProject` (r:1 w:1) + /// Proof: `FundAdmin::RevenuesByProject` (`max_values`: None, `max_size`: Some(320034), added: 322509, mode: `MaxEncodedLen`) + /// The range of component `b` is `[1, 200]`. + /// The range of component `e` is `[1, 100]`. + /// The range of component `j` is `[1, 100]`. + /// The range of component `u` is `[1, 100]`. + fn projects_create_project(b: u32, e: u32, j: u32, u: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `2637 + u * (170 ±0)` + // Estimated: `3203501 + e * (3058 ±0) + j * (3057 ±0) + u * (322525 ±0)` + // Minimum execution time: 9_790_769_000 picoseconds. + Weight::from_parts(10_107_081_000, 3203501) + // Standard Error: 1_276_572 + .saturating_add(Weight::from_parts(118_455_417, 0).saturating_mul(b.into())) + // Standard Error: 2_558_990 + .saturating_add(Weight::from_parts(81_492_563, 0).saturating_mul(u.into())) + .saturating_add(T::DbWeight::get().reads(22_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(e.into()))) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(j.into()))) + .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(u.into()))) + .saturating_add(T::DbWeight::get().writes(12_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(e.into()))) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(j.into()))) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(u.into()))) + .saturating_add(Weight::from_parts(0, 3058).saturating_mul(e.into())) + .saturating_add(Weight::from_parts(0, 3057).saturating_mul(j.into())) + .saturating_add(Weight::from_parts(0, 322525).saturating_mul(u.into())) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:1 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// The range of component `b` is `[1, 200]`. + fn projects_edit_project(b: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `8357` + // Estimated: `2525475` + // Minimum execution time: 133_118_000 picoseconds. + Weight::from_parts(140_642_760, 2525475) + // Standard Error: 17_072 + .saturating_add(Weight::from_parts(1_612_915, 0).saturating_mul(b.into())) + .saturating_add(T::DbWeight::get().reads(8_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: `FundAdmin::UsersInfo` (r:101 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:1) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:2 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:101 w:100) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::UsersByProject` (r:1 w:1) + /// Proof: `FundAdmin::UsersByProject` (`max_values`: None, `max_size`: Some(3200036), added: 3202511, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsByUser` (r:100 w:100) + /// Proof: `FundAdmin::ProjectsByUser` (`max_values`: None, `max_size`: Some(320050), added: 322525, mode: `MaxEncodedLen`) + /// Storage: `RBAC::UsersByScope` (r:2 w:1) + /// Proof: `RBAC::UsersByScope` (`max_values`: None, `max_size`: Some(80098), added: 82573, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ExpendituresByProject` (r:1 w:1) + /// Proof: `FundAdmin::ExpendituresByProject` (`max_values`: None, `max_size`: Some(3200036), added: 3202511, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsByProject` (r:1 w:1) + /// Proof: `FundAdmin::DrawdownsByProject` (`max_values`: None, `max_size`: Some(320034), added: 322509, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsByDrawdown` (r:3 w:3) + /// Proof: `FundAdmin::TransactionsByDrawdown` (`max_values`: None, `max_size`: Some(32066), added: 34541, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::JobEligiblesByProject` (r:1 w:1) + /// Proof: `FundAdmin::JobEligiblesByProject` (`max_values`: None, `max_size`: Some(3200036), added: 3202511, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenuesByProject` (r:1 w:1) + /// Proof: `FundAdmin::RevenuesByProject` (`max_values`: None, `max_size`: Some(320034), added: 322509, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsByRevenue` (r:1 w:1) + /// Proof: `FundAdmin::TransactionsByRevenue` (`max_values`: None, `max_size`: Some(32066), added: 34541, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsInfo` (r:0 w:3) + /// Proof: `FundAdmin::DrawdownsInfo` (`max_values`: None, `max_size`: Some(90710), added: 93185, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ExpendituresInfo` (r:0 w:100) + /// Proof: `FundAdmin::ExpendituresInfo` (`max_values`: None, `max_size`: Some(583), added: 3058, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::JobEligiblesInfo` (r:0 w:100) + /// Proof: `FundAdmin::JobEligiblesInfo` (`max_values`: None, `max_size`: Some(582), added: 3057, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenuesInfo` (r:0 w:1) + /// Proof: `FundAdmin::RevenuesInfo` (`max_values`: None, `max_size`: Some(49097), added: 51572, mode: `MaxEncodedLen`) + fn projects_delete_project() -> Weight { + // Proof Size summary in bytes: + // Measured: `61657` + // Estimated: `32253490` + // Minimum execution time: 6_707_751_000 picoseconds. + Weight::from_parts(7_116_813_000, 32253490) + .saturating_add(T::DbWeight::get().reads(319_u64)) + .saturating_add(T::DbWeight::get().writes(416_u64)) + } + /// Storage: `FundAdmin::UsersInfo` (r:101 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:1 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:101 w:100) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::UsersByProject` (r:1 w:1) + /// Proof: `FundAdmin::UsersByProject` (`max_values`: None, `max_size`: Some(3200036), added: 3202511, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsByUser` (r:100 w:100) + /// Proof: `FundAdmin::ProjectsByUser` (`max_values`: None, `max_size`: Some(320050), added: 322525, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PalletRoles` (r:1 w:0) + /// Proof: `RBAC::PalletRoles` (`max_values`: None, `max_size`: Some(1633), added: 4108, mode: `MaxEncodedLen`) + /// Storage: `RBAC::UsersByScope` (r:1 w:1) + /// Proof: `RBAC::UsersByScope` (`max_values`: None, `max_size`: Some(80098), added: 82573, mode: `MaxEncodedLen`) + /// The range of component `a` is `[1, 100]`. + fn projects_assign_user(a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `20420 + a * (226 ±0)` + // Estimated: `3203501 + a * (322525 ±0)` + // Minimum execution time: 197_024_000 picoseconds. + Weight::from_parts(116_804_696, 3203501) + // Standard Error: 177_570 + .saturating_add(Weight::from_parts(66_856_513, 0).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(10_u64)) + .saturating_add(T::DbWeight::get().reads((3_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(a.into()))) + .saturating_add(Weight::from_parts(0, 322525).saturating_mul(a.into())) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:2 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:0) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ExpendituresInfo` (r:100 w:100) + /// Proof: `FundAdmin::ExpendituresInfo` (`max_values`: None, `max_size`: Some(583), added: 3058, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ExpendituresByProject` (r:1 w:1) + /// Proof: `FundAdmin::ExpendituresByProject` (`max_values`: None, `max_size`: Some(3200036), added: 3202511, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::JobEligiblesInfo` (r:100 w:100) + /// Proof: `FundAdmin::JobEligiblesInfo` (`max_values`: None, `max_size`: Some(582), added: 3057, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::JobEligiblesByProject` (r:1 w:1) + /// Proof: `FundAdmin::JobEligiblesByProject` (`max_values`: None, `max_size`: Some(3200036), added: 3202511, mode: `MaxEncodedLen`) + /// The range of component `e` is `[1, 100]`. + /// The range of component `j` is `[1, 100]`. + fn expenditures_and_job_eligibles(e: u32, j: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `18858 + e * (17 ±0) + j * (20 ±0)` + // Estimated: `3203501 + e * (3058 ±0) + j * (3057 ±0)` + // Minimum execution time: 2_179_973_000 picoseconds. + Weight::from_parts(175_581_406, 3203501) + // Standard Error: 96_960 + .saturating_add(Weight::from_parts(20_560_587, 0).saturating_mul(e.into())) + // Standard Error: 96_960 + .saturating_add(Weight::from_parts(21_411_639, 0).saturating_mul(j.into())) + .saturating_add(T::DbWeight::get().reads(11_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(e.into()))) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(j.into()))) + .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(e.into()))) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(j.into()))) + .saturating_add(Weight::from_parts(0, 3058).saturating_mul(e.into())) + .saturating_add(Weight::from_parts(0, 3057).saturating_mul(j.into())) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:2 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsInfo` (r:1 w:1) + /// Proof: `FundAdmin::DrawdownsInfo` (`max_values`: None, `max_size`: Some(90710), added: 93185, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ExpendituresInfo` (r:1 w:0) + /// Proof: `FundAdmin::ExpendituresInfo` (`max_values`: None, `max_size`: Some(583), added: 3058, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsInfo` (r:100 w:100) + /// Proof: `FundAdmin::TransactionsInfo` (`max_values`: None, `max_size`: Some(20967), added: 23442, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsByDrawdown` (r:1 w:1) + /// Proof: `FundAdmin::TransactionsByDrawdown` (`max_values`: None, `max_size`: Some(32066), added: 34541, mode: `MaxEncodedLen`) + /// The range of component `a` is `[1, 100]`. + fn submit_drawdown(a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `9282` + // Estimated: `2525475 + a * (23442 ±0)` + // Minimum execution time: 502_651_000 picoseconds. + Weight::from_parts(238_227_832, 2525475) + // Standard Error: 256_323 + .saturating_add(Weight::from_parts(235_581_283, 0).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(12_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(a.into()))) + .saturating_add(Weight::from_parts(0, 23442).saturating_mul(a.into())) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:3 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsInfo` (r:2 w:2) + /// Proof: `FundAdmin::DrawdownsInfo` (`max_values`: None, `max_size`: Some(90710), added: 93185, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ExpendituresInfo` (r:1 w:0) + /// Proof: `FundAdmin::ExpendituresInfo` (`max_values`: None, `max_size`: Some(583), added: 3058, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsInfo` (r:200 w:200) + /// Proof: `FundAdmin::TransactionsInfo` (`max_values`: None, `max_size`: Some(20967), added: 23442, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsByDrawdown` (r:1 w:1) + /// Proof: `FundAdmin::TransactionsByDrawdown` (`max_values`: None, `max_size`: Some(32066), added: 34541, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsByProject` (r:1 w:1) + /// Proof: `FundAdmin::DrawdownsByProject` (`max_values`: None, `max_size`: Some(320034), added: 322509, mode: `MaxEncodedLen`) + /// The range of component `a` is `[1, 100]`. + fn approve_drawdown(a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `2070176` + // Estimated: `2525475 + a * (23442 ±0)` + // Minimum execution time: 19_643_024_000 picoseconds. + Weight::from_parts(19_444_937_640, 2525475) + // Standard Error: 628_560 + .saturating_add(Weight::from_parts(304_456_545, 0).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(115_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes(105_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(a.into()))) + .saturating_add(Weight::from_parts(0, 23442).saturating_mul(a.into())) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:1 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsInfo` (r:1 w:1) + /// Proof: `FundAdmin::DrawdownsInfo` (`max_values`: None, `max_size`: Some(90710), added: 93185, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsByDrawdown` (r:1 w:0) + /// Proof: `FundAdmin::TransactionsByDrawdown` (`max_values`: None, `max_size`: Some(32066), added: 34541, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsInfo` (r:100 w:100) + /// Proof: `FundAdmin::TransactionsInfo` (`max_values`: None, `max_size`: Some(20967), added: 23442, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + fn reject_drawdown() -> Weight { + // Proof Size summary in bytes: + // Measured: `2069261` + // Estimated: `2525475` + // Minimum execution time: 13_787_694_000 picoseconds. + Weight::from_parts(13_914_317_000, 2525475) + .saturating_add(T::DbWeight::get().reads(110_u64)) + .saturating_add(T::DbWeight::get().writes(102_u64)) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:1 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsInfo` (r:1 w:1) + /// Proof: `FundAdmin::DrawdownsInfo` (`max_values`: None, `max_size`: Some(90710), added: 93185, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// The range of component `d` is `[1, 100]`. + fn up_bulkupload(d: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `8500` + // Estimated: `2525475` + // Minimum execution time: 147_995_000 picoseconds. + Weight::from_parts(163_935_160, 2525475) + // Standard Error: 15_510 + .saturating_add(Weight::from_parts(1_880_851, 0).saturating_mul(d.into())) + .saturating_add(T::DbWeight::get().reads(9_u64)) + .saturating_add(T::DbWeight::get().writes(2_u64)) + } + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:1 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// The range of component `a` is `[1, 100]`. + fn inflation_rate(a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `8288` + // Estimated: `2525475` + // Minimum execution time: 123_969_000 picoseconds. + Weight::from_parts(126_316_183, 2525475) + // Standard Error: 24_264 + .saturating_add(Weight::from_parts(12_619_465, 0).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(7_u64)) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:2 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenuesInfo` (r:1 w:1) + /// Proof: `FundAdmin::RevenuesInfo` (`max_values`: None, `max_size`: Some(49097), added: 51572, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenueTransactionsInfo` (r:100 w:100) + /// Proof: `FundAdmin::RevenueTransactionsInfo` (`max_values`: None, `max_size`: Some(20967), added: 23442, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsByRevenue` (r:1 w:1) + /// Proof: `FundAdmin::TransactionsByRevenue` (`max_values`: None, `max_size`: Some(32066), added: 34541, mode: `MaxEncodedLen`) + /// The range of component `a` is `[1, 100]`. + fn submit_revenue(a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `8449` + // Estimated: `2525475 + a * (23442 ±0)` + // Minimum execution time: 490_569_000 picoseconds. + Weight::from_parts(236_757_131, 2525475) + // Standard Error: 345_267 + .saturating_add(Weight::from_parts(234_868_590, 0).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(11_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes(3_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(a.into()))) + .saturating_add(Weight::from_parts(0, 23442).saturating_mul(a.into())) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:1 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenuesInfo` (r:2 w:2) + /// Proof: `FundAdmin::RevenuesInfo` (`max_values`: None, `max_size`: Some(49097), added: 51572, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsByRevenue` (r:1 w:0) + /// Proof: `FundAdmin::TransactionsByRevenue` (`max_values`: None, `max_size`: Some(32066), added: 34541, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenueTransactionsInfo` (r:100 w:100) + /// Proof: `FundAdmin::RevenueTransactionsInfo` (`max_values`: None, `max_size`: Some(20967), added: 23442, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenuesByProject` (r:1 w:1) + /// Proof: `FundAdmin::RevenuesByProject` (`max_values`: None, `max_size`: Some(320034), added: 322509, mode: `MaxEncodedLen`) + fn approve_revenue() -> Weight { + // Proof Size summary in bytes: + // Measured: `2069236` + // Estimated: `2525475` + // Minimum execution time: 12_293_638_000 picoseconds. + Weight::from_parts(12_507_563_000, 2525475) + .saturating_add(T::DbWeight::get().reads(112_u64)) + .saturating_add(T::DbWeight::get().writes(104_u64)) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:1 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenuesInfo` (r:1 w:1) + /// Proof: `FundAdmin::RevenuesInfo` (`max_values`: None, `max_size`: Some(49097), added: 51572, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsByRevenue` (r:1 w:0) + /// Proof: `FundAdmin::TransactionsByRevenue` (`max_values`: None, `max_size`: Some(32066), added: 34541, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenueTransactionsInfo` (r:100 w:100) + /// Proof: `FundAdmin::RevenueTransactionsInfo` (`max_values`: None, `max_size`: Some(20967), added: 23442, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + fn reject_revenue() -> Weight { + // Proof Size summary in bytes: + // Measured: `2069144` + // Estimated: `2525475` + // Minimum execution time: 18_412_764_000 picoseconds. + Weight::from_parts(18_591_490_000, 2525475) + .saturating_add(T::DbWeight::get().reads(110_u64)) + .saturating_add(T::DbWeight::get().writes(102_u64)) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:1 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:0) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsInfo` (r:1 w:1) + /// Proof: `FundAdmin::DrawdownsInfo` (`max_values`: None, `max_size`: Some(90710), added: 93185, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsByDrawdown` (r:1 w:0) + /// Proof: `FundAdmin::TransactionsByDrawdown` (`max_values`: None, `max_size`: Some(32066), added: 34541, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsInfo` (r:100 w:100) + /// Proof: `FundAdmin::TransactionsInfo` (`max_values`: None, `max_size`: Some(20967), added: 23442, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// The range of component `a` is `[1, 100]`. + fn bank_confirming_documents(a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `2065064` + // Estimated: `2525475` + // Minimum execution time: 7_553_050_000 picoseconds. + Weight::from_parts(7_752_950_488, 2525475) + // Standard Error: 226_141 + .saturating_add(Weight::from_parts(1_532_143, 0).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(110_u64)) + .saturating_add(T::DbWeight::get().writes(101_u64)) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:1 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsInfo` (r:1 w:1) + /// Proof: `FundAdmin::DrawdownsInfo` (`max_values`: None, `max_size`: Some(90710), added: 93185, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsByDrawdown` (r:1 w:1) + /// Proof: `FundAdmin::TransactionsByDrawdown` (`max_values`: None, `max_size`: Some(32066), added: 34541, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsInfo` (r:0 w:100) + /// Proof: `FundAdmin::TransactionsInfo` (`max_values`: None, `max_size`: Some(20967), added: 23442, mode: `MaxEncodedLen`) + fn reset_drawdown() -> Weight { + // Proof Size summary in bytes: + // Measured: `11813` + // Estimated: `2525475` + // Minimum execution time: 356_822_000 picoseconds. + Weight::from_parts(368_486_000, 2525475) + .saturating_add(T::DbWeight::get().reads(10_u64)) + .saturating_add(T::DbWeight::get().writes(103_u64)) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:2 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:0) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsInfo` (r:1 w:1) + /// Proof: `FundAdmin::DrawdownsInfo` (`max_values`: None, `max_size`: Some(90710), added: 93185, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsByProject` (r:1 w:0) + /// Proof: `FundAdmin::DrawdownsByProject` (`max_values`: None, `max_size`: Some(320034), added: 322509, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsByDrawdown` (r:1 w:1) + /// Proof: `FundAdmin::TransactionsByDrawdown` (`max_values`: None, `max_size`: Some(32066), added: 34541, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ExpendituresInfo` (r:1 w:0) + /// Proof: `FundAdmin::ExpendituresInfo` (`max_values`: None, `max_size`: Some(583), added: 3058, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsInfo` (r:200 w:100) + /// Proof: `FundAdmin::TransactionsInfo` (`max_values`: None, `max_size`: Some(20967), added: 23442, mode: `MaxEncodedLen`) + /// The range of component `a` is `[1, 100]`. + fn recovery_drawdown(a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `2070245` + // Estimated: `2525475 + a * (23442 ±0)` + // Minimum execution time: 12_614_492_000 picoseconds. + Weight::from_parts(12_466_050_756, 2525475) + // Standard Error: 392_127 + .saturating_add(Weight::from_parts(303_815_694, 0).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(113_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(a.into()))) + .saturating_add(Weight::from_parts(0, 23442).saturating_mul(a.into())) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:2 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:0) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenuesInfo` (r:1 w:1) + /// Proof: `FundAdmin::RevenuesInfo` (`max_values`: None, `max_size`: Some(49097), added: 51572, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenuesByProject` (r:1 w:0) + /// Proof: `FundAdmin::RevenuesByProject` (`max_values`: None, `max_size`: Some(320034), added: 322509, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsByRevenue` (r:1 w:1) + /// Proof: `FundAdmin::TransactionsByRevenue` (`max_values`: None, `max_size`: Some(32066), added: 34541, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenueTransactionsInfo` (r:200 w:100) + /// Proof: `FundAdmin::RevenueTransactionsInfo` (`max_values`: None, `max_size`: Some(20967), added: 23442, mode: `MaxEncodedLen`) + /// The range of component `a` is `[1, 100]`. + fn recovery_revenue(a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `2069441` + // Estimated: `2525475 + a * (23442 ±0)` + // Minimum execution time: 12_740_348_000 picoseconds. + Weight::from_parts(12_498_173_075, 2525475) + // Standard Error: 392_799 + .saturating_add(Weight::from_parts(298_353_500, 0).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(112_u64)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(a.into()))) + .saturating_add(T::DbWeight::get().writes(2_u64)) + .saturating_add(T::DbWeight::get().writes((1_u64).saturating_mul(a.into()))) + .saturating_add(Weight::from_parts(0, 23442).saturating_mul(a.into())) + } + /// Storage: `FundAdmin::UsersInfo` (r:101 w:101) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::UsersByProject` (r:1 w:1) + /// Proof: `FundAdmin::UsersByProject` (`max_values`: None, `max_size`: Some(3200036), added: 3202511, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsByUser` (r:100 w:100) + /// Proof: `FundAdmin::ProjectsByUser` (`max_values`: None, `max_size`: Some(320050), added: 322525, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ExpendituresInfo` (r:100 w:100) + /// Proof: `FundAdmin::ExpendituresInfo` (`max_values`: None, `max_size`: Some(583), added: 3058, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ExpendituresByProject` (r:1 w:1) + /// Proof: `FundAdmin::ExpendituresByProject` (`max_values`: None, `max_size`: Some(3200036), added: 3202511, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsInfo` (r:3 w:3) + /// Proof: `FundAdmin::DrawdownsInfo` (`max_values`: None, `max_size`: Some(90710), added: 93185, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsByProject` (r:1 w:1) + /// Proof: `FundAdmin::DrawdownsByProject` (`max_values`: None, `max_size`: Some(320034), added: 322509, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::JobEligiblesInfo` (r:100 w:100) + /// Proof: `FundAdmin::JobEligiblesInfo` (`max_values`: None, `max_size`: Some(582), added: 3057, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::JobEligiblesByProject` (r:1 w:1) + /// Proof: `FundAdmin::JobEligiblesByProject` (`max_values`: None, `max_size`: Some(3200036), added: 3202511, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenuesInfo` (r:1 w:1) + /// Proof: `FundAdmin::RevenuesInfo` (`max_values`: None, `max_size`: Some(49097), added: 51572, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenuesByProject` (r:1 w:1) + /// Proof: `FundAdmin::RevenuesByProject` (`max_values`: None, `max_size`: Some(320034), added: 322509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:1) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::UsersByScope` (r:4 w:2) + /// Proof: `RBAC::UsersByScope` (`max_values`: None, `max_size`: Some(80098), added: 82573, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PalletRoles` (r:2 w:1) + /// Proof: `RBAC::PalletRoles` (`max_values`: None, `max_size`: Some(1633), added: 4108, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:5 w:5) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:25 w:25) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:0 w:1) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Roles` (r:0 w:5) + /// Proof: `RBAC::Roles` (`max_values`: None, `max_size`: Some(83), added: 2558, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:0 w:101) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + fn kill_storage() -> Weight { + // Proof Size summary in bytes: + // Measured: `41100` + // Estimated: `32253490` + // Minimum execution time: 1_245_208_000 picoseconds. + Weight::from_parts(1_282_585_000, 32253490) + .saturating_add(T::DbWeight::get().reads(448_u64)) + .saturating_add(T::DbWeight::get().writes(552_u64)) + } +} + +// For backwards compatibility and tests. +impl WeightInfo for () { + /// Storage: `RBAC::Scopes` (r:1 w:1) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Roles` (r:5 w:5) + /// Proof: `RBAC::Roles` (`max_values`: None, `max_size`: Some(83), added: 2558, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PalletRoles` (r:1 w:1) + /// Proof: `RBAC::PalletRoles` (`max_values`: None, `max_size`: Some(1633), added: 4108, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:25 w:25) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:5 w:5) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:0 w:1) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + fn initial_setup() -> Weight { + // Proof Size summary in bytes: + // Measured: `42` + // Estimated: `65740` + // Minimum execution time: 368_275_000 picoseconds. + Weight::from_parts(377_843_000, 65740) + .saturating_add(RocksDbWeight::get().reads(37_u64)) + .saturating_add(RocksDbWeight::get().writes(38_u64)) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:1) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PalletRoles` (r:1 w:0) + /// Proof: `RBAC::PalletRoles` (`max_values`: None, `max_size`: Some(1633), added: 4108, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:1) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::UsersByScope` (r:1 w:1) + /// Proof: `RBAC::UsersByScope` (`max_values`: None, `max_size`: Some(80098), added: 82573, mode: `MaxEncodedLen`) + fn sudo_add_administrator() -> Weight { + // Proof Size summary in bytes: + // Measured: `515` + // Estimated: `83563` + // Minimum execution time: 53_359_000 picoseconds. + Weight::from_parts(59_086_000, 83563) + .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:1) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:1) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::UsersByScope` (r:1 w:1) + /// Proof: `RBAC::UsersByScope` (`max_values`: None, `max_size`: Some(80098), added: 82573, mode: `MaxEncodedLen`) + fn sudo_remove_administrator() -> Weight { + // Proof Size summary in bytes: + // Measured: `695` + // Estimated: `83563` + // Minimum execution time: 50_077_000 picoseconds. + Weight::from_parts(52_381_000, 83563) + .saturating_add(RocksDbWeight::get().reads(4_u64)) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + } + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::UsersInfo` (r:101 w:100) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:1 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:101 w:100) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PalletRoles` (r:1 w:0) + /// Proof: `RBAC::PalletRoles` (`max_values`: None, `max_size`: Some(1633), added: 4108, mode: `MaxEncodedLen`) + /// Storage: `RBAC::UsersByScope` (r:1 w:1) + /// Proof: `RBAC::UsersByScope` (`max_values`: None, `max_size`: Some(80098), added: 82573, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:101 w:101) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// The range of component `x` is `[1, 100]`. + fn users(x: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `2977 + x * (2 ±0)` + // Estimated: `83563 + x * (23241 ±0)` + // Minimum execution time: 165_804_000 picoseconds. + Weight::from_parts(172_091_000, 83563) + // Standard Error: 225_062 + .saturating_add(Weight::from_parts(97_520_036, 0).saturating_mul(x.into())) + .saturating_add(RocksDbWeight::get().reads(10_u64)) + .saturating_add(RocksDbWeight::get().reads((3_u64).saturating_mul(x.into()))) + .saturating_add(RocksDbWeight::get().writes(2_u64)) + .saturating_add(RocksDbWeight::get().writes((3_u64).saturating_mul(x.into()))) + .saturating_add(Weight::from_parts(0, 23241).saturating_mul(x.into())) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:1) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// The range of component `d` is `[1, 100]`. + fn users_edit_user(d: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `266` + // Estimated: `24231` + // Minimum execution time: 28_635_000 picoseconds. + Weight::from_parts(37_740_439, 24231) + // Standard Error: 10_782 + .saturating_add(Weight::from_parts(610_507, 0).saturating_mul(d.into())) + .saturating_add(RocksDbWeight::get().reads(1_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::UsersInfo` (r:101 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:1) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:4 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:101 w:100) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ExpendituresInfo` (r:100 w:100) + /// Proof: `FundAdmin::ExpendituresInfo` (`max_values`: None, `max_size`: Some(583), added: 3058, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ExpendituresByProject` (r:1 w:1) + /// Proof: `FundAdmin::ExpendituresByProject` (`max_values`: None, `max_size`: Some(3200036), added: 3202511, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::JobEligiblesInfo` (r:100 w:100) + /// Proof: `FundAdmin::JobEligiblesInfo` (`max_values`: None, `max_size`: Some(582), added: 3057, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::JobEligiblesByProject` (r:1 w:1) + /// Proof: `FundAdmin::JobEligiblesByProject` (`max_values`: None, `max_size`: Some(3200036), added: 3202511, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::UsersByProject` (r:1 w:1) + /// Proof: `FundAdmin::UsersByProject` (`max_values`: None, `max_size`: Some(3200036), added: 3202511, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsByUser` (r:100 w:100) + /// Proof: `FundAdmin::ProjectsByUser` (`max_values`: None, `max_size`: Some(320050), added: 322525, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PalletRoles` (r:1 w:0) + /// Proof: `RBAC::PalletRoles` (`max_values`: None, `max_size`: Some(1633), added: 4108, mode: `MaxEncodedLen`) + /// Storage: `RBAC::UsersByScope` (r:1 w:1) + /// Proof: `RBAC::UsersByScope` (`max_values`: None, `max_size`: Some(80098), added: 82573, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsInfo` (r:3 w:3) + /// Proof: `FundAdmin::DrawdownsInfo` (`max_values`: None, `max_size`: Some(90710), added: 93185, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsByProject` (r:1 w:1) + /// Proof: `FundAdmin::DrawdownsByProject` (`max_values`: None, `max_size`: Some(320034), added: 322509, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenuesInfo` (r:1 w:1) + /// Proof: `FundAdmin::RevenuesInfo` (`max_values`: None, `max_size`: Some(49097), added: 51572, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenuesByProject` (r:1 w:1) + /// Proof: `FundAdmin::RevenuesByProject` (`max_values`: None, `max_size`: Some(320034), added: 322509, mode: `MaxEncodedLen`) + /// The range of component `b` is `[1, 200]`. + /// The range of component `e` is `[1, 100]`. + /// The range of component `j` is `[1, 100]`. + /// The range of component `u` is `[1, 100]`. + fn projects_create_project(b: u32, e: u32, j: u32, u: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `2637 + u * (170 ±0)` + // Estimated: `3203501 + e * (3058 ±0) + j * (3057 ±0) + u * (322525 ±0)` + // Minimum execution time: 9_790_769_000 picoseconds. + Weight::from_parts(10_107_081_000, 3203501) + // Standard Error: 1_276_572 + .saturating_add(Weight::from_parts(118_455_417, 0).saturating_mul(b.into())) + // Standard Error: 2_558_990 + .saturating_add(Weight::from_parts(81_492_563, 0).saturating_mul(u.into())) + .saturating_add(RocksDbWeight::get().reads(22_u64)) + .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(e.into()))) + .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(j.into()))) + .saturating_add(RocksDbWeight::get().reads((3_u64).saturating_mul(u.into()))) + .saturating_add(RocksDbWeight::get().writes(12_u64)) + .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(e.into()))) + .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(j.into()))) + .saturating_add(RocksDbWeight::get().writes((2_u64).saturating_mul(u.into()))) + .saturating_add(Weight::from_parts(0, 3058).saturating_mul(e.into())) + .saturating_add(Weight::from_parts(0, 3057).saturating_mul(j.into())) + .saturating_add(Weight::from_parts(0, 322525).saturating_mul(u.into())) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:1 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// The range of component `b` is `[1, 200]`. + fn projects_edit_project(b: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `8357` + // Estimated: `2525475` + // Minimum execution time: 133_118_000 picoseconds. + Weight::from_parts(140_642_760, 2525475) + // Standard Error: 17_072 + .saturating_add(Weight::from_parts(1_612_915, 0).saturating_mul(b.into())) + .saturating_add(RocksDbWeight::get().reads(8_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: `FundAdmin::UsersInfo` (r:101 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:1) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:2 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:101 w:100) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::UsersByProject` (r:1 w:1) + /// Proof: `FundAdmin::UsersByProject` (`max_values`: None, `max_size`: Some(3200036), added: 3202511, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsByUser` (r:100 w:100) + /// Proof: `FundAdmin::ProjectsByUser` (`max_values`: None, `max_size`: Some(320050), added: 322525, mode: `MaxEncodedLen`) + /// Storage: `RBAC::UsersByScope` (r:2 w:1) + /// Proof: `RBAC::UsersByScope` (`max_values`: None, `max_size`: Some(80098), added: 82573, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ExpendituresByProject` (r:1 w:1) + /// Proof: `FundAdmin::ExpendituresByProject` (`max_values`: None, `max_size`: Some(3200036), added: 3202511, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsByProject` (r:1 w:1) + /// Proof: `FundAdmin::DrawdownsByProject` (`max_values`: None, `max_size`: Some(320034), added: 322509, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsByDrawdown` (r:3 w:3) + /// Proof: `FundAdmin::TransactionsByDrawdown` (`max_values`: None, `max_size`: Some(32066), added: 34541, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::JobEligiblesByProject` (r:1 w:1) + /// Proof: `FundAdmin::JobEligiblesByProject` (`max_values`: None, `max_size`: Some(3200036), added: 3202511, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenuesByProject` (r:1 w:1) + /// Proof: `FundAdmin::RevenuesByProject` (`max_values`: None, `max_size`: Some(320034), added: 322509, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsByRevenue` (r:1 w:1) + /// Proof: `FundAdmin::TransactionsByRevenue` (`max_values`: None, `max_size`: Some(32066), added: 34541, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsInfo` (r:0 w:3) + /// Proof: `FundAdmin::DrawdownsInfo` (`max_values`: None, `max_size`: Some(90710), added: 93185, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ExpendituresInfo` (r:0 w:100) + /// Proof: `FundAdmin::ExpendituresInfo` (`max_values`: None, `max_size`: Some(583), added: 3058, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::JobEligiblesInfo` (r:0 w:100) + /// Proof: `FundAdmin::JobEligiblesInfo` (`max_values`: None, `max_size`: Some(582), added: 3057, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenuesInfo` (r:0 w:1) + /// Proof: `FundAdmin::RevenuesInfo` (`max_values`: None, `max_size`: Some(49097), added: 51572, mode: `MaxEncodedLen`) + fn projects_delete_project() -> Weight { + // Proof Size summary in bytes: + // Measured: `61657` + // Estimated: `32253490` + // Minimum execution time: 6_707_751_000 picoseconds. + Weight::from_parts(7_116_813_000, 32253490) + .saturating_add(RocksDbWeight::get().reads(319_u64)) + .saturating_add(RocksDbWeight::get().writes(416_u64)) + } + /// Storage: `FundAdmin::UsersInfo` (r:101 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:1 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:101 w:100) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::UsersByProject` (r:1 w:1) + /// Proof: `FundAdmin::UsersByProject` (`max_values`: None, `max_size`: Some(3200036), added: 3202511, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsByUser` (r:100 w:100) + /// Proof: `FundAdmin::ProjectsByUser` (`max_values`: None, `max_size`: Some(320050), added: 322525, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PalletRoles` (r:1 w:0) + /// Proof: `RBAC::PalletRoles` (`max_values`: None, `max_size`: Some(1633), added: 4108, mode: `MaxEncodedLen`) + /// Storage: `RBAC::UsersByScope` (r:1 w:1) + /// Proof: `RBAC::UsersByScope` (`max_values`: None, `max_size`: Some(80098), added: 82573, mode: `MaxEncodedLen`) + /// The range of component `a` is `[1, 100]`. + fn projects_assign_user(a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `20420 + a * (226 ±0)` + // Estimated: `3203501 + a * (322525 ±0)` + // Minimum execution time: 197_024_000 picoseconds. + Weight::from_parts(116_804_696, 3203501) + // Standard Error: 177_570 + .saturating_add(Weight::from_parts(66_856_513, 0).saturating_mul(a.into())) + .saturating_add(RocksDbWeight::get().reads(10_u64)) + .saturating_add(RocksDbWeight::get().reads((3_u64).saturating_mul(a.into()))) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + .saturating_add(RocksDbWeight::get().writes((2_u64).saturating_mul(a.into()))) + .saturating_add(Weight::from_parts(0, 322525).saturating_mul(a.into())) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:2 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:0) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ExpendituresInfo` (r:100 w:100) + /// Proof: `FundAdmin::ExpendituresInfo` (`max_values`: None, `max_size`: Some(583), added: 3058, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ExpendituresByProject` (r:1 w:1) + /// Proof: `FundAdmin::ExpendituresByProject` (`max_values`: None, `max_size`: Some(3200036), added: 3202511, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::JobEligiblesInfo` (r:100 w:100) + /// Proof: `FundAdmin::JobEligiblesInfo` (`max_values`: None, `max_size`: Some(582), added: 3057, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::JobEligiblesByProject` (r:1 w:1) + /// Proof: `FundAdmin::JobEligiblesByProject` (`max_values`: None, `max_size`: Some(3200036), added: 3202511, mode: `MaxEncodedLen`) + /// The range of component `e` is `[1, 100]`. + /// The range of component `j` is `[1, 100]`. + fn expenditures_and_job_eligibles(e: u32, j: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `18858 + e * (17 ±0) + j * (20 ±0)` + // Estimated: `3203501 + e * (3058 ±0) + j * (3057 ±0)` + // Minimum execution time: 2_179_973_000 picoseconds. + Weight::from_parts(175_581_406, 3203501) + // Standard Error: 96_960 + .saturating_add(Weight::from_parts(20_560_587, 0).saturating_mul(e.into())) + // Standard Error: 96_960 + .saturating_add(Weight::from_parts(21_411_639, 0).saturating_mul(j.into())) + .saturating_add(RocksDbWeight::get().reads(11_u64)) + .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(e.into()))) + .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(j.into()))) + .saturating_add(RocksDbWeight::get().writes(2_u64)) + .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(e.into()))) + .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(j.into()))) + .saturating_add(Weight::from_parts(0, 3058).saturating_mul(e.into())) + .saturating_add(Weight::from_parts(0, 3057).saturating_mul(j.into())) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:2 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsInfo` (r:1 w:1) + /// Proof: `FundAdmin::DrawdownsInfo` (`max_values`: None, `max_size`: Some(90710), added: 93185, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ExpendituresInfo` (r:1 w:0) + /// Proof: `FundAdmin::ExpendituresInfo` (`max_values`: None, `max_size`: Some(583), added: 3058, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsInfo` (r:100 w:100) + /// Proof: `FundAdmin::TransactionsInfo` (`max_values`: None, `max_size`: Some(20967), added: 23442, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsByDrawdown` (r:1 w:1) + /// Proof: `FundAdmin::TransactionsByDrawdown` (`max_values`: None, `max_size`: Some(32066), added: 34541, mode: `MaxEncodedLen`) + /// The range of component `a` is `[1, 100]`. + fn submit_drawdown(a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `9282` + // Estimated: `2525475 + a * (23442 ±0)` + // Minimum execution time: 502_651_000 picoseconds. + Weight::from_parts(238_227_832, 2525475) + // Standard Error: 256_323 + .saturating_add(Weight::from_parts(235_581_283, 0).saturating_mul(a.into())) + .saturating_add(RocksDbWeight::get().reads(12_u64)) + .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(a.into()))) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(a.into()))) + .saturating_add(Weight::from_parts(0, 23442).saturating_mul(a.into())) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:3 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsInfo` (r:2 w:2) + /// Proof: `FundAdmin::DrawdownsInfo` (`max_values`: None, `max_size`: Some(90710), added: 93185, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ExpendituresInfo` (r:1 w:0) + /// Proof: `FundAdmin::ExpendituresInfo` (`max_values`: None, `max_size`: Some(583), added: 3058, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsInfo` (r:200 w:200) + /// Proof: `FundAdmin::TransactionsInfo` (`max_values`: None, `max_size`: Some(20967), added: 23442, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsByDrawdown` (r:1 w:1) + /// Proof: `FundAdmin::TransactionsByDrawdown` (`max_values`: None, `max_size`: Some(32066), added: 34541, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsByProject` (r:1 w:1) + /// Proof: `FundAdmin::DrawdownsByProject` (`max_values`: None, `max_size`: Some(320034), added: 322509, mode: `MaxEncodedLen`) + /// The range of component `a` is `[1, 100]`. + fn approve_drawdown(a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `2070176` + // Estimated: `2525475 + a * (23442 ±0)` + // Minimum execution time: 19_643_024_000 picoseconds. + Weight::from_parts(19_444_937_640, 2525475) + // Standard Error: 628_560 + .saturating_add(Weight::from_parts(304_456_545, 0).saturating_mul(a.into())) + .saturating_add(RocksDbWeight::get().reads(115_u64)) + .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(a.into()))) + .saturating_add(RocksDbWeight::get().writes(105_u64)) + .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(a.into()))) + .saturating_add(Weight::from_parts(0, 23442).saturating_mul(a.into())) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:1 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsInfo` (r:1 w:1) + /// Proof: `FundAdmin::DrawdownsInfo` (`max_values`: None, `max_size`: Some(90710), added: 93185, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsByDrawdown` (r:1 w:0) + /// Proof: `FundAdmin::TransactionsByDrawdown` (`max_values`: None, `max_size`: Some(32066), added: 34541, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsInfo` (r:100 w:100) + /// Proof: `FundAdmin::TransactionsInfo` (`max_values`: None, `max_size`: Some(20967), added: 23442, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + fn reject_drawdown() -> Weight { + // Proof Size summary in bytes: + // Measured: `2069261` + // Estimated: `2525475` + // Minimum execution time: 13_787_694_000 picoseconds. + Weight::from_parts(13_914_317_000, 2525475) + .saturating_add(RocksDbWeight::get().reads(110_u64)) + .saturating_add(RocksDbWeight::get().writes(102_u64)) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:1 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsInfo` (r:1 w:1) + /// Proof: `FundAdmin::DrawdownsInfo` (`max_values`: None, `max_size`: Some(90710), added: 93185, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// The range of component `d` is `[1, 100]`. + fn up_bulkupload(d: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `8500` + // Estimated: `2525475` + // Minimum execution time: 147_995_000 picoseconds. + Weight::from_parts(163_935_160, 2525475) + // Standard Error: 15_510 + .saturating_add(Weight::from_parts(1_880_851, 0).saturating_mul(d.into())) + .saturating_add(RocksDbWeight::get().reads(9_u64)) + .saturating_add(RocksDbWeight::get().writes(2_u64)) + } + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:1 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// The range of component `a` is `[1, 100]`. + fn inflation_rate(a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `8288` + // Estimated: `2525475` + // Minimum execution time: 123_969_000 picoseconds. + Weight::from_parts(126_316_183, 2525475) + // Standard Error: 24_264 + .saturating_add(Weight::from_parts(12_619_465, 0).saturating_mul(a.into())) + .saturating_add(RocksDbWeight::get().reads(7_u64)) + .saturating_add(RocksDbWeight::get().writes(1_u64)) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:2 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenuesInfo` (r:1 w:1) + /// Proof: `FundAdmin::RevenuesInfo` (`max_values`: None, `max_size`: Some(49097), added: 51572, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenueTransactionsInfo` (r:100 w:100) + /// Proof: `FundAdmin::RevenueTransactionsInfo` (`max_values`: None, `max_size`: Some(20967), added: 23442, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsByRevenue` (r:1 w:1) + /// Proof: `FundAdmin::TransactionsByRevenue` (`max_values`: None, `max_size`: Some(32066), added: 34541, mode: `MaxEncodedLen`) + /// The range of component `a` is `[1, 100]`. + fn submit_revenue(a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `8449` + // Estimated: `2525475 + a * (23442 ±0)` + // Minimum execution time: 490_569_000 picoseconds. + Weight::from_parts(236_757_131, 2525475) + // Standard Error: 345_267 + .saturating_add(Weight::from_parts(234_868_590, 0).saturating_mul(a.into())) + .saturating_add(RocksDbWeight::get().reads(11_u64)) + .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(a.into()))) + .saturating_add(RocksDbWeight::get().writes(3_u64)) + .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(a.into()))) + .saturating_add(Weight::from_parts(0, 23442).saturating_mul(a.into())) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:1 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenuesInfo` (r:2 w:2) + /// Proof: `FundAdmin::RevenuesInfo` (`max_values`: None, `max_size`: Some(49097), added: 51572, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsByRevenue` (r:1 w:0) + /// Proof: `FundAdmin::TransactionsByRevenue` (`max_values`: None, `max_size`: Some(32066), added: 34541, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenueTransactionsInfo` (r:100 w:100) + /// Proof: `FundAdmin::RevenueTransactionsInfo` (`max_values`: None, `max_size`: Some(20967), added: 23442, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenuesByProject` (r:1 w:1) + /// Proof: `FundAdmin::RevenuesByProject` (`max_values`: None, `max_size`: Some(320034), added: 322509, mode: `MaxEncodedLen`) + fn approve_revenue() -> Weight { + // Proof Size summary in bytes: + // Measured: `2069236` + // Estimated: `2525475` + // Minimum execution time: 12_293_638_000 picoseconds. + Weight::from_parts(12_507_563_000, 2525475) + .saturating_add(RocksDbWeight::get().reads(112_u64)) + .saturating_add(RocksDbWeight::get().writes(104_u64)) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:1 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenuesInfo` (r:1 w:1) + /// Proof: `FundAdmin::RevenuesInfo` (`max_values`: None, `max_size`: Some(49097), added: 51572, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsByRevenue` (r:1 w:0) + /// Proof: `FundAdmin::TransactionsByRevenue` (`max_values`: None, `max_size`: Some(32066), added: 34541, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenueTransactionsInfo` (r:100 w:100) + /// Proof: `FundAdmin::RevenueTransactionsInfo` (`max_values`: None, `max_size`: Some(20967), added: 23442, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + fn reject_revenue() -> Weight { + // Proof Size summary in bytes: + // Measured: `2069144` + // Estimated: `2525475` + // Minimum execution time: 18_412_764_000 picoseconds. + Weight::from_parts(18_591_490_000, 2525475) + .saturating_add(RocksDbWeight::get().reads(110_u64)) + .saturating_add(RocksDbWeight::get().writes(102_u64)) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:1 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:0) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsInfo` (r:1 w:1) + /// Proof: `FundAdmin::DrawdownsInfo` (`max_values`: None, `max_size`: Some(90710), added: 93185, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsByDrawdown` (r:1 w:0) + /// Proof: `FundAdmin::TransactionsByDrawdown` (`max_values`: None, `max_size`: Some(32066), added: 34541, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsInfo` (r:100 w:100) + /// Proof: `FundAdmin::TransactionsInfo` (`max_values`: None, `max_size`: Some(20967), added: 23442, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// The range of component `a` is `[1, 100]`. + fn bank_confirming_documents(a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `2065064` + // Estimated: `2525475` + // Minimum execution time: 7_553_050_000 picoseconds. + Weight::from_parts(7_752_950_488, 2525475) + // Standard Error: 226_141 + .saturating_add(Weight::from_parts(1_532_143, 0).saturating_mul(a.into())) + .saturating_add(RocksDbWeight::get().reads(110_u64)) + .saturating_add(RocksDbWeight::get().writes(101_u64)) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:1 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsInfo` (r:1 w:1) + /// Proof: `FundAdmin::DrawdownsInfo` (`max_values`: None, `max_size`: Some(90710), added: 93185, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsByDrawdown` (r:1 w:1) + /// Proof: `FundAdmin::TransactionsByDrawdown` (`max_values`: None, `max_size`: Some(32066), added: 34541, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsInfo` (r:0 w:100) + /// Proof: `FundAdmin::TransactionsInfo` (`max_values`: None, `max_size`: Some(20967), added: 23442, mode: `MaxEncodedLen`) + fn reset_drawdown() -> Weight { + // Proof Size summary in bytes: + // Measured: `11813` + // Estimated: `2525475` + // Minimum execution time: 356_822_000 picoseconds. + Weight::from_parts(368_486_000, 2525475) + .saturating_add(RocksDbWeight::get().reads(10_u64)) + .saturating_add(RocksDbWeight::get().writes(103_u64)) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:2 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:0) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsInfo` (r:1 w:1) + /// Proof: `FundAdmin::DrawdownsInfo` (`max_values`: None, `max_size`: Some(90710), added: 93185, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsByProject` (r:1 w:0) + /// Proof: `FundAdmin::DrawdownsByProject` (`max_values`: None, `max_size`: Some(320034), added: 322509, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsByDrawdown` (r:1 w:1) + /// Proof: `FundAdmin::TransactionsByDrawdown` (`max_values`: None, `max_size`: Some(32066), added: 34541, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ExpendituresInfo` (r:1 w:0) + /// Proof: `FundAdmin::ExpendituresInfo` (`max_values`: None, `max_size`: Some(583), added: 3058, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsInfo` (r:200 w:100) + /// Proof: `FundAdmin::TransactionsInfo` (`max_values`: None, `max_size`: Some(20967), added: 23442, mode: `MaxEncodedLen`) + /// The range of component `a` is `[1, 100]`. + fn recovery_drawdown(a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `2070245` + // Estimated: `2525475 + a * (23442 ±0)` + // Minimum execution time: 12_614_492_000 picoseconds. + Weight::from_parts(12_466_050_756, 2525475) + // Standard Error: 392_127 + .saturating_add(Weight::from_parts(303_815_694, 0).saturating_mul(a.into())) + .saturating_add(RocksDbWeight::get().reads(113_u64)) + .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(a.into()))) + .saturating_add(RocksDbWeight::get().writes(2_u64)) + .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(a.into()))) + .saturating_add(Weight::from_parts(0, 23442).saturating_mul(a.into())) + } + /// Storage: `FundAdmin::UsersInfo` (r:1 w:0) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:1 w:0) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:0) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:2 w:0) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:1 w:0) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:1 w:0) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:0) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenuesInfo` (r:1 w:1) + /// Proof: `FundAdmin::RevenuesInfo` (`max_values`: None, `max_size`: Some(49097), added: 51572, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenuesByProject` (r:1 w:0) + /// Proof: `FundAdmin::RevenuesByProject` (`max_values`: None, `max_size`: Some(320034), added: 322509, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::TransactionsByRevenue` (r:1 w:1) + /// Proof: `FundAdmin::TransactionsByRevenue` (`max_values`: None, `max_size`: Some(32066), added: 34541, mode: `MaxEncodedLen`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenueTransactionsInfo` (r:200 w:100) + /// Proof: `FundAdmin::RevenueTransactionsInfo` (`max_values`: None, `max_size`: Some(20967), added: 23442, mode: `MaxEncodedLen`) + /// The range of component `a` is `[1, 100]`. + fn recovery_revenue(a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `2069441` + // Estimated: `2525475 + a * (23442 ±0)` + // Minimum execution time: 12_740_348_000 picoseconds. + Weight::from_parts(12_498_173_075, 2525475) + // Standard Error: 392_799 + .saturating_add(Weight::from_parts(298_353_500, 0).saturating_mul(a.into())) + .saturating_add(RocksDbWeight::get().reads(112_u64)) + .saturating_add(RocksDbWeight::get().reads((1_u64).saturating_mul(a.into()))) + .saturating_add(RocksDbWeight::get().writes(2_u64)) + .saturating_add(RocksDbWeight::get().writes((1_u64).saturating_mul(a.into()))) + .saturating_add(Weight::from_parts(0, 23442).saturating_mul(a.into())) + } + /// Storage: `FundAdmin::UsersInfo` (r:101 w:101) + /// Proof: `FundAdmin::UsersInfo` (`max_values`: None, `max_size`: Some(20766), added: 23241, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsInfo` (r:1 w:1) + /// Proof: `FundAdmin::ProjectsInfo` (`max_values`: None, `max_size`: Some(2522010), added: 2524485, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::UsersByProject` (r:1 w:1) + /// Proof: `FundAdmin::UsersByProject` (`max_values`: None, `max_size`: Some(3200036), added: 3202511, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ProjectsByUser` (r:100 w:100) + /// Proof: `FundAdmin::ProjectsByUser` (`max_values`: None, `max_size`: Some(320050), added: 322525, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ExpendituresInfo` (r:100 w:100) + /// Proof: `FundAdmin::ExpendituresInfo` (`max_values`: None, `max_size`: Some(583), added: 3058, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::ExpendituresByProject` (r:1 w:1) + /// Proof: `FundAdmin::ExpendituresByProject` (`max_values`: None, `max_size`: Some(3200036), added: 3202511, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsInfo` (r:3 w:3) + /// Proof: `FundAdmin::DrawdownsInfo` (`max_values`: None, `max_size`: Some(90710), added: 93185, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::DrawdownsByProject` (r:1 w:1) + /// Proof: `FundAdmin::DrawdownsByProject` (`max_values`: None, `max_size`: Some(320034), added: 322509, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::JobEligiblesInfo` (r:100 w:100) + /// Proof: `FundAdmin::JobEligiblesInfo` (`max_values`: None, `max_size`: Some(582), added: 3057, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::JobEligiblesByProject` (r:1 w:1) + /// Proof: `FundAdmin::JobEligiblesByProject` (`max_values`: None, `max_size`: Some(3200036), added: 3202511, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenuesInfo` (r:1 w:1) + /// Proof: `FundAdmin::RevenuesInfo` (`max_values`: None, `max_size`: Some(49097), added: 51572, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::RevenuesByProject` (r:1 w:1) + /// Proof: `FundAdmin::RevenuesByProject` (`max_values`: None, `max_size`: Some(320034), added: 322509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Scopes` (r:1 w:1) + /// Proof: `RBAC::Scopes` (`max_values`: None, `max_size`: Some(32034), added: 34509, mode: `MaxEncodedLen`) + /// Storage: `RBAC::UsersByScope` (r:4 w:2) + /// Proof: `RBAC::UsersByScope` (`max_values`: None, `max_size`: Some(80098), added: 82573, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PalletRoles` (r:2 w:1) + /// Proof: `RBAC::PalletRoles` (`max_values`: None, `max_size`: Some(1633), added: 4108, mode: `MaxEncodedLen`) + /// Storage: `RBAC::PermissionsByRole` (r:5 w:5) + /// Proof: `RBAC::PermissionsByRole` (`max_values`: None, `max_size`: Some(3266), added: 5741, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Permissions` (r:25 w:25) + /// Proof: `RBAC::Permissions` (`max_values`: None, `max_size`: Some(115), added: 2590, mode: `MaxEncodedLen`) + /// Storage: `FundAdmin::GlobalScope` (r:0 w:1) + /// Proof: `FundAdmin::GlobalScope` (`max_values`: Some(1), `max_size`: Some(32), added: 527, mode: `MaxEncodedLen`) + /// Storage: `RBAC::Roles` (r:0 w:5) + /// Proof: `RBAC::Roles` (`max_values`: None, `max_size`: Some(83), added: 2558, mode: `MaxEncodedLen`) + /// Storage: `RBAC::RolesByUser` (r:0 w:101) + /// Proof: `RBAC::RolesByUser` (`max_values`: None, `max_size`: Some(433), added: 2908, mode: `MaxEncodedLen`) + fn kill_storage() -> Weight { + // Proof Size summary in bytes: + // Measured: `41100` + // Estimated: `32253490` + // Minimum execution time: 1_245_208_000 picoseconds. + Weight::from_parts(1_282_585_000, 32253490) + .saturating_add(RocksDbWeight::get().reads(448_u64)) + .saturating_add(RocksDbWeight::get().writes(552_u64)) + } +}