mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 01:07:57 +00:00
contracts: Expose rent parameter to contracts (#8231)
* contracts: Expose rent parameter to contracts * cargo run --release --features=runtime-benchmarks --manifest-path=bin/node/cli/Cargo.toml -- benchmark --chain=dev --steps=50 --repeat=20 --pallet=pallet_contracts --extrinsic=* --execution=wasm --wasm-execution=compiled --heap-pages=4096 --output=./frame/contracts/src/weights.rs --template=./.maintain/frame-weight-template.hbs * Fix typos * Improve comments * Add rent parameter weights * Allow deploying a new schedule with the same version * Add storage migration for new schedule * Only decode the schedule version in storage migration * Remove confusing docs * Replace original_code_len() by aggregate_code_len() Co-authored-by: Parity Benchmarking Bot <admin@parity.io>
This commit is contained in:
committed by
GitHub
parent
3743cec9bd
commit
a4e8875897
@@ -30,7 +30,7 @@ use sp_io::hashing::blake2_256;
|
||||
use sp_runtime::traits::{Bounded, Saturating, Zero};
|
||||
use sp_core::crypto::UncheckedFrom;
|
||||
use frame_support::{
|
||||
dispatch::DispatchResult,
|
||||
dispatch::{DispatchError, DispatchResult},
|
||||
storage::child::{self, KillChildStorageResult},
|
||||
traits::Get,
|
||||
weights::Weight,
|
||||
@@ -162,7 +162,7 @@ where
|
||||
account: &AccountIdOf<T>,
|
||||
trie_id: TrieId,
|
||||
ch: CodeHash<T>,
|
||||
) -> DispatchResult {
|
||||
) -> Result<AliveContractInfo<T>, DispatchError> {
|
||||
<ContractInfoOf<T>>::try_mutate(account, |existing| {
|
||||
if existing.is_some() {
|
||||
return Err(Error::<T>::DuplicateContract.into());
|
||||
@@ -184,9 +184,9 @@ where
|
||||
_reserved: None,
|
||||
};
|
||||
|
||||
*existing = Some(contract.into());
|
||||
*existing = Some(contract.clone().into());
|
||||
|
||||
Ok(())
|
||||
Ok(contract)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user