Skip to content

Commit

Permalink
rob-kusama-runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
rphmeier authored and pepyakin committed Dec 1, 2023
1 parent 2c0ebc3 commit a9574a5
Show file tree
Hide file tree
Showing 26 changed files with 1,672 additions and 85 deletions.
172 changes: 116 additions & 56 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ resolver = "2"
members = [
"sugondat-chain/node",
"sugondat-chain/pallets/*",
"sugondat-chain/runtime",
"sugondat-chain/runtimes/*",
"sugondat-chain/primitives",
"adapters/sovereign",
"sugondat-nmt",
Expand Down
6 changes: 3 additions & 3 deletions sugondat-chain/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ futures = "0.3.28"
serde_json = "1.0.108"

# Local
sugondat-runtime = { path = "../runtime" }
sugondat-test-runtime = { path = "../runtimes/test" }

# Substrate
frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.2.0" }
Expand Down Expand Up @@ -79,14 +79,14 @@ default = []
runtime-benchmarks = [
"frame-benchmarking-cli/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"sugondat-runtime/runtime-benchmarks",
"sugondat-test-runtime/runtime-benchmarks",
"polkadot-cli/runtime-benchmarks",
"polkadot-primitives/runtime-benchmarks",
"sc-service/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
]
try-runtime = [
"sugondat-runtime/try-runtime",
"sugondat-test-runtime/try-runtime",
"polkadot-cli/try-runtime",
"sp-runtime/try-runtime",
]
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ use sc_service::ChainType;
use serde::{Deserialize, Serialize};
use sp_core::{sr25519, Pair, Public};
use sp_runtime::traits::{IdentifyAccount, Verify};
use sugondat_runtime::{AccountId, AuraId, Signature, EXISTENTIAL_DEPOSIT};
use sugondat_test_runtime::{AccountId, AuraId, Signature, EXISTENTIAL_DEPOSIT};

/// Specialized `ChainSpec` for the normal parachain runtime.
pub type ChainSpec =
sc_service::GenericChainSpec<sugondat_runtime::RuntimeGenesisConfig, Extensions>;
sc_service::GenericChainSpec<sugondat_test_runtime::RuntimeGenesisConfig, Extensions>;

/// The default XCM version to set in genesis config.
const SAFE_XCM_VERSION: u32 = xcm::prelude::XCM_VERSION;
Expand Down Expand Up @@ -57,8 +57,8 @@ where
/// Generate the session keys from individual elements.
///
/// The input must be a tuple of individual keys (a single arg for now since we have just one key).
pub fn template_session_keys(keys: AuraId) -> sugondat_runtime::SessionKeys {
sugondat_runtime::SessionKeys { aura: keys }
pub fn template_session_keys(keys: AuraId) -> sugondat_test_runtime::SessionKeys {
sugondat_test_runtime::SessionKeys { aura: keys }
}

pub fn development_config() -> ChainSpec {
Expand Down Expand Up @@ -184,31 +184,31 @@ fn testnet_genesis(
endowed_accounts: Vec<AccountId>,
root: AccountId,
id: ParaId,
) -> sugondat_runtime::RuntimeGenesisConfig {
sugondat_runtime::RuntimeGenesisConfig {
system: sugondat_runtime::SystemConfig {
code: sugondat_runtime::WASM_BINARY
) -> sugondat_test_runtime::RuntimeGenesisConfig {
sugondat_test_runtime::RuntimeGenesisConfig {
system: sugondat_test_runtime::SystemConfig {
code: sugondat_test_runtime::WASM_BINARY
.expect("WASM binary was not build, please build it!")
.to_vec(),
..Default::default()
},
balances: sugondat_runtime::BalancesConfig {
balances: sugondat_test_runtime::BalancesConfig {
balances: endowed_accounts
.iter()
.cloned()
.map(|k| (k, 1 << 60))
.collect(),
},
parachain_info: sugondat_runtime::ParachainInfoConfig {
parachain_info: sugondat_test_runtime::ParachainInfoConfig {
parachain_id: id,
..Default::default()
},
collator_selection: sugondat_runtime::CollatorSelectionConfig {
collator_selection: sugondat_test_runtime::CollatorSelectionConfig {
invulnerables: invulnerables.iter().cloned().map(|(acc, _)| acc).collect(),
candidacy_bond: EXISTENTIAL_DEPOSIT * 16,
..Default::default()
},
session: sugondat_runtime::SessionConfig {
session: sugondat_test_runtime::SessionConfig {
keys: invulnerables
.into_iter()
.map(|(acc, aura)| {
Expand All @@ -225,11 +225,11 @@ fn testnet_genesis(
aura: Default::default(),
aura_ext: Default::default(),
parachain_system: Default::default(),
polkadot_xcm: sugondat_runtime::PolkadotXcmConfig {
polkadot_xcm: sugondat_test_runtime::PolkadotXcmConfig {
safe_xcm_version: Some(SAFE_XCM_VERSION),
..Default::default()
},
transaction_payment: Default::default(),
sudo: sugondat_runtime::SudoConfig { key: Some(root) },
sudo: sugondat_test_runtime::SudoConfig { key: Some(root) },
}
}
2 changes: 1 addition & 1 deletion sugondat-chain/node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use sc_cli::{
};
use sc_service::config::{BasePath, PrometheusConfig};
use sp_runtime::traits::AccountIdConversion;
use sugondat_runtime::Block;
use sugondat_test_runtime::Block;

use crate::{
chain_spec,
Expand Down
2 changes: 1 addition & 1 deletion sugondat-chain/node/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

use std::sync::Arc;

use sugondat_runtime::{opaque::Block, AccountId, Balance, Nonce};
use sugondat_test_runtime::{opaque::Block, AccountId, Balance, Nonce};

use sc_client_api::AuxStore;
pub use sc_rpc::DenyUnsafe;
Expand Down
6 changes: 3 additions & 3 deletions sugondat-chain/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{sync::Arc, time::Duration};

use cumulus_client_cli::CollatorOptions;
// Local Runtime Types
use sugondat_runtime::{
use sugondat_test_runtime::{
opaque::{Block, Hash},
RuntimeApi,
};
Expand Down Expand Up @@ -43,11 +43,11 @@ impl sc_executor::NativeExecutionDispatch for ParachainNativeExecutor {
type ExtendHostFunctions = frame_benchmarking::benchmarking::HostFunctions;

fn dispatch(method: &str, data: &[u8]) -> Option<Vec<u8>> {
sugondat_runtime::api::dispatch(method, data)
sugondat_test_runtime::api::dispatch(method, data)
}

fn native_version() -> sc_executor::NativeVersion {
sugondat_runtime::native_version()
sugondat_test_runtime::native_version()
}
}

Expand Down
Loading

0 comments on commit a9574a5

Please sign in to comment.