mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 07:41: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:
@@ -13,12 +13,12 @@ readme = "README.md"
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
array-bytes = "4.1"
|
||||
bytes = "1.1"
|
||||
codec = { package = "parity-scale-codec", version = "3.0.0", features = ["derive"] }
|
||||
fnv = "1.0.6"
|
||||
futures = "0.3.21"
|
||||
futures-timer = "3.0.2"
|
||||
hex = "0.4"
|
||||
hyper = { version = "0.14.16", features = ["stream", "http2"] }
|
||||
hyper-rustls = { version = "0.23.0", features = ["http2"] }
|
||||
libp2p = { version = "0.46.1", default-features = false }
|
||||
|
||||
@@ -79,8 +79,8 @@ impl<Storage: OffchainStorage> offchain::DbExternalities for Db<Storage> {
|
||||
tracing::debug!(
|
||||
target: "offchain-worker::storage",
|
||||
?kind,
|
||||
key = ?hex::encode(key),
|
||||
value = ?hex::encode(value),
|
||||
key = ?array_bytes::bytes2hex("", key),
|
||||
value = ?array_bytes::bytes2hex("", value),
|
||||
"Write",
|
||||
);
|
||||
match kind {
|
||||
@@ -93,7 +93,7 @@ impl<Storage: OffchainStorage> offchain::DbExternalities for Db<Storage> {
|
||||
tracing::debug!(
|
||||
target: "offchain-worker::storage",
|
||||
?kind,
|
||||
key = ?hex::encode(key),
|
||||
key = ?array_bytes::bytes2hex("", key),
|
||||
"Clear",
|
||||
);
|
||||
match kind {
|
||||
@@ -112,9 +112,9 @@ impl<Storage: OffchainStorage> offchain::DbExternalities for Db<Storage> {
|
||||
tracing::debug!(
|
||||
target: "offchain-worker::storage",
|
||||
?kind,
|
||||
key = ?hex::encode(key),
|
||||
new_value = ?hex::encode(new_value),
|
||||
old_value = ?old_value.as_ref().map(hex::encode),
|
||||
key = ?array_bytes::bytes2hex("", key),
|
||||
new_value = ?array_bytes::bytes2hex("", new_value),
|
||||
old_value = ?old_value.as_ref().map(|s| array_bytes::bytes2hex("", s)),
|
||||
"CAS",
|
||||
);
|
||||
match kind {
|
||||
@@ -132,8 +132,8 @@ impl<Storage: OffchainStorage> offchain::DbExternalities for Db<Storage> {
|
||||
tracing::debug!(
|
||||
target: "offchain-worker::storage",
|
||||
?kind,
|
||||
key = ?hex::encode(key),
|
||||
result = ?result.as_ref().map(hex::encode),
|
||||
key = ?array_bytes::bytes2hex("", key),
|
||||
result = ?result.as_ref().map(|s| array_bytes::bytes2hex("", s)),
|
||||
"Read",
|
||||
);
|
||||
result
|
||||
|
||||
Reference in New Issue
Block a user