use frame_support::runtime; use polkadot_sdk::*; use polkadot_sdk::{ polkadot_sdk_frame::{log, runtime::prelude::*}, sp_runtime::{AccountId32, Perbill}, }; pub type Balance = u128; pub type AccountId = pallet_revive::DefaultAddressMapper; pub type Block = frame_system::mocking::MockBlock; pub type Hash = ::Hash; pub type EventRecord = frame_system::EventRecord<::RuntimeEvent, Hash>; #[runtime] mod runtime { #[runtime::runtime] #[runtime::derive( RuntimeCall, RuntimeEvent, RuntimeError, RuntimeOrigin, RuntimeFreezeReason, RuntimeHoldReason, RuntimeSlashReason, RuntimeLockId, RuntimeTask )] pub struct Runtime; #[runtime::pallet_index(0)] pub type System = frame_system; #[runtime::pallet_index(1)] pub type Timestamp = pallet_timestamp; #[runtime::pallet_index(2)] pub type Balances = pallet_balances; #[runtime::pallet_index(3)] pub type Contracts = pallet_revive; } #[derive_impl(frame_system::config_preludes::SolochainDefaultConfig)] impl frame_system::Config for Runtime { type Block = Block; type AccountId = AccountId32; type AccountData = pallet_balances::AccountData<::Balance>; } #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)] impl pallet_balances::Config for Runtime { type AccountStore = System; type Balance = Balance; type ExistentialDeposit = ConstU128<1_000>; } #[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)] impl pallet_timestamp::Config for Runtime {} parameter_types! { pub const UnstableInterface: bool = true; pub const DepositPerByte: Balance = 1; pub const DepositPerItem: Balance = 2; pub const CodeHashLockupDepositPercent: Perbill = Perbill::from_percent(0); } #[derive_impl(pallet_revive::config_preludes::TestDefaultConfig)] impl pallet_revive::Config for Runtime { type Time = Timestamp; type Currency = Balances; type CallFilter = (); type ChainExtension = (); type DepositPerByte = DepositPerByte; type DepositPerItem = DepositPerItem; type AddressMapper = AccountId; type RuntimeMemory = ConstU32<{ 512 * 1024 * 1024 }>; type PVFMemory = ConstU32<{ 1024 * 1024 * 1024 }>; type MaxCodeLen = ConstU32<{ 256 * 1024 }>; type UnsafeUnstableInterface = UnstableInterface; type UploadOrigin = EnsureSigned; type InstantiateOrigin = EnsureSigned; type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent; type Debug = (); }