37 lines
1.0 KiB
Rust
37 lines
1.0 KiB
Rust
use frame_support::traits::tokens::{Pay, PaymentStatus};
|
|
use pallet_treasury::ArgumentsFactory;
|
|
use primitives::{AccountId, Balance};
|
|
use sp_core::crypto::FromEntropy;
|
|
|
|
pub struct BenchmarkTreasuryHelper;
|
|
impl ArgumentsFactory<(), AccountId> for BenchmarkTreasuryHelper {
|
|
fn create_asset_kind(_seed: u32) -> () {
|
|
()
|
|
}
|
|
fn create_beneficiary(seed: [u8; 32]) -> AccountId {
|
|
AccountId::from_entropy(&mut seed.as_slice()).unwrap()
|
|
}
|
|
}
|
|
|
|
pub struct BenchmarkTreasuryPaymaster;
|
|
impl Pay for BenchmarkTreasuryPaymaster {
|
|
type Beneficiary = AccountId;
|
|
type Balance = Balance;
|
|
type Id = ();
|
|
type AssetKind = ();
|
|
type Error = ();
|
|
|
|
fn pay(
|
|
_: &Self::Beneficiary,
|
|
_: Self::AssetKind,
|
|
_: Self::Balance,
|
|
) -> Result<Self::Id, Self::Error> {
|
|
Ok(())
|
|
}
|
|
fn check_payment(_: Self::Id) -> PaymentStatus {
|
|
PaymentStatus::Success
|
|
}
|
|
fn ensure_successful(_: &Self::Beneficiary, _: Self::AssetKind, _: Self::Balance) {}
|
|
fn ensure_concluded(_: Self::Id) {}
|
|
}
|