Skip to content

Commit

Permalink
Merge pull request #19 from mangata-finance/feature/charleth
Browse files Browse the repository at this point in the history
Charleth support
  • Loading branch information
mateuszaaa authored Jul 4, 2024
2 parents 3aa09bb + 3c1c68a commit bc44f82
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 12 deletions.
1 change: 0 additions & 1 deletion Cargo.lock

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

Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,8 @@ where
// there might be some txs comming in that time - so its better to sleep than
// shortening remaining time
debug!(target: LOG_TARGET, "sleeping by the end of the slot");
first_slot_limit.await;
//TODO: figure out better fix
// first_slot_limit.await;

// artificially simulate that block is half filled
// also include header & proof cost for the second part to make sure
Expand Down
26 changes: 16 additions & 10 deletions substrate/client/cli/src/commands/run_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,44 +149,48 @@ pub struct RunCmd {
pub keystore_params: KeystoreParams,

/// Shortcut for `--name Alice --validator` with session keys for `Alice` added to keystore.
#[arg(long, conflicts_with_all = &["alice", "bob", "charlie", "dave", "eve", "ferdie", "one", "two"])]
#[arg(long, conflicts_with_all = &["alice", "bob", "charlie", "dave", "eve", "ferdie", "one", "two", "baltathar", "charleth"])]
pub alith: bool,

/// Shortcut for `--name Bob --validator` with session keys for `Bob` added to keystore.
#[arg(long, conflicts_with_all = &["alice", "bob", "charlie", "dave", "eve", "ferdie", "one", "two"])]
#[arg(long, conflicts_with_all = &["alice", "bob", "charlie", "dave", "eve", "ferdie", "one", "two", "alith", "charleth"])]
pub baltathar: bool,

/// Shortcut for `--name Bob --validator` with session keys for `Bob` added to keystore.
#[arg(long, conflicts_with_all = &["alice", "bob", "charlie", "dave", "eve", "ferdie", "one", "two", "alith", "charleth"])]
pub baltathar: bool,

/// Shortcut for `--name Alice --validator` with session keys for `Alice` added to keystore.
#[arg(long, conflicts_with_all = &["bob", "charlie", "dave", "eve", "ferdie", "one", "two", "alith", "baltathar"])]
#[arg(long, conflicts_with_all = &["bob", "charlie", "dave", "eve", "ferdie", "one", "two", "alith", "baltathar", "charleth"])]
pub alice: bool,

/// Shortcut for `--name Bob --validator` with session keys for `Bob` added to keystore.
#[arg(long, conflicts_with_all = &["alice", "charlie", "dave", "eve", "ferdie", "one", "two", "alith", "baltathar"])]
#[arg(long, conflicts_with_all = &["alice", "charlie", "dave", "eve", "ferdie", "one", "two", "alith", "baltathar", "charleth"])]
pub bob: bool,

/// Shortcut for `--name Charlie --validator` with session keys for `Charlie` added to
/// keystore.
#[arg(long, conflicts_with_all = &["alice", "bob", "dave", "eve", "ferdie", "one", "two", "alith", "baltathar"])]
#[arg(long, conflicts_with_all = &["alice", "bob", "dave", "eve", "ferdie", "one", "two", "alith", "baltathar", "charleth"])]
pub charlie: bool,

/// Shortcut for `--name Dave --validator` with session keys for `Dave` added to keystore.
#[arg(long, conflicts_with_all = &["alice", "bob", "charlie", "eve", "ferdie", "one", "two", "alith", "baltathar"])]
#[arg(long, conflicts_with_all = &["alice", "bob", "charlie", "eve", "ferdie", "one", "two", "alith", "baltathar", "charleth"])]
pub dave: bool,

/// Shortcut for `--name Eve --validator` with session keys for `Eve` added to keystore.
#[arg(long, conflicts_with_all = &["alice", "bob", "charlie", "dave", "ferdie", "one", "two", "alith", "baltathar"])]
#[arg(long, conflicts_with_all = &["alice", "bob", "charlie", "dave", "ferdie", "one", "two", "alith", "baltathar", "charleth"])]
pub eve: bool,

/// Shortcut for `--name Ferdie --validator` with session keys for `Ferdie` added to keystore.
#[arg(long, conflicts_with_all = &["alice", "bob", "charlie", "dave", "eve", "one", "two", "alith", "baltathar"])]
#[arg(long, conflicts_with_all = &["alice", "bob", "charlie", "dave", "eve", "one", "two", "alith", "baltathar", "charleth"])]
pub ferdie: bool,

/// Shortcut for `--name One --validator` with session keys for `One` added to keystore.
#[arg(long, conflicts_with_all = &["alice", "bob", "charlie", "dave", "eve", "ferdie", "two", "alith", "baltathar"])]
#[arg(long, conflicts_with_all = &["alice", "bob", "charlie", "dave", "eve", "ferdie", "two", "alith", "baltathar", "charleth"])]
pub one: bool,

/// Shortcut for `--name Two --validator` with session keys for `Two` added to keystore.
#[arg(long, conflicts_with_all = &["alice", "bob", "charlie", "dave", "eve", "ferdie", "one", "alith", "baltathar"])]
#[arg(long, conflicts_with_all = &["alice", "bob", "charlie", "dave", "eve", "ferdie", "one", "alith", "baltathar", "charleth"])]
pub two: bool,

/// Enable authoring even when offline.
Expand All @@ -212,6 +216,8 @@ impl RunCmd {
Some(Alith)
} else if self.baltathar {
Some(Baltathar)
} else if self.charleth {
Some(Charleth)
} else if self.alice {
Some(Alice)
} else if self.bob {
Expand Down
2 changes: 2 additions & 0 deletions substrate/primitives/keyring/src/ed25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ pub enum Keyring {
Two,
Alith,
Baltathar,
Charleth,
}

impl Keyring {
Expand Down Expand Up @@ -110,6 +111,7 @@ impl From<Keyring> for &'static str {
Keyring::Two => "Two",
Keyring::Alith => "Alith",
Keyring::Baltathar => "Baltathar",
Keyring::Charleth => "Charleth,
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions substrate/primitives/keyring/src/sr25519.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ pub enum Keyring {
Two,
Alith,
Baltathar,
Charleth,
}

impl Keyring {
Expand Down Expand Up @@ -120,6 +121,7 @@ impl From<Keyring> for &'static str {
Keyring::Two => "Two",
Keyring::Alith => "Alith",
Keyring::Baltathar => "Baltathar",
Keyring::Charleth => "Charleth",
}
}
}
Expand Down Expand Up @@ -154,6 +156,7 @@ impl std::str::FromStr for Keyring {
"two" => Ok(Keyring::Two),
"Alith" => Ok(Keyring::Alith),
"Baltathar" => Ok(Keyring::Baltathar),
"Charleth" => Ok(Keyring::Charleth),
_ => Err(ParseKeyringError),
}
}
Expand Down

0 comments on commit bc44f82

Please sign in to comment.