mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 09:51:10 +00:00
Adapt pallet-contracts to WeightV2 (#12421)
* Replace contract access weight by proper PoV component * Return the whole weight struct from dry-runs * Fixup `seal_call` and `seal_instantiate` * Fix duplicate extrinsics * Remove ContractAccessWeight from runtime * Fix doc link * Remove leftover debugging output
This commit is contained in:
committed by
GitHub
parent
8f048cf522
commit
b135a0fae4
@@ -228,16 +228,11 @@ impl<T: Config> Token<T> for CodeToken {
|
||||
// contract code. This is why we subtract `T::*::(0)`. We need to do this at this
|
||||
// point because when charging the general weight for calling the contract we not know the
|
||||
// size of the contract.
|
||||
let ref_time_weight = match *self {
|
||||
match *self {
|
||||
Reinstrument(len) => T::WeightInfo::reinstrument(len),
|
||||
Load(len) => {
|
||||
let computation = T::WeightInfo::call_with_code_per_byte(len)
|
||||
.saturating_sub(T::WeightInfo::call_with_code_per_byte(0));
|
||||
let bandwidth = T::ContractAccessWeight::get().saturating_mul(len as u64);
|
||||
computation.max(bandwidth)
|
||||
},
|
||||
};
|
||||
|
||||
ref_time_weight
|
||||
Load(len) => T::WeightInfo::call_with_code_per_byte(len)
|
||||
.saturating_sub(T::WeightInfo::call_with_code_per_byte(0))
|
||||
.set_proof_size(len.into()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user