Contracts add code_len to ContractsInfo (#14523)

* add code_len to v12

* fix

* Update frame/contracts/src/wasm/mod.rs

* fix

* fixes

* rm test

* add test back

* fix

* update test

* Fix comments

* fix build

* del

* fix clippy

* fix

* re-rename
This commit is contained in:
PG Herveou
2023-07-14 14:49:47 +02:00
committed by GitHub
parent 70694b903a
commit e8a9559696
5 changed files with 54 additions and 24 deletions
+7 -7
View File
@@ -1,4 +1,5 @@
// This file is part of Substrate.
mod pallet_dummy;
// Copyright (C) Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
@@ -68,6 +69,7 @@ frame_support::construct_runtime!(
Utility: pallet_utility::{Pallet, Call, Storage, Event},
Contracts: pallet_contracts::{Pallet, Call, Storage, Event<T>},
Proxy: pallet_proxy::{Pallet, Call, Storage, Event<T>},
Dummy: pallet_dummy
}
);
@@ -373,6 +375,8 @@ impl pallet_proxy::Config for Test {
type AnnouncementDepositFactor = ConstU64<1>;
}
impl pallet_dummy::Config for Test {}
parameter_types! {
pub MySchedule: Schedule<Test> = {
let schedule = <Schedule<Test>>::default();
@@ -2999,7 +3003,7 @@ fn gas_estimation_call_runtime() {
.unwrap()
.account_id;
let addr_callee = Contracts::bare_instantiate(
Contracts::bare_instantiate(
ALICE,
min_balance * 100,
GAS_LIMIT,
@@ -3011,15 +3015,11 @@ fn gas_estimation_call_runtime() {
CollectEvents::Skip,
)
.result
.unwrap()
.account_id;
.unwrap();
// Call something trivial with a huge gas limit so that we can observe the effects
// of pre-charging. This should create a difference between consumed and required.
let call = RuntimeCall::Balances(pallet_balances::Call::transfer_allow_death {
dest: addr_callee,
value: min_balance * 10,
});
let call = RuntimeCall::Dummy(pallet_dummy::Call::overestimate_pre_charge {});
let result = Contracts::bare_call(
ALICE,
addr_caller.clone(),