mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 15:41:02 +00:00
Stored conversion rate updater (#1005)
* update conversion rate: initial commit * Rialto=Polkadot && Millau=Kusama + actually update conversion rates * update deployment scripts and readme * allow non-zero difference between stored and real rates * dummy commit * Revert "dummy commit" This reverts commit a438198180a8385feeaaca60c9d2da0950465215. * clippy * #[allow(clippy::float_cmp)] in conversion rate update * dummy * Revert "dummy" This reverts commit 90cd6e47cda56f655e94dbef76138e6cc58d664a. * spell * shared_value_ref() -> get() * Revert "shared_value_ref() -> get()" This reverts commit 20aa30de6a59b2099cfba3e9676e71200b7bb468.
This commit is contained in:
committed by
Bastian Köcher
parent
fc9363619a
commit
3ef4574594
@@ -391,6 +391,17 @@ macro_rules! declare_chain_options {
|
||||
pub [<$chain_prefix _signer_password_file>]: Option<std::path::PathBuf>,
|
||||
}
|
||||
|
||||
#[doc = "Parameters required to sign transaction on behalf of owner of the messages pallet at " $chain "."]
|
||||
#[derive(StructOpt, Debug, PartialEq, Eq)]
|
||||
pub struct [<$chain MessagesPalletOwnerSigningParams>] {
|
||||
#[doc = "The SURI of secret key to use when transactions are submitted to the " $chain " node."]
|
||||
#[structopt(long)]
|
||||
pub [<$chain_prefix _messages_pallet_owner>]: Option<String>,
|
||||
#[doc = "The password for the SURI of secret key to use when transactions are submitted to the " $chain " node."]
|
||||
#[structopt(long)]
|
||||
pub [<$chain_prefix _messages_pallet_owner_password>]: Option<String>,
|
||||
}
|
||||
|
||||
impl [<$chain SigningParams>] {
|
||||
/// Parse signing params into chain-specific KeyPair.
|
||||
pub fn to_keypair<Chain: CliChain>(&self) -> anyhow::Result<Chain::KeyPair> {
|
||||
@@ -433,6 +444,23 @@ macro_rules! declare_chain_options {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
impl [<$chain MessagesPalletOwnerSigningParams>] {
|
||||
/// Parse signing params into chain-specific KeyPair.
|
||||
pub fn to_keypair<Chain: CliChain>(&self) -> anyhow::Result<Option<Chain::KeyPair>> {
|
||||
use sp_core::crypto::Pair;
|
||||
|
||||
let [<$chain_prefix _messages_pallet_owner>] = match self.[<$chain_prefix _messages_pallet_owner>] {
|
||||
Some(ref messages_pallet_owner) => messages_pallet_owner,
|
||||
None => return Ok(None),
|
||||
};
|
||||
Chain::KeyPair::from_string(
|
||||
[<$chain_prefix _messages_pallet_owner>],
|
||||
self.[<$chain_prefix _messages_pallet_owner_password>].as_deref()
|
||||
).map_err(|e| anyhow::format_err!("{:?}", e)).map(Some)
|
||||
}
|
||||
}
|
||||
|
||||
impl [<$chain ConnectionParams>] {
|
||||
/// Convert connection params into Substrate client.
|
||||
pub async fn to_client<Chain: CliChain>(
|
||||
|
||||
Reference in New Issue
Block a user