mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 20:27:58 +00:00
Use array-bytes for All Array/Bytes/Hex Operations (#12190)
* Use `array-bytes` for All Array/Bytes/Hex Operations Signed-off-by: Xavier Lau <xavier@inv.cafe> * Reorder * Self Review * Format * Fix Tests * Bump `array-bytes` * Optimize large test res Signed-off-by: Xavier Lau <xavier@inv.cafe> Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -27,10 +27,11 @@ use std::time::Duration;
|
||||
|
||||
/// Generate the light client protocol name from the genesis hash and fork id.
|
||||
fn generate_protocol_name<Hash: AsRef<[u8]>>(genesis_hash: Hash, fork_id: Option<&str>) -> String {
|
||||
let genesis_hash = genesis_hash.as_ref();
|
||||
if let Some(fork_id) = fork_id {
|
||||
format!("/{}/{}/light/2", hex::encode(genesis_hash), fork_id)
|
||||
format!("/{}/{}/light/2", array_bytes::bytes2hex("", genesis_hash), fork_id)
|
||||
} else {
|
||||
format!("/{}/light/2", hex::encode(genesis_hash))
|
||||
format!("/{}/light/2", array_bytes::bytes2hex("", genesis_hash))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user