mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 02:48:03 +00:00
Replace 'Module' with 'Pallet' in construct_runtime macro (#8372)
* Use 'Pallet' struct in construct_runtime. * Fix genesis and metadata macro. * Fix 'Pallet' type alias. * Replace 'Module' with 'Pallet' for all construct_runtime use cases. * Replace more deprecated 'Module' struct. * Bring back AllModules and AllPalletsWithSystem type, but deprecate them. * Replace deprecated 'Module' struct from merge master. * Minor fix. * Fix UI tests. * Revert UI override in derive_no_bound. * Fix more deprecated 'Module' use from master branch. * Fix more deprecated 'Module' use from master branch.
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
//! compiles it down into a `WasmModule` that can be used as a contract's code.
|
||||
|
||||
use crate::Config;
|
||||
use crate::Module as Contracts;
|
||||
use crate::Pallet as Contracts;
|
||||
|
||||
use parity_wasm::elements::{
|
||||
Instruction, Instructions, FuncBody, ValueType, BlockType, Section, CustomSection,
|
||||
|
||||
@@ -23,7 +23,7 @@ mod code;
|
||||
mod sandbox;
|
||||
|
||||
use crate::{
|
||||
*, Module as Contracts,
|
||||
*, Pallet as Contracts,
|
||||
exec::StorageKey,
|
||||
rent::Rent,
|
||||
schedule::{API_BENCHMARK_BATCH_SIZE, INSTR_BENCHMARK_BATCH_SIZE},
|
||||
@@ -37,7 +37,7 @@ use self::{
|
||||
sandbox::Sandbox,
|
||||
};
|
||||
use frame_benchmarking::{benchmarks, account, whitelisted_caller, impl_benchmark_test_suite};
|
||||
use frame_system::{Module as System, RawOrigin};
|
||||
use frame_system::{Pallet as System, RawOrigin};
|
||||
use parity_wasm::elements::{Instruction, ValueType, BlockType};
|
||||
use sp_runtime::traits::{Hash, Bounded, Zero};
|
||||
use sp_std::{default::Default, convert::{TryInto}, vec::Vec, vec};
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
use crate::{
|
||||
CodeHash, Event, Config, Module as Contracts,
|
||||
CodeHash, Event, Config, Pallet as Contracts,
|
||||
TrieId, BalanceOf, ContractInfo, gas::GasMeter, rent::Rent, storage::{self, Storage},
|
||||
Error, ContractInfoOf, Schedule, AliveContractInfo,
|
||||
};
|
||||
@@ -384,7 +384,7 @@ where
|
||||
depth: 0,
|
||||
schedule,
|
||||
timestamp: T::Time::now(),
|
||||
block_number: <frame_system::Module<T>>::block_number(),
|
||||
block_number: <frame_system::Pallet<T>>::block_number(),
|
||||
_phantom: Default::default(),
|
||||
}
|
||||
}
|
||||
@@ -909,7 +909,7 @@ fn deposit_event<T: Config>(
|
||||
topics: Vec<T::Hash>,
|
||||
event: Event<T>,
|
||||
) {
|
||||
<frame_system::Module<T>>::deposit_event_indexed(
|
||||
<frame_system::Pallet<T>>::deposit_event_indexed(
|
||||
&*topics,
|
||||
<T as Config>::Event::from(event).into(),
|
||||
)
|
||||
@@ -961,7 +961,7 @@ mod tests {
|
||||
}
|
||||
|
||||
fn events() -> Vec<Event<Test>> {
|
||||
<frame_system::Module<Test>>::events()
|
||||
<frame_system::Pallet<Test>>::events()
|
||||
.into_iter()
|
||||
.filter_map(|meta| match meta.event {
|
||||
MetaEvent::pallet_contracts(contract_event) => Some(contract_event),
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
//! # Contract Module
|
||||
//! # Contract Pallet
|
||||
//!
|
||||
//! The Contract module provides functionality for the runtime to deploy and execute WebAssembly smart-contracts.
|
||||
//!
|
||||
@@ -124,7 +124,7 @@ use frame_support::{
|
||||
traits::{OnUnbalanced, Currency, Get, Time, Randomness},
|
||||
weights::{Weight, PostDispatchInfo, WithPostDispatchInfo},
|
||||
};
|
||||
use frame_system::Module as System;
|
||||
use frame_system::Pallet as System;
|
||||
use pallet_contracts_primitives::{
|
||||
RentProjectionResult, GetStorageResult, ContractAccessError, ContractExecResult,
|
||||
};
|
||||
@@ -290,7 +290,7 @@ pub mod pallet {
|
||||
schedule: Schedule<T>
|
||||
) -> DispatchResultWithPostInfo {
|
||||
ensure_root(origin)?;
|
||||
if <Module<T>>::current_schedule().version > schedule.version {
|
||||
if <Pallet<T>>::current_schedule().version > schedule.version {
|
||||
Err(Error::<T>::InvalidScheduleVersion)?
|
||||
}
|
||||
Self::deposit_event(Event::ScheduleUpdated(schedule.version));
|
||||
@@ -316,7 +316,7 @@ pub mod pallet {
|
||||
let origin = ensure_signed(origin)?;
|
||||
let dest = T::Lookup::lookup(dest)?;
|
||||
let mut gas_meter = GasMeter::new(gas_limit);
|
||||
let schedule = <Module<T>>::current_schedule();
|
||||
let schedule = <Pallet<T>>::current_schedule();
|
||||
let mut ctx = ExecutionContext::<T, PrefabWasmModule<T>>::top_level(origin, &schedule);
|
||||
let (result, code_len) = match ctx.call(dest, value, &mut gas_meter, data) {
|
||||
Ok((output, len)) => (Ok(output), len),
|
||||
@@ -365,7 +365,7 @@ pub mod pallet {
|
||||
let code_len = code.len() as u32;
|
||||
ensure!(code_len <= T::MaxCodeSize::get(), Error::<T>::CodeTooLarge);
|
||||
let mut gas_meter = GasMeter::new(gas_limit);
|
||||
let schedule = <Module<T>>::current_schedule();
|
||||
let schedule = <Pallet<T>>::current_schedule();
|
||||
let executable = PrefabWasmModule::from_code(code, &schedule)?;
|
||||
let code_len = executable.code_len();
|
||||
ensure!(code_len <= T::MaxCodeSize::get(), Error::<T>::CodeTooLarge);
|
||||
@@ -397,7 +397,7 @@ pub mod pallet {
|
||||
) -> DispatchResultWithPostInfo {
|
||||
let origin = ensure_signed(origin)?;
|
||||
let mut gas_meter = GasMeter::new(gas_limit);
|
||||
let schedule = <Module<T>>::current_schedule();
|
||||
let schedule = <Pallet<T>>::current_schedule();
|
||||
let executable = PrefabWasmModule::from_storage(code_hash, &schedule, &mut gas_meter)?;
|
||||
let mut ctx = ExecutionContext::<T, PrefabWasmModule<T>>::top_level(origin, &schedule);
|
||||
let code_len = executable.code_len();
|
||||
@@ -665,7 +665,7 @@ pub mod pallet {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Config> Module<T>
|
||||
impl<T: Config> Pallet<T>
|
||||
where
|
||||
T::AccountId: UncheckedFrom<T::Hash> + AsRef<[u8]>,
|
||||
{
|
||||
@@ -683,7 +683,7 @@ where
|
||||
input_data: Vec<u8>,
|
||||
) -> ContractExecResult {
|
||||
let mut gas_meter = GasMeter::new(gas_limit);
|
||||
let schedule = <Module<T>>::current_schedule();
|
||||
let schedule = <Pallet<T>>::current_schedule();
|
||||
let mut ctx = ExecutionContext::<T, PrefabWasmModule<T>>::top_level(origin, &schedule);
|
||||
let result = ctx.call(dest, value, &mut gas_meter, input_data);
|
||||
let gas_consumed = gas_meter.gas_spent();
|
||||
@@ -746,7 +746,7 @@ where
|
||||
/// Store code for benchmarks which does not check nor instrument the code.
|
||||
#[cfg(feature = "runtime-benchmarks")]
|
||||
fn store_code_raw(code: Vec<u8>) -> frame_support::dispatch::DispatchResult {
|
||||
let schedule = <Module<T>>::current_schedule();
|
||||
let schedule = <Pallet<T>>::current_schedule();
|
||||
PrefabWasmModule::store_code_unchecked(code, &schedule)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
//! A module responsible for computing the right amount of weight and charging it.
|
||||
|
||||
use crate::{
|
||||
AliveContractInfo, BalanceOf, ContractInfo, ContractInfoOf, Module, Event,
|
||||
AliveContractInfo, BalanceOf, ContractInfo, ContractInfoOf, Pallet, Event,
|
||||
TombstoneContractInfo, Config, CodeHash, Error,
|
||||
storage::Storage, wasm::PrefabWasmModule, exec::Executable,
|
||||
};
|
||||
@@ -124,7 +124,7 @@ where
|
||||
free_balance: &BalanceOf<T>,
|
||||
contract: &AliveContractInfo<T>,
|
||||
) -> Option<BalanceOf<T>> {
|
||||
let subsistence_threshold = Module::<T>::subsistence_threshold();
|
||||
let subsistence_threshold = Pallet::<T>::subsistence_threshold();
|
||||
// Reserved balance contributes towards the subsistence threshold to stay consistent
|
||||
// with the existential deposit where the reserved balance is also counted.
|
||||
if *total_balance < subsistence_threshold {
|
||||
@@ -268,7 +268,7 @@ where
|
||||
let tombstone_info = ContractInfo::Tombstone(tombstone);
|
||||
<ContractInfoOf<T>>::insert(account, &tombstone_info);
|
||||
code.drop_from_storage();
|
||||
<Module<T>>::deposit_event(Event::Evicted(account.clone()));
|
||||
<Pallet<T>>::deposit_event(Event::Evicted(account.clone()));
|
||||
Ok(None)
|
||||
}
|
||||
(Verdict::Evict { amount: _ }, None) => {
|
||||
@@ -298,7 +298,7 @@ where
|
||||
contract: AliveContractInfo<T>,
|
||||
code_size: u32,
|
||||
) -> Result<Option<AliveContractInfo<T>>, DispatchError> {
|
||||
let current_block_number = <frame_system::Module<T>>::block_number();
|
||||
let current_block_number = <frame_system::Pallet<T>>::block_number();
|
||||
let verdict = Self::consider_case(
|
||||
account,
|
||||
current_block_number,
|
||||
@@ -333,7 +333,7 @@ where
|
||||
};
|
||||
let module = PrefabWasmModule::<T>::from_storage_noinstr(contract.code_hash)?;
|
||||
let code_len = module.code_len();
|
||||
let current_block_number = <frame_system::Module<T>>::block_number();
|
||||
let current_block_number = <frame_system::Pallet<T>>::block_number();
|
||||
let verdict = Self::consider_case(
|
||||
account,
|
||||
current_block_number,
|
||||
@@ -384,7 +384,7 @@ where
|
||||
let module = PrefabWasmModule::from_storage_noinstr(alive_contract_info.code_hash)
|
||||
.map_err(|_| IsTombstone)?;
|
||||
let code_size = module.occupied_storage();
|
||||
let current_block_number = <frame_system::Module<T>>::block_number();
|
||||
let current_block_number = <frame_system::Pallet<T>>::block_number();
|
||||
let verdict = Self::consider_case(
|
||||
account,
|
||||
current_block_number,
|
||||
@@ -465,7 +465,7 @@ where
|
||||
|
||||
let child_trie_info = origin_contract.child_trie_info();
|
||||
|
||||
let current_block = <frame_system::Module<T>>::block_number();
|
||||
let current_block = <frame_system::Pallet<T>>::block_number();
|
||||
|
||||
if origin_contract.last_write == Some(current_block) {
|
||||
return Err((Error::<T>::InvalidContractOrigin.into(), 0, 0));
|
||||
|
||||
@@ -117,7 +117,7 @@ where
|
||||
.and_then(|val| val.checked_add(new_value_len))
|
||||
.ok_or_else(|| Error::<T>::StorageExhausted)?;
|
||||
|
||||
new_info.last_write = Some(<frame_system::Module<T>>::block_number());
|
||||
new_info.last_write = Some(<frame_system::Pallet<T>>::block_number());
|
||||
<ContractInfoOf<T>>::insert(&account, ContractInfo::Alive(new_info));
|
||||
|
||||
// Finally, perform the change on the storage.
|
||||
@@ -176,7 +176,7 @@ where
|
||||
// We want to charge rent for the first block in advance. Therefore we
|
||||
// treat the contract as if it was created in the last block and then
|
||||
// charge rent for it during instantiation.
|
||||
<frame_system::Module<T>>::block_number().saturating_sub(1u32.into()),
|
||||
<frame_system::Pallet<T>>::block_number().saturating_sub(1u32.into()),
|
||||
rent_allowance: <BalanceOf<T>>::max_value(),
|
||||
rent_payed: <BalanceOf<T>>::zero(),
|
||||
pair_count: 0,
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
// limitations under the License.
|
||||
|
||||
use crate::{
|
||||
BalanceOf, ContractInfo, ContractInfoOf, Module,
|
||||
BalanceOf, ContractInfo, ContractInfoOf, Pallet,
|
||||
RawAliveContractInfo, Config, Schedule,
|
||||
Error, storage::Storage,
|
||||
chain_extension::{
|
||||
@@ -57,11 +57,11 @@ frame_support::construct_runtime!(
|
||||
NodeBlock = Block,
|
||||
UncheckedExtrinsic = UncheckedExtrinsic,
|
||||
{
|
||||
System: frame_system::{Module, Call, Config, Storage, Event<T>},
|
||||
Balances: pallet_balances::{Module, Call, Storage, Config<T>, Event<T>},
|
||||
Timestamp: pallet_timestamp::{Module, Call, Storage, Inherent},
|
||||
Randomness: pallet_randomness_collective_flip::{Module, Call, Storage},
|
||||
Contracts: pallet_contracts::{Module, Call, Config<T>, Storage, Event<T>},
|
||||
System: frame_system::{Pallet, Call, Config, Storage, Event<T>},
|
||||
Balances: pallet_balances::{Pallet, Call, Storage, Config<T>, Event<T>},
|
||||
Timestamp: pallet_timestamp::{Pallet, Call, Storage, Inherent},
|
||||
Randomness: pallet_randomness_collective_flip::{Pallet, Call, Storage},
|
||||
Contracts: pallet_contracts::{Pallet, Call, Config<T>, Storage, Event<T>},
|
||||
}
|
||||
);
|
||||
|
||||
@@ -72,7 +72,7 @@ pub mod test_utils {
|
||||
ContractInfoOf, CodeHash,
|
||||
storage::Storage,
|
||||
exec::{StorageKey, AccountIdOf},
|
||||
Module as Contracts,
|
||||
Pallet as Contracts,
|
||||
};
|
||||
use frame_support::traits::Currency;
|
||||
|
||||
@@ -457,7 +457,7 @@ fn instantiate_and_call_and_deposit_event() {
|
||||
.build()
|
||||
.execute_with(|| {
|
||||
let _ = Balances::deposit_creating(&ALICE, 1_000_000);
|
||||
let subsistence = Module::<Test>::subsistence_threshold();
|
||||
let subsistence = Pallet::<Test>::subsistence_threshold();
|
||||
|
||||
// Check at the end to get hash on error easily
|
||||
let creation = Contracts::instantiate_with_code(
|
||||
@@ -572,7 +572,7 @@ fn deposit_event_max_value_limit() {
|
||||
#[test]
|
||||
fn run_out_of_gas() {
|
||||
let (wasm, code_hash) = compile_module::<Test>("run_out_of_gas").unwrap();
|
||||
let subsistence = Module::<Test>::subsistence_threshold();
|
||||
let subsistence = Pallet::<Test>::subsistence_threshold();
|
||||
|
||||
ExtBuilder::default()
|
||||
.existential_deposit(50)
|
||||
@@ -908,7 +908,7 @@ fn removals(trigger_call: impl Fn(AccountIdOf<Test>) -> bool) {
|
||||
.unwrap().get_alive().unwrap().rent_allowance;
|
||||
let balance = Balances::free_balance(&addr);
|
||||
|
||||
let subsistence_threshold = Module::<Test>::subsistence_threshold();
|
||||
let subsistence_threshold = Pallet::<Test>::subsistence_threshold();
|
||||
|
||||
// Trigger rent must have no effect
|
||||
assert!(!trigger_call(addr.clone()));
|
||||
@@ -997,7 +997,7 @@ fn removals(trigger_call: impl Fn(AccountIdOf<Test>) -> bool) {
|
||||
.build()
|
||||
.execute_with(|| {
|
||||
// Create
|
||||
let subsistence_threshold = Module::<Test>::subsistence_threshold();
|
||||
let subsistence_threshold = Pallet::<Test>::subsistence_threshold();
|
||||
let _ = Balances::deposit_creating(&ALICE, subsistence_threshold * 1000);
|
||||
assert_ok!(Contracts::instantiate_with_code(
|
||||
Origin::signed(ALICE),
|
||||
@@ -1878,7 +1878,7 @@ fn crypto_hashes() {
|
||||
// We offset data in the contract tables by 1.
|
||||
let mut params = vec![(n + 1) as u8];
|
||||
params.extend_from_slice(input);
|
||||
let result = <Module<Test>>::bare_call(
|
||||
let result = <Pallet<Test>>::bare_call(
|
||||
ALICE,
|
||||
addr.clone(),
|
||||
0,
|
||||
@@ -1896,7 +1896,7 @@ fn crypto_hashes() {
|
||||
fn transfer_return_code() {
|
||||
let (wasm, code_hash) = compile_module::<Test>("transfer_return_code").unwrap();
|
||||
ExtBuilder::default().existential_deposit(50).build().execute_with(|| {
|
||||
let subsistence = Module::<Test>::subsistence_threshold();
|
||||
let subsistence = Pallet::<Test>::subsistence_threshold();
|
||||
let _ = Balances::deposit_creating(&ALICE, 1000 * subsistence);
|
||||
|
||||
assert_ok!(
|
||||
@@ -1943,7 +1943,7 @@ fn call_return_code() {
|
||||
let (caller_code, caller_hash) = compile_module::<Test>("call_return_code").unwrap();
|
||||
let (callee_code, callee_hash) = compile_module::<Test>("ok_trap_revert").unwrap();
|
||||
ExtBuilder::default().existential_deposit(50).build().execute_with(|| {
|
||||
let subsistence = Module::<Test>::subsistence_threshold();
|
||||
let subsistence = Pallet::<Test>::subsistence_threshold();
|
||||
let _ = Balances::deposit_creating(&ALICE, 1000 * subsistence);
|
||||
let _ = Balances::deposit_creating(&CHARLIE, 1000 * subsistence);
|
||||
|
||||
@@ -2036,7 +2036,7 @@ fn instantiate_return_code() {
|
||||
let (caller_code, caller_hash) = compile_module::<Test>("instantiate_return_code").unwrap();
|
||||
let (callee_code, callee_hash) = compile_module::<Test>("ok_trap_revert").unwrap();
|
||||
ExtBuilder::default().existential_deposit(50).build().execute_with(|| {
|
||||
let subsistence = Module::<Test>::subsistence_threshold();
|
||||
let subsistence = Pallet::<Test>::subsistence_threshold();
|
||||
let _ = Balances::deposit_creating(&ALICE, 1000 * subsistence);
|
||||
let _ = Balances::deposit_creating(&CHARLIE, 1000 * subsistence);
|
||||
let callee_hash = callee_hash.as_ref().to_vec();
|
||||
@@ -2127,7 +2127,7 @@ fn instantiate_return_code() {
|
||||
fn disabled_chain_extension_wont_deploy() {
|
||||
let (code, _hash) = compile_module::<Test>("chain_extension").unwrap();
|
||||
ExtBuilder::default().existential_deposit(50).build().execute_with(|| {
|
||||
let subsistence = Module::<Test>::subsistence_threshold();
|
||||
let subsistence = Pallet::<Test>::subsistence_threshold();
|
||||
let _ = Balances::deposit_creating(&ALICE, 1000 * subsistence);
|
||||
TestExtension::disable();
|
||||
assert_err_ignore_postinfo!(
|
||||
@@ -2148,7 +2148,7 @@ fn disabled_chain_extension_wont_deploy() {
|
||||
fn disabled_chain_extension_errors_on_call() {
|
||||
let (code, hash) = compile_module::<Test>("chain_extension").unwrap();
|
||||
ExtBuilder::default().existential_deposit(50).build().execute_with(|| {
|
||||
let subsistence = Module::<Test>::subsistence_threshold();
|
||||
let subsistence = Pallet::<Test>::subsistence_threshold();
|
||||
let _ = Balances::deposit_creating(&ALICE, 1000 * subsistence);
|
||||
assert_ok!(
|
||||
Contracts::instantiate_with_code(
|
||||
@@ -2179,7 +2179,7 @@ fn disabled_chain_extension_errors_on_call() {
|
||||
fn chain_extension_works() {
|
||||
let (code, hash) = compile_module::<Test>("chain_extension").unwrap();
|
||||
ExtBuilder::default().existential_deposit(50).build().execute_with(|| {
|
||||
let subsistence = Module::<Test>::subsistence_threshold();
|
||||
let subsistence = Pallet::<Test>::subsistence_threshold();
|
||||
let _ = Balances::deposit_creating(&ALICE, 1000 * subsistence);
|
||||
assert_ok!(
|
||||
Contracts::instantiate_with_code(
|
||||
@@ -2248,7 +2248,7 @@ fn chain_extension_works() {
|
||||
fn lazy_removal_works() {
|
||||
let (code, hash) = compile_module::<Test>("self_destruct").unwrap();
|
||||
ExtBuilder::default().existential_deposit(50).build().execute_with(|| {
|
||||
let subsistence = Module::<Test>::subsistence_threshold();
|
||||
let subsistence = Pallet::<Test>::subsistence_threshold();
|
||||
let _ = Balances::deposit_creating(&ALICE, 1000 * subsistence);
|
||||
|
||||
assert_ok!(
|
||||
@@ -2308,7 +2308,7 @@ fn lazy_removal_partial_remove_works() {
|
||||
let mut ext = ExtBuilder::default().existential_deposit(50).build();
|
||||
|
||||
let trie = ext.execute_with(|| {
|
||||
let subsistence = Module::<Test>::subsistence_threshold();
|
||||
let subsistence = Pallet::<Test>::subsistence_threshold();
|
||||
let _ = Balances::deposit_creating(&ALICE, 1000 * subsistence);
|
||||
|
||||
assert_ok!(
|
||||
@@ -2389,7 +2389,7 @@ fn lazy_removal_partial_remove_works() {
|
||||
fn lazy_removal_does_no_run_on_full_block() {
|
||||
let (code, hash) = compile_module::<Test>("self_destruct").unwrap();
|
||||
ExtBuilder::default().existential_deposit(50).build().execute_with(|| {
|
||||
let subsistence = Module::<Test>::subsistence_threshold();
|
||||
let subsistence = Pallet::<Test>::subsistence_threshold();
|
||||
let _ = Balances::deposit_creating(&ALICE, 1000 * subsistence);
|
||||
|
||||
assert_ok!(
|
||||
@@ -2473,7 +2473,7 @@ fn lazy_removal_does_no_run_on_full_block() {
|
||||
fn lazy_removal_does_not_use_all_weight() {
|
||||
let (code, hash) = compile_module::<Test>("self_destruct").unwrap();
|
||||
ExtBuilder::default().existential_deposit(50).build().execute_with(|| {
|
||||
let subsistence = Module::<Test>::subsistence_threshold();
|
||||
let subsistence = Pallet::<Test>::subsistence_threshold();
|
||||
let _ = Balances::deposit_creating(&ALICE, 1000 * subsistence);
|
||||
|
||||
assert_ok!(
|
||||
@@ -2543,7 +2543,7 @@ fn lazy_removal_does_not_use_all_weight() {
|
||||
fn deletion_queue_full() {
|
||||
let (code, hash) = compile_module::<Test>("self_destruct").unwrap();
|
||||
ExtBuilder::default().existential_deposit(50).build().execute_with(|| {
|
||||
let subsistence = Module::<Test>::subsistence_threshold();
|
||||
let subsistence = Pallet::<Test>::subsistence_threshold();
|
||||
let _ = Balances::deposit_creating(&ALICE, 1000 * subsistence);
|
||||
|
||||
assert_ok!(
|
||||
@@ -2669,7 +2669,7 @@ fn refcounter() {
|
||||
let (wasm, code_hash) = compile_module::<Test>("self_destruct").unwrap();
|
||||
ExtBuilder::default().existential_deposit(50).build().execute_with(|| {
|
||||
let _ = Balances::deposit_creating(&ALICE, 1_000_000);
|
||||
let subsistence = Module::<Test>::subsistence_threshold();
|
||||
let subsistence = Pallet::<Test>::subsistence_threshold();
|
||||
|
||||
// Create two contracts with the same code and check that they do in fact share it.
|
||||
assert_ok!(Contracts::instantiate_with_code(
|
||||
@@ -2741,7 +2741,7 @@ fn reinstrument_does_charge() {
|
||||
let (wasm, code_hash) = compile_module::<Test>("return_with_data").unwrap();
|
||||
ExtBuilder::default().existential_deposit(50).build().execute_with(|| {
|
||||
let _ = Balances::deposit_creating(&ALICE, 1_000_000);
|
||||
let subsistence = Module::<Test>::subsistence_threshold();
|
||||
let subsistence = Pallet::<Test>::subsistence_threshold();
|
||||
let zero = 0u32.to_le_bytes().encode();
|
||||
let code_len = wasm.len() as u32;
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
use crate::{
|
||||
CodeHash, CodeStorage, PristineCode, Schedule, Config, Error, Weight,
|
||||
wasm::{prepare, PrefabWasmModule}, Module as Contracts, Event,
|
||||
wasm::{prepare, PrefabWasmModule}, Pallet as Contracts, Event,
|
||||
gas::{GasMeter, Token},
|
||||
weights::WeightInfo,
|
||||
};
|
||||
|
||||
@@ -245,7 +245,7 @@ where
|
||||
mod tests {
|
||||
use super::*;
|
||||
use crate::{
|
||||
CodeHash, BalanceOf, Error, Module as Contracts,
|
||||
CodeHash, BalanceOf, Error, Pallet as Contracts,
|
||||
exec::{Ext, StorageKey, AccountIdOf, Executable, RentParams},
|
||||
gas::GasMeter,
|
||||
tests::{Test, Call, ALICE, BOB},
|
||||
|
||||
Reference in New Issue
Block a user