mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 00:01:09 +00:00
seal_reentrant_count returns contract reentrant count (#12695)
* Add logic, test, broken benchmark * account_entrance_count * Addressing comments * Address @agryaznov's comments * Add test for account_entrance_count, fix ci * Cargo fmt * Fix tests * Fix tests * Remove delegated call from test, address comments * Minor fixes and indentation in wat files * Update test for account_entrance_count * Update reentrant_count_call test * Delegate call test * Cargo +nightly fmt * Address comments * Update reentrant_count_works test * Apply weights diff * Add fixture descriptions * Update comments as suggested * Update reentrant_count_call test to use seal_address * add missing code * cargo fmt * account_entrance_count -> account_reentrance_count * fix tests * fmt * normalize signatures Co-authored-by: yarikbratashchuk <yarik.bratashchuk@gmail.com>
This commit is contained in:
@@ -109,6 +109,8 @@ pub trait WeightInfo {
|
||||
fn seal_ecdsa_recover(r: u32, ) -> Weight;
|
||||
fn seal_ecdsa_to_eth_address(r: u32, ) -> Weight;
|
||||
fn seal_set_code_hash(r: u32, ) -> Weight;
|
||||
fn seal_reentrant_count(r: u32, ) -> Weight;
|
||||
fn seal_account_reentrance_count(r: u32, ) -> Weight;
|
||||
fn instr_i64const(r: u32, ) -> Weight;
|
||||
fn instr_i64load(r: u32, ) -> Weight;
|
||||
fn instr_i64store(r: u32, ) -> Weight;
|
||||
@@ -1020,6 +1022,30 @@ impl<T: frame_system::Config> WeightInfo for SubstrateWeight<T> {
|
||||
.saturating_add(T::DbWeight::get().writes(3 as u64))
|
||||
.saturating_add(T::DbWeight::get().writes((150 as u64).saturating_mul(r as u64)))
|
||||
}
|
||||
// Storage: System Account (r:1 w:0)
|
||||
// Storage: Contracts ContractInfoOf (r:1 w:1)
|
||||
// Storage: Contracts CodeStorage (r:1 w:0)
|
||||
// Storage: Timestamp Now (r:1 w:0)
|
||||
/// The range of component `r` is `[0, 20]`.
|
||||
fn seal_reentrant_count(r: u32, ) -> Weight {
|
||||
Weight::from_ref_time(304_709_000 as u64)
|
||||
// Standard Error: 67_000
|
||||
.saturating_add(Weight::from_ref_time(15_411_000 as u64).saturating_mul(r as u64))
|
||||
.saturating_add(T::DbWeight::get().reads(4 as u64))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as u64))
|
||||
}
|
||||
// Storage: System Account (r:1 w:0)
|
||||
// Storage: Contracts ContractInfoOf (r:1 w:1)
|
||||
// Storage: Contracts CodeStorage (r:1 w:0)
|
||||
// Storage: Timestamp Now (r:1 w:0)
|
||||
/// The range of component `r` is `[0, 20]`.
|
||||
fn seal_account_reentrance_count(r: u32, ) -> Weight {
|
||||
Weight::from_ref_time(328_378_000 as u64)
|
||||
// Standard Error: 137_000
|
||||
.saturating_add(Weight::from_ref_time(37_448_000 as u64).saturating_mul(r as u64))
|
||||
.saturating_add(T::DbWeight::get().reads(4 as u64))
|
||||
.saturating_add(T::DbWeight::get().writes(1 as u64))
|
||||
}
|
||||
/// The range of component `r` is `[0, 50]`.
|
||||
fn instr_i64const(r: u32, ) -> Weight {
|
||||
// Minimum execution time: 69_022 nanoseconds.
|
||||
@@ -2236,6 +2262,30 @@ impl WeightInfo for () {
|
||||
.saturating_add(RocksDbWeight::get().writes(3 as u64))
|
||||
.saturating_add(RocksDbWeight::get().writes((150 as u64).saturating_mul(r as u64)))
|
||||
}
|
||||
// Storage: System Account (r:1 w:0)
|
||||
// Storage: Contracts ContractInfoOf (r:1 w:1)
|
||||
// Storage: Contracts CodeStorage (r:1 w:0)
|
||||
// Storage: Timestamp Now (r:1 w:0)
|
||||
/// The range of component `r` is `[0, 20]`.
|
||||
fn seal_reentrant_count(r: u32, ) -> Weight {
|
||||
Weight::from_ref_time(304_709_000 as u64)
|
||||
// Standard Error: 67_000
|
||||
.saturating_add(Weight::from_ref_time(15_411_000 as u64).saturating_mul(r as u64))
|
||||
.saturating_add(RocksDbWeight::get().reads(4 as u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(1 as u64))
|
||||
}
|
||||
// Storage: System Account (r:1 w:0)
|
||||
// Storage: Contracts ContractInfoOf (r:1 w:1)
|
||||
// Storage: Contracts CodeStorage (r:1 w:0)
|
||||
// Storage: Timestamp Now (r:1 w:0)
|
||||
/// The range of component `r` is `[0, 20]`.
|
||||
fn seal_account_reentrance_count(r: u32, ) -> Weight {
|
||||
Weight::from_ref_time(328_378_000 as u64)
|
||||
// Standard Error: 137_000
|
||||
.saturating_add(Weight::from_ref_time(37_448_000 as u64).saturating_mul(r as u64))
|
||||
.saturating_add(RocksDbWeight::get().reads(4 as u64))
|
||||
.saturating_add(RocksDbWeight::get().writes(1 as u64))
|
||||
}
|
||||
/// The range of component `r` is `[0, 50]`.
|
||||
fn instr_i64const(r: u32, ) -> Weight {
|
||||
// Minimum execution time: 69_022 nanoseconds.
|
||||
@@ -2593,4 +2643,4 @@ impl WeightInfo for () {
|
||||
// Standard Error: 986
|
||||
.saturating_add(Weight::from_ref_time(1_867_001 as u64).saturating_mul(r as u64))
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user