difftreelog
chore add posibility to define different limits for methods in the future
in: master
2 files changed
pallets/evm-contract-helpers/src/eth.rsdiffbeforeafterboth263 }263 }264264265 fn get_sponsoring_fee_limit(&self, contract_address: address) -> Result<uint256> {265 fn get_sponsoring_fee_limit(&self, contract_address: address) -> Result<uint256> {266 Ok(<SponsoringFeeLimit<T>>::get(contract_address))266 Ok(<SponsoringFeeLimit<T>>::get(contract_address, 0xffffffff))267 }267 }268268269 /// Is specified user present in contract allow list269 /// Is specified user present in contract allow list413 }413 }414 }414 }415415416 let sponsored_fee_limit = <SponsoringFeeLimit<T>>::get(contract_address);416 let sponsored_fee_limit = <SponsoringFeeLimit<T>>::get(contract_address, 0xffffffff);417417418 if call_context.max_fee > sponsored_fee_limit {418 if call_context.max_fee > sponsored_fee_limit {419 return None;419 return None;pallets/evm-contract-helpers/src/lib.rsdiffbeforeafterboth121 /// * **Key2** - sponsored user address.121 /// * **Key2** - sponsored user address.122 /// * **Value** - last sponsored block number.122 /// * **Value** - last sponsored block number.123 #[pallet::storage]123 #[pallet::storage]124 pub(super) type SponsoringFeeLimit<T: Config> = StorageMap<124 pub(super) type SponsoringFeeLimit<T: Config> = StorageDoubleMap<125 Hasher = Twox128,125 Hasher1 = Twox128,126 Key = H160,126 Key1 = H160,127 Hasher2 = Blake2_128Concat,128 Key2 = u32,127 Value = U256,129 Value = U256,128 QueryKind = ValueQuery,130 QueryKind = ValueQuery,129 OnEmpty = T::DefaultSponsoringFeeLimit,131 OnEmpty = T::DefaultSponsoringFeeLimit,367369368 /// Set maximum for gas limit of transaction370 /// Set maximum for gas limit of transaction369 pub fn set_sponsoring_fee_limit(contract: H160, fee_limit: U256) {371 pub fn set_sponsoring_fee_limit(contract: H160, fee_limit: U256) {370 <SponsoringFeeLimit<T>>::insert(contract, fee_limit);372 <SponsoringFeeLimit<T>>::insert(contract, 0xffffffff, fee_limit);371 }373 }372374373 /// Is user added to allowlist, or he is owner of specified contract375 /// Is user added to allowlist, or he is owner of specified contract