Benchmarks for new relayers pallet calls (#2040)

* slash relayer balance for invalid transactions

* require some gap before unstake is possible

* more clippy

* log priority boost

* add issue ref to TODO

* fix typo

* is_message_delivery_call -> is_receive_messages_proof_call

* moved is_receive_messages_proof_call above

* only slash relayers for priority transactions

* benchmarks for new relayers pallet calls

* generated weights

* regenerated weights afer master merge

* actually use weights
This commit is contained in:
Svyatoslav Nikolsky
2023-04-27 13:18:20 +03:00
committed by Bastian Köcher
parent f7cc060d9b
commit 1f738f1389
5 changed files with 147 additions and 23 deletions
+6 -3
View File
@@ -118,13 +118,16 @@ impl pallet_bridge_relayers::Config for TestRuntime {
#[cfg(feature = "runtime-benchmarks")]
impl pallet_bridge_relayers::benchmarking::Config for TestRuntime {
fn prepare_environment(account_params: RewardsAccountParams, reward: Balance) {
use frame_support::traits::fungible::Mutate;
fn prepare_rewards_account(account_params: RewardsAccountParams, reward: Balance) {
let rewards_account =
bp_relayers::PayRewardFromAccount::<Balances, AccountId>::rewards_account(
account_params,
);
Balances::mint_into(&rewards_account, reward).unwrap();
Self::deposit_account(rewards_account, reward);
}
fn deposit_account(account: Self::AccountId, balance: Self::Reward) {
Balances::mint_into(&account, balance.saturating_add(ExistentialDeposit::get())).unwrap();
}
}