mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-18 18:51:02 +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:
@@ -57,7 +57,7 @@ impl GenerateNodeKeyCmd {
|
||||
let file_data = if self.bin {
|
||||
secret.as_ref().to_owned()
|
||||
} else {
|
||||
hex::encode(secret.as_ref()).into_bytes()
|
||||
array_bytes::bytes2hex("", secret.as_ref()).into_bytes()
|
||||
};
|
||||
|
||||
match &self.file {
|
||||
@@ -85,6 +85,6 @@ mod tests {
|
||||
assert!(generate.run().is_ok());
|
||||
let mut buf = String::new();
|
||||
assert!(file.read_to_string(&mut buf).is_ok());
|
||||
assert!(hex::decode(buf).is_ok());
|
||||
assert!(array_bytes::hex2bytes(&buf).is_ok());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user