feat: Rebrand Polkadot/Substrate references to PezkuwiChain

This commit systematically rebrands various references from Parity Technologies'
Polkadot/Substrate ecosystem to PezkuwiChain within the kurdistan-sdk.

Key changes include:
- Updated external repository URLs (zombienet-sdk, parity-db, parity-scale-codec, wasm-instrument) to point to pezkuwichain forks.
- Modified internal documentation and code comments to reflect PezkuwiChain naming and structure.
- Replaced direct references to  with  or specific paths within the  for XCM, Pezkuwi, and other modules.
- Cleaned up deprecated  issue and PR references in various  and  files, particularly in  and  modules.
- Adjusted image and logo URLs in documentation to point to PezkuwiChain assets.
- Removed or rephrased comments related to external Polkadot/Substrate PRs and issues.

This is a significant step towards fully customizing the SDK for the PezkuwiChain ecosystem.
This commit is contained in:
2025-12-14 00:04:10 +03:00
parent 286de54384
commit 1c0e57d984
9084 changed files with 997839 additions and 997557 deletions
@@ -0,0 +1,849 @@
// This file is part of Bizinikiwi.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//! Bounties pallet benchmarking.
#![cfg(feature = "runtime-benchmarks")]
use super::*;
use crate as pezpallet_bounties;
use crate::Pallet as Bounties;
use alloc::{borrow::Cow, vec};
use pezframe_benchmarking::{v2::*, BenchmarkError};
use pezframe_support::assert_ok;
use pezframe_system::RawOrigin;
use pezsp_core::crypto::FromEntropy;
/// Trait describing factory functions for dispatchables' parameters.
pub trait ArgumentsFactory<AssetKind, Beneficiary, Balance> {
/// Factory function for an asset kind.
fn create_asset_kind(seed: u32) -> AssetKind;
/// Factory function for a beneficiary.
fn create_beneficiary(seed: [u8; 32]) -> Beneficiary;
}
/// Implementation that expects the parameters implement the [`FromEntropy`] trait.
impl<AssetKind, Beneficiary, Balance> ArgumentsFactory<AssetKind, Beneficiary, Balance> for ()
where
AssetKind: FromEntropy,
Beneficiary: FromEntropy,
{
fn create_asset_kind(seed: u32) -> AssetKind {
AssetKind::from_entropy(&mut seed.encode().as_slice()).unwrap()
}
fn create_beneficiary(seed: [u8; 32]) -> Beneficiary {
Beneficiary::from_entropy(&mut seed.as_slice()).unwrap()
}
}
#[derive(Clone)]
struct BenchmarkBounty<T: Config<I>, I: 'static> {
/// Parent bounty ID.
parent_bounty_id: BountyIndex,
/// Child-bounty ID.
child_bounty_id: BountyIndex,
/// The parent bounty curator account.
curator: T::AccountId,
/// The child-bounty curator account.
child_curator: T::AccountId,
/// The kind of asset the child-/bounty is rewarded in.
asset_kind: T::AssetKind,
/// The amount that should be paid if the bounty is rewarded.
value: BalanceOf<T, I>,
/// The amount that should be paid if the child-bounty is rewarded.
child_value: BalanceOf<T, I>,
/// The child-/bounty beneficiary account.
beneficiary: T::Beneficiary,
/// Bounty metadata hash.
metadata: T::Hash,
}
const SEED: u32 = 0;
fn assert_last_event<T: Config<I>, I: 'static>(
generic_event: <T as pezframe_system::Config>::RuntimeEvent,
) {
pezframe_system::Pallet::<T>::assert_last_event(generic_event.into());
}
fn assert_has_event<T: Config<I>, I: 'static>(
generic_event: <T as pezframe_system::Config>::RuntimeEvent,
) {
pezframe_system::Pallet::<T>::assert_has_event(generic_event.into());
}
pub fn get_payment_id<T: Config<I>, I: 'static>(
parent_bounty_id: BountyIndex,
child_bounty_id: Option<BountyIndex>,
) -> Option<PaymentIdOf<T, I>> {
let bounty = Bounties::<T, I>::get_bounty_details(parent_bounty_id, child_bounty_id)
.expect("no bounty found");
match bounty.3 {
BountyStatus::FundingAttempted {
payment_status: PaymentState::Attempted { id }, ..
} => Some(id),
BountyStatus::RefundAttempted {
payment_status: PaymentState::Attempted { id }, ..
} => Some(id),
BountyStatus::PayoutAttempted {
payment_status: PaymentState::Attempted { id }, ..
} => Some(id),
_ => None,
}
}
// Create the pre-requisite information needed to `fund_bounty`.
fn setup_bounty<T: Config<I>, I: 'static>() -> Result<BenchmarkBounty<T, I>, BenchmarkError> {
let asset_kind = <T as Config<I>>::BenchmarkHelper::create_asset_kind(SEED);
let min_native_value = T::BountyValueMinimum::get();
T::BalanceConverter::ensure_successful(asset_kind.clone());
let value = T::BalanceConverter::to_asset_balance(min_native_value, asset_kind.clone())
.map_err(|_| BenchmarkError::Stop("Failed to convert balance"))?;
let child_value = value / 2u32.into(); // so that retry works
let curator = account("curator", 0, SEED);
let child_curator = account("child-curator", 1, SEED);
let beneficiary =
<T as Config<I>>::BenchmarkHelper::create_beneficiary([(SEED).try_into().unwrap(); 32]);
let metadata = T::Preimages::note(Cow::from(vec![5, 6])).unwrap();
Ok(BenchmarkBounty::<T, I> {
parent_bounty_id: 0,
child_bounty_id: 0,
curator,
child_curator,
asset_kind,
value,
child_value,
beneficiary,
metadata,
})
}
fn create_parent_bounty<T: Config<I>, I: 'static>() -> Result<BenchmarkBounty<T, I>, BenchmarkError>
{
let mut s = setup_bounty::<T, I>()?;
let spend_origin = T::SpendOrigin::try_successful_origin().map_err(|_| {
BenchmarkError::Stop("SpendOrigin has no successful origin required for the benchmark")
})?;
let funding_source_account =
Bounties::<T, I>::funding_source_account(s.asset_kind.clone()).expect("conversion failed");
let parent_bounty_account =
Bounties::<T, I>::bounty_account(s.parent_bounty_id, s.asset_kind.clone())
.expect("conversion failed");
let curator_lookup = T::Lookup::unlookup(s.curator.clone());
<T as pezpallet_bounties::Config<I>>::Paymaster::ensure_successful(
&funding_source_account,
&parent_bounty_account,
s.asset_kind.clone(),
s.value,
);
Bounties::<T, I>::fund_bounty(
spend_origin,
Box::new(s.asset_kind.clone()),
s.value,
curator_lookup,
s.metadata,
)?;
s.parent_bounty_id = pezpallet_bounties::BountyCount::<T, I>::get() - 1;
Ok(s)
}
fn create_funded_bounty<T: Config<I>, I: 'static>() -> Result<BenchmarkBounty<T, I>, BenchmarkError>
{
let s = create_parent_bounty::<T, I>()?;
let payment_id = get_payment_id::<T, I>(s.parent_bounty_id, None).expect("no payment attempt");
<T as pallet::Config<I>>::Paymaster::ensure_concluded(payment_id);
let caller = account("caller", 0, SEED);
Bounties::<T, I>::check_status(RawOrigin::Signed(caller).into(), s.parent_bounty_id, None)?;
Ok(s)
}
fn create_active_parent_bounty<T: Config<I>, I: 'static>(
) -> Result<BenchmarkBounty<T, I>, BenchmarkError> {
let s = create_funded_bounty::<T, I>()?;
let curator = s.curator.clone();
<T as pezpallet_bounties::Config<I>>::Consideration::ensure_successful(&curator, s.value);
Bounties::<T, I>::accept_curator(RawOrigin::Signed(curator).into(), s.parent_bounty_id, None)?;
Ok(s)
}
fn create_child_bounty<T: Config<I>, I: 'static>() -> Result<BenchmarkBounty<T, I>, BenchmarkError>
{
let mut s = create_active_parent_bounty::<T, I>()?;
let child_curator_lookup = T::Lookup::unlookup(s.child_curator.clone());
Bounties::<T, I>::fund_child_bounty(
RawOrigin::Signed(s.curator.clone()).into(),
s.parent_bounty_id,
s.child_value,
Some(child_curator_lookup),
s.metadata,
)?;
s.child_bounty_id =
pezpallet_bounties::TotalChildBountiesPerParent::<T, I>::get(s.parent_bounty_id) - 1;
Ok(s)
}
fn create_funded_child_bounty<T: Config<I>, I: 'static>(
) -> Result<BenchmarkBounty<T, I>, BenchmarkError> {
let s = create_child_bounty::<T, I>()?;
let caller = account("caller", 0, SEED);
let payment_id = get_payment_id::<T, I>(s.parent_bounty_id, Some(s.child_bounty_id))
.expect("no payment attempt");
<T as pallet::Config<I>>::Paymaster::ensure_concluded(payment_id);
Bounties::<T, I>::check_status(
RawOrigin::Signed(caller).into(),
s.parent_bounty_id,
Some(s.child_bounty_id),
)?;
Ok(s)
}
fn create_active_child_bounty<T: Config<I>, I: 'static>(
) -> Result<BenchmarkBounty<T, I>, BenchmarkError> {
let s = create_funded_child_bounty::<T, I>()?;
let caller = s.child_curator.clone();
<T as pezpallet_bounties::Config<I>>::Consideration::ensure_successful(&caller, s.child_value);
Bounties::<T, I>::accept_curator(
RawOrigin::Signed(caller).into(),
s.parent_bounty_id,
Some(s.child_bounty_id),
)?;
Ok(s)
}
fn create_awarded_child_bounty<T: Config<I>, I: 'static>(
) -> Result<BenchmarkBounty<T, I>, BenchmarkError> {
let s = create_active_child_bounty::<T, I>()?;
let caller = s.child_curator.clone();
let beneficiary_lookup = T::BeneficiaryLookup::unlookup(s.beneficiary.clone());
Bounties::<T, I>::award_bounty(
RawOrigin::Signed(caller).into(),
s.parent_bounty_id,
Some(s.child_bounty_id),
beneficiary_lookup,
)?;
Ok(s)
}
pub fn set_status<T: Config<I>, I: 'static>(
parent_bounty_id: BountyIndex,
child_bounty_id: Option<BountyIndex>,
new_payment_status: PaymentState<PaymentIdOf<T, I>>,
) -> Result<(), BenchmarkError> {
let bounty =
pezpallet_bounties::Pallet::<T, I>::get_bounty_details(parent_bounty_id, child_bounty_id)
.expect("no bounty");
let new_status = match bounty.3 {
BountyStatus::FundingAttempted { curator, .. } =>
BountyStatus::FundingAttempted { payment_status: new_payment_status, curator },
BountyStatus::RefundAttempted { curator, .. } =>
BountyStatus::RefundAttempted { payment_status: new_payment_status, curator },
BountyStatus::PayoutAttempted { curator, beneficiary, .. } =>
BountyStatus::PayoutAttempted {
payment_status: new_payment_status,
curator,
beneficiary,
},
_ => return Err(BenchmarkError::Stop("unexpected bounty status")),
};
let _ = pezpallet_bounties::Pallet::<T, I>::update_bounty_status(
parent_bounty_id,
child_bounty_id,
new_status,
);
Ok(())
}
#[instance_benchmarks]
mod benchmarks {
use super::*;
/// This benchmark is short-circuited if `SpendOrigin` cannot provide
/// a successful origin, in which case `fund_bounty` is un-callable and can use weight=0.
#[benchmark]
fn fund_bounty() -> Result<(), BenchmarkError> {
let s = setup_bounty::<T, I>()?;
let spend_origin =
T::SpendOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;
let curator_lookup = T::Lookup::unlookup(s.curator.clone());
let funding_source_account = Bounties::<T, I>::funding_source_account(s.asset_kind.clone())
.expect("conversion failed");
let parent_bounty_account =
Bounties::<T, I>::bounty_account(s.parent_bounty_id, s.asset_kind.clone())
.expect("conversion failed");
<T as pezpallet_bounties::Config<I>>::Paymaster::ensure_successful(
&funding_source_account,
&parent_bounty_account,
s.asset_kind.clone(),
s.value,
);
#[extrinsic_call]
_(spend_origin, Box::new(s.asset_kind), s.value, curator_lookup, s.metadata);
let parent_bounty_id = BountyCount::<T, I>::get() - 1;
assert_last_event::<T, I>(Event::BountyCreated { index: parent_bounty_id }.into());
let payment_id =
get_payment_id::<T, I>(parent_bounty_id, None).expect("no payment attempt");
assert_has_event::<T, I>(
Event::Paid { index: s.parent_bounty_id, child_index: None, payment_id }.into(),
);
assert_ne!(
<T as pezpallet_bounties::Config<I>>::Paymaster::check_payment(payment_id),
PaymentStatus::Failure
);
Ok(())
}
#[benchmark]
fn fund_child_bounty() -> Result<(), BenchmarkError> {
let s = create_active_parent_bounty::<T, I>()?;
let child_curator_lookup = T::Lookup::unlookup(s.child_curator.clone());
#[extrinsic_call]
_(
RawOrigin::Signed(s.curator),
s.parent_bounty_id,
s.child_value,
Some(child_curator_lookup),
s.metadata,
);
let child_bounty_id =
pezpallet_bounties::TotalChildBountiesPerParent::<T, I>::get(s.parent_bounty_id) - 1;
assert_last_event::<T, I>(
Event::ChildBountyCreated { index: s.parent_bounty_id, child_index: child_bounty_id }
.into(),
);
let payment_id = get_payment_id::<T, I>(s.parent_bounty_id, Some(child_bounty_id))
.expect("no payment attempt");
assert_has_event::<T, I>(
Event::Paid {
index: s.parent_bounty_id,
child_index: Some(child_bounty_id),
payment_id,
}
.into(),
);
assert_ne!(
<T as pezpallet_bounties::Config<I>>::Paymaster::check_payment(payment_id),
PaymentStatus::Failure
);
Ok(())
}
/// This benchmark is short-circuited if `SpendOrigin` cannot provide
/// a successful origin, in which case `propose_curator` is un-callable and can use weight=0.
#[benchmark]
fn propose_curator_parent_bounty() -> Result<(), BenchmarkError> {
let s = create_funded_bounty::<T, I>()?;
let spend_origin =
T::SpendOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;
Bounties::<T, I>::unassign_curator(
RawOrigin::Signed(s.curator.clone()).into(),
s.parent_bounty_id,
None,
)?;
let curator_lookup = T::Lookup::unlookup(s.curator.clone());
#[block]
{
assert_ok!(Bounties::<T, I>::propose_curator(
spend_origin,
s.parent_bounty_id,
None,
curator_lookup,
));
}
assert_last_event::<T, I>(
Event::CuratorProposed {
index: s.parent_bounty_id,
child_index: None,
curator: s.curator,
}
.into(),
);
Ok(())
}
#[benchmark]
fn propose_curator_child_bounty() -> Result<(), BenchmarkError> {
let s = create_funded_child_bounty::<T, I>()?;
let child_curator_lookup = T::Lookup::unlookup(s.child_curator.clone());
Bounties::<T, I>::unassign_curator(
RawOrigin::Signed(s.curator.clone()).into(),
s.parent_bounty_id,
Some(s.child_bounty_id),
)?;
#[block]
{
assert_ok!(Bounties::<T, I>::propose_curator(
RawOrigin::Signed(s.curator).into(),
s.parent_bounty_id,
Some(s.child_bounty_id),
child_curator_lookup,
));
}
assert_last_event::<T, I>(
Event::CuratorProposed {
index: s.parent_bounty_id,
child_index: Some(s.child_bounty_id),
curator: s.child_curator,
}
.into(),
);
Ok(())
}
#[benchmark]
fn accept_curator() -> Result<(), BenchmarkError> {
let s = create_funded_child_bounty::<T, I>()?;
let caller = s.child_curator.clone();
<T as pezpallet_bounties::Config<I>>::Consideration::ensure_successful(&caller, s.child_value);
#[block]
{
assert_ok!(Bounties::<T, I>::accept_curator(
RawOrigin::Signed(caller).into(),
s.parent_bounty_id,
Some(s.child_bounty_id),
));
}
assert_last_event::<T, I>(
Event::BountyBecameActive {
index: s.parent_bounty_id,
child_index: Some(s.child_bounty_id),
curator: s.child_curator,
}
.into(),
);
Ok(())
}
#[benchmark]
fn unassign_curator() -> Result<(), BenchmarkError> {
let s = create_active_child_bounty::<T, I>()?;
#[extrinsic_call]
_(RawOrigin::Signed(s.curator), s.parent_bounty_id, Some(s.child_bounty_id));
assert_last_event::<T, I>(
Event::CuratorUnassigned {
index: s.parent_bounty_id,
child_index: Some(s.child_bounty_id),
}
.into(),
);
Ok(())
}
#[benchmark]
fn award_bounty() -> Result<(), BenchmarkError> {
let s = create_active_child_bounty::<T, I>()?;
let beneficiary_lookup = T::BeneficiaryLookup::unlookup(s.beneficiary.clone());
#[extrinsic_call]
_(
RawOrigin::Signed(s.child_curator),
s.parent_bounty_id,
Some(s.child_bounty_id),
beneficiary_lookup,
);
assert_last_event::<T, I>(
Event::BountyAwarded {
index: s.parent_bounty_id,
child_index: Some(s.child_bounty_id),
beneficiary: s.beneficiary,
}
.into(),
);
Ok(())
}
#[benchmark]
fn close_parent_bounty() -> Result<(), BenchmarkError> {
let s = create_active_parent_bounty::<T, I>()?;
let reject_origin =
T::RejectOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;
#[block]
{
assert_ok!(Bounties::<T, I>::close_bounty(
reject_origin.clone(),
s.parent_bounty_id,
None
));
}
assert_last_event::<T, I>(
Event::BountyCanceled { index: s.parent_bounty_id, child_index: None }.into(),
);
let payment_id =
get_payment_id::<T, I>(s.parent_bounty_id, None).expect("no payment attempt");
assert_has_event::<T, I>(
Event::Paid { index: s.parent_bounty_id, child_index: None, payment_id }.into(),
);
assert_ne!(
<T as pezpallet_bounties::Config<I>>::Paymaster::check_payment(payment_id),
PaymentStatus::Failure
);
assert!(Bounties::<T, I>::close_bounty(reject_origin, s.parent_bounty_id, None).is_err());
Ok(())
}
#[benchmark]
fn close_child_bounty() -> Result<(), BenchmarkError> {
let s = create_active_child_bounty::<T, I>()?;
let reject_origin =
T::RejectOrigin::try_successful_origin().map_err(|_| BenchmarkError::Weightless)?;
#[block]
{
assert_ok!(Bounties::<T, I>::close_bounty(
reject_origin.clone(),
s.parent_bounty_id,
Some(s.child_bounty_id),
));
}
assert_last_event::<T, I>(
Event::BountyCanceled {
index: s.parent_bounty_id,
child_index: Some(s.child_bounty_id),
}
.into(),
);
let payment_id = get_payment_id::<T, I>(s.parent_bounty_id, Some(s.child_bounty_id))
.expect("no payment attempt");
assert_has_event::<T, I>(
Event::Paid {
index: s.parent_bounty_id,
child_index: Some(s.child_bounty_id),
payment_id,
}
.into(),
);
assert_ne!(
<T as pezpallet_bounties::Config<I>>::Paymaster::check_payment(payment_id),
PaymentStatus::Failure
);
assert!(Bounties::<T, I>::close_bounty(
reject_origin,
s.parent_bounty_id,
Some(s.child_bounty_id)
)
.is_err());
Ok(())
}
#[benchmark]
fn check_status_funding() -> Result<(), BenchmarkError> {
let s = create_child_bounty::<T, I>()?;
let caller = s.curator.clone();
let payment_id = get_payment_id::<T, I>(s.parent_bounty_id, Some(s.child_bounty_id))
.expect("no payment attempt");
<T as pezpallet_bounties::Config<I>>::Paymaster::ensure_concluded(payment_id);
#[block]
{
assert_ok!(Bounties::<T, I>::check_status(
RawOrigin::Signed(caller).into(),
s.parent_bounty_id,
Some(s.child_bounty_id),
));
}
assert_last_event::<T, I>(
Event::BountyFundingProcessed {
index: s.parent_bounty_id,
child_index: Some(s.child_bounty_id),
}
.into(),
);
let child_bounty =
pezpallet_bounties::ChildBounties::<T, I>::get(s.parent_bounty_id, s.child_bounty_id)
.expect("no bounty");
assert!(matches!(child_bounty.status, BountyStatus::Funded { .. }));
Ok(())
}
#[benchmark]
fn check_status_refund() -> Result<(), BenchmarkError> {
let s = create_active_child_bounty::<T, I>()?;
let caller = s.curator.clone();
Bounties::<T, I>::close_bounty(
RawOrigin::Signed(caller.clone()).into(),
s.parent_bounty_id,
Some(s.child_bounty_id),
)?;
let payment_id = get_payment_id::<T, I>(s.parent_bounty_id, Some(s.child_bounty_id))
.expect("no payment attempt");
<T as pezpallet_bounties::Config<I>>::Paymaster::ensure_concluded(payment_id);
#[block]
{
assert_ok!(Bounties::<T, I>::check_status(
RawOrigin::Signed(caller).into(),
s.parent_bounty_id,
Some(s.child_bounty_id),
));
}
assert_has_event::<T, I>(
Event::BountyRefundProcessed {
index: s.parent_bounty_id,
child_index: Some(s.child_bounty_id),
}
.into(),
);
assert_eq!(
pezpallet_bounties::ChildBounties::<T, I>::get(s.parent_bounty_id, s.child_bounty_id),
None
);
Ok(())
}
#[benchmark]
fn check_status_payout() -> Result<(), BenchmarkError> {
let s = create_awarded_child_bounty::<T, I>()?;
let caller = s.child_curator.clone();
let payment_id = get_payment_id::<T, I>(s.parent_bounty_id, Some(s.child_bounty_id))
.expect("no payment attempt");
<T as pezpallet_bounties::Config<I>>::Paymaster::ensure_concluded(payment_id);
#[block]
{
assert_ok!(Bounties::<T, I>::check_status(
RawOrigin::Signed(caller).into(),
s.parent_bounty_id,
Some(s.child_bounty_id),
));
}
assert_has_event::<T, I>(
Event::BountyPayoutProcessed {
index: s.parent_bounty_id,
child_index: Some(s.child_bounty_id),
asset_kind: s.asset_kind,
value: s.child_value,
beneficiary: s.beneficiary,
}
.into(),
);
assert_eq!(
pezpallet_bounties::ChildBounties::<T, I>::get(s.parent_bounty_id, s.child_bounty_id),
None
);
Ok(())
}
#[benchmark]
fn retry_payment_funding() -> Result<(), BenchmarkError> {
let s = create_child_bounty::<T, I>()?;
let caller = s.curator.clone();
let payment_id = get_payment_id::<T, I>(s.parent_bounty_id, Some(s.child_bounty_id))
.expect("no payment attempt");
<T as pezpallet_bounties::Config<I>>::Paymaster::ensure_concluded(payment_id);
set_status::<T, I>(s.parent_bounty_id, Some(s.child_bounty_id), PaymentState::Failed)?;
#[block]
{
assert_ok!(Bounties::<T, I>::retry_payment(
RawOrigin::Signed(caller.clone()).into(),
s.parent_bounty_id,
Some(s.child_bounty_id),
));
}
let payment_id = get_payment_id::<T, I>(s.parent_bounty_id, Some(s.child_bounty_id))
.expect("no payment attempt");
assert_last_event::<T, I>(
Event::Paid {
index: s.parent_bounty_id,
child_index: Some(s.child_bounty_id),
payment_id,
}
.into(),
);
assert_ne!(
<T as pallet::Config<I>>::Paymaster::check_payment(payment_id),
PaymentStatus::Failure
);
assert!(Bounties::<T, I>::retry_payment(
RawOrigin::Signed(caller).into(),
s.parent_bounty_id,
Some(s.child_bounty_id),
)
.is_err());
Ok(())
}
#[benchmark]
fn retry_payment_refund() -> Result<(), BenchmarkError> {
let s = create_active_child_bounty::<T, I>()?;
let caller = s.curator.clone();
let new_status = BountyStatus::RefundAttempted {
payment_status: PaymentState::Failed,
curator: Some(s.child_curator),
};
let _ = pezpallet_bounties::Pallet::<T, I>::update_bounty_status(
s.parent_bounty_id,
Some(s.child_bounty_id),
new_status,
);
#[block]
{
assert_ok!(Bounties::<T, I>::retry_payment(
RawOrigin::Signed(caller.clone()).into(),
s.parent_bounty_id,
Some(s.child_bounty_id),
));
}
let payment_id = get_payment_id::<T, I>(s.parent_bounty_id, Some(s.child_bounty_id))
.expect("no payment attempt");
assert_last_event::<T, I>(
Event::Paid {
index: s.parent_bounty_id,
child_index: Some(s.child_bounty_id),
payment_id,
}
.into(),
);
assert_ne!(
<T as pallet::Config<I>>::Paymaster::check_payment(payment_id),
PaymentStatus::Failure
);
assert!(Bounties::<T, I>::retry_payment(
RawOrigin::Signed(caller).into(),
s.parent_bounty_id,
Some(s.child_bounty_id),
)
.is_err());
Ok(())
}
#[benchmark]
fn retry_payment_payout() -> Result<(), BenchmarkError> {
let s = create_active_child_bounty::<T, I>()?;
let caller = s.curator.clone();
let new_status = BountyStatus::PayoutAttempted {
payment_status: PaymentState::Failed,
curator: s.child_curator.clone(),
beneficiary: s.beneficiary.clone(),
};
let _ = pezpallet_bounties::Pallet::<T, I>::update_bounty_status(
s.parent_bounty_id,
Some(s.child_bounty_id),
new_status,
);
#[block]
{
assert_ok!(Bounties::<T, I>::retry_payment(
RawOrigin::Signed(caller.clone()).into(),
s.parent_bounty_id,
Some(s.child_bounty_id),
));
}
let payment_id = get_payment_id::<T, I>(s.parent_bounty_id, Some(s.child_bounty_id))
.expect("no payment attempt");
assert_last_event::<T, I>(
Event::Paid {
index: s.parent_bounty_id,
child_index: Some(s.child_bounty_id),
payment_id,
}
.into(),
);
assert_ne!(
<T as pallet::Config<I>>::Paymaster::check_payment(payment_id),
PaymentStatus::Failure
);
assert!(Bounties::<T, I>::retry_payment(
RawOrigin::Signed(caller).into(),
s.parent_bounty_id,
Some(s.child_bounty_id),
)
.is_err());
Ok(())
}
impl_benchmark_test_suite! {
Pallet,
crate::mock::ExtBuilder::default().build(),
crate::mock::Test
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,569 @@
// This file is part of Bizinikiwi.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//! Bounties pallet tests.
#![cfg(test)]
use crate as pezpallet_bounties;
use crate::{Event as BountiesEvent, *};
use alloc::collections::btree_map::BTreeMap;
use core::cell::RefCell;
use pezframe_support::{
assert_ok, derive_impl, parameter_types,
traits::{
fungible::{HoldConsideration, Mutate},
tokens::UnityAssetBalanceConversion,
ConstU64, Currency,
},
weights::constants::ParityDbWeight,
PalletId,
};
use pezsp_runtime::{
traits::{BlakeTwo256, Convert, Hash, IdentityLookup},
BuildStorage, Perbill,
};
type Block = pezframe_system::mocking::MockBlock<Test>;
thread_local! {
pub static PAID: RefCell<BTreeMap<(u128, u32), u64>> = RefCell::new(BTreeMap::new());
pub static STATUS: RefCell<BTreeMap<u64, PaymentStatus>> = RefCell::new(BTreeMap::new());
pub static LAST_ID: RefCell<u64> = RefCell::new(0u64);
}
pub struct TestBountiesPay;
impl PayWithSource for TestBountiesPay {
type Source = u128;
type Beneficiary = u128;
type Balance = u64;
type Id = u64;
type AssetKind = u32;
type Error = ();
fn pay(
_: &Self::Source,
to: &Self::Beneficiary,
asset_kind: Self::AssetKind,
amount: Self::Balance,
) -> Result<Self::Id, Self::Error> {
PAID.with(|paid| *paid.borrow_mut().entry((*to, asset_kind)).or_default() += amount);
Ok(LAST_ID.with(|lid| {
let x = *lid.borrow();
lid.replace(x + 1);
x
}))
}
fn check_payment(id: Self::Id) -> PaymentStatus {
STATUS.with(|s| s.borrow().get(&id).cloned().unwrap_or(PaymentStatus::InProgress))
}
#[cfg(feature = "runtime-benchmarks")]
fn ensure_successful(
_: &Self::Source,
_: &Self::Beneficiary,
_: Self::AssetKind,
_: Self::Balance,
) {
}
#[cfg(feature = "runtime-benchmarks")]
fn ensure_concluded(id: Self::Id) {
set_status(id, PaymentStatus::Success);
}
}
pezframe_support::construct_runtime!(
pub enum Test
{
System: pezframe_system,
Balances: pezpallet_balances,
Preimage: pezpallet_preimage,
Utility: pezpallet_utility,
Bounties: pezpallet_bounties,
Bounties1: pezpallet_bounties::<Instance1>,
}
);
parameter_types! {
pub const AvailableBlockRatio: Perbill = Perbill::one();
}
type Balance = u64;
#[derive_impl(pezframe_system::config_preludes::TestDefaultConfig)]
impl pezframe_system::Config for Test {
type AccountId = u128; // u64 is not enough to hold bytes used to generate bounty account
type Lookup = IdentityLookup<Self::AccountId>;
type Block = Block;
type AccountData = pezpallet_balances::AccountData<u64>;
type DbWeight = ParityDbWeight;
}
#[derive_impl(pezpallet_balances::config_preludes::TestDefaultConfig)]
impl pezpallet_balances::Config for Test {
type AccountStore = System;
type RuntimeHoldReason = RuntimeHoldReason;
}
impl pezpallet_preimage::Config for Test {
type RuntimeEvent = RuntimeEvent;
type WeightInfo = ();
type Currency = Balances;
type ManagerOrigin = pezframe_system::EnsureRoot<u64>;
type Consideration = ();
}
impl pezpallet_utility::Config for Test {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type PalletsOrigin = OriginCaller;
type WeightInfo = ();
}
parameter_types! {
pub static Burn: Permill = Permill::from_percent(50);
pub const BountyPalletId: PalletId = PalletId(*b"py/mbnty");
pub const BountyPalletId2: PalletId = PalletId(*b"py/mbnt2");
pub static SpendLimit: Balance = u64::MAX;
pub static SpendLimit1: Balance = u64::MAX;
}
pub struct TestSpendOrigin;
impl pezframe_support::traits::EnsureOrigin<RuntimeOrigin> for TestSpendOrigin {
type Success = u64;
fn try_origin(o: RuntimeOrigin) -> Result<Self::Success, RuntimeOrigin> {
Result::<pezframe_system::RawOrigin<_>, RuntimeOrigin>::from(o).and_then(|o| match o {
pezframe_system::RawOrigin::Root => Ok(SpendLimit::get()),
pezframe_system::RawOrigin::Signed(10) => Ok(5),
pezframe_system::RawOrigin::Signed(11) => Ok(10),
pezframe_system::RawOrigin::Signed(12) => Ok(20),
pezframe_system::RawOrigin::Signed(13) => Ok(50),
pezframe_system::RawOrigin::Signed(14) => Ok(500),
r => Err(RuntimeOrigin::from(r)),
})
}
#[cfg(feature = "runtime-benchmarks")]
fn try_successful_origin() -> Result<RuntimeOrigin, ()> {
Ok(pezframe_system::RawOrigin::Root.into())
}
}
parameter_types! {
// This will be 50% of the bounty value.
pub const CuratorDepositMultiplier: Permill = Permill::from_percent(50);
pub const CuratorDepositMin: Balance = 3;
pub const CuratorDepositMax: Balance = 1_000;
pub const CuratorDepositHoldReason: RuntimeHoldReason = RuntimeHoldReason::Bounties(pezpallet_bounties::HoldReason::CuratorDeposit);
pub static MaxActiveChildBountyCount: u32 = 3;
}
impl Config for Test {
type Balance = <Self as pezpallet_balances::Config>::Balance;
type RejectOrigin = pezframe_system::EnsureRoot<u128>;
type SpendOrigin = TestSpendOrigin;
type AssetKind = u32;
type Beneficiary = u128;
type BeneficiaryLookup = IdentityLookup<Self::Beneficiary>;
type BountyValueMinimum = ConstU64<2>;
type ChildBountyValueMinimum = ConstU64<1>;
type MaxActiveChildBountyCount = MaxActiveChildBountyCount;
type WeightInfo = ();
type FundingSource = PalletIdAsFundingSource<BountyPalletId, Test, ()>;
type BountySource = BountySourceAccount<BountyPalletId, Test, ()>;
type ChildBountySource = ChildBountySourceAccount<BountyPalletId, Test, ()>;
type Paymaster = TestBountiesPay;
type BalanceConverter = UnityAssetBalanceConversion;
type Preimages = Preimage;
type Consideration = HoldConsideration<
Self::AccountId,
Balances,
CuratorDepositHoldReason,
CuratorDepositAmount<
CuratorDepositMultiplier,
CuratorDepositMin,
CuratorDepositMax,
Balance,
>,
Balance,
>;
#[cfg(feature = "runtime-benchmarks")]
type BenchmarkHelper = ();
}
type CuratorDeposit =
CuratorDepositAmount<CuratorDepositMultiplier, CuratorDepositMin, CuratorDepositMax, Balance>;
impl Config<Instance1> for Test {
type Balance = <Self as pezpallet_balances::Config>::Balance;
type RejectOrigin = pezframe_system::EnsureRoot<u128>;
type SpendOrigin = TestSpendOrigin;
type AssetKind = u32;
type Beneficiary = u128;
type BeneficiaryLookup = IdentityLookup<Self::Beneficiary>;
type BountyValueMinimum = ConstU64<2>;
type ChildBountyValueMinimum = ConstU64<1>;
type MaxActiveChildBountyCount = MaxActiveChildBountyCount;
type WeightInfo = ();
type FundingSource = PalletIdAsFundingSource<BountyPalletId2, Test, Instance1>;
type BountySource = BountySourceAccount<BountyPalletId2, Test, Instance1>;
type ChildBountySource = ChildBountySourceAccount<BountyPalletId2, Test, Instance1>;
type Paymaster = TestBountiesPay;
type BalanceConverter = UnityAssetBalanceConversion;
type Preimages = Preimage;
type Consideration = HoldConsideration<
Self::AccountId,
Balances,
CuratorDepositHoldReason,
CuratorDeposit,
Balance,
>;
#[cfg(feature = "runtime-benchmarks")]
type BenchmarkHelper = ();
}
pub struct ExtBuilder {}
impl Default for ExtBuilder {
fn default() -> Self {
Self {}
}
}
impl ExtBuilder {
pub fn build(self) -> pezsp_io::TestExternalities {
let mut ext: pezsp_io::TestExternalities = RuntimeGenesisConfig {
system: pezframe_system::GenesisConfig::default(),
balances: pezpallet_balances::GenesisConfig {
balances: vec![(0, 100), (1, 98), (2, 1)],
..Default::default()
},
}
.build_storage()
.unwrap()
.into();
ext.execute_with(|| {
pezframe_system::Pallet::<Test>::set_block_number(1);
});
ext
}
pub fn build_and_execute(self, test: impl FnOnce() -> ()) {
self.build().execute_with(|| {
test();
Bounties::do_try_state().expect("All invariants must hold after a test");
Bounties1::do_try_state().expect("All invariants must hold after a test");
})
}
}
/// paid balance for a given account and asset ids
pub fn paid(who: u128, asset_id: u32) -> u64 {
PAID.with(|p| p.borrow().get(&(who, asset_id)).cloned().unwrap_or(0))
}
/// reduce paid balance for a given account and asset ids
pub fn unpay(who: u128, asset_id: u32, amount: u64) {
PAID.with(|p| p.borrow_mut().entry((who, asset_id)).or_default().saturating_reduce(amount))
}
/// set status for a given payment id
pub fn set_status(id: u64, s: PaymentStatus) {
STATUS.with(|m| m.borrow_mut().insert(id, s));
}
pub fn last_events(n: usize) -> Vec<BountiesEvent<Test>> {
let mut res = System::events()
.into_iter()
.rev()
.filter_map(
|e| if let RuntimeEvent::Bounties(inner) = e.event { Some(inner) } else { None },
)
.take(n)
.collect::<Vec<_>>();
res.reverse();
res
}
pub fn last_event() -> BountiesEvent<Test> {
last_events(1).into_iter().next().unwrap()
}
pub fn expect_events(e: Vec<BountiesEvent<Test>>) {
assert_eq!(last_events(e.len()), e);
}
/// note a new preimage without registering.
pub fn note_preimage(who: u128) -> <Test as pezframe_system::Config>::Hash {
use std::sync::atomic::{AtomicU8, Ordering};
// note a new preimage on every function invoke.
static COUNTER: AtomicU8 = AtomicU8::new(0);
let data = vec![COUNTER.fetch_add(1, Ordering::Relaxed)];
assert_ok!(Preimage::note_preimage(RuntimeOrigin::signed(who), data.clone()));
let hash = BlakeTwo256::hash(&data);
assert!(!Preimage::is_requested(&hash));
hash
}
/// create consideration for comparison in tests
pub fn consideration(amount: u64) -> <Test as Config>::Consideration {
<Test as Config>::Consideration::new(&0, amount).unwrap()
}
pub fn get_payment_id(
parent_bounty_id: BountyIndex,
child_bounty_id: Option<BountyIndex>,
) -> Option<u64> {
let bounty =
pezpallet_bounties::Pallet::<Test>::get_bounty_details(parent_bounty_id, child_bounty_id)
.expect("no bounty");
match bounty.3 {
BountyStatus::FundingAttempted {
payment_status: PaymentState::Attempted { id }, ..
} => Some(id),
BountyStatus::RefundAttempted {
payment_status: PaymentState::Attempted { id }, ..
} => Some(id),
BountyStatus::PayoutAttempted {
payment_status: PaymentState::Attempted { id }, ..
} => Some(id),
_ => None,
}
}
pub fn approve_payment(
dest: u128,
parent_bounty_id: BountyIndex,
child_bounty_id: Option<BountyIndex>,
asset_kind: u32,
amount: u64,
) {
assert_eq!(paid(dest, asset_kind), amount);
let payment_id = get_payment_id(parent_bounty_id, child_bounty_id).expect("no payment attempt");
set_status(payment_id, PaymentStatus::Success);
assert_ok!(Bounties::check_status(RuntimeOrigin::signed(0), parent_bounty_id, child_bounty_id));
}
pub fn reject_payment(
dest: u128,
parent_bounty_id: BountyIndex,
child_bounty_id: Option<BountyIndex>,
asset_kind: u32,
amount: u64,
) {
unpay(dest, asset_kind, amount);
let payment_id = get_payment_id(parent_bounty_id, child_bounty_id).expect("no payment attempt");
set_status(payment_id, PaymentStatus::Failure);
assert_ok!(Bounties::check_status(RuntimeOrigin::signed(0), parent_bounty_id, child_bounty_id));
}
#[derive(Clone)]
pub struct TestBounty {
pub parent_bounty_id: BountyIndex,
pub child_bounty_id: BountyIndex,
pub asset_kind: u32,
pub value: u64,
pub child_value: u64,
pub curator: u128,
pub curator_deposit: u64,
pub child_curator: u128,
pub child_curator_deposit: u64,
pub beneficiary: u128,
pub child_beneficiary: u128,
pub metadata: <Test as pezframe_system::Config>::Hash,
}
pub fn setup_bounty() -> TestBounty {
let asset_kind = 1;
let value = 50;
let child_value = 10;
let curator = 4;
let child_curator = 8;
let beneficiary = 5;
let child_beneficiary = 9;
let expected_deposit = CuratorDeposit::convert(value);
let child_expected_deposit = CuratorDeposit::convert(child_value);
let metadata = note_preimage(1);
Balances::set_balance(&curator, Balances::minimum_balance() + expected_deposit);
Balances::set_balance(&child_curator, Balances::minimum_balance() + child_expected_deposit);
TestBounty {
parent_bounty_id: 0,
child_bounty_id: 0,
asset_kind,
value,
child_value,
curator,
curator_deposit: expected_deposit,
child_curator,
child_curator_deposit: child_expected_deposit,
beneficiary,
child_beneficiary,
metadata,
}
}
pub fn create_parent_bounty() -> TestBounty {
let mut s = setup_bounty();
assert_ok!(Bounties::fund_bounty(
RuntimeOrigin::root(),
Box::new(s.asset_kind),
s.value,
s.curator,
s.metadata
));
let parent_bounty_id = pezpallet_bounties::BountyCount::<Test>::get() - 1;
s.parent_bounty_id = parent_bounty_id;
s
}
pub fn create_funded_parent_bounty() -> TestBounty {
let s = create_parent_bounty();
let parent_bounty_account =
Bounties::bounty_account(s.parent_bounty_id, s.asset_kind).expect("conversion failed");
approve_payment(parent_bounty_account, s.parent_bounty_id, None, s.asset_kind, s.value);
s
}
pub fn create_active_parent_bounty() -> TestBounty {
let s = create_funded_parent_bounty();
assert_ok!(Bounties::accept_curator(
RuntimeOrigin::signed(s.curator),
s.parent_bounty_id,
None,
));
s
}
pub fn create_parent_bounty_with_unassigned_curator() -> TestBounty {
let s = create_funded_parent_bounty();
assert_ok!(Bounties::unassign_curator(
RuntimeOrigin::signed(s.curator),
s.parent_bounty_id,
None,
));
s
}
pub fn create_awarded_parent_bounty() -> TestBounty {
let s = create_active_parent_bounty();
assert_ok!(Bounties::award_bounty(
RuntimeOrigin::signed(s.curator),
s.parent_bounty_id,
None,
s.beneficiary,
));
s
}
pub fn create_canceled_parent_bounty() -> TestBounty {
let s = create_active_parent_bounty();
assert_ok!(Bounties::close_bounty(RuntimeOrigin::root(), s.parent_bounty_id, None,));
s
}
pub fn create_child_bounty_with_curator() -> TestBounty {
let mut s = create_active_parent_bounty();
assert_ok!(Bounties::fund_child_bounty(
RuntimeOrigin::signed(s.curator),
s.parent_bounty_id,
s.child_value,
Some(s.child_curator),
s.metadata
));
s.child_bounty_id =
pezpallet_bounties::TotalChildBountiesPerParent::<Test>::get(s.parent_bounty_id) - 1;
s
}
pub fn create_funded_child_bounty() -> TestBounty {
let s = create_child_bounty_with_curator();
let child_bounty_account =
Bounties::child_bounty_account(s.parent_bounty_id, s.child_bounty_id, s.asset_kind)
.expect("conversion failed");
approve_payment(
child_bounty_account,
s.parent_bounty_id,
Some(s.child_bounty_id),
s.asset_kind,
s.child_value,
);
s
}
pub fn create_child_bounty_with_unassigned_curator() -> TestBounty {
let s = create_funded_child_bounty();
assert_ok!(Bounties::unassign_curator(
RuntimeOrigin::signed(s.curator),
s.parent_bounty_id,
Some(s.child_bounty_id),
));
s
}
pub fn create_active_child_bounty() -> TestBounty {
let s = create_funded_child_bounty();
assert_ok!(Bounties::accept_curator(
RuntimeOrigin::signed(s.child_curator),
s.parent_bounty_id,
Some(s.child_bounty_id)
));
s
}
pub fn create_canceled_child_bounty() -> TestBounty {
let s = create_active_child_bounty();
assert_ok!(Bounties::close_bounty(
RuntimeOrigin::signed(s.curator),
s.parent_bounty_id,
Some(s.child_bounty_id),
));
s
}
pub fn create_awarded_child_bounty() -> TestBounty {
let s = create_active_child_bounty();
assert_ok!(Bounties::award_bounty(
RuntimeOrigin::signed(s.child_curator),
s.parent_bounty_id,
Some(s.child_bounty_id),
s.child_beneficiary
));
s
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,700 @@
// This file is part of Bizinikiwi.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// This file is part of Bizinikiwi.
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//! Autogenerated weights for `pezpallet_multi_asset_bounties`
//!
//! THIS FILE WAS AUTO-GENERATED USING THE BIZINIKIWI BENCHMARK CLI VERSION 32.0.0
//! DATE: 2025-09-17, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]`
//! WORST CASE MAP SIZE: `1000000`
//! HOSTNAME: `550243634b2d`, CPU: `Intel(R) Xeon(R) CPU @ 2.60GHz`
//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024`
// Executed Command:
// frame-omni-bencher
// v1
// benchmark
// pallet
// --extrinsic=*
// --runtime=target/production/wbuild/kitchensink-runtime/kitchensink_runtime.wasm
// --pallet=pezpallet_multi_asset_bounties
// --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2
// --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/multi-asset-bounties/src/weights.rs
// --wasm-execution=compiled
// --steps=50
// --repeat=20
// --heap-pages=4096
// --template=bizinikiwi/.maintain/frame-weight-template.hbs
// --no-storage-info
// --no-min-squares
// --no-median-slopes
// --exclude-pallets=pezpallet_xcm,pezpallet_xcm_benchmarks::fungible,pezpallet_xcm_benchmarks::generic,pezpallet_nomination_pools,pezpallet_remark,pezpallet_transaction_storage
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(missing_docs)]
#![allow(dead_code)]
use pezframe_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}};
use core::marker::PhantomData;
/// Weight functions needed for `pezpallet_multi_asset_bounties`.
pub trait WeightInfo {
fn fund_bounty() -> Weight;
fn fund_child_bounty() -> Weight;
fn propose_curator_parent_bounty() -> Weight;
fn propose_curator_child_bounty() -> Weight;
fn accept_curator() -> Weight;
fn unassign_curator() -> Weight;
fn award_bounty() -> Weight;
fn close_parent_bounty() -> Weight;
fn close_child_bounty() -> Weight;
fn check_status_funding() -> Weight;
fn check_status_refund() -> Weight;
fn check_status_payout() -> Weight;
fn retry_payment_funding() -> Weight;
fn retry_payment_refund() -> Weight;
fn retry_payment_payout() -> Weight;
}
/// Weights for `pezpallet_multi_asset_bounties` using the Bizinikiwi node and recommended hardware.
pub struct BizinikiwiWeight<T>(PhantomData<T>);
impl<T: pezframe_system::Config> WeightInfo for BizinikiwiWeight<T> {
/// Storage: `Preimage::StatusFor` (r:1 w:0)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `AssetRate::ConversionRateToNative` (r:1 w:0)
/// Proof: `AssetRate::ConversionRateToNative` (`max_values`: None, `max_size`: Some(37), added: 2512, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::BountyCount` (r:1 w:1)
/// Proof: `MultiAssetBounties::BountyCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `Assets::Account` (r:2 w:2)
/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::Bounties` (r:0 w:1)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
fn fund_bounty() -> Weight {
// Proof Size summary in bytes:
// Measured: `817`
// Estimated: `6208`
// Minimum execution time: 81_027_000 picoseconds.
Weight::from_parts(83_204_000, 6208)
.saturating_add(T::DbWeight::get().reads(8_u64))
.saturating_add(T::DbWeight::get().writes(7_u64))
}
/// Storage: `Preimage::StatusFor` (r:1 w:0)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:0)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `AssetRate::ConversionRateToNative` (r:1 w:0)
/// Proof: `AssetRate::ConversionRateToNative` (`max_values`: None, `max_size`: Some(37), added: 2512, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBountiesPerParent` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBountiesPerParent` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBountiesValuePerParent` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBountiesValuePerParent` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::TotalChildBountiesPerParent` (r:1 w:1)
/// Proof: `MultiAssetBounties::TotalChildBountiesPerParent` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `Assets::Account` (r:2 w:2)
/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBounties` (r:0 w:1)
/// Proof: `MultiAssetBounties::ChildBounties` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`)
fn fund_child_bounty() -> Weight {
// Proof Size summary in bytes:
// Measured: `960`
// Estimated: `6208`
// Minimum execution time: 96_619_000 picoseconds.
Weight::from_parts(97_686_000, 6208)
.saturating_add(T::DbWeight::get().reads(11_u64))
.saturating_add(T::DbWeight::get().writes(9_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `AssetRate::ConversionRateToNative` (r:1 w:0)
/// Proof: `AssetRate::ConversionRateToNative` (`max_values`: None, `max_size`: Some(37), added: 2512, mode: `MaxEncodedLen`)
fn propose_curator_parent_bounty() -> Weight {
// Proof Size summary in bytes:
// Measured: `400`
// Estimated: `3596`
// Minimum execution time: 23_638_000 picoseconds.
Weight::from_parts(24_633_000, 3596)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:0)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBounties` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`)
fn propose_curator_child_bounty() -> Weight {
// Proof Size summary in bytes:
// Measured: `531`
// Estimated: `3607`
// Minimum execution time: 24_830_000 picoseconds.
Weight::from_parts(25_766_000, 3607)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:0)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBounties` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`)
/// Storage: `AssetRate::ConversionRateToNative` (r:1 w:0)
/// Proof: `AssetRate::ConversionRateToNative` (`max_values`: None, `max_size`: Some(37), added: 2512, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `Balances::Holds` (r:1 w:1)
/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(463), added: 2938, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::CuratorDeposit` (r:0 w:1)
/// Proof: `MultiAssetBounties::CuratorDeposit` (`max_values`: None, `max_size`: Some(41), added: 2516, mode: `MaxEncodedLen`)
fn accept_curator() -> Weight {
// Proof Size summary in bytes:
// Measured: `930`
// Estimated: `3928`
// Minimum execution time: 75_920_000 picoseconds.
Weight::from_parts(78_025_000, 3928)
.saturating_add(T::DbWeight::get().reads(5_u64))
.saturating_add(T::DbWeight::get().writes(4_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:0)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBounties` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::CuratorDeposit` (r:1 w:1)
/// Proof: `MultiAssetBounties::CuratorDeposit` (`max_values`: None, `max_size`: Some(41), added: 2516, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `Balances::Holds` (r:1 w:1)
/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(463), added: 2938, mode: `MaxEncodedLen`)
fn unassign_curator() -> Weight {
// Proof Size summary in bytes:
// Measured: `892`
// Estimated: `3928`
// Minimum execution time: 59_334_000 picoseconds.
Weight::from_parts(61_590_000, 3928)
.saturating_add(T::DbWeight::get().reads(5_u64))
.saturating_add(T::DbWeight::get().writes(4_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:0)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBounties` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `Assets::Account` (r:2 w:2)
/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:2 w:2)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn award_bounty() -> Weight {
// Proof Size summary in bytes:
// Measured: `1146`
// Estimated: `6208`
// Minimum execution time: 81_389_000 picoseconds.
Weight::from_parts(83_103_000, 6208)
.saturating_add(T::DbWeight::get().reads(7_u64))
.saturating_add(T::DbWeight::get().writes(6_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBountiesPerParent` (r:1 w:0)
/// Proof: `MultiAssetBounties::ChildBountiesPerParent` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `Assets::Account` (r:2 w:2)
/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn close_parent_bounty() -> Weight {
// Proof Size summary in bytes:
// Measured: `890`
// Estimated: `6208`
// Minimum execution time: 72_586_000 picoseconds.
Weight::from_parts(74_588_000, 6208)
.saturating_add(T::DbWeight::get().reads(6_u64))
.saturating_add(T::DbWeight::get().writes(5_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:0)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBounties` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `Assets::Account` (r:2 w:2)
/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn close_child_bounty() -> Weight {
// Proof Size summary in bytes:
// Measured: `1132`
// Estimated: `6208`
// Minimum execution time: 76_465_000 picoseconds.
Weight::from_parts(79_003_000, 6208)
.saturating_add(T::DbWeight::get().reads(6_u64))
.saturating_add(T::DbWeight::get().writes(5_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:0)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBounties` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`)
fn check_status_funding() -> Weight {
// Proof Size summary in bytes:
// Measured: `565`
// Estimated: `3607`
// Minimum execution time: 24_720_000 picoseconds.
Weight::from_parts(25_430_000, 3607)
.saturating_add(T::DbWeight::get().reads(2_u64))
.saturating_add(T::DbWeight::get().writes(1_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:0)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBounties` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::CuratorDeposit` (r:1 w:1)
/// Proof: `MultiAssetBounties::CuratorDeposit` (`max_values`: None, `max_size`: Some(41), added: 2516, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `Balances::Holds` (r:1 w:1)
/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(463), added: 2938, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBountiesValuePerParent` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBountiesValuePerParent` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBountiesPerParent` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBountiesPerParent` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `MaxEncodedLen`)
/// Storage: `Preimage::StatusFor` (r:1 w:0)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
fn check_status_refund() -> Weight {
// Proof Size summary in bytes:
// Measured: `1018`
// Estimated: `3928`
// Minimum execution time: 80_848_000 picoseconds.
Weight::from_parts(82_600_000, 3928)
.saturating_add(T::DbWeight::get().reads(9_u64))
.saturating_add(T::DbWeight::get().writes(7_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:0)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBounties` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::CuratorDeposit` (r:1 w:1)
/// Proof: `MultiAssetBounties::CuratorDeposit` (`max_values`: None, `max_size`: Some(41), added: 2516, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `Balances::Holds` (r:1 w:1)
/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(463), added: 2938, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBountiesPerParent` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBountiesPerParent` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `MaxEncodedLen`)
/// Storage: `Preimage::StatusFor` (r:1 w:0)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
fn check_status_payout() -> Weight {
// Proof Size summary in bytes:
// Measured: `1034`
// Estimated: `3928`
// Minimum execution time: 77_905_000 picoseconds.
Weight::from_parts(81_722_000, 3928)
.saturating_add(T::DbWeight::get().reads(8_u64))
.saturating_add(T::DbWeight::get().writes(6_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:0)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBounties` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `Assets::Account` (r:2 w:2)
/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn retry_payment_funding() -> Weight {
// Proof Size summary in bytes:
// Measured: `1204`
// Estimated: `6208`
// Minimum execution time: 74_731_000 picoseconds.
Weight::from_parts(77_503_000, 6208)
.saturating_add(T::DbWeight::get().reads(6_u64))
.saturating_add(T::DbWeight::get().writes(5_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:0)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBounties` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `Assets::Account` (r:2 w:2)
/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn retry_payment_refund() -> Weight {
// Proof Size summary in bytes:
// Measured: `1134`
// Estimated: `6208`
// Minimum execution time: 75_014_000 picoseconds.
Weight::from_parts(77_215_000, 6208)
.saturating_add(T::DbWeight::get().reads(6_u64))
.saturating_add(T::DbWeight::get().writes(5_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:0)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBounties` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `Assets::Account` (r:2 w:2)
/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:2 w:2)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn retry_payment_payout() -> Weight {
// Proof Size summary in bytes:
// Measured: `1179`
// Estimated: `6208`
// Minimum execution time: 79_478_000 picoseconds.
Weight::from_parts(81_758_000, 6208)
.saturating_add(T::DbWeight::get().reads(7_u64))
.saturating_add(T::DbWeight::get().writes(6_u64))
}
}
// For backwards compatibility and tests.
impl WeightInfo for () {
/// Storage: `Preimage::StatusFor` (r:1 w:0)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `AssetRate::ConversionRateToNative` (r:1 w:0)
/// Proof: `AssetRate::ConversionRateToNative` (`max_values`: None, `max_size`: Some(37), added: 2512, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::BountyCount` (r:1 w:1)
/// Proof: `MultiAssetBounties::BountyCount` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `Assets::Account` (r:2 w:2)
/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::Bounties` (r:0 w:1)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
fn fund_bounty() -> Weight {
// Proof Size summary in bytes:
// Measured: `817`
// Estimated: `6208`
// Minimum execution time: 81_027_000 picoseconds.
Weight::from_parts(83_204_000, 6208)
.saturating_add(RocksDbWeight::get().reads(8_u64))
.saturating_add(RocksDbWeight::get().writes(7_u64))
}
/// Storage: `Preimage::StatusFor` (r:1 w:0)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:0)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `AssetRate::ConversionRateToNative` (r:1 w:0)
/// Proof: `AssetRate::ConversionRateToNative` (`max_values`: None, `max_size`: Some(37), added: 2512, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBountiesPerParent` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBountiesPerParent` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBountiesValuePerParent` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBountiesValuePerParent` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::TotalChildBountiesPerParent` (r:1 w:1)
/// Proof: `MultiAssetBounties::TotalChildBountiesPerParent` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `Assets::Account` (r:2 w:2)
/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBounties` (r:0 w:1)
/// Proof: `MultiAssetBounties::ChildBounties` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`)
fn fund_child_bounty() -> Weight {
// Proof Size summary in bytes:
// Measured: `960`
// Estimated: `6208`
// Minimum execution time: 96_619_000 picoseconds.
Weight::from_parts(97_686_000, 6208)
.saturating_add(RocksDbWeight::get().reads(11_u64))
.saturating_add(RocksDbWeight::get().writes(9_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `AssetRate::ConversionRateToNative` (r:1 w:0)
/// Proof: `AssetRate::ConversionRateToNative` (`max_values`: None, `max_size`: Some(37), added: 2512, mode: `MaxEncodedLen`)
fn propose_curator_parent_bounty() -> Weight {
// Proof Size summary in bytes:
// Measured: `400`
// Estimated: `3596`
// Minimum execution time: 23_638_000 picoseconds.
Weight::from_parts(24_633_000, 3596)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:0)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBounties` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`)
fn propose_curator_child_bounty() -> Weight {
// Proof Size summary in bytes:
// Measured: `531`
// Estimated: `3607`
// Minimum execution time: 24_830_000 picoseconds.
Weight::from_parts(25_766_000, 3607)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:0)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBounties` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`)
/// Storage: `AssetRate::ConversionRateToNative` (r:1 w:0)
/// Proof: `AssetRate::ConversionRateToNative` (`max_values`: None, `max_size`: Some(37), added: 2512, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `Balances::Holds` (r:1 w:1)
/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(463), added: 2938, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::CuratorDeposit` (r:0 w:1)
/// Proof: `MultiAssetBounties::CuratorDeposit` (`max_values`: None, `max_size`: Some(41), added: 2516, mode: `MaxEncodedLen`)
fn accept_curator() -> Weight {
// Proof Size summary in bytes:
// Measured: `930`
// Estimated: `3928`
// Minimum execution time: 75_920_000 picoseconds.
Weight::from_parts(78_025_000, 3928)
.saturating_add(RocksDbWeight::get().reads(5_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:0)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBounties` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::CuratorDeposit` (r:1 w:1)
/// Proof: `MultiAssetBounties::CuratorDeposit` (`max_values`: None, `max_size`: Some(41), added: 2516, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `Balances::Holds` (r:1 w:1)
/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(463), added: 2938, mode: `MaxEncodedLen`)
fn unassign_curator() -> Weight {
// Proof Size summary in bytes:
// Measured: `892`
// Estimated: `3928`
// Minimum execution time: 59_334_000 picoseconds.
Weight::from_parts(61_590_000, 3928)
.saturating_add(RocksDbWeight::get().reads(5_u64))
.saturating_add(RocksDbWeight::get().writes(4_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:0)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBounties` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `Assets::Account` (r:2 w:2)
/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:2 w:2)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn award_bounty() -> Weight {
// Proof Size summary in bytes:
// Measured: `1146`
// Estimated: `6208`
// Minimum execution time: 81_389_000 picoseconds.
Weight::from_parts(83_103_000, 6208)
.saturating_add(RocksDbWeight::get().reads(7_u64))
.saturating_add(RocksDbWeight::get().writes(6_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBountiesPerParent` (r:1 w:0)
/// Proof: `MultiAssetBounties::ChildBountiesPerParent` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `Assets::Account` (r:2 w:2)
/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn close_parent_bounty() -> Weight {
// Proof Size summary in bytes:
// Measured: `890`
// Estimated: `6208`
// Minimum execution time: 72_586_000 picoseconds.
Weight::from_parts(74_588_000, 6208)
.saturating_add(RocksDbWeight::get().reads(6_u64))
.saturating_add(RocksDbWeight::get().writes(5_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:0)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBounties` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `Assets::Account` (r:2 w:2)
/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn close_child_bounty() -> Weight {
// Proof Size summary in bytes:
// Measured: `1132`
// Estimated: `6208`
// Minimum execution time: 76_465_000 picoseconds.
Weight::from_parts(79_003_000, 6208)
.saturating_add(RocksDbWeight::get().reads(6_u64))
.saturating_add(RocksDbWeight::get().writes(5_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:0)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBounties` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`)
fn check_status_funding() -> Weight {
// Proof Size summary in bytes:
// Measured: `565`
// Estimated: `3607`
// Minimum execution time: 24_720_000 picoseconds.
Weight::from_parts(25_430_000, 3607)
.saturating_add(RocksDbWeight::get().reads(2_u64))
.saturating_add(RocksDbWeight::get().writes(1_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:0)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBounties` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::CuratorDeposit` (r:1 w:1)
/// Proof: `MultiAssetBounties::CuratorDeposit` (`max_values`: None, `max_size`: Some(41), added: 2516, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `Balances::Holds` (r:1 w:1)
/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(463), added: 2938, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBountiesValuePerParent` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBountiesValuePerParent` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBountiesPerParent` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBountiesPerParent` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `MaxEncodedLen`)
/// Storage: `Preimage::StatusFor` (r:1 w:0)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
fn check_status_refund() -> Weight {
// Proof Size summary in bytes:
// Measured: `1018`
// Estimated: `3928`
// Minimum execution time: 80_848_000 picoseconds.
Weight::from_parts(82_600_000, 3928)
.saturating_add(RocksDbWeight::get().reads(9_u64))
.saturating_add(RocksDbWeight::get().writes(7_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:0)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBounties` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::CuratorDeposit` (r:1 w:1)
/// Proof: `MultiAssetBounties::CuratorDeposit` (`max_values`: None, `max_size`: Some(41), added: 2516, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
/// Storage: `Balances::Holds` (r:1 w:1)
/// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(463), added: 2938, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBountiesPerParent` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBountiesPerParent` (`max_values`: None, `max_size`: Some(16), added: 2491, mode: `MaxEncodedLen`)
/// Storage: `Preimage::StatusFor` (r:1 w:0)
/// Proof: `Preimage::StatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
/// Storage: `Preimage::RequestStatusFor` (r:1 w:1)
/// Proof: `Preimage::RequestStatusFor` (`max_values`: None, `max_size`: Some(91), added: 2566, mode: `MaxEncodedLen`)
fn check_status_payout() -> Weight {
// Proof Size summary in bytes:
// Measured: `1034`
// Estimated: `3928`
// Minimum execution time: 77_905_000 picoseconds.
Weight::from_parts(81_722_000, 3928)
.saturating_add(RocksDbWeight::get().reads(8_u64))
.saturating_add(RocksDbWeight::get().writes(6_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:0)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBounties` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `Assets::Account` (r:2 w:2)
/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn retry_payment_funding() -> Weight {
// Proof Size summary in bytes:
// Measured: `1204`
// Estimated: `6208`
// Minimum execution time: 74_731_000 picoseconds.
Weight::from_parts(77_503_000, 6208)
.saturating_add(RocksDbWeight::get().reads(6_u64))
.saturating_add(RocksDbWeight::get().writes(5_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:0)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBounties` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `Assets::Account` (r:2 w:2)
/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:1 w:1)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn retry_payment_refund() -> Weight {
// Proof Size summary in bytes:
// Measured: `1134`
// Estimated: `6208`
// Minimum execution time: 75_014_000 picoseconds.
Weight::from_parts(77_215_000, 6208)
.saturating_add(RocksDbWeight::get().reads(6_u64))
.saturating_add(RocksDbWeight::get().writes(5_u64))
}
/// Storage: `MultiAssetBounties::Bounties` (r:1 w:0)
/// Proof: `MultiAssetBounties::Bounties` (`max_values`: None, `max_size`: Some(131), added: 2606, mode: `MaxEncodedLen`)
/// Storage: `MultiAssetBounties::ChildBounties` (r:1 w:1)
/// Proof: `MultiAssetBounties::ChildBounties` (`max_values`: None, `max_size`: Some(142), added: 2617, mode: `MaxEncodedLen`)
/// Storage: `Assets::Asset` (r:1 w:1)
/// Proof: `Assets::Asset` (`max_values`: None, `max_size`: Some(210), added: 2685, mode: `MaxEncodedLen`)
/// Storage: `Assets::Account` (r:2 w:2)
/// Proof: `Assets::Account` (`max_values`: None, `max_size`: Some(134), added: 2609, mode: `MaxEncodedLen`)
/// Storage: `System::Account` (r:2 w:2)
/// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`)
fn retry_payment_payout() -> Weight {
// Proof Size summary in bytes:
// Measured: `1179`
// Estimated: `6208`
// Minimum execution time: 79_478_000 picoseconds.
Weight::from_parts(81_758_000, 6208)
.saturating_add(RocksDbWeight::get().reads(7_u64))
.saturating_add(RocksDbWeight::get().writes(6_u64))
}
}