mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 12:41:07 +00:00
Zombienet add tests (#1321)
* changes to read json spec in test binary
* add zombienet tests
* fmt
* use {{COL_IMAGE}} and clean config
* add comment and use relay image from env
* use test-parachain image from pr
* fix warns
* fix warns
* fmt
* typo
* fix ci to use zombienet image
* fix spawn nodes for test
* reorg test
* add within to test
* remove check for full node collators is up
* add tests for pov, mirate solo to para, sync blocks
* bump zombienet image
* add job dep with artifacts
* add sleep for test
* fix after merge
* fmt
* bump zombienet version
* changes from clap
* use base/shared params
* fmt
* debug ci
* add upgrade test
* update js test for debug
* less debug in test
* print assertion
* fix upgrade test
* Collator key only needed if we run as collator
* [Fix] Benchmark build artifact folder creation (#1518)
* Trivial networking changes for Substrate PR #11940 (#1486)
* Trivial networking changes for Substrate PR https://github.com/paritytech/substrate/pull/11940
* Apply formatting rules
* update lockfile for {"polkadot", "substrate"}
Co-authored-by: parity-processbot <>
* bump zombienet version
* update network def for test
* typo
Co-authored-by: Sebastian Kunert <skunert49@gmail.com>
Co-authored-by: Roman Useinov <roman.useinov@gmail.com>
Co-authored-by: Nazar Mokrynskyi <nazar@mokrynskyi.com>
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
mod cli;
|
||||
|
||||
use std::sync::Arc;
|
||||
use std::{io::Write, sync::Arc};
|
||||
|
||||
use cli::{RelayChainCli, Subcommand, TestCollatorCli};
|
||||
use cumulus_client_cli::generate_genesis_block;
|
||||
@@ -43,14 +43,31 @@ fn main() -> Result<(), sc_cli::Error> {
|
||||
let runner = cli.create_runner(cmd)?;
|
||||
runner.sync_run(|config| cmd.run(config.chain_spec, config.network))
|
||||
},
|
||||
Some(Subcommand::ExportGenesisState(cmd)) => {
|
||||
let runner = cli.create_runner(cmd)?;
|
||||
runner.sync_run(|_config| {
|
||||
let parachain_id = ParaId::from(cmd.parachain_id);
|
||||
let spec = cumulus_test_service::get_chain_spec(parachain_id);
|
||||
let state_version = cumulus_test_service::runtime::VERSION.state_version();
|
||||
cmd.base.run::<parachains_common::Block>(&spec, state_version)
|
||||
})
|
||||
|
||||
Some(Subcommand::ExportGenesisState(params)) => {
|
||||
let mut builder = sc_cli::LoggerBuilder::new("");
|
||||
builder.with_profiling(sc_tracing::TracingReceiver::Log, "");
|
||||
let _ = builder.init();
|
||||
|
||||
let spec =
|
||||
cli.load_spec(¶ms.base.shared_params.chain.clone().unwrap_or_default())?;
|
||||
let state_version = cumulus_test_service::runtime::VERSION.state_version();
|
||||
|
||||
let block: parachains_common::Block = generate_genesis_block(&*spec, state_version)?;
|
||||
let raw_header = block.header().encode();
|
||||
let output_buf = if params.base.raw {
|
||||
raw_header
|
||||
} else {
|
||||
format!("0x{:?}", HexDisplay::from(&block.header().encode())).into_bytes()
|
||||
};
|
||||
|
||||
if let Some(output) = ¶ms.base.output {
|
||||
std::fs::write(output, output_buf)?;
|
||||
} else {
|
||||
std::io::stdout().write_all(&output_buf)?;
|
||||
}
|
||||
|
||||
Ok(())
|
||||
},
|
||||
Some(Subcommand::ExportGenesisWasm(cmd)) => {
|
||||
let runner = cli.create_runner(cmd)?;
|
||||
@@ -106,7 +123,7 @@ fn main() -> Result<(), sc_cli::Error> {
|
||||
if config.role.is_authority() { "yes" } else { "no" }
|
||||
);
|
||||
|
||||
let collator_key = Some(CollatorPair::generate().0);
|
||||
let collator_key = config.role.is_authority().then(|| CollatorPair::generate().0);
|
||||
|
||||
let consensus = cli
|
||||
.use_null_consensus
|
||||
|
||||
Reference in New Issue
Block a user