Skip to content

Commit

Permalink
deps: update byte-unit
Browse files Browse the repository at this point in the history
  • Loading branch information
tzemanovic committed Feb 7, 2025
1 parent 97f7abe commit 169e47e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 14 deletions.
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ bimap = {version = "0.6", features = ["serde"]}
bit-set = "0.8"
bitflags = { version = "2.5", features = ["serde"] }
blake2b-rs = "0.2"
byte-unit = "4.0.13"
byte-unit = "5.1"
byteorder = "1.4"
borsh = {version = "1.2", features = ["unstable__schema", "derive"]}
cargo_metadata = "0.19"
Expand Down
22 changes: 13 additions & 9 deletions crates/node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use std::convert::TryInto;
use std::net::SocketAddr;
use std::path::PathBuf;

use byte_unit::Byte;
use byte_unit::{Byte, UnitType};
use data_encoding::HEXUPPER;
pub use dry_run_tx::dry_run_tx;
use futures::future::TryFutureExt;
Expand Down Expand Up @@ -511,8 +511,9 @@ async fn run_aux_setup(
let available_memory_bytes = sys.available_memory();
tracing::info!(
"Available memory: {}",
Byte::from_bytes(u128::from(available_memory_bytes))
.get_appropriate_unit(true)
Byte::from_u128(u128::from(available_memory_bytes))
.unwrap()
.get_appropriate_unit(UnitType::Binary)
);
available_memory_bytes
});
Expand All @@ -536,8 +537,9 @@ async fn run_aux_setup(
};
tracing::info!(
"VP WASM compilation cache size: {}",
Byte::from_bytes(u128::from(vp_wasm_compilation_cache))
.get_appropriate_unit(true)
Byte::from_u128(u128::from(vp_wasm_compilation_cache))
.unwrap()
.get_appropriate_unit(UnitType::Binary)
);

// Find the tx WASM compilation cache size
Expand All @@ -559,8 +561,9 @@ async fn run_aux_setup(
};
tracing::info!(
"Tx WASM compilation cache size: {}",
Byte::from_bytes(u128::from(tx_wasm_compilation_cache))
.get_appropriate_unit(true)
Byte::from_u128(u128::from(tx_wasm_compilation_cache))
.unwrap()
.get_appropriate_unit(UnitType::Binary)
);

// Find the RocksDB block cache size
Expand All @@ -579,8 +582,9 @@ async fn run_aux_setup(
};
tracing::info!(
"RocksDB block cache size: {}",
Byte::from_bytes(u128::from(db_block_cache_size_bytes))
.get_appropriate_unit(true)
Byte::from_u128(u128::from(db_block_cache_size_bytes))
.unwrap()
.get_appropriate_unit(UnitType::Binary)
);

RunAuxSetup {
Expand Down
6 changes: 4 additions & 2 deletions crates/vm/src/wasm/compilation_cache/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ mod test {
use std::cmp::max;

use assert_matches::assert_matches;
use byte_unit::Byte;
use byte_unit::{Byte, UnitType};
use namada_test_utils::TestWasms;
use tempfile::{tempdir, TempDir};
use test_log::test;
Expand All @@ -659,7 +659,9 @@ mod test {
let max_bytes = max(tx_read_storage_key.size, tx_no_op.size) + 1;
println!(
"Using cache with max_bytes {} ({})",
Byte::from_bytes(max_bytes as u128).get_appropriate_unit(true),
Byte::from_u128(max_bytes as u128)
.unwrap()
.get_appropriate_unit(UnitType::Binary),
max_bytes
);
let (mut cache, _tmp_dir) = cache(max_bytes);
Expand Down

0 comments on commit 169e47e

Please sign in to comment.