difftreelog
feat default sponsoring rate limit
in: master
2 files changed
pallets/contract-helpers/src/lib.rsdiffbeforeafterboth232324 #[pallet::config]24 #[pallet::config]25 pub trait Config: frame_system::Config + pallet_contracts::Config {}25 pub trait Config: frame_system::Config + pallet_contracts::Config {26 type DefaultSponsoringRateLimit: Get<Self::BlockNumber>;27 }262827 #[pallet::pallet]29 #[pallet::pallet]60 Key = T::AccountId,62 Key = T::AccountId,61 Value = T::BlockNumber,63 Value = T::BlockNumber,62 QueryKind = ValueQuery,64 QueryKind = ValueQuery,65 OnEmpty = T::DefaultSponsoringRateLimit,63 >;66 >;646765 #[pallet::storage]68 #[pallet::storage]69 Hasher2 = Twox128,72 Hasher2 = Twox128,70 Key2 = T::AccountId,73 Key2 = T::AccountId,71 Value = T::BlockNumber,74 Value = T::BlockNumber,72 QueryKind = ValueQuery,75 QueryKind = OptionQuery,73 >;76 >;747775 #[pallet::call]78 #[pallet::call]pallets/evm-contract-helpers/src/lib.rsdiffbeforeafterboth--- a/pallets/evm-contract-helpers/src/lib.rs
+++ b/pallets/evm-contract-helpers/src/lib.rs
@@ -13,6 +13,7 @@
#[pallet::config]
pub trait Config: frame_system::Config + pallet_evm_coder_substrate::Config {
type ContractAddress: Get<H160>;
+ type DefaultSponsoringRateLimit: Get<Self::BlockNumber>;
}
#[pallet::error]
@@ -34,8 +35,13 @@
StorageMap<Hasher = Twox128, Key = H160, Value = bool, QueryKind = ValueQuery>;
#[pallet::storage]
- pub(super) type SponsoringRateLimit<T: Config> =
- StorageMap<Hasher = Twox128, Key = H160, Value = T::BlockNumber, QueryKind = ValueQuery>;
+ pub(super) type SponsoringRateLimit<T: Config> = StorageMap<
+ Hasher = Twox128,
+ Key = H160,
+ Value = T::BlockNumber,
+ QueryKind = ValueQuery,
+ OnEmpty = T::DefaultSponsoringRateLimit,
+ >;
#[pallet::storage]
pub(super) type SponsorBasket<T: Config> = StorageDoubleMap<