Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: testing chain spec extension #310

Merged
merged 3 commits into from
Jan 16, 2022
Merged
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
5 changes: 4 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ jobs:
test-inclusion:
needs: [build]
runs-on: ubuntu-latest
strategy:
matrix:
chain: [ main, testing ]
steps:
- uses: actions/checkout@v2
with:
Expand Down Expand Up @@ -184,7 +187,7 @@ jobs:
with:
node-version: '14'
check-latest: true
- run: npm install && npm start
- run: npm install && npm run ${{ matrix.chain }}
name: Launch rococo local & wait for inclusion
working-directory: scripts/wait-for-inclusion

Expand Down
2 changes: 1 addition & 1 deletion 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 node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "basilisk"
version = "5.1.0"
version = "5.1.1"
description = "Basilisk node"
authors = ["GalacticCouncil"]
edition = "2018"
Expand Down
1 change: 0 additions & 1 deletion node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ pub struct Extensions {

impl Extensions {
/// Try to get the extension from the given `ChainSpec`.
#[allow(clippy::borrowed_box)]
pub fn try_get(chain_spec: &dyn sc_service::ChainSpec) -> Option<&Self> {
sc_chain_spec::get_extension(chain_spec.extensions())
}
Expand Down
22 changes: 1 addition & 21 deletions node/src/testing_chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
use cumulus_primitives_core::ParaId;
use hex_literal::hex;
use primitives::{AssetId, BlockNumber, Price};
use sc_chain_spec::{ChainSpecExtension, ChainSpecGroup};
use sc_service::ChainType;
use serde::{Deserialize, Serialize};
use serde_json::map::Map;
use sp_core::{crypto::UncheckedInto, sr25519, Pair, Public};
use sp_runtime::traits::{IdentifyAccount, Verify};
Expand All @@ -33,32 +31,14 @@ use testing_basilisk_runtime::{
ParachainInfoConfig, SessionConfig, Signature, SudoConfig, SystemConfig, TechnicalCommitteeConfig, TokensConfig,
VestingConfig, NATIVE_EXISTENTIAL_DEPOSIT, UNITS, WASM_BINARY,
};
use crate::chain_spec::Extensions;

const TOKEN_DECIMALS: u8 = 12;
const TOKEN_SYMBOL: &str = "BSX";
const PROTOCOL_ID: &str = "bsx";
//Kusama parachain id
const PARA_ID: u32 = 2090;

/// The extensions for the [`ChainSpec`].
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ChainSpecGroup, ChainSpecExtension)]
#[serde(deny_unknown_fields)]
pub struct Extensions {
/// The relay chain of the Parachain.
pub relay_chain: String,
/// The id of the Parachain.
pub para_id: u32,
}

impl Extensions {
/// Try to get the extension from the given `ChainSpec`.
#[allow(clippy::borrowed_box)]
#[allow(dead_code)]
pub fn try_get(chain_spec: &Box<dyn sc_service::ChainSpec>) -> Option<&Self> {
sc_chain_spec::get_extension(chain_spec.extensions())
}
}

/// Specialized `ChainSpec`. This is a specialization of the general Substrate ChainSpec type.
pub type ChainSpec = sc_service::GenericChainSpec<GenesisConfig, Extensions>;

Expand Down
16 changes: 10 additions & 6 deletions rococo-local/testing-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@
"port": 30777
}
],
"runtime_genesis_config": {
"parachainsConfiguration": {
"config": {
"validation_upgrade_frequency": 1,
"validation_upgrade_delay": 1
"genesis": {
"runtime": {
"runtime_genesis_config": {
"configuration": {
"config": {
"validation_upgrade_frequency": 1,
"validation_upgrade_delay": 10
}
}
}
}
}
Expand All @@ -37,7 +41,7 @@
"parachains": [
{
"bin": "../target/release/testing-basilisk",
"chain":"dev",
"chain":"local",
"balance": "1000000000000000000000",
"nodes": [
{
Expand Down
169 changes: 168 additions & 1 deletion scripts/wait-for-inclusion/package-lock.json

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

Loading