diff --git a/Cargo.lock b/Cargo.lock index 687935c21fd6d..59a716fbc56a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18481,9 +18481,11 @@ version = "0.0.0" dependencies = [ "array-bytes 6.2.2", "parity-scale-codec", + "polkadot-runtime-common", "polkadot-sdk", "scale-info", "serde_json", + "testnet-parachains-constants", ] [[package]] diff --git a/substrate/frame/revive/dev-node/runtime/Cargo.toml b/substrate/frame/revive/dev-node/runtime/Cargo.toml index 3b5f144689e86..36d32b767039e 100644 --- a/substrate/frame/revive/dev-node/runtime/Cargo.toml +++ b/substrate/frame/revive/dev-node/runtime/Cargo.toml @@ -22,6 +22,8 @@ polkadot-sdk = { workspace = true, features = [ "runtime", "with-tracing", ] } +polkadot-runtime-common = { workspace = true } +testnet-parachains-constants = { features = ["westend"], workspace = true } scale-info = { workspace = true } serde_json = { workspace = true, default-features = false, features = ["alloc"] } @@ -33,6 +35,8 @@ default = ["std"] std = [ "codec/std", "polkadot-sdk/std", + "polkadot-runtime-common/std", + "testnet-parachains-constants/std", "scale-info/std", "serde_json/std", ] diff --git a/substrate/frame/revive/dev-node/runtime/src/lib.rs b/substrate/frame/revive/dev-node/runtime/src/lib.rs index fcfc12afc66e7..82c61bb669b2b 100644 --- a/substrate/frame/revive/dev-node/runtime/src/lib.rs +++ b/substrate/frame/revive/dev-node/runtime/src/lib.rs @@ -39,7 +39,9 @@ use polkadot_sdk::{ }, *, }; -use sp_weights::{ConstantMultiplier, IdentityFee}; +use polkadot_runtime_common::SlowAdjustingFeeUpdate; +use sp_weights::ConstantMultiplier; +use testnet_parachains_constants::westend::{currency::deposit, fee::WeightToFee}; pub use polkadot_sdk::{ parachains_common::{AccountId, Balance, BlockNumber, Hash, Header, Nonce, Signature}, @@ -304,15 +306,21 @@ impl pallet_sudo::Config for Runtime {} impl pallet_timestamp::Config for Runtime {} parameter_types! { - pub const TransactionByteFee: Balance = 10 * MILLICENTS; + /// Relay Chain `TransactionByteFee` / 10 + pub const TransactionByteFee: Balance = MILLICENTS; + pub const DepositPerItem: Balance = deposit(1, 0); + pub const DepositPerByte: Balance = deposit(0, 1); } // Implements the types required for the transaction payment pallet. -#[derive_impl(pallet_transaction_payment::config_preludes::TestDefaultConfig)] impl pallet_transaction_payment::Config for Runtime { + type RuntimeEvent = RuntimeEvent; type OnChargeTransaction = pallet_transaction_payment::FungibleAdapter; - type WeightToFee = IdentityFee; + type WeightToFee = WeightToFee; type LengthToFee = ConstantMultiplier; + type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; + type OperationalFeeMultiplier = ConstU8<5>; + type WeightInfo = (); } parameter_types! { @@ -325,6 +333,8 @@ impl pallet_revive::Config for Runtime { type ChainId = ConstU64<420_420_420>; type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent; type Currency = Balances; + type DepositPerItem = DepositPerItem; + type DepositPerByte = DepositPerByte; type NativeToEthRatio = ConstU32<1_000_000>; type UploadOrigin = EnsureSigned; type InstantiateOrigin = EnsureSigned;