diff --git a/Cargo.lock b/Cargo.lock index aa5a434..9bab55f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -825,7 +825,7 @@ checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "cryo_cli" -version = "0.2.0" +version = "0.3.0" dependencies = [ "anstyle", "clap_cryo", @@ -845,7 +845,7 @@ dependencies = [ [[package]] name = "cryo_freeze" -version = "0.2.0" +version = "0.3.0" dependencies = [ "async-trait", "chrono", @@ -885,7 +885,7 @@ dependencies = [ [[package]] name = "cryo_to_df" -version = "0.2.0" +version = "0.3.0" dependencies = [ "indexmap 2.1.0", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index ba17905..c1d70d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ members = ["crates/cli", "crates/freeze", "crates/to_df", "crates/python"] resolver = "2" [workspace.package] -version = "0.2.0" +version = "0.3.0" edition = "2021" license = "MIT OR Apache-2.0" homepage = "https://github.com/paradigmxyz/cryo" diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index 91bf0e4..3421947 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -18,7 +18,7 @@ path = "src/main.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -cryo_freeze = { version = "0.2.0", path = "../freeze" } +cryo_freeze = { version = "0.3.0", path = "../freeze" } anstyle = { workspace = true } clap_cryo = { workspace = true } diff --git a/crates/cli/src/parse/blocks.rs b/crates/cli/src/parse/blocks.rs index e59dda3..8cd355c 100644 --- a/crates/cli/src/parse/blocks.rs +++ b/crates/cli/src/parse/blocks.rs @@ -391,11 +391,11 @@ async fn apply_reorg_buffer( pub(crate) async fn get_latest_block_number( fetcher: &Fetcher

, ) -> Result { - return fetcher + fetcher .get_block_number() .await .map(|n| n.as_u64()) - .map_err(|_e| ParseError::ParseError("Error retrieving latest block number".to_string())); + .map_err(|_e| ParseError::ParseError("Error retrieving latest block number".to_string())) } #[cfg(test)] diff --git a/crates/cli/src/parse/mod.rs b/crates/cli/src/parse/mod.rs index a5152dc..689e344 100644 --- a/crates/cli/src/parse/mod.rs +++ b/crates/cli/src/parse/mod.rs @@ -10,5 +10,6 @@ mod source; mod timestamps; pub use args::*; +#[allow(unused_imports)] pub use query::*; use schemas::*; diff --git a/crates/cli/src/parse/timestamps.rs b/crates/cli/src/parse/timestamps.rs index 9163b7a..a9342c6 100644 --- a/crates/cli/src/parse/timestamps.rs +++ b/crates/cli/src/parse/timestamps.rs @@ -267,12 +267,9 @@ fn scale_timestamp_str_by_metric_unit( metric_scale: u64, ) -> Result { let s = ×tamp_ref[..timestamp_ref.len() - 1]; - let timestamp = s - .parse::() + s.parse::() .map(|n| (metric_scale as f64 * n) as u64) - .map_err(|_e| ParseError::ParseError("Error parsing timestamp ref".to_string())); - - return timestamp; + .map_err(|_e| ParseError::ParseError("Error parsing timestamp ref".to_string())) } // perform binary search to determine the closest block number smaller than or equal to a given @@ -300,6 +297,7 @@ async fn timestamp_to_block_number( .map_err(|_e| ParseError::ParseError("Error fetching block for timestamp".to_string()))? .unwrap(); + #[warn(clippy::comparison_chain)] if block.timestamp == timestamp.into() { return Ok(mid); } else if block.timestamp < timestamp.into() { @@ -311,9 +309,9 @@ async fn timestamp_to_block_number( // If timestamp is between two different blocks, return the lower block. if mid > 0 && block.timestamp > ethers::types::U256::from(timestamp) { - return Ok(mid - 1); + Ok(mid - 1) } else { - return Ok(mid); + Ok(mid) } } @@ -325,7 +323,7 @@ async fn get_latest_timestamp(fetcher: &Fetcher

) -> Result< .map_err(|_e| ParseError::ParseError("Error fetching latest block".to_string()))? .unwrap(); - return Ok(latest_block.timestamp.as_u64()); + Ok(latest_block.timestamp.as_u64()) } #[cfg(test)] diff --git a/crates/freeze/Cargo.toml b/crates/freeze/Cargo.toml index 68d91cc..b5edde3 100644 --- a/crates/freeze/Cargo.toml +++ b/crates/freeze/Cargo.toml @@ -11,7 +11,7 @@ repository.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -cryo_to_df = { version = "0.2.0", path = "../to_df" } +cryo_to_df = { version = "0.3.0", path = "../to_df" } async-trait = { workspace = true } ethers = { workspace = true } ethers-core = { workspace = true } diff --git a/crates/python/Cargo.toml b/crates/python/Cargo.toml index d8fb014..f276af7 100644 --- a/crates/python/Cargo.toml +++ b/crates/python/Cargo.toml @@ -1,8 +1,12 @@ [package] name = "cryo_python" -version = "0.2.0" -edition = "2021" build = "build.rs" +description = "cryo python is a python library built on top of the rust cryo library" +version.workspace = true +edition.workspace = true +license.workspace = true +homepage.workspace = true +repository.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] @@ -11,8 +15,8 @@ path = "rust/lib.rs" crate-type = ["cdylib"] [dependencies] -cryo_cli = { version = "0.2.0", path = "../cli" } -cryo_freeze = { version = "0.2.0", path = "../freeze" } +cryo_cli = { version = "0.3.0", path = "../cli" } +cryo_freeze = { version = "0.3.0", path = "../freeze" } polars = { workspace = true } pyo3 = { workspace = true } diff --git a/crates/to_df/Cargo.toml b/crates/to_df/Cargo.toml index 177c6b1..19058dc 100644 --- a/crates/to_df/Cargo.toml +++ b/crates/to_df/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "cryo_to_df" +description = "cryo_to_df is a procedural macro used for defining datasets" version.workspace = true edition.workspace = true license.workspace = true @@ -13,6 +14,6 @@ proc-macro = true [dependencies] indexmap = { workspace = true } -syn = "1.0" +syn = { version = "1.0", features = ["full"] } quote = "1.0" proc-macro2 = "1.0"