Skip to content

Commit

Permalink
Pushed event
Browse files Browse the repository at this point in the history
  • Loading branch information
1 parent 3cc5bf5 commit 482c05e
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 45 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

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

18 changes: 6 additions & 12 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "minimal-template-node"
description = "A minimal Substrate-based Substrate node, ready for hacking."
version = "0.0.0"
description = "A miniaml Substrate-based Substrate node, ready for hacking. (polkadot v1.9.0)"
version = "0.1.0"
license = "MIT-0"
edition = "2021"
publish = false
Expand All @@ -13,12 +13,11 @@ build = "build.rs"
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
clap = { version = "4.5.3", features = ["derive"] }
futures = { version = "0.3.30", features = ["thread-pool"] }
clap = { version = "4.5.1", features = ["derive"] }
futures = { version = "0.3.21", features = ["thread-pool"] }
futures-timer = "3.0.1"
jsonrpsee = { version = "0.22", features = ["server"] }
serde_json = { version = "1.0.114", default-features = true }

sc-cli = { version = "0.39.0" }
sc-executor = { version = "0.35.0" }
sc-network = { version = "0.37.0" }
Expand All @@ -32,24 +31,19 @@ sc-rpc-api = { version = "0.36.0" }
sc-basic-authorship = { version = "0.37.0" }
sc-offchain = { version = "32.0.0" }
sc-client-api = { version = "31.0.0" }

sp-timestamp = { version = "29.0.0" }
sp-keyring = { version = "34.0.0" }
sp-api = { version = "29.0.0" }
sp-blockchain = { version = "31.0.0" }
sp-block-builder = { version = "29.0.0" }
sp-io = { version = "33.0.0" }
sp-runtime = { version = "34.0.0" }

substrate-frame-rpc-system = { version = "31.0.0" }

# Once the native runtime is gone, there should be little to no dependency on FRAME here, and
# certainly no dependency on the runtime.
polkadot-sdk-frame = { version = "0.1.1", features = [
"experimental",
"runtime",
] }
runtime = { package = "minimal-template-runtime", path = "../runtime" }
frame = { version = "0.1.1", package = "polkadot-sdk-frame", features = ["experimental", "runtime"] }
runtime = { package = "minimal-template-runtime", path = "../runtime", version = "0.1.0" }

[build-dependencies]
substrate-build-script-utils = { version = "11.0.0" }
Expand Down
2 changes: 1 addition & 1 deletion node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub fn development_config() -> Result<ChainSpec, String> {

/// Configure initial storage state for FRAME pallets.
fn testnet_genesis() -> Value {
use polkadot_sdk_frame::traits::Get;
use frame::traits::Get;
use runtime::interface::{Balance, MinimumBalance};
let endowment = <MinimumBalance as Get<Balance>>::get().max(1) * 1000;
let balances = AccountKeyring::iter()
Expand Down
13 changes: 5 additions & 8 deletions pallets/template/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "pallet-minimal-template"
description = "A minimal pallet built with FRAME, part of Polkadot Sdk."
version = "0.0.0"
description = "A minimal pallet built with FRAME, part of Polkadot Sdk. (polkadot v1.9.0)"
version = "0.1.0"
license = "MIT-0"
edition = "2021"
publish = false
Expand All @@ -15,15 +15,12 @@ targets = ["x86_64-unknown-linux-gnu"]
codec = { package = "parity-scale-codec", version = "3.0.0", features = [
"derive",
], default-features = false }
scale-info = { version = "2.11.1", default-features = false, features = [
scale-info = { version = "2.10.0", default-features = false, features = [
"derive",
] }
polkadot-sdk-frame = { version = "0.1.1", default-features = false, features = [
"experimental",
"runtime",
] }
frame = { version = "0.1.1", package = "polkadot-sdk-frame", default-features = false, features = ["experimental", "runtime"] }


[features]
default = ["std"]
std = ["codec/std", "polkadot-sdk-frame/std", "scale-info/std"]
std = ["codec/std", "frame/std", "scale-info/std"]
6 changes: 3 additions & 3 deletions pallets/template/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//! A shell pallet built with [`polkadot_sdk_frame`].
//! A shell pallet built with [`frame`].
#![cfg_attr(not(feature = "std"), no_std)]

use polkadot_sdk_frame::prelude::*;
use frame::prelude::*;

// Re-export all pallet parts, this is needed to properly import the pallet into the runtime.
pub use pallet::*;

#[polkadot_sdk_frame::pallet]
#[frame::pallet]
pub mod pallet {
use super::*;

Expand Down
15 changes: 6 additions & 9 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "minimal-template-runtime"
description = "A solochain runtime template built with Substrate, part of Polkadot Sdk."
version = "0.0.0"
description = "A solochain runtime template built with Substrate, part of Polkadot Sdk. (polkadot v1.9.0)"
version = "0.1.0"
license = "MIT-0"
edition = "2021"
publish = false
Expand All @@ -13,10 +13,7 @@ parity-scale-codec = { version = "3.0.0", default-features = false }
scale-info = { version = "2.6.0", default-features = false }

# this is a frame-based runtime, thus importing `frame` with runtime feature enabled.
polkadot-sdk-frame = { version = "0.1.1", default-features = false, features = [
"experimental",
"runtime",
] }
frame = { version = "0.1.1", package = "polkadot-sdk-frame", default-features = false, features = ["experimental", "runtime"] }

# pallets that we want to use
pallet-balances = { version = "31.0.0", default-features = false }
Expand All @@ -25,11 +22,11 @@ pallet-timestamp = { version = "30.0.0", default-features = false }
pallet-transaction-payment = { version = "31.0.0", default-features = false }
pallet-transaction-payment-rpc-runtime-api = { version = "31.0.0", default-features = false }

# genesis builder that allows us to interact with runtime genesis config
# genesis builder that allows us to interacto with runtime genesis config
sp-genesis-builder = { version = "0.10.0", default-features = false }

# local pallet templates
pallet-minimal-template = { path = "../pallets/template", default-features = false }
pallet-minimal-template = { path = "../pallets/template", default-features = false, version = "0.1.0" }

[build-dependencies]
substrate-wasm-builder = { version = "20.0.0", optional = true }
Expand All @@ -40,7 +37,7 @@ std = [
"parity-scale-codec/std",
"scale-info/std",

"polkadot-sdk-frame/std",
"frame/std",

"pallet-balances/std",
"pallet-sudo/std",
Expand Down
18 changes: 9 additions & 9 deletions runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#[cfg(feature = "std")]
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));

use polkadot_sdk_frame::{
use frame::{
deps::frame_support::{
genesis_builder_helper::{build_config, create_default_config},
weights::{FixedFee, NoFee},
Expand Down Expand Up @@ -86,26 +86,26 @@ parameter_types! {
pub const Version: RuntimeVersion = VERSION;
}

#[derive_impl(frame_system::config_preludes::SolochainDefaultConfig)]
#[derive_impl(frame_system::config_preludes::SolochainDefaultConfig as frame_system::DefaultConfig)]
impl frame_system::Config for Runtime {
type Block = Block;
type Version = Version;
type BlockHashCount = ConstU32<1024>;
type AccountData = pallet_balances::AccountData<<Runtime as pallet_balances::Config>::Balance>;
}

#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig)]
#[derive_impl(pallet_balances::config_preludes::TestDefaultConfig as pallet_balances::DefaultConfig)]
impl pallet_balances::Config for Runtime {
type AccountStore = System;
}

#[derive_impl(pallet_sudo::config_preludes::TestDefaultConfig)]
#[derive_impl(pallet_sudo::config_preludes::TestDefaultConfig as pallet_sudo::DefaultConfig)]
impl pallet_sudo::Config for Runtime {}

#[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig)]
#[derive_impl(pallet_timestamp::config_preludes::TestDefaultConfig as pallet_timestamp::DefaultConfig)]
impl pallet_timestamp::Config for Runtime {}

#[derive_impl(pallet_transaction_payment::config_preludes::TestDefaultConfig)]
#[derive_impl(pallet_transaction_payment::config_preludes::TestDefaultConfig as pallet_transaction_payment::DefaultConfig)]
impl pallet_transaction_payment::Config for Runtime {
type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter<Balances, ()>;
type WeightToFee = NoFee<<Self as pallet_balances::Config>::Balance>;
Expand All @@ -114,7 +114,7 @@ impl pallet_transaction_payment::Config for Runtime {

impl pallet_minimal_template::Config for Runtime {}

type Block = polkadot_sdk_frame::runtime::types_common::BlockOf<Runtime, SignedExtra>;
type Block = frame::runtime::types_common::BlockOf<Runtime, SignedExtra>;
type Header = HeaderFor<Runtime>;

type RuntimeExecutive =
Expand Down Expand Up @@ -241,10 +241,10 @@ impl_runtime_apis! {
// https://github.com/paritytech/substrate/issues/10579#issuecomment-1600537558
pub mod interface {
use super::Runtime;
use polkadot_sdk_frame::deps::frame_system;
use frame::deps::frame_system;

pub type Block = super::Block;
pub use polkadot_sdk_frame::runtime::types_common::OpaqueBlock;
pub use frame::runtime::types_common::OpaqueBlock;
pub type AccountId = <Runtime as frame_system::Config>::AccountId;
pub type Nonce = <Runtime as frame_system::Config>::Nonce;
pub type Hash = <Runtime as frame_system::Config>::Hash;
Expand Down

0 comments on commit 482c05e

Please sign in to comment.