mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-08 03:08:06 +00:00
Gav display addrs (#267)
* Tidy up warnings * Better Display for AccountId
This commit is contained in:
@@ -160,25 +160,6 @@ pub fn run<I, T>(args: I) -> error::Result<()> where
|
||||
|
||||
config.chain_name = chain_spec.clone().into();
|
||||
|
||||
let _guard = if matches.is_present("telemetry") || matches.value_of("telemetry-url").is_some() {
|
||||
let name = config.name.clone();
|
||||
let chain_name = config.chain_name.clone();
|
||||
Some(init_telemetry(TelemetryConfig {
|
||||
url: matches.value_of("telemetry-url").unwrap_or(DEFAULT_TELEMETRY_URL).into(),
|
||||
on_connect: Box::new(move || {
|
||||
telemetry!("system.connected";
|
||||
"name" => name.clone(),
|
||||
"implementation" => "parity-polkadot",
|
||||
"version" => crate_version!(),
|
||||
"config" => "",
|
||||
"chain" => chain_name.clone(),
|
||||
);
|
||||
}),
|
||||
}))
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
let base_path = matches.value_of("base-path")
|
||||
.map(|x| Path::new(x).to_owned())
|
||||
.unwrap_or_else(default_base_path);
|
||||
@@ -263,6 +244,25 @@ pub fn run<I, T>(args: I) -> error::Result<()> where
|
||||
chain_name: config.chain_name.clone(),
|
||||
};
|
||||
|
||||
let _guard = if matches.is_present("telemetry") || matches.value_of("telemetry-url").is_some() {
|
||||
let name = config.name.clone();
|
||||
let chain_name = config.chain_name.clone();
|
||||
Some(init_telemetry(TelemetryConfig {
|
||||
url: matches.value_of("telemetry-url").unwrap_or(DEFAULT_TELEMETRY_URL).into(),
|
||||
on_connect: Box::new(move || {
|
||||
telemetry!("system.connected";
|
||||
"name" => name.clone(),
|
||||
"implementation" => "parity-polkadot",
|
||||
"version" => crate_version!(),
|
||||
"config" => "",
|
||||
"chain" => chain_name.clone(),
|
||||
);
|
||||
}),
|
||||
}))
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
match role == service::Role::LIGHT {
|
||||
true => run_until_exit(core, service::new_light(config)?, &matches, sys_conf),
|
||||
false => run_until_exit(core, service::new_full(config)?, &matches, sys_conf),
|
||||
|
||||
@@ -100,7 +100,7 @@ impl Components for FullComponents {
|
||||
|
||||
// Load the first available key
|
||||
let key = keystore.load(&keystore.contents()?[0], "")?;
|
||||
info!("Using authority key {:?}", key.public());
|
||||
info!("Using authority key: {}", key.public());
|
||||
Ok(Some(consensus::Service::new(
|
||||
client.clone(),
|
||||
client.clone(),
|
||||
|
||||
@@ -125,7 +125,7 @@ impl<Components> Service<Components>
|
||||
let api = components.build_api(client.clone());
|
||||
let best_header = client.best_block_header()?;
|
||||
|
||||
info!("Best block is #{}", best_header.number);
|
||||
info!("Best block: #{}", best_header.number);
|
||||
telemetry!("node.start"; "height" => best_header.number, "best" => ?best_header.hash());
|
||||
|
||||
let transaction_pool = Arc::new(TransactionPool::new(config.transaction_pool, api.clone()));
|
||||
|
||||
@@ -168,13 +168,14 @@ impl AsRef<Pair> for Pair {
|
||||
|
||||
impl ::std::fmt::Display for Public {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
write!(f, "{}", ::primitives::hexdisplay::HexDisplay::from(&self.0))
|
||||
write!(f, "{}", self.to_ss58check())
|
||||
}
|
||||
}
|
||||
|
||||
impl ::std::fmt::Debug for Public {
|
||||
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
||||
write!(f, "{}", ::primitives::hexdisplay::HexDisplay::from(&self.0))
|
||||
let s = self.to_ss58check();
|
||||
write!(f, "{} ({}...)", ::primitives::hexdisplay::HexDisplay::from(&self.0), &s[0..8])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user