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
+7 -3
View File
@@ -1108,16 +1108,20 @@ impl_runtime_apis! {
}
impl RelayersConfig for Runtime {
fn prepare_environment(
fn prepare_rewards_account(
account_params: RewardsAccountParams,
reward: Balance,
) {
use frame_support::traits::fungible::Mutate;
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: AccountId, balance: Balance) {
use frame_support::traits::fungible::Mutate;
Balances::mint_into(&account, balance.saturating_add(ExistentialDeposit::get())).unwrap();
}
}