From cb3a5b26b54b92add30e588a57ab99de236da84e Mon Sep 17 00:00:00 2001 From: Lohachov Mykhailo Date: Sat, 16 Nov 2024 21:45:30 +0900 Subject: [PATCH 01/16] feat: add timeouts to client cli Signed-off-by: Lohachov Mykhailo --- Cargo.lock | 2 + crates/iroha_cli/Cargo.toml | 2 + crates/iroha_cli/src/main.rs | 124 ++++++++++++++++++++++++++++------- 3 files changed, 103 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4940c0f920d..5ae16c4f885 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2953,6 +2953,7 @@ dependencies = [ "erased-serde", "error-stack", "eyre", + "futures", "humantime", "iroha", "iroha_primitives", @@ -2961,6 +2962,7 @@ dependencies = [ "serde_json", "supports-color 2.1.0", "thiserror", + "tokio", "vergen", ] diff --git a/crates/iroha_cli/Cargo.toml b/crates/iroha_cli/Cargo.toml index b843a2dccc2..f92581e2073 100644 --- a/crates/iroha_cli/Cargo.toml +++ b/crates/iroha_cli/Cargo.toml @@ -40,6 +40,8 @@ serde = { workspace = true } serde_json = { workspace = true } erased-serde = "0.4.5" supports-color = { workspace = true } +tokio = { workspace = true, features = ["rt"] } +futures = { workspace = true } [build-dependencies] vergen = { version = "8.3.1", default-features = false } diff --git a/crates/iroha_cli/src/main.rs b/crates/iroha_cli/src/main.rs index 41c8d252843..bf559cb85a6 100644 --- a/crates/iroha_cli/src/main.rs +++ b/crates/iroha_cli/src/main.rs @@ -10,9 +10,11 @@ use std::{ use erased_serde::Serialize; use error_stack::{fmt::ColorMode, IntoReportCompat, ResultExt}; use eyre::{eyre, Error, Result, WrapErr}; +use futures::TryStreamExt; use iroha::{client::Client, config::Config, data_model::prelude::*}; use iroha_primitives::json::Json; use thiserror::Error; +use tokio::{runtime::Runtime, time::Duration}; /// Re-usable clap `--metadata ` (`-m`) argument. /// Should be combined with `#[command(flatten)]` attr. @@ -179,7 +181,7 @@ enum MainError { #[error("Failed to run the command")] Subcommand, } - +#[allow(unused)] fn main() -> error_stack::Result<(), MainError> { let Args { config: config_path, @@ -309,37 +311,85 @@ mod events { #[derive(clap::Subcommand, Debug, Clone, Copy)] pub enum Args { /// Gets block pipeline events - BlockPipeline, + BlockPipeline(Options), /// Gets transaction pipeline events - TransactionPipeline, + TransactionPipeline(Options), /// Gets data events - Data, + Data(Options), /// Get execute trigger events - ExecuteTrigger, + ExecuteTrigger(Options), /// Get trigger completed events - TriggerCompleted, + TriggerCompleted(Options), + } + + #[derive(clap::Args, Debug, Clone, Copy)] + pub struct Options { + /// Wait timeout in seconds + #[clap(short, long)] + timeout: Option, } impl RunArgs for Args { fn run(self, context: &mut dyn RunContext) -> Result<()> { match self { - Args::TransactionPipeline => listen(TransactionEventFilter::default(), context), - Args::BlockPipeline => listen(BlockEventFilter::default(), context), - Args::Data => listen(DataEventFilter::Any, context), - Args::ExecuteTrigger => listen(ExecuteTriggerEventFilter::new(), context), - Args::TriggerCompleted => listen(TriggerCompletedEventFilter::new(), context), + Args::TransactionPipeline(Options { timeout }) => listen( + TransactionEventFilter::default(), + context, + timeout.map(Duration::from_secs), + ), + Args::BlockPipeline(Options { timeout }) => listen( + BlockEventFilter::default(), + context, + timeout.map(Duration::from_secs), + ), + Args::Data(Options { timeout }) => listen( + DataEventFilter::Any, + context, + timeout.map(Duration::from_secs), + ), + Args::ExecuteTrigger(Options { timeout }) => listen( + ExecuteTriggerEventFilter::new(), + context, + timeout.map(Duration::from_secs), + ), + Args::TriggerCompleted(Options { timeout }) => listen( + TriggerCompletedEventFilter::new(), + context, + timeout.map(Duration::from_secs), + ), } } } - fn listen(filter: impl Into, context: &mut dyn RunContext) -> Result<()> { + fn listen( + filter: impl Into, + context: &mut dyn RunContext, + timeout: Option, + ) -> Result<()> { let filter = filter.into(); let client = context.client_from_config(); - eprintln!("Listening to events with filter: {filter:?}"); - client - .listen_for_events([filter]) - .wrap_err("Failed to listen for events.")? - .try_for_each(|event| context.print_data(&event?))?; + + if let Some(timeout) = timeout { + eprintln!("Listening to events with filter: {filter:?} and timeout: {timeout:?}"); + let rt = Runtime::new().wrap_err("Failed to create runtime.")?; + rt.block_on(async { + let mut stream = client + .listen_for_events_async([filter]) + .await + .expect("Failed to listen for events."); + while let Ok(event) = tokio::time::timeout(timeout, stream.try_next()).await { + context.print_data(&event?)?; + } + eprintln!("Timeout period has expired."); + Result::<()>::Ok(()) + })?; + } else { + eprintln!("Listening to events with filter: {filter:?}"); + client + .listen_for_events([filter]) + .wrap_err("Failed to listen for events.")? + .try_for_each(|event| context.print_data(&event?))?; + } Ok(()) } } @@ -354,22 +404,46 @@ mod blocks { pub struct Args { /// Block height from which to start streaming blocks height: NonZeroU64, + + /// Wait timeout in seconds + #[clap(short, long)] + timeout: Option, } impl RunArgs for Args { fn run(self, context: &mut dyn RunContext) -> Result<()> { - let Args { height } = self; - listen(height, context) + let Args { height, timeout } = self; + listen(height, context, timeout.map(Duration::from_secs)) } } - fn listen(height: NonZeroU64, context: &mut dyn RunContext) -> Result<()> { + fn listen( + height: NonZeroU64, + context: &mut dyn RunContext, + timeout: Option, + ) -> Result<()> { let client = context.client_from_config(); - eprintln!("Listening to blocks from height: {height}"); - client - .listen_for_blocks(height) - .wrap_err("Failed to listen for blocks.")? - .try_for_each(|event| context.print_data(&event?))?; + if let Some(timeout) = timeout { + eprintln!("Listening to blocks from height: {height} and timeout: {timeout:?}"); + let rt = Runtime::new().wrap_err("Failed to create runtime.")?; + rt.block_on(async { + let mut stream = client + .listen_for_blocks_async(height) + .await + .expect("Failed to listen for blocks."); + while let Ok(event) = tokio::time::timeout(timeout, stream.try_next()).await { + context.print_data(&event?)?; + } + eprintln!("Timeout period has expired."); + Result::<()>::Ok(()) + })?; + } else { + eprintln!("Listening to blocks from height: {height}"); + client + .listen_for_blocks(height) + .wrap_err("Failed to listen for blocks.")? + .try_for_each(|event| context.print_data(&event?))?; + } Ok(()) } } From 5d49a0480a7a0b19f08b487ca30fad390d2e8999 Mon Sep 17 00:00:00 2001 From: Lohachov Mykhailo Date: Sun, 17 Nov 2024 01:03:48 +0900 Subject: [PATCH 02/16] chore: remove unused macro Signed-off-by: Lohachov Mykhailo --- crates/iroha_cli/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/iroha_cli/src/main.rs b/crates/iroha_cli/src/main.rs index bf559cb85a6..8ffdc3a93aa 100644 --- a/crates/iroha_cli/src/main.rs +++ b/crates/iroha_cli/src/main.rs @@ -181,7 +181,7 @@ enum MainError { #[error("Failed to run the command")] Subcommand, } -#[allow(unused)] + fn main() -> error_stack::Result<(), MainError> { let Args { config: config_path, From f40377c364871048156c2dc0dd36149ca3d467fd Mon Sep 17 00:00:00 2001 From: Lohachov Mykhailo Date: Mon, 18 Nov 2024 20:03:59 +0900 Subject: [PATCH 03/16] test: add tests for cli Signed-off-by: Lohachov Mykhailo --- Cargo.lock | 1 + crates/iroha_cli/Cargo.toml | 3 ++ crates/iroha_cli/src/main.rs | 85 +++++++++++++++++++++++++++++++++++- 3 files changed, 87 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5392550e46e..a54e09680c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2956,6 +2956,7 @@ dependencies = [ "humantime", "iroha", "iroha_primitives", + "iroha_test_network", "json5", "serde", "serde_json", diff --git a/crates/iroha_cli/Cargo.toml b/crates/iroha_cli/Cargo.toml index f92581e2073..ecea75537ab 100644 --- a/crates/iroha_cli/Cargo.toml +++ b/crates/iroha_cli/Cargo.toml @@ -46,3 +46,6 @@ futures = { workspace = true } [build-dependencies] vergen = { version = "8.3.1", default-features = false } color-eyre = "0.6.3" + +[dev-dependencies] +iroha_test_network = { workspace = true } diff --git a/crates/iroha_cli/src/main.rs b/crates/iroha_cli/src/main.rs index d6bfe963ee1..8713247201f 100644 --- a/crates/iroha_cli/src/main.rs +++ b/crates/iroha_cli/src/main.rs @@ -361,7 +361,7 @@ mod events { } } - fn listen( + pub fn listen( filter: impl Into, context: &mut dyn RunContext, timeout: Option, @@ -417,7 +417,7 @@ mod blocks { } } - fn listen( + pub fn listen( height: NonZeroU64, context: &mut dyn RunContext, timeout: Option, @@ -1451,8 +1451,13 @@ mod multisig { Ok(()) } } + #[cfg(test)] mod tests { + use iroha::crypto::KeyPair; + use iroha_test_network::*; + use serde_json::to_string; + use super::*; #[test] @@ -1477,4 +1482,80 @@ mod tests { let json_str = r#"{"Vec":[{"String":"a"},{"String":"b"}]}"#; case!(json_str, serde_json::from_str(json_str).unwrap()); } + + struct MockContext { + network: Network, + config: Config, + datastream: String, + } + + impl MockContext { + fn test_config() -> Config { + return Config{ + chain: ChainId::from("00000000-0000-0000-0000-000000000000"), + account: "ed0120CE7FA46C9DCE7EA4B125E2E36BDB63EA33073E7590AC92816AE1E861B7048B03@wonderland".parse().expect("Can't parse mock account"), + key_pair: KeyPair::random(), + basic_auth: None, + torii_api_url: "http://127.0.0.1:8080/".parse().expect("Can't parse mock url"), + transaction_ttl: Duration::from_millis(100_000), + transaction_status_timeout: Duration::from_millis(100_000), + transaction_add_nonce: false, + }; + } + } + + impl RunContext for MockContext { + fn configuration(&self) -> &Config { + return &self.config; + } + + fn client_from_config(&self) -> Client { + self.network.client() + } + + fn print_data(&mut self, data: &dyn Serialize) -> Result<()> { + self.datastream.push_str(&to_string(data)?); + Ok(()) + } + } + + #[test] + fn listen_events_timeouts() { + let (network, _rt) = NetworkBuilder::new() + .start_blocking() + .expect("Failed to start network."); + let mut tc = MockContext { + network, + config: MockContext::test_config(), + datastream: String::new(), + }; + + assert!(events::listen( + ExecuteTriggerEventFilter::new(), + &mut tc, + Some(Duration::from_secs(1)) + ) + .is_ok()); + } + + #[test] + fn listen_blocks_timeouts() { + use std::num::NonZeroU64; + + let (network, _rt) = NetworkBuilder::new() + .start_blocking() + .expect("Failed to start network."); + let mut tc = MockContext { + network, + config: MockContext::test_config(), + datastream: String::new(), + }; + + assert!(blocks::listen( + NonZeroU64::new(1).expect("Blocks cannot be zero"), + &mut tc, + Some(Duration::from_secs(1)) + ) + .is_ok()); + } } From baa3b173e2ec44305897fc9328344015a9ab17ab Mon Sep 17 00:00:00 2001 From: Lohachov Mykhailo Date: Tue, 19 Nov 2024 01:49:54 +0900 Subject: [PATCH 04/16] fix: test codecover Signed-off-by: Lohachov Mykhailo --- crates/iroha_cli/src/main.rs | 224 +++++++++++++++++------------------ 1 file changed, 106 insertions(+), 118 deletions(-) diff --git a/crates/iroha_cli/src/main.rs b/crates/iroha_cli/src/main.rs index 8713247201f..f708f3f3cf0 100644 --- a/crates/iroha_cli/src/main.rs +++ b/crates/iroha_cli/src/main.rs @@ -102,7 +102,7 @@ enum Subcommand { #[clap(subcommand)] Peer(peer::Args), /// The subcommand related to event streaming - #[clap(subcommand)] + // #[clap(args)] Events(events::Args), /// The subcommand related to Wasm Wasm(wasm::Args), @@ -307,56 +307,44 @@ mod events { use super::*; + #[derive(clap::Args, Debug, Clone, Copy)] + pub struct Args { + #[clap(short, long)] + timeout: Option, + #[clap(subcommand)] + command: Command, + } + /// Get event stream from Iroha peer #[derive(clap::Subcommand, Debug, Clone, Copy)] - pub enum Args { + enum Command { /// Gets block pipeline events - BlockPipeline(Options), + BlockPipeline, /// Gets transaction pipeline events - TransactionPipeline(Options), + TransactionPipeline, /// Gets data events - Data(Options), + Data, /// Get execute trigger events - ExecuteTrigger(Options), + ExecuteTrigger, /// Get trigger completed events - TriggerCompleted(Options), - } - - #[derive(clap::Args, Debug, Clone, Copy)] - pub struct Options { - /// Wait timeout in seconds - #[clap(short, long)] - timeout: Option, + TriggerCompleted, } impl RunArgs for Args { fn run(self, context: &mut dyn RunContext) -> Result<()> { - match self { - Args::TransactionPipeline(Options { timeout }) => listen( - TransactionEventFilter::default(), - context, - timeout.map(Duration::from_secs), - ), - Args::BlockPipeline(Options { timeout }) => listen( - BlockEventFilter::default(), - context, - timeout.map(Duration::from_secs), - ), - Args::Data(Options { timeout }) => listen( - DataEventFilter::Any, - context, - timeout.map(Duration::from_secs), - ), - Args::ExecuteTrigger(Options { timeout }) => listen( - ExecuteTriggerEventFilter::new(), - context, - timeout.map(Duration::from_secs), - ), - Args::TriggerCompleted(Options { timeout }) => listen( - TriggerCompletedEventFilter::new(), - context, - timeout.map(Duration::from_secs), - ), + let timeout = self.timeout.map(Duration::from_secs); + match self.command { + Command::TransactionPipeline => { + listen(TransactionEventFilter::default(), context, timeout) + } + Command::BlockPipeline => listen(BlockEventFilter::default(), context, timeout), + Command::Data => listen(DataEventFilter::Any, context, timeout), + Command::ExecuteTrigger => { + listen(ExecuteTriggerEventFilter::new(), context, timeout) + } + Command::TriggerCompleted => { + listen(TriggerCompletedEventFilter::new(), context, timeout) + } } } } @@ -1454,9 +1442,9 @@ mod multisig { #[cfg(test)] mod tests { - use iroha::crypto::KeyPair; - use iroha_test_network::*; - use serde_json::to_string; + // use iroha::crypto::KeyPair; + // use iroha_test_network::*; + // use serde_json::to_string; use super::*; @@ -1483,79 +1471,79 @@ mod tests { case!(json_str, serde_json::from_str(json_str).unwrap()); } - struct MockContext { - network: Network, - config: Config, - datastream: String, - } - - impl MockContext { - fn test_config() -> Config { - return Config{ - chain: ChainId::from("00000000-0000-0000-0000-000000000000"), - account: "ed0120CE7FA46C9DCE7EA4B125E2E36BDB63EA33073E7590AC92816AE1E861B7048B03@wonderland".parse().expect("Can't parse mock account"), - key_pair: KeyPair::random(), - basic_auth: None, - torii_api_url: "http://127.0.0.1:8080/".parse().expect("Can't parse mock url"), - transaction_ttl: Duration::from_millis(100_000), - transaction_status_timeout: Duration::from_millis(100_000), - transaction_add_nonce: false, - }; - } - } - - impl RunContext for MockContext { - fn configuration(&self) -> &Config { - return &self.config; - } - - fn client_from_config(&self) -> Client { - self.network.client() - } - - fn print_data(&mut self, data: &dyn Serialize) -> Result<()> { - self.datastream.push_str(&to_string(data)?); - Ok(()) - } - } - - #[test] - fn listen_events_timeouts() { - let (network, _rt) = NetworkBuilder::new() - .start_blocking() - .expect("Failed to start network."); - let mut tc = MockContext { - network, - config: MockContext::test_config(), - datastream: String::new(), - }; - - assert!(events::listen( - ExecuteTriggerEventFilter::new(), - &mut tc, - Some(Duration::from_secs(1)) - ) - .is_ok()); - } - - #[test] - fn listen_blocks_timeouts() { - use std::num::NonZeroU64; - - let (network, _rt) = NetworkBuilder::new() - .start_blocking() - .expect("Failed to start network."); - let mut tc = MockContext { - network, - config: MockContext::test_config(), - datastream: String::new(), - }; - - assert!(blocks::listen( - NonZeroU64::new(1).expect("Blocks cannot be zero"), - &mut tc, - Some(Duration::from_secs(1)) - ) - .is_ok()); - } + // struct MockContext { + // network: Network, + // config: Config, + // datastream: String, + // } + + // impl MockContext { + // fn test_config() -> Config { + // return Config{ + // chain: ChainId::from("00000000-0000-0000-0000-000000000000"), + // account: "ed0120CE7FA46C9DCE7EA4B125E2E36BDB63EA33073E7590AC92816AE1E861B7048B03@wonderland".parse().expect("Can't parse mock account"), + // key_pair: KeyPair::random(), + // basic_auth: None, + // torii_api_url: "http://127.0.0.1:8080/".parse().expect("Can't parse mock url"), + // transaction_ttl: Duration::from_millis(100_000), + // transaction_status_timeout: Duration::from_millis(100_000), + // transaction_add_nonce: false, + // }; + // } + // } + + // impl RunContext for MockContext { + // fn configuration(&self) -> &Config { + // return &self.config; + // } + + // fn client_from_config(&self) -> Client { + // self.network.client() + // } + + // fn print_data(&mut self, data: &dyn Serialize) -> Result<()> { + // self.datastream.push_str(&to_string(data)?); + // Ok(()) + // } + // } + + // #[test] + // fn listen_events_timeouts() { + // let (network, _rt) = NetworkBuilder::new() + // .start_blocking() + // .expect("Failed to start network."); + // let mut tc = MockContext { + // network, + // config: MockContext::test_config(), + // datastream: String::new(), + // }; + + // assert!(events::listen( + // ExecuteTriggerEventFilter::new(), + // &mut tc, + // Some(Duration::from_secs(1)) + // ) + // .is_ok()); + // } + + // #[test] + // fn listen_blocks_timeouts() { + // use std::num::NonZeroU64; + + // let (network, _rt) = NetworkBuilder::new() + // .start_blocking() + // .expect("Failed to start network."); + // let mut tc = MockContext { + // network, + // config: MockContext::test_config(), + // datastream: String::new(), + // }; + + // assert!(blocks::listen( + // NonZeroU64::new(1).expect("Blocks cannot be zero"), + // &mut tc, + // Some(Duration::from_secs(1)) + // ) + // .is_ok()); + // } } From ae89ae85487baa67473ba4c17ab18a3658ae7274 Mon Sep 17 00:00:00 2001 From: Lohachov Mykhailo Date: Tue, 19 Nov 2024 02:25:47 +0900 Subject: [PATCH 05/16] fix: remove unused tests Signed-off-by: Lohachov Mykhailo --- Cargo.lock | 1 - crates/iroha_cli/Cargo.toml | 3 -- crates/iroha_cli/src/main.rs | 79 ------------------------------------ 3 files changed, 83 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a54e09680c1..5392550e46e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2956,7 +2956,6 @@ dependencies = [ "humantime", "iroha", "iroha_primitives", - "iroha_test_network", "json5", "serde", "serde_json", diff --git a/crates/iroha_cli/Cargo.toml b/crates/iroha_cli/Cargo.toml index ecea75537ab..f92581e2073 100644 --- a/crates/iroha_cli/Cargo.toml +++ b/crates/iroha_cli/Cargo.toml @@ -46,6 +46,3 @@ futures = { workspace = true } [build-dependencies] vergen = { version = "8.3.1", default-features = false } color-eyre = "0.6.3" - -[dev-dependencies] -iroha_test_network = { workspace = true } diff --git a/crates/iroha_cli/src/main.rs b/crates/iroha_cli/src/main.rs index f708f3f3cf0..65695c05ada 100644 --- a/crates/iroha_cli/src/main.rs +++ b/crates/iroha_cli/src/main.rs @@ -1442,9 +1442,6 @@ mod multisig { #[cfg(test)] mod tests { - // use iroha::crypto::KeyPair; - // use iroha_test_network::*; - // use serde_json::to_string; use super::*; @@ -1470,80 +1467,4 @@ mod tests { let json_str = r#"{"Vec":[{"String":"a"},{"String":"b"}]}"#; case!(json_str, serde_json::from_str(json_str).unwrap()); } - - // struct MockContext { - // network: Network, - // config: Config, - // datastream: String, - // } - - // impl MockContext { - // fn test_config() -> Config { - // return Config{ - // chain: ChainId::from("00000000-0000-0000-0000-000000000000"), - // account: "ed0120CE7FA46C9DCE7EA4B125E2E36BDB63EA33073E7590AC92816AE1E861B7048B03@wonderland".parse().expect("Can't parse mock account"), - // key_pair: KeyPair::random(), - // basic_auth: None, - // torii_api_url: "http://127.0.0.1:8080/".parse().expect("Can't parse mock url"), - // transaction_ttl: Duration::from_millis(100_000), - // transaction_status_timeout: Duration::from_millis(100_000), - // transaction_add_nonce: false, - // }; - // } - // } - - // impl RunContext for MockContext { - // fn configuration(&self) -> &Config { - // return &self.config; - // } - - // fn client_from_config(&self) -> Client { - // self.network.client() - // } - - // fn print_data(&mut self, data: &dyn Serialize) -> Result<()> { - // self.datastream.push_str(&to_string(data)?); - // Ok(()) - // } - // } - - // #[test] - // fn listen_events_timeouts() { - // let (network, _rt) = NetworkBuilder::new() - // .start_blocking() - // .expect("Failed to start network."); - // let mut tc = MockContext { - // network, - // config: MockContext::test_config(), - // datastream: String::new(), - // }; - - // assert!(events::listen( - // ExecuteTriggerEventFilter::new(), - // &mut tc, - // Some(Duration::from_secs(1)) - // ) - // .is_ok()); - // } - - // #[test] - // fn listen_blocks_timeouts() { - // use std::num::NonZeroU64; - - // let (network, _rt) = NetworkBuilder::new() - // .start_blocking() - // .expect("Failed to start network."); - // let mut tc = MockContext { - // network, - // config: MockContext::test_config(), - // datastream: String::new(), - // }; - - // assert!(blocks::listen( - // NonZeroU64::new(1).expect("Blocks cannot be zero"), - // &mut tc, - // Some(Duration::from_secs(1)) - // ) - // .is_ok()); - // } } From 805c0faf93b14aa16438449a1fbedb2cb8d495e7 Mon Sep 17 00:00:00 2001 From: Lohachov Mykhailo Date: Tue, 19 Nov 2024 02:28:48 +0900 Subject: [PATCH 06/16] chore: newlines Signed-off-by: Lohachov Mykhailo --- crates/iroha_cli/src/main.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/crates/iroha_cli/src/main.rs b/crates/iroha_cli/src/main.rs index 65695c05ada..cb5b2163c0e 100644 --- a/crates/iroha_cli/src/main.rs +++ b/crates/iroha_cli/src/main.rs @@ -102,7 +102,6 @@ enum Subcommand { #[clap(subcommand)] Peer(peer::Args), /// The subcommand related to event streaming - // #[clap(args)] Events(events::Args), /// The subcommand related to Wasm Wasm(wasm::Args), @@ -1442,7 +1441,6 @@ mod multisig { #[cfg(test)] mod tests { - use super::*; #[test] From 77384098a38b2efdb6e846ab395bc10898bc8d6e Mon Sep 17 00:00:00 2001 From: Lohachov Mykhailo Date: Tue, 19 Nov 2024 02:34:45 +0900 Subject: [PATCH 07/16] chore: make args global Signed-off-by: Lohachov Mykhailo --- crates/iroha_cli/src/main.rs | 2 +- defaults/docker-compose.single.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/iroha_cli/src/main.rs b/crates/iroha_cli/src/main.rs index cb5b2163c0e..eab43d4eab5 100644 --- a/crates/iroha_cli/src/main.rs +++ b/crates/iroha_cli/src/main.rs @@ -308,7 +308,7 @@ mod events { #[derive(clap::Args, Debug, Clone, Copy)] pub struct Args { - #[clap(short, long)] + #[clap(short, long, global = true)] timeout: Option, #[clap(subcommand)] command: Command, diff --git a/defaults/docker-compose.single.yml b/defaults/docker-compose.single.yml index b654bfb7668..1ff73b0f080 100644 --- a/defaults/docker-compose.single.yml +++ b/defaults/docker-compose.single.yml @@ -32,7 +32,7 @@ services: retries: 30 start_period: 4s command: |- - /bin/bash -c " + /bin/sh -c " EXECUTOR_RELATIVE_PATH=$(jq -r '.executor' /config/genesis.json) && \\ EXECUTOR_ABSOLUTE_PATH=$(realpath \"/config/$$EXECUTOR_RELATIVE_PATH\") && \\ WASM_DIR_RELATIVE_PATH=$(jq -r '.wasm_dir' /config/genesis.json) && \\ From bc082ecd49797c170cd566f3e741b43c3c06744e Mon Sep 17 00:00:00 2001 From: Mykhailo Lohachov Date: Tue, 19 Nov 2024 02:40:07 +0900 Subject: [PATCH 08/16] chore: update docker-compose.single.yml Signed-off-by: Mykhailo Lohachov --- defaults/docker-compose.single.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/docker-compose.single.yml b/defaults/docker-compose.single.yml index 1ff73b0f080..b654bfb7668 100644 --- a/defaults/docker-compose.single.yml +++ b/defaults/docker-compose.single.yml @@ -32,7 +32,7 @@ services: retries: 30 start_period: 4s command: |- - /bin/sh -c " + /bin/bash -c " EXECUTOR_RELATIVE_PATH=$(jq -r '.executor' /config/genesis.json) && \\ EXECUTOR_ABSOLUTE_PATH=$(realpath \"/config/$$EXECUTOR_RELATIVE_PATH\") && \\ WASM_DIR_RELATIVE_PATH=$(jq -r '.wasm_dir' /config/genesis.json) && \\ From 3eb704f705631404fb8d8b836fe86e68f98dfee8 Mon Sep 17 00:00:00 2001 From: Lohachov Mykhailo Date: Tue, 19 Nov 2024 18:15:23 +0900 Subject: [PATCH 09/16] fix: use float for duration Signed-off-by: Lohachov Mykhailo --- crates/iroha_cli/src/main.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/iroha_cli/src/main.rs b/crates/iroha_cli/src/main.rs index eab43d4eab5..ce7306b3e82 100644 --- a/crates/iroha_cli/src/main.rs +++ b/crates/iroha_cli/src/main.rs @@ -394,13 +394,19 @@ mod blocks { /// Wait timeout in seconds #[clap(short, long)] - timeout: Option, + timeout: Option, } impl RunArgs for Args { fn run(self, context: &mut dyn RunContext) -> Result<()> { let Args { height, timeout } = self; - listen(height, context, timeout.map(Duration::from_secs)) + listen( + height, + context, + timeout + .map(|t| (1000f32 * t).floor() as u64) + .map(Duration::from_millis), + ) } } From 8fd4f1f5fbdb0408585e11f864ab59b686bbba3e Mon Sep 17 00:00:00 2001 From: Lohachov Mykhailo Date: Tue, 19 Nov 2024 23:22:55 +0900 Subject: [PATCH 10/16] fix: use milis in events streaming Signed-off-by: Lohachov Mykhailo --- crates/iroha_cli/src/main.rs | 24 +++++++++++++----------- defaults/docker-compose.single.yml | 2 +- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/crates/iroha_cli/src/main.rs b/crates/iroha_cli/src/main.rs index ce7306b3e82..59849bae8ea 100644 --- a/crates/iroha_cli/src/main.rs +++ b/crates/iroha_cli/src/main.rs @@ -308,8 +308,9 @@ mod events { #[derive(clap::Args, Debug, Clone, Copy)] pub struct Args { + /// Wait timeout in seconds #[clap(short, long, global = true)] - timeout: Option, + timeout: Option, #[clap(subcommand)] command: Command, } @@ -331,7 +332,11 @@ mod events { impl RunArgs for Args { fn run(self, context: &mut dyn RunContext) -> Result<()> { - let timeout = self.timeout.map(Duration::from_secs); + let timeout = self + .timeout + .map(|t| (1000f32 * t).floor() as u64) + .map(Duration::from_millis); + match self.command { Command::TransactionPipeline => { listen(TransactionEventFilter::default(), context, timeout) @@ -348,7 +353,7 @@ mod events { } } - pub fn listen( + fn listen( filter: impl Into, context: &mut dyn RunContext, timeout: Option, @@ -400,17 +405,14 @@ mod blocks { impl RunArgs for Args { fn run(self, context: &mut dyn RunContext) -> Result<()> { let Args { height, timeout } = self; - listen( - height, - context, - timeout - .map(|t| (1000f32 * t).floor() as u64) - .map(Duration::from_millis), - ) + let timeout = timeout + .map(|t| (1000f32 * t).floor() as u64) + .map(Duration::from_millis); + listen(height, context, timeout) } } - pub fn listen( + fn listen( height: NonZeroU64, context: &mut dyn RunContext, timeout: Option, diff --git a/defaults/docker-compose.single.yml b/defaults/docker-compose.single.yml index b654bfb7668..1ff73b0f080 100644 --- a/defaults/docker-compose.single.yml +++ b/defaults/docker-compose.single.yml @@ -32,7 +32,7 @@ services: retries: 30 start_period: 4s command: |- - /bin/bash -c " + /bin/sh -c " EXECUTOR_RELATIVE_PATH=$(jq -r '.executor' /config/genesis.json) && \\ EXECUTOR_ABSOLUTE_PATH=$(realpath \"/config/$$EXECUTOR_RELATIVE_PATH\") && \\ WASM_DIR_RELATIVE_PATH=$(jq -r '.wasm_dir' /config/genesis.json) && \\ From 7391d98fe6945d9bd68cf3a07cc89019667eda90 Mon Sep 17 00:00:00 2001 From: Lohachov Mykhailo Date: Tue, 19 Nov 2024 23:59:58 +0900 Subject: [PATCH 11/16] chore: fix compose Signed-off-by: Lohachov Mykhailo --- defaults/docker-compose.single.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/docker-compose.single.yml b/defaults/docker-compose.single.yml index 1ff73b0f080..b654bfb7668 100644 --- a/defaults/docker-compose.single.yml +++ b/defaults/docker-compose.single.yml @@ -32,7 +32,7 @@ services: retries: 30 start_period: 4s command: |- - /bin/sh -c " + /bin/bash -c " EXECUTOR_RELATIVE_PATH=$(jq -r '.executor' /config/genesis.json) && \\ EXECUTOR_ABSOLUTE_PATH=$(realpath \"/config/$$EXECUTOR_RELATIVE_PATH\") && \\ WASM_DIR_RELATIVE_PATH=$(jq -r '.wasm_dir' /config/genesis.json) && \\ From 10f92a81eb83d69e485f45061777c7ec3c67665b Mon Sep 17 00:00:00 2001 From: Lohachov Mykhailo Date: Wed, 20 Nov 2024 15:45:12 +0900 Subject: [PATCH 12/16] fix: use humantime Signed-off-by: Lohachov Mykhailo --- crates/iroha_cli/src/main.rs | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/crates/iroha_cli/src/main.rs b/crates/iroha_cli/src/main.rs index 59849bae8ea..8e80d366888 100644 --- a/crates/iroha_cli/src/main.rs +++ b/crates/iroha_cli/src/main.rs @@ -5,6 +5,7 @@ use std::{ io::{stdin, stdout}, path::PathBuf, str::FromStr, + time::Duration, }; use erased_serde::Serialize; @@ -14,7 +15,7 @@ use futures::TryStreamExt; use iroha::{client::Client, config::Config, data_model::prelude::*}; use iroha_primitives::json::Json; use thiserror::Error; -use tokio::{runtime::Runtime, time::Duration}; +use tokio::runtime::Runtime; /// Re-usable clap `--metadata ` (`-m`) argument. /// Should be combined with `#[command(flatten)]` attr. @@ -308,9 +309,9 @@ mod events { #[derive(clap::Args, Debug, Clone, Copy)] pub struct Args { - /// Wait timeout in seconds + /// Wait timeout #[clap(short, long, global = true)] - timeout: Option, + timeout: Option, #[clap(subcommand)] command: Command, } @@ -332,10 +333,7 @@ mod events { impl RunArgs for Args { fn run(self, context: &mut dyn RunContext) -> Result<()> { - let timeout = self - .timeout - .map(|t| (1000f32 * t).floor() as u64) - .map(Duration::from_millis); + let timeout: Option = self.timeout.map(Into::into); match self.command { Command::TransactionPipeline => { @@ -397,17 +395,15 @@ mod blocks { /// Block height from which to start streaming blocks height: NonZeroU64, - /// Wait timeout in seconds + /// Wait timeout #[clap(short, long)] - timeout: Option, + timeout: Option, } impl RunArgs for Args { fn run(self, context: &mut dyn RunContext) -> Result<()> { let Args { height, timeout } = self; - let timeout = timeout - .map(|t| (1000f32 * t).floor() as u64) - .map(Duration::from_millis); + let timeout: Option = timeout.map(Into::into); listen(height, context, timeout) } } From 4b455c1b38ba699abe2938e2473d1286646e442e Mon Sep 17 00:00:00 2001 From: Lohachov Mykhailo Date: Thu, 21 Nov 2024 00:06:51 +0900 Subject: [PATCH 13/16] test: add integration test Signed-off-by: Lohachov Mykhailo --- pytests/iroha_cli_tests/poetry.lock | 224 ++++++++++-------- pytests/iroha_cli_tests/pyproject.toml | 1 + .../iroha_cli_tests/test/events/__init__.py | 0 .../iroha_cli_tests/test/events/conftest.py | 11 + .../test/events/test_listen_events.py | 23 ++ 5 files changed, 155 insertions(+), 104 deletions(-) create mode 100644 pytests/iroha_cli_tests/test/events/__init__.py create mode 100644 pytests/iroha_cli_tests/test/events/conftest.py create mode 100644 pytests/iroha_cli_tests/test/events/test_listen_events.py diff --git a/pytests/iroha_cli_tests/poetry.lock b/pytests/iroha_cli_tests/poetry.lock index 787e5b695dc..561755d2ae8 100644 --- a/pytests/iroha_cli_tests/poetry.lock +++ b/pytests/iroha_cli_tests/poetry.lock @@ -1,29 +1,29 @@ -# This file is automatically @generated by Poetry 1.8.3 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.4 and should not be changed by hand. [[package]] name = "allure-pytest" -version = "2.13.2" +version = "2.13.5" description = "Allure pytest integration" optional = false python-versions = "*" files = [ - {file = "allure-pytest-2.13.2.tar.gz", hash = "sha256:22243159e8ec81ce2b5254b4013802198821b1b42f118f69d4a289396607c7b3"}, - {file = "allure_pytest-2.13.2-py3-none-any.whl", hash = "sha256:17de9dbee7f61c8e66a5b5e818b00e419dbcea44cb55c24319401ba813220690"}, + {file = "allure-pytest-2.13.5.tar.gz", hash = "sha256:0ef8e1790c44a988db6b83c4d4f5e91451e2c4c8ea10601dfa88528d23afcf6e"}, + {file = "allure_pytest-2.13.5-py3-none-any.whl", hash = "sha256:94130bac32964b78058e62cf4b815ad97a5ac82a065e6dd2d43abac2be7640fc"}, ] [package.dependencies] -allure-python-commons = "2.13.2" +allure-python-commons = "2.13.5" pytest = ">=4.5.0" [[package]] name = "allure-python-commons" -version = "2.13.2" -description = "Common module for integrate allure with python-based frameworks" +version = "2.13.5" +description = "('Contains the API for end users as well as helper functions and classes to build Allure adapters for Python test frameworks',)" optional = false python-versions = ">=3.6" files = [ - {file = "allure-python-commons-2.13.2.tar.gz", hash = "sha256:8a03681330231b1deadd86b97ff68841c6591320114ae638570f1ed60d7a2033"}, - {file = "allure_python_commons-2.13.2-py3-none-any.whl", hash = "sha256:2bb3646ec3fbf5b36d178a5e735002bc130ae9f9ba80f080af97d368ba375051"}, + {file = "allure-python-commons-2.13.5.tar.gz", hash = "sha256:a232e7955811f988e49a4c1dd6c16cce7e9b81d0ea0422b1e5654d3254e2caf3"}, + {file = "allure_python_commons-2.13.5-py3-none-any.whl", hash = "sha256:8b0e837b6e32d810adec563f49e1d04127a5b6770e0232065b7cb09b9953980d"}, ] [package.dependencies] @@ -32,33 +32,33 @@ pluggy = ">=0.4.0" [[package]] name = "astroid" -version = "3.3.4" +version = "3.3.5" description = "An abstract syntax tree for Python with inference support." optional = false python-versions = ">=3.9.0" files = [ - {file = "astroid-3.3.4-py3-none-any.whl", hash = "sha256:5eba185467253501b62a9f113c263524b4f5d55e1b30456370eed4cdbd6438fd"}, - {file = "astroid-3.3.4.tar.gz", hash = "sha256:e73d0b62dd680a7c07cb2cd0ce3c22570b044dd01bd994bc3a2dd16c6cbba162"}, + {file = "astroid-3.3.5-py3-none-any.whl", hash = "sha256:a9d1c946ada25098d790e079ba2a1b112157278f3fb7e718ae6a9252f5835dc8"}, + {file = "astroid-3.3.5.tar.gz", hash = "sha256:5cfc40ae9f68311075d27ef68a4841bdc5cc7f6cf86671b49f00607d30188e2d"}, ] [[package]] name = "attrs" -version = "23.2.0" +version = "24.2.0" description = "Classes Without Boilerplate" optional = false python-versions = ">=3.7" files = [ - {file = "attrs-23.2.0-py3-none-any.whl", hash = "sha256:99b87a485a5820b23b879f04c2305b44b951b502fd64be915879d77a7e8fc6f1"}, - {file = "attrs-23.2.0.tar.gz", hash = "sha256:935dc3b529c262f6cf76e50877d35a4bd3c1de194fd41f47a2b7ae8f19971f30"}, + {file = "attrs-24.2.0-py3-none-any.whl", hash = "sha256:81921eb96de3191c8258c199618104dd27ac608d9366f5e35d011eae1867ede2"}, + {file = "attrs-24.2.0.tar.gz", hash = "sha256:5cfb1b9148b5b086569baec03f20d7b6bf3bcacc9a42bebf87ffaaca362f6346"}, ] [package.extras] -cov = ["attrs[tests]", "coverage[toml] (>=5.3)"] -dev = ["attrs[tests]", "pre-commit"] -docs = ["furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier", "zope-interface"] -tests = ["attrs[tests-no-zope]", "zope-interface"] -tests-mypy = ["mypy (>=1.6)", "pytest-mypy-plugins"] -tests-no-zope = ["attrs[tests-mypy]", "cloudpickle", "hypothesis", "pympler", "pytest (>=4.3.0)", "pytest-xdist[psutil]"] +benchmark = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-codspeed", "pytest-mypy-plugins", "pytest-xdist[psutil]"] +cov = ["cloudpickle", "coverage[toml] (>=5.3)", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] +dev = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pre-commit", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] +docs = ["cogapp", "furo", "myst-parser", "sphinx", "sphinx-notfound-page", "sphinxcontrib-towncrier", "towncrier (<24.7)"] +tests = ["cloudpickle", "hypothesis", "mypy (>=1.11.1)", "pympler", "pytest (>=4.3.0)", "pytest-mypy-plugins", "pytest-xdist[psutil]"] +tests-mypy = ["mypy (>=1.11.1)", "pytest-mypy-plugins"] [[package]] name = "black" @@ -106,63 +106,78 @@ uvloop = ["uvloop (>=0.15.2)"] [[package]] name = "cffi" -version = "1.16.0" +version = "1.17.1" description = "Foreign Function Interface for Python calling C code." optional = false python-versions = ">=3.8" files = [ - {file = "cffi-1.16.0-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:6b3d6606d369fc1da4fd8c357d026317fbb9c9b75d36dc16e90e84c26854b088"}, - {file = "cffi-1.16.0-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ac0f5edd2360eea2f1daa9e26a41db02dd4b0451b48f7c318e217ee092a213e9"}, - {file = "cffi-1.16.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7e61e3e4fa664a8588aa25c883eab612a188c725755afff6289454d6362b9673"}, - {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a72e8961a86d19bdb45851d8f1f08b041ea37d2bd8d4fd19903bc3083d80c896"}, - {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5b50bf3f55561dac5438f8e70bfcdfd74543fd60df5fa5f62d94e5867deca684"}, - {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7651c50c8c5ef7bdb41108b7b8c5a83013bfaa8a935590c5d74627c047a583c7"}, - {file = "cffi-1.16.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e4108df7fe9b707191e55f33efbcb2d81928e10cea45527879a4749cbe472614"}, - {file = "cffi-1.16.0-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:32c68ef735dbe5857c810328cb2481e24722a59a2003018885514d4c09af9743"}, - {file = "cffi-1.16.0-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:673739cb539f8cdaa07d92d02efa93c9ccf87e345b9a0b556e3ecc666718468d"}, - {file = "cffi-1.16.0-cp310-cp310-win32.whl", hash = "sha256:9f90389693731ff1f659e55c7d1640e2ec43ff725cc61b04b2f9c6d8d017df6a"}, - {file = "cffi-1.16.0-cp310-cp310-win_amd64.whl", hash = "sha256:e6024675e67af929088fda399b2094574609396b1decb609c55fa58b028a32a1"}, - {file = "cffi-1.16.0-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:b84834d0cf97e7d27dd5b7f3aca7b6e9263c56308ab9dc8aae9784abb774d404"}, - {file = "cffi-1.16.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:1b8ebc27c014c59692bb2664c7d13ce7a6e9a629be20e54e7271fa696ff2b417"}, - {file = "cffi-1.16.0-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ee07e47c12890ef248766a6e55bd38ebfb2bb8edd4142d56db91b21ea68b7627"}, - {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d8a9d3ebe49f084ad71f9269834ceccbf398253c9fac910c4fd7053ff1386936"}, - {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e70f54f1796669ef691ca07d046cd81a29cb4deb1e5f942003f401c0c4a2695d"}, - {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5bf44d66cdf9e893637896c7faa22298baebcd18d1ddb6d2626a6e39793a1d56"}, - {file = "cffi-1.16.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7b78010e7b97fef4bee1e896df8a4bbb6712b7f05b7ef630f9d1da00f6444d2e"}, - {file = "cffi-1.16.0-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:c6a164aa47843fb1b01e941d385aab7215563bb8816d80ff3a363a9f8448a8dc"}, - {file = "cffi-1.16.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:e09f3ff613345df5e8c3667da1d918f9149bd623cd9070c983c013792a9a62eb"}, - {file = "cffi-1.16.0-cp311-cp311-win32.whl", hash = "sha256:2c56b361916f390cd758a57f2e16233eb4f64bcbeee88a4881ea90fca14dc6ab"}, - {file = "cffi-1.16.0-cp311-cp311-win_amd64.whl", hash = "sha256:db8e577c19c0fda0beb7e0d4e09e0ba74b1e4c092e0e40bfa12fe05b6f6d75ba"}, - {file = "cffi-1.16.0-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:fa3a0128b152627161ce47201262d3140edb5a5c3da88d73a1b790a959126956"}, - {file = "cffi-1.16.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:68e7c44931cc171c54ccb702482e9fc723192e88d25a0e133edd7aff8fcd1f6e"}, - {file = "cffi-1.16.0-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:abd808f9c129ba2beda4cfc53bde801e5bcf9d6e0f22f095e45327c038bfe68e"}, - {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:88e2b3c14bdb32e440be531ade29d3c50a1a59cd4e51b1dd8b0865c54ea5d2e2"}, - {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:fcc8eb6d5902bb1cf6dc4f187ee3ea80a1eba0a89aba40a5cb20a5087d961357"}, - {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b7be2d771cdba2942e13215c4e340bfd76398e9227ad10402a8767ab1865d2e6"}, - {file = "cffi-1.16.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e715596e683d2ce000574bae5d07bd522c781a822866c20495e52520564f0969"}, - {file = "cffi-1.16.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:2d92b25dbf6cae33f65005baf472d2c245c050b1ce709cc4588cdcdd5495b520"}, - {file = "cffi-1.16.0-cp312-cp312-win32.whl", hash = "sha256:b2ca4e77f9f47c55c194982e10f058db063937845bb2b7a86c84a6cfe0aefa8b"}, - {file = "cffi-1.16.0-cp312-cp312-win_amd64.whl", hash = "sha256:68678abf380b42ce21a5f2abde8efee05c114c2fdb2e9eef2efdb0257fba1235"}, - {file = "cffi-1.16.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0c9ef6ff37e974b73c25eecc13952c55bceed9112be2d9d938ded8e856138bcc"}, - {file = "cffi-1.16.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:a09582f178759ee8128d9270cd1344154fd473bb77d94ce0aeb2a93ebf0feaf0"}, - {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e760191dd42581e023a68b758769e2da259b5d52e3103c6060ddc02c9edb8d7b"}, - {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:80876338e19c951fdfed6198e70bc88f1c9758b94578d5a7c4c91a87af3cf31c"}, - {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a6a14b17d7e17fa0d207ac08642c8820f84f25ce17a442fd15e27ea18d67c59b"}, - {file = "cffi-1.16.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6602bc8dc6f3a9e02b6c22c4fc1e47aa50f8f8e6d3f78a5e16ac33ef5fefa324"}, - {file = "cffi-1.16.0-cp38-cp38-win32.whl", hash = "sha256:131fd094d1065b19540c3d72594260f118b231090295d8c34e19a7bbcf2e860a"}, - {file = "cffi-1.16.0-cp38-cp38-win_amd64.whl", hash = "sha256:31d13b0f99e0836b7ff893d37af07366ebc90b678b6664c955b54561fc36ef36"}, - {file = "cffi-1.16.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:582215a0e9adbe0e379761260553ba11c58943e4bbe9c36430c4ca6ac74b15ed"}, - {file = "cffi-1.16.0-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:b29ebffcf550f9da55bec9e02ad430c992a87e5f512cd63388abb76f1036d8d2"}, - {file = "cffi-1.16.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dc9b18bf40cc75f66f40a7379f6a9513244fe33c0e8aa72e2d56b0196a7ef872"}, - {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cb4a35b3642fc5c005a6755a5d17c6c8b6bcb6981baf81cea8bfbc8903e8ba8"}, - {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:b86851a328eedc692acf81fb05444bdf1891747c25af7529e39ddafaf68a4f3f"}, - {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c0f31130ebc2d37cdd8e44605fb5fa7ad59049298b3f745c74fa74c62fbfcfc4"}, - {file = "cffi-1.16.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8f8e709127c6c77446a8c0a8c8bf3c8ee706a06cd44b1e827c3e6a2ee6b8c098"}, - {file = "cffi-1.16.0-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:748dcd1e3d3d7cd5443ef03ce8685043294ad6bd7c02a38d1bd367cfd968e000"}, - {file = "cffi-1.16.0-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8895613bcc094d4a1b2dbe179d88d7fb4a15cee43c052e8885783fac397d91fe"}, - {file = "cffi-1.16.0-cp39-cp39-win32.whl", hash = "sha256:ed86a35631f7bfbb28e108dd96773b9d5a6ce4811cf6ea468bb6a359b256b1e4"}, - {file = "cffi-1.16.0-cp39-cp39-win_amd64.whl", hash = "sha256:3686dffb02459559c74dd3d81748269ffb0eb027c39a6fc99502de37d501faa8"}, - {file = "cffi-1.16.0.tar.gz", hash = "sha256:bcb3ef43e58665bbda2fb198698fcae6776483e0c4a631aa5647806c25e02cc0"}, + {file = "cffi-1.17.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:df8b1c11f177bc2313ec4b2d46baec87a5f3e71fc8b45dab2ee7cae86d9aba14"}, + {file = "cffi-1.17.1-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:8f2cdc858323644ab277e9bb925ad72ae0e67f69e804f4898c070998d50b1a67"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:edae79245293e15384b51f88b00613ba9f7198016a5948b5dddf4917d4d26382"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:45398b671ac6d70e67da8e4224a065cec6a93541bb7aebe1b198a61b58c7b702"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:ad9413ccdeda48c5afdae7e4fa2192157e991ff761e7ab8fdd8926f40b160cc3"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:5da5719280082ac6bd9aa7becb3938dc9f9cbd57fac7d2871717b1feb0902ab6"}, + {file = "cffi-1.17.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:2bb1a08b8008b281856e5971307cc386a8e9c5b625ac297e853d36da6efe9c17"}, + {file = "cffi-1.17.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:045d61c734659cc045141be4bae381a41d89b741f795af1dd018bfb532fd0df8"}, + {file = "cffi-1.17.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:6883e737d7d9e4899a8a695e00ec36bd4e5e4f18fabe0aca0efe0a4b44cdb13e"}, + {file = "cffi-1.17.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:6b8b4a92e1c65048ff98cfe1f735ef8f1ceb72e3d5f0c25fdb12087a23da22be"}, + {file = "cffi-1.17.1-cp310-cp310-win32.whl", hash = "sha256:c9c3d058ebabb74db66e431095118094d06abf53284d9c81f27300d0e0d8bc7c"}, + {file = "cffi-1.17.1-cp310-cp310-win_amd64.whl", hash = "sha256:0f048dcf80db46f0098ccac01132761580d28e28bc0f78ae0d58048063317e15"}, + {file = "cffi-1.17.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:a45e3c6913c5b87b3ff120dcdc03f6131fa0065027d0ed7ee6190736a74cd401"}, + {file = "cffi-1.17.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:30c5e0cb5ae493c04c8b42916e52ca38079f1b235c2f8ae5f4527b963c401caf"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:f75c7ab1f9e4aca5414ed4d8e5c0e303a34f4421f8a0d47a4d019ceff0ab6af4"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a1ed2dd2972641495a3ec98445e09766f077aee98a1c896dcb4ad0d303628e41"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:46bf43160c1a35f7ec506d254e5c890f3c03648a4dbac12d624e4490a7046cd1"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:a24ed04c8ffd54b0729c07cee15a81d964e6fee0e3d4d342a27b020d22959dc6"}, + {file = "cffi-1.17.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:610faea79c43e44c71e1ec53a554553fa22321b65fae24889706c0a84d4ad86d"}, + {file = "cffi-1.17.1-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:a9b15d491f3ad5d692e11f6b71f7857e7835eb677955c00cc0aefcd0669adaf6"}, + {file = "cffi-1.17.1-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:de2ea4b5833625383e464549fec1bc395c1bdeeb5f25c4a3a82b5a8c756ec22f"}, + {file = "cffi-1.17.1-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:fc48c783f9c87e60831201f2cce7f3b2e4846bf4d8728eabe54d60700b318a0b"}, + {file = "cffi-1.17.1-cp311-cp311-win32.whl", hash = "sha256:85a950a4ac9c359340d5963966e3e0a94a676bd6245a4b55bc43949eee26a655"}, + {file = "cffi-1.17.1-cp311-cp311-win_amd64.whl", hash = "sha256:caaf0640ef5f5517f49bc275eca1406b0ffa6aa184892812030f04c2abf589a0"}, + {file = "cffi-1.17.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:805b4371bf7197c329fcb3ead37e710d1bca9da5d583f5073b799d5c5bd1eee4"}, + {file = "cffi-1.17.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:733e99bc2df47476e3848417c5a4540522f234dfd4ef3ab7fafdf555b082ec0c"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1257bdabf294dceb59f5e70c64a3e2f462c30c7ad68092d01bbbfb1c16b1ba36"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:da95af8214998d77a98cc14e3a3bd00aa191526343078b530ceb0bd710fb48a5"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d63afe322132c194cf832bfec0dc69a99fb9bb6bbd550f161a49e9e855cc78ff"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f79fc4fc25f1c8698ff97788206bb3c2598949bfe0fef03d299eb1b5356ada99"}, + {file = "cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b62ce867176a75d03a665bad002af8e6d54644fad99a3c70905c543130e39d93"}, + {file = "cffi-1.17.1-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:386c8bf53c502fff58903061338ce4f4950cbdcb23e2902d86c0f722b786bbe3"}, + {file = "cffi-1.17.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:4ceb10419a9adf4460ea14cfd6bc43d08701f0835e979bf821052f1805850fe8"}, + {file = "cffi-1.17.1-cp312-cp312-win32.whl", hash = "sha256:a08d7e755f8ed21095a310a693525137cfe756ce62d066e53f502a83dc550f65"}, + {file = "cffi-1.17.1-cp312-cp312-win_amd64.whl", hash = "sha256:51392eae71afec0d0c8fb1a53b204dbb3bcabcb3c9b807eedf3e1e6ccf2de903"}, + {file = "cffi-1.17.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f3a2b4222ce6b60e2e8b337bb9596923045681d71e5a082783484d845390938e"}, + {file = "cffi-1.17.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:0984a4925a435b1da406122d4d7968dd861c1385afe3b45ba82b750f229811e2"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d01b12eeeb4427d3110de311e1774046ad344f5b1a7403101878976ecd7a10f3"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:706510fe141c86a69c8ddc029c7910003a17353970cff3b904ff0686a5927683"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:de55b766c7aa2e2a3092c51e0483d700341182f08e67c63630d5b6f200bb28e5"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c59d6e989d07460165cc5ad3c61f9fd8f1b4796eacbd81cee78957842b834af4"}, + {file = "cffi-1.17.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:dd398dbc6773384a17fe0d3e7eeb8d1a21c2200473ee6806bb5e6a8e62bb73dd"}, + {file = "cffi-1.17.1-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:3edc8d958eb099c634dace3c7e16560ae474aa3803a5df240542b305d14e14ed"}, + {file = "cffi-1.17.1-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:72e72408cad3d5419375fc87d289076ee319835bdfa2caad331e377589aebba9"}, + {file = "cffi-1.17.1-cp313-cp313-win32.whl", hash = "sha256:e03eab0a8677fa80d646b5ddece1cbeaf556c313dcfac435ba11f107ba117b5d"}, + {file = "cffi-1.17.1-cp313-cp313-win_amd64.whl", hash = "sha256:f6a16c31041f09ead72d69f583767292f750d24913dadacf5756b966aacb3f1a"}, + {file = "cffi-1.17.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:636062ea65bd0195bc012fea9321aca499c0504409f413dc88af450b57ffd03b"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c7eac2ef9b63c79431bc4b25f1cd649d7f061a28808cbc6c47b534bd789ef964"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e221cf152cff04059d011ee126477f0d9588303eb57e88923578ace7baad17f9"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:31000ec67d4221a71bd3f67df918b1f88f676f1c3b535a7eb473255fdc0b83fc"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6f17be4345073b0a7b8ea599688f692ac3ef23ce28e5df79c04de519dbc4912c"}, + {file = "cffi-1.17.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0e2b1fac190ae3ebfe37b979cc1ce69c81f4e4fe5746bb401dca63a9062cdaf1"}, + {file = "cffi-1.17.1-cp38-cp38-win32.whl", hash = "sha256:7596d6620d3fa590f677e9ee430df2958d2d6d6de2feeae5b20e82c00b76fbf8"}, + {file = "cffi-1.17.1-cp38-cp38-win_amd64.whl", hash = "sha256:78122be759c3f8a014ce010908ae03364d00a1f81ab5c7f4a7a5120607ea56e1"}, + {file = "cffi-1.17.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b2ab587605f4ba0bf81dc0cb08a41bd1c0a5906bd59243d56bad7668a6fc6c16"}, + {file = "cffi-1.17.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:28b16024becceed8c6dfbc75629e27788d8a3f9030691a1dbf9821a128b22c36"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1d599671f396c4723d016dbddb72fe8e0397082b0a77a4fab8028923bec050e8"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ca74b8dbe6e8e8263c0ffd60277de77dcee6c837a3d0881d8c1ead7268c9e576"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:f7f5baafcc48261359e14bcd6d9bff6d4b28d9103847c9e136694cb0501aef87"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:98e3969bcff97cae1b2def8ba499ea3d6f31ddfdb7635374834cf89a1a08ecf0"}, + {file = "cffi-1.17.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cdf5ce3acdfd1661132f2a9c19cac174758dc2352bfe37d98aa7512c6b7178b3"}, + {file = "cffi-1.17.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:9755e4345d1ec879e3849e62222a18c7174d65a6a92d5b346b1863912168b595"}, + {file = "cffi-1.17.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:f1e22e8c4419538cb197e4dd60acc919d7696e5ef98ee4da4e01d3f8cfa4cc5a"}, + {file = "cffi-1.17.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:c03e868a0b3bc35839ba98e74211ed2b05d2119be4e8a0f224fba9384f1fe02e"}, + {file = "cffi-1.17.1-cp39-cp39-win32.whl", hash = "sha256:e31ae45bc2e29f6b2abd0de1cc3b9d5205aa847cafaecb8af1476a609a2f6eb7"}, + {file = "cffi-1.17.1-cp39-cp39-win_amd64.whl", hash = "sha256:d016c76bdd850f3c626af19b0542c9677ba156e4ee4fccfdd7848803533ef662"}, + {file = "cffi-1.17.1.tar.gz", hash = "sha256:1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824"}, ] [package.dependencies] @@ -244,13 +259,13 @@ test-randomorder = ["pytest-randomly"] [[package]] name = "dill" -version = "0.3.8" +version = "0.3.9" description = "serialize all of Python" optional = false python-versions = ">=3.8" files = [ - {file = "dill-0.3.8-py3-none-any.whl", hash = "sha256:c36ca9ffb54365bdd2f8eb3eff7d2a21237f8452b57ace88b1ac615b7e815bd7"}, - {file = "dill-0.3.8.tar.gz", hash = "sha256:3ebe3c479ad625c4553aca177444d89b486b1d84982eeacded644afc0cf797ca"}, + {file = "dill-0.3.9-py3-none-any.whl", hash = "sha256:468dff3b89520b474c0397703366b7b95eebe6303f108adf9b19da1f702be87a"}, + {file = "dill-0.3.9.tar.gz", hash = "sha256:81aa267dddf68cbfe8029c42ca9ec6a4ab3b22371d1c450abc54422577b4512c"}, ] [package.extras] @@ -273,13 +288,13 @@ testing = ["hatch", "pre-commit", "pytest", "tox"] [[package]] name = "faker" -version = "30.8.2" +version = "33.0.0" description = "Faker is a Python package that generates fake data for you." optional = false python-versions = ">=3.8" files = [ - {file = "Faker-30.8.2-py3-none-any.whl", hash = "sha256:4a82b2908cd19f3bba1a4da2060cc4eb18a40410ccdf9350d071d79dc92fe3ce"}, - {file = "faker-30.8.2.tar.gz", hash = "sha256:aa31b52cdae3673d6a78b4857c7bcdc0e98f201a5cb77d7827fa9e6b5876da94"}, + {file = "Faker-33.0.0-py3-none-any.whl", hash = "sha256:68e5580cb6b4226710886e595eabc13127149d6e71e9d1db65506a7fbe2c7fce"}, + {file = "faker-33.0.0.tar.gz", hash = "sha256:9b01019c1ddaf2253ca2308c0472116e993f4ad8fc9905f82fa965e0c6f932e9"}, ] [package.dependencies] @@ -403,13 +418,13 @@ files = [ [[package]] name = "packaging" -version = "23.2" +version = "24.2" description = "Core utilities for Python packages" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "packaging-23.2-py3-none-any.whl", hash = "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7"}, - {file = "packaging-23.2.tar.gz", hash = "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5"}, + {file = "packaging-24.2-py3-none-any.whl", hash = "sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759"}, + {file = "packaging-24.2.tar.gz", hash = "sha256:c228a6dc5e932d346bc5739379109d49e8853dd8223571c7c5b55260edc0b97f"}, ] [[package]] @@ -425,18 +440,19 @@ files = [ [[package]] name = "platformdirs" -version = "4.2.0" -description = "A small Python package for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +version = "4.3.6" +description = "A small Python package for determining appropriate platform-specific dirs, e.g. a `user data dir`." optional = false python-versions = ">=3.8" files = [ - {file = "platformdirs-4.2.0-py3-none-any.whl", hash = "sha256:0614df2a2f37e1a662acbd8e2b25b92ccf8632929bc6d43467e17fe89c75e068"}, - {file = "platformdirs-4.2.0.tar.gz", hash = "sha256:ef0cc731df711022c174543cb70a9b5bd22e5a9337c8624ef2c2ceb8ddad8768"}, + {file = "platformdirs-4.3.6-py3-none-any.whl", hash = "sha256:73e575e1408ab8103900836b97580d5307456908a03e92031bab39e4554cc3fb"}, + {file = "platformdirs-4.3.6.tar.gz", hash = "sha256:357fb2acbc885b0419afd3ce3ed34564c13c9b95c89360cd9563f73aa5e2b907"}, ] [package.extras] -docs = ["furo (>=2023.9.10)", "proselint (>=0.13)", "sphinx (>=7.2.6)", "sphinx-autodoc-typehints (>=1.25.2)"] -test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=7.4.3)", "pytest-cov (>=4.1)", "pytest-mock (>=3.12)"] +docs = ["furo (>=2024.8.6)", "proselint (>=0.14)", "sphinx (>=8.0.2)", "sphinx-autodoc-typehints (>=2.4)"] +test = ["appdirs (==1.4.4)", "covdefaults (>=2.3)", "pytest (>=8.3.2)", "pytest-cov (>=5)", "pytest-mock (>=3.14)"] +type = ["mypy (>=1.11.2)"] [[package]] name = "pluggy" @@ -455,24 +471,24 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "pycodestyle" -version = "2.12.0" +version = "2.12.1" description = "Python style guide checker" optional = false python-versions = ">=3.8" files = [ - {file = "pycodestyle-2.12.0-py2.py3-none-any.whl", hash = "sha256:949a39f6b86c3e1515ba1787c2022131d165a8ad271b11370a8819aa070269e4"}, - {file = "pycodestyle-2.12.0.tar.gz", hash = "sha256:442f950141b4f43df752dd303511ffded3a04c2b6fb7f65980574f0c31e6e79c"}, + {file = "pycodestyle-2.12.1-py2.py3-none-any.whl", hash = "sha256:46f0fb92069a7c28ab7bb558f05bfc0110dac69a0cd23c61ea0040283a9d78b3"}, + {file = "pycodestyle-2.12.1.tar.gz", hash = "sha256:6838eae08bbce4f6accd5d5572075c63626a15ee3e6f842df996bf62f6d73521"}, ] [[package]] name = "pycparser" -version = "2.21" +version = "2.22" description = "C parser in Python" optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +python-versions = ">=3.8" files = [ - {file = "pycparser-2.21-py2.py3-none-any.whl", hash = "sha256:8ee45429555515e1f6b185e78100aea234072576aa43ab53aefcae078162fca9"}, - {file = "pycparser-2.21.tar.gz", hash = "sha256:e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"}, + {file = "pycparser-2.22-py3-none-any.whl", hash = "sha256:c3702b6d3dd8c7abc1afa565d7e63d53a1d0bd86cdc24edd75470f4de499cfcc"}, + {file = "pycparser-2.22.tar.gz", hash = "sha256:491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6"}, ] [[package]] @@ -555,13 +571,13 @@ testing = ["filelock"] [[package]] name = "python-dateutil" -version = "2.8.2" +version = "2.9.0.post0" description = "Extensions to the standard Python datetime module" optional = false python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" files = [ - {file = "python-dateutil-2.8.2.tar.gz", hash = "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"}, - {file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"}, + {file = "python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3"}, + {file = "python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427"}, ] [package.dependencies] @@ -605,16 +621,16 @@ files = [ [[package]] name = "typing-extensions" -version = "4.9.0" +version = "4.12.2" description = "Backported and Experimental Type Hints for Python 3.8+" optional = false python-versions = ">=3.8" files = [ - {file = "typing_extensions-4.9.0-py3-none-any.whl", hash = "sha256:af72aea155e91adfc61c3ae9e0e342dbc0cba726d6cba4b6c72c1f34e47291cd"}, - {file = "typing_extensions-4.9.0.tar.gz", hash = "sha256:23478f88c37f27d76ac8aee6c905017a143b0b1b886c3c9f66bc2fd94f9f5783"}, + {file = "typing_extensions-4.12.2-py3-none-any.whl", hash = "sha256:04e5ca0351e0f3f85c6853954072df659d0d13fac324d0072316b67d7794700d"}, + {file = "typing_extensions-4.12.2.tar.gz", hash = "sha256:1a7ead55c7e559dd4dee8856e3a88b41225abfe1ce8df57b7c13915fe121ffb8"}, ] [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "57066bd7fa291d8da3b3296aff6a318def6c0573d2083c99bf6c2fa678d0cf97" +content-hash = "663e03c60427c7c2f7c32c384c855449178ebbcc37677ac46c5b0a4ffe08f1a4" diff --git a/pytests/iroha_cli_tests/pyproject.toml b/pytests/iroha_cli_tests/pyproject.toml index c0cb12e570f..5c1c5e1a99e 100644 --- a/pytests/iroha_cli_tests/pyproject.toml +++ b/pytests/iroha_cli_tests/pyproject.toml @@ -8,6 +8,7 @@ readme = "README.md" [tool.poetry.dependencies] python = "^3.11" faker = "*" +cffi = ">=1.17.0" allure-python-commons = "*" cryptography = "*" python-dotenv = "*" diff --git a/pytests/iroha_cli_tests/test/events/__init__.py b/pytests/iroha_cli_tests/test/events/__init__.py new file mode 100644 index 00000000000..e69de29bb2d diff --git a/pytests/iroha_cli_tests/test/events/conftest.py b/pytests/iroha_cli_tests/test/events/conftest.py new file mode 100644 index 00000000000..4570484926a --- /dev/null +++ b/pytests/iroha_cli_tests/test/events/conftest.py @@ -0,0 +1,11 @@ +from .. import ( + GIVEN_currently_authorized_account, +) + +import allure # type: ignore +import pytest + + +@pytest.fixture(scope="function", autouse=True) +def events_test_setup(): + allure.dynamic.feature("Events") diff --git a/pytests/iroha_cli_tests/test/events/test_listen_events.py b/pytests/iroha_cli_tests/test/events/test_listen_events.py new file mode 100644 index 00000000000..c82ce3d237f --- /dev/null +++ b/pytests/iroha_cli_tests/test/events/test_listen_events.py @@ -0,0 +1,23 @@ +import allure # type: ignore +import pytest + +from ...src.iroha_cli import iroha_cli, have, iroha + + +@pytest.fixture(scope="function", autouse=True) +def story_account_transfers_domain(): + allure.dynamic.story("Account streams events") + + +@allure.label("sdk_test_id", "stream_data_events_timeouts") +def test_stream_data_events_timeouts(GIVEN_currently_authorized_account): + with allure.step( + f"WHEN {GIVEN_currently_authorized_account} streams block-pipeline events with timeout " + ): + iroha_cli.execute( + f"events data --timeout 1s" + ) + + iroha_cli.should( + have.error("Timeout period has expired.\n") + ) From a000b8d440f1f266b8a8dcf3c2d50124991f7cd0 Mon Sep 17 00:00:00 2001 From: Lohachov Mykhailo Date: Thu, 21 Nov 2024 00:14:01 +0900 Subject: [PATCH 14/16] chore: fmt Signed-off-by: Lohachov Mykhailo --- pytests/iroha_cli_tests/test/events/test_listen_events.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pytests/iroha_cli_tests/test/events/test_listen_events.py b/pytests/iroha_cli_tests/test/events/test_listen_events.py index c82ce3d237f..915f8069f67 100644 --- a/pytests/iroha_cli_tests/test/events/test_listen_events.py +++ b/pytests/iroha_cli_tests/test/events/test_listen_events.py @@ -14,10 +14,6 @@ def test_stream_data_events_timeouts(GIVEN_currently_authorized_account): with allure.step( f"WHEN {GIVEN_currently_authorized_account} streams block-pipeline events with timeout " ): - iroha_cli.execute( - f"events data --timeout 1s" - ) + iroha_cli.execute(f"events data --timeout 1s") - iroha_cli.should( - have.error("Timeout period has expired.\n") - ) + iroha_cli.should(have.error("Timeout period has expired.\n")) From b1a6295332c2250451fef6abd037a48be61e875f Mon Sep 17 00:00:00 2001 From: Lohachov Mykhailo Date: Thu, 21 Nov 2024 00:56:33 +0900 Subject: [PATCH 15/16] chore: fmt Signed-off-by: Lohachov Mykhailo --- pytests/iroha_cli_tests/test/events/test_listen_events.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytests/iroha_cli_tests/test/events/test_listen_events.py b/pytests/iroha_cli_tests/test/events/test_listen_events.py index 915f8069f67..f43b27a002a 100644 --- a/pytests/iroha_cli_tests/test/events/test_listen_events.py +++ b/pytests/iroha_cli_tests/test/events/test_listen_events.py @@ -14,6 +14,6 @@ def test_stream_data_events_timeouts(GIVEN_currently_authorized_account): with allure.step( f"WHEN {GIVEN_currently_authorized_account} streams block-pipeline events with timeout " ): - iroha_cli.execute(f"events data --timeout 1s") + iroha_cli.execute("events data --timeout 1s") iroha_cli.should(have.error("Timeout period has expired.\n")) From 4e3f995d59249e28e19438a677b91565b0512eef Mon Sep 17 00:00:00 2001 From: Lohachov Mykhailo Date: Thu, 21 Nov 2024 19:04:34 +0900 Subject: [PATCH 16/16] chore: update python test dependencies Signed-off-by: Lohachov Mykhailo --- pytests/iroha_cli_tests/poetry.lock | 2 +- pytests/iroha_cli_tests/pyproject.toml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pytests/iroha_cli_tests/poetry.lock b/pytests/iroha_cli_tests/poetry.lock index 561755d2ae8..ccce5c38515 100644 --- a/pytests/iroha_cli_tests/poetry.lock +++ b/pytests/iroha_cli_tests/poetry.lock @@ -633,4 +633,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.11" -content-hash = "663e03c60427c7c2f7c32c384c855449178ebbcc37677ac46c5b0a4ffe08f1a4" +content-hash = "57066bd7fa291d8da3b3296aff6a318def6c0573d2083c99bf6c2fa678d0cf97" diff --git a/pytests/iroha_cli_tests/pyproject.toml b/pytests/iroha_cli_tests/pyproject.toml index 5c1c5e1a99e..c0cb12e570f 100644 --- a/pytests/iroha_cli_tests/pyproject.toml +++ b/pytests/iroha_cli_tests/pyproject.toml @@ -8,7 +8,6 @@ readme = "README.md" [tool.poetry.dependencies] python = "^3.11" faker = "*" -cffi = ">=1.17.0" allure-python-commons = "*" cryptography = "*" python-dotenv = "*"