mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-21 07:25:44 +00:00
Public extrinsic apply doesn't panic (#178)
* Merge remote-tracking branch 'origin/master' into gav-xts-dont-panic * Update wasm. * consensus, session and staking all panic-safe. * Democracy doesn't panic in apply. * Fix tests. * Extra helper macro, council depanicked. * Fix one test. * Fix up all council tests. No panics! * Council voting depanicked. * utilise hygene
This commit is contained in:
@@ -65,6 +65,6 @@ args:
|
|||||||
- chain:
|
- chain:
|
||||||
long: chain
|
long: chain
|
||||||
value_name: CHAIN_SPEC
|
value_name: CHAIN_SPEC
|
||||||
help: Specify the chain specification (one of dev, local or poc-1)
|
help: Specify the chain specification (one of dev, local or poc-2)
|
||||||
takes_value: true
|
takes_value: true
|
||||||
subcommands:
|
subcommands:
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ impl substrate_rpc::system::SystemApi for Configuration {
|
|||||||
Ok(match self.0.chain_spec {
|
Ok(match self.0.chain_spec {
|
||||||
ChainSpec::Development => "dev",
|
ChainSpec::Development => "dev",
|
||||||
ChainSpec::LocalTestnet => "local",
|
ChainSpec::LocalTestnet => "local",
|
||||||
ChainSpec::PoC1Testnet => "poc-1",
|
ChainSpec::PoC2Testnet => "poc-2",
|
||||||
}.into())
|
}.into())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -174,14 +174,14 @@ pub fn run<I, T>(args: I) -> error::Result<()> where
|
|||||||
match matches.value_of("chain") {
|
match matches.value_of("chain") {
|
||||||
Some("dev") => config.chain_spec = ChainSpec::Development,
|
Some("dev") => config.chain_spec = ChainSpec::Development,
|
||||||
Some("local") => config.chain_spec = ChainSpec::LocalTestnet,
|
Some("local") => config.chain_spec = ChainSpec::LocalTestnet,
|
||||||
Some("poc-1") => config.chain_spec = ChainSpec::PoC1Testnet,
|
Some("poc-2") => config.chain_spec = ChainSpec::PoC2Testnet,
|
||||||
None => (),
|
None => (),
|
||||||
Some(unknown) => panic!("Invalid chain name: {}", unknown),
|
Some(unknown) => panic!("Invalid chain name: {}", unknown),
|
||||||
}
|
}
|
||||||
info!("Chain specification: {}", match config.chain_spec {
|
info!("Chain specification: {}", match config.chain_spec {
|
||||||
ChainSpec::Development => "Development",
|
ChainSpec::Development => "Development",
|
||||||
ChainSpec::LocalTestnet => "Local Testnet",
|
ChainSpec::LocalTestnet => "Local Testnet",
|
||||||
ChainSpec::PoC1Testnet => "PoC-1 Testnet",
|
ChainSpec::PoC2Testnet => "PoC-2 Testnet",
|
||||||
});
|
});
|
||||||
|
|
||||||
config.roles = role;
|
config.roles = role;
|
||||||
|
|||||||
BIN
Binary file not shown.
Binary file not shown.
@@ -28,8 +28,8 @@ pub enum ChainSpec {
|
|||||||
Development,
|
Development,
|
||||||
/// Whatever the current runtime is, with simple Alice/Bob auths.
|
/// Whatever the current runtime is, with simple Alice/Bob auths.
|
||||||
LocalTestnet,
|
LocalTestnet,
|
||||||
/// The PoC-1 testnet.
|
/// The PoC-2 testnet.
|
||||||
PoC1Testnet,
|
PoC2Testnet,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Service configuration.
|
/// Service configuration.
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ pub struct ChainConfig {
|
|||||||
boot_nodes: Vec<String>,
|
boot_nodes: Vec<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn poc_1_testnet_config() -> ChainConfig {
|
fn poc_2_testnet_config() -> ChainConfig {
|
||||||
let initial_authorities = vec![
|
let initial_authorities = vec![
|
||||||
hex!["82c39b31a2b79a90f8e66e7a77fdb85a4ed5517f2ae39f6a80565e8ecae85cf5"].into(),
|
hex!["82c39b31a2b79a90f8e66e7a77fdb85a4ed5517f2ae39f6a80565e8ecae85cf5"].into(),
|
||||||
hex!["4de37a07567ebcbf8c64568428a835269a566723687058e017b6d69db00a77e7"].into(),
|
hex!["4de37a07567ebcbf8c64568428a835269a566723687058e017b6d69db00a77e7"].into(),
|
||||||
@@ -164,7 +164,8 @@ fn poc_1_testnet_config() -> ChainConfig {
|
|||||||
staking: Some(StakingConfig {
|
staking: Some(StakingConfig {
|
||||||
current_era: 0,
|
current_era: 0,
|
||||||
intentions: initial_authorities.clone(),
|
intentions: initial_authorities.clone(),
|
||||||
transaction_fee: 100,
|
transaction_base_fee: 100,
|
||||||
|
transaction_byte_fee: 1,
|
||||||
balances: endowed_accounts.iter().map(|&k|(k, 1u128 << 60)).collect(),
|
balances: endowed_accounts.iter().map(|&k|(k, 1u128 << 60)).collect(),
|
||||||
validator_count: 12,
|
validator_count: 12,
|
||||||
sessions_per_era: 24, // 24 hours per era.
|
sessions_per_era: 24, // 24 hours per era.
|
||||||
@@ -222,7 +223,8 @@ fn testnet_config(initial_authorities: Vec<AuthorityId>) -> ChainConfig {
|
|||||||
staking: Some(StakingConfig {
|
staking: Some(StakingConfig {
|
||||||
current_era: 0,
|
current_era: 0,
|
||||||
intentions: initial_authorities.clone(),
|
intentions: initial_authorities.clone(),
|
||||||
transaction_fee: 1,
|
transaction_base_fee: 1,
|
||||||
|
transaction_byte_fee: 0,
|
||||||
balances: endowed_accounts.iter().map(|&k|(k, (1u128 << 60))).collect(),
|
balances: endowed_accounts.iter().map(|&k|(k, (1u128 << 60))).collect(),
|
||||||
validator_count: 2,
|
validator_count: 2,
|
||||||
sessions_per_era: 5,
|
sessions_per_era: 5,
|
||||||
@@ -364,7 +366,7 @@ impl<B, E> Service<B, E>
|
|||||||
let ChainConfig { genesis_config, boot_nodes } = match config.chain_spec {
|
let ChainConfig { genesis_config, boot_nodes } = match config.chain_spec {
|
||||||
ChainSpec::Development => development_config(),
|
ChainSpec::Development => development_config(),
|
||||||
ChainSpec::LocalTestnet => local_testnet_config(),
|
ChainSpec::LocalTestnet => local_testnet_config(),
|
||||||
ChainSpec::PoC1Testnet => poc_1_testnet_config(),
|
ChainSpec::PoC2Testnet => poc_2_testnet_config(),
|
||||||
};
|
};
|
||||||
config.network.boot_nodes.extend(boot_nodes);
|
config.network.boot_nodes.extend(boot_nodes);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user