Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions substrate/frame/revive/dev-node/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }

Expand All @@ -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",
]
18 changes: 14 additions & 4 deletions substrate/frame/revive/dev-node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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},
Expand Down Expand Up @@ -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<Balances, ()>;
type WeightToFee = IdentityFee<Balance>;
type WeightToFee = WeightToFee;
type LengthToFee = ConstantMultiplier<Balance, TransactionByteFee>;
type FeeMultiplierUpdate = SlowAdjustingFeeUpdate<Self>;
type OperationalFeeMultiplier = ConstU8<5>;
type WeightInfo = ();
}

parameter_types! {
Expand All @@ -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<Self::AccountId>;
type InstantiateOrigin = EnsureSigned<Self::AccountId>;
Expand Down
Loading