From fbabd8443770574936609b9f9519b8d7d0e7ff42 Mon Sep 17 00:00:00 2001 From: dkijania Date: Fri, 26 Feb 2021 10:25:41 +0100 Subject: [PATCH 1/8] make necessary adjustment for private voting in vitup --- vitup/Cargo.toml | 6 +++--- vitup/src/config/mod.rs | 2 +- vitup/src/scenario/controller.rs | 25 +++++++++++++++++++++ vitup/src/setup/start/quick/builder.rs | 30 +++----------------------- 4 files changed, 32 insertions(+), 31 deletions(-) diff --git a/vitup/Cargo.toml b/vitup/Cargo.toml index 82a7c416..e2edba56 100644 --- a/vitup/Cargo.toml +++ b/vitup/Cargo.toml @@ -19,9 +19,9 @@ chain-addr = { git = "https://github.com/input-output-hk/chain-libs.gi chain-impl-mockchain = { git = "https://github.com/input-output-hk/chain-libs.git", branch = "master", features = [ "property-test-api" ] } chain-time = { git = "https://github.com/input-output-hk/chain-libs.git", branch = "master" } chain-vote = { git = "https://github.com/input-output-hk/chain-libs.git", branch = "master" } -jormungandr-testing-utils = { git = "https://github.com/input-output-hk/jormungandr.git", rev = "7a201c6694118561f08e9140b9899888e6c6d993" } -jormungandr-lib = { git = "https://github.com/input-output-hk/jormungandr.git", rev = "7a201c6694118561f08e9140b9899888e6c6d993" } -jormungandr-scenario-tests = { git = "https://github.com/input-output-hk/jormungandr.git", rev = "7a201c6694118561f08e9140b9899888e6c6d993" } +jormungandr-scenario-tests = { git = "https://github.com/input-output-hk/jormungandr.git", rev = "04e065d055d6ca7bb0b0237a60ac5036c190569e" } +jormungandr-testing-utils = { git = "https://github.com/input-output-hk/jormungandr.git", rev = "04e065d055d6ca7bb0b0237a60ac5036c190569e" } +jormungandr-lib = { git = "https://github.com/input-output-hk/jormungandr.git", rev = "04e065d055d6ca7bb0b0237a60ac5036c190569e" } jortestkit = { git = "https://github.com/input-output-hk/jortestkit.git", branch = "master" } vit-servicing-station-tests = { git = "https://github.com/input-output-hk/vit-servicing-station.git", rev = "700c4d06b366c920e6daf46885d98d74d3791d0a" } vit-servicing-station-lib = { git = "https://github.com/input-output-hk/vit-servicing-station.git", rev = "700c4d06b366c920e6daf46885d98d74d3791d0a" } diff --git a/vitup/src/config/mod.rs b/vitup/src/config/mod.rs index c06a51d3..95f79350 100644 --- a/vitup/src/config/mod.rs +++ b/vitup/src/config/mod.rs @@ -2,7 +2,7 @@ mod env; mod initials; pub use env::VitStartParameters; -pub use initials::Initials; +pub use initials::{Initial as InitialEntry, Initials}; use chain_impl_mockchain::fee::LinearFee; use jormungandr_lib::interfaces::{CommitteeIdDef, ConsensusLeaderId, Initial, LinearFeeDef}; diff --git a/vitup/src/scenario/controller.rs b/vitup/src/scenario/controller.rs index 4ff451d1..0f1ba6f6 100644 --- a/vitup/src/scenario/controller.rs +++ b/vitup/src/scenario/controller.rs @@ -10,6 +10,7 @@ use iapyx::WalletBackend; use indicatif::ProgressBar; use jormungandr_scenario_tests::scenario::{ContextChaCha, Controller, ControllerBuilder}; use jormungandr_testing_utils::testing::network_builder::{Blockchain, Topology}; +use std::path::Path; use vit_servicing_station_tests::common::data::ValidVotePlanParameters; use vit_servicing_station_tests::common::data::ValidVotingTemplateGenerator; @@ -83,6 +84,30 @@ impl VitController { Ok(iapyx::Controller::recover_with_backend(backend, mnemonics, &[]).unwrap()) } + /// iapyx wallet is a mock mobile wallet + /// it uses some production code while handling wallet operation + // therefore controller has separate method to build such wallet + pub fn iapyx_wallet_from_qr>( + &self, + qr: P, + password: &str, + wallet_proxy: &WalletProxyController, + ) -> Result { + let settings = iapyx::WalletBackendSettings { + use_https_for_post: false, + enable_debug: true, + certificate: None, + }; + + Ok(iapyx::Controller::recover_from_qr( + wallet_proxy.settings().base_address().to_string(), + qr, + password, + settings, + ) + .unwrap()) + } + pub fn spawn_vit_station( &self, controller: &mut Controller, diff --git a/vitup/src/setup/start/quick/builder.rs b/vitup/src/setup/start/quick/builder.rs index 95394a8d..08df1dad 100644 --- a/vitup/src/setup/start/quick/builder.rs +++ b/vitup/src/setup/start/quick/builder.rs @@ -218,20 +218,8 @@ impl QuickVitBackendSettingsBuilder { parameters.set_fund_id(self.parameters.fund_id); if self.parameters.private { - let mut committee_wallet = settings - .network_settings - .wallets - .get(self.committe_wallet_names.first().unwrap()) - .unwrap() - .clone(); - let identifier = committee_wallet.identifier(); - let private_key_data = settings - .private_vote_plans - .values() - .next() - .unwrap() - .get(&identifier.into()) - .unwrap(); + let private_key_data = settings.private_vote_plans.get(&self.fund_name()).unwrap(); + let key: ElectionPublicKey = private_key_data.encrypting_vote_key(); parameters.set_vote_encryption_key(key.to_base32().unwrap()); } @@ -416,19 +404,7 @@ impl QuickVitBackendSettingsBuilder { .block0_date, ); - if self.parameters.private { - let vote_plan = controller - .settings() - .private_vote_plans - .values() - .next() - .unwrap(); - let committee_keys = vote_plan_def.committee_keys_mut(); - - for key in vote_plan.member_public_keys().iter() { - committee_keys.push(key.clone()); - } - } + vote_plan_def = controller.vote_plan(&self.fund_name()).unwrap(); let parameters = self.vote_plan_parameters(vote_plan_def, &controller.settings()); Ok((vit_controller, controller, parameters)) } From 23217aef5138193369d405bc421bac29e54afd9a Mon Sep 17 00:00:00 2001 From: dkijania Date: Fri, 26 Feb 2021 10:26:03 +0100 Subject: [PATCH 2/8] move all setup related things to isolated module --- integration-tests/src/setup.rs | 80 ++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 integration-tests/src/setup.rs diff --git a/integration-tests/src/setup.rs b/integration-tests/src/setup.rs new file mode 100644 index 00000000..272ab07b --- /dev/null +++ b/integration-tests/src/setup.rs @@ -0,0 +1,80 @@ +use jormungandr_scenario_tests::prepare_command; +use jormungandr_scenario_tests::scenario::Controller; +use jormungandr_scenario_tests::Context; +use jormungandr_testing_utils::testing::network_builder::Seed; +use jortestkit::prelude::*; +use std::path::Path; +use std::path::PathBuf; +use std::str::FromStr; +use vit_servicing_station_tests::common::data::ValidVotePlanParameters; +use vitup::scenario::controller::VitController; +use vitup::setup::start::quick::QuickVitBackendSettingsBuilder; + +pub fn wait_until_folder_contains_all_qrs>(qrs_count: usize, folder: P) { + println!("waiting for qr code in: {:?}", folder.as_ref()); + + loop { + let qrs = std::fs::read_dir(folder.as_ref()).unwrap(); + let actual = qrs.into_iter().count(); + println!("waiting for qr code in: {}/{}", actual, qrs_count); + if actual >= qrs_count { + break; + } + std::thread::sleep(std::time::Duration::from_secs(5)); + } +} + +pub fn context(testing_directory: &PathBuf) -> Context { + let jormungandr = prepare_command(PathBuf::from_str("jormungandr").unwrap()); + let jcli = prepare_command(PathBuf::from_str("jcli").unwrap()); + let seed = Seed::generate(rand::rngs::OsRng); + let generate_documentation = true; + let log_level = "info".to_string(); + + Context::new( + seed, + jormungandr, + jcli, + Some(testing_directory.clone()), + generate_documentation, + ProgressBarMode::Standard, + log_level, + ) +} + +pub fn vitup_setup_default( + private: bool, + no_of_wallets: usize, + testing_directory: PathBuf, +) -> (VitController, Controller, ValidVotePlanParameters, String) { + let mut quick_setup = QuickVitBackendSettingsBuilder::new(); + + quick_setup + .initials_count(no_of_wallets, "1234") + .vote_start_epoch(0) + .tally_start_epoch(20) + .tally_end_epoch(21) + .slot_duration_in_seconds(5) + .slots_in_epoch_count(10) + .proposals_count(1) + .voting_power(8_000) + .private(private); + + vitup_setup(quick_setup, testing_directory) +} + +pub fn vitup_setup( + mut quick_setup: QuickVitBackendSettingsBuilder, + mut testing_directory: PathBuf, +) -> (VitController, Controller, ValidVotePlanParameters, String) { + let context = context(&testing_directory); + + testing_directory.push(quick_setup.title()); + if testing_directory.exists() { + std::fs::remove_dir_all(&testing_directory).unwrap(); + } + + let fund_name = quick_setup.fund_name(); + let (vit_controller, controller, vit_parameters) = quick_setup.build(context).unwrap(); + (vit_controller, controller, vit_parameters, fund_name) +} From 8608b8fc54967bba0f9715a393f191f59f527031 Mon Sep 17 00:00:00 2001 From: dkijania Date: Fri, 26 Feb 2021 10:26:18 +0100 Subject: [PATCH 3/8] refactor public test and add private --- integration-tests/src/public.rs | 431 +++++++++++++++++--------------- 1 file changed, 236 insertions(+), 195 deletions(-) diff --git a/integration-tests/src/public.rs b/integration-tests/src/public.rs index 1727e778..5a7553ef 100644 --- a/integration-tests/src/public.rs +++ b/integration-tests/src/public.rs @@ -1,38 +1,17 @@ +use crate::setup::*; +use assert_fs::TempDir; use chain_impl_mockchain::block::BlockDate; -use jormungandr_lib::interfaces::Explorer; -use jormungandr_scenario_tests::Seed; -use jormungandr_scenario_tests::{ - node::{LeadershipMode, PersistenceMode}, - test::utils, - Context, -}; - -use jormungandr_testing_utils::testing::network_builder::SpawnParams; +use chain_impl_mockchain::key::Hash; +use iapyx::Protocol; use jormungandr_testing_utils::testing::node::time; -use jortestkit::prelude::ProgressBarMode; -use std::path::PathBuf; +use rand::rngs::OsRng; +use std::path::Path; +use std::str::FromStr; use tokio; use vit_servicing_station_tests::common::data::ArbitraryValidVotingTemplateGenerator; -use vitup::scenario::controller::VitController; -use vitup::scenario::settings::VitSettings; +use vitup::config::{InitialEntry, Initials}; +use vitup::scenario::network::setup_network; use vitup::setup::start::quick::QuickVitBackendSettingsBuilder; -const LEADER_1: &str = "Leader1"; -const LEADER_2: &str = "Leader2"; -const LEADER_3: &str = "Leader3"; -const LEADER_4: &str = "Leader4"; -const WALLET_NODE: &str = "Wallet_Node"; - -const DAVID_ADDRESS: &str = "DdzFFzCqrhsktawSMCWJJy3Dpp9BCjYPVecgsMb5U2G7d1ErUUmwSZvfSY3Yjn5njNadfwvebpVNS5cD4acEKSQih2sR76wx2kF4oLXT"; -const DAVID_MNEMONICS: &str = - "tired owner misery large dream glad upset welcome shuffle eagle pulp time"; - -const EDGAR_ADDRESS: &str = "DdzFFzCqrhsf2sWcZLzXhyLoLZcmw3Zf3UcJ2ozG1EKTwQ6wBY1wMG1tkXtPvEgvE5PKUFmoyzkP8BL4BwLmXuehjRHJtnPj73E5RPMx"; -const EDGAR_MNEMONICS: &str = - "edge club wrap where juice nephew whip entry cover bullet cause jeans"; - -const FILIP_MNEMONICS: &str = - "neck bulb teach illegal soul cry monitor claw amount boring provide village rival draft stone"; -const FILIP_ADDRESS: &str = "Ae2tdPwUPEZ8og5u4WF5rmSyme5Gvp8RYiLM2u7Vm8CyDQzLN3VYTN895Wk"; #[allow(dead_code)] pub enum Vote { @@ -40,152 +19,209 @@ pub enum Vote { YES = 1, NO = 2, } -pub fn context() -> Context { - Context::new( - Seed::generate(rand::rngs::OsRng), - PathBuf::from("jormungandr"), - PathBuf::from("jcli"), - Some(PathBuf::from("./testing")), - true, - ProgressBarMode::Standard, - "info".to_string(), - ) -} #[tokio::test] -pub async fn vote_e2e_flow() -> std::result::Result<(), crate::Error> { - let mut context = context(); - let title = "vote_e2e_flow"; - let scenario_settings = prepare_scenario! { - title, - &mut context, - topology [ - LEADER_1, - LEADER_2 -> LEADER_1, - LEADER_3 -> LEADER_1, - LEADER_4 -> LEADER_1, - WALLET_NODE -> LEADER_1,LEADER_2,LEADER_3,LEADER_4 - ] - blockchain { - consensus = Bft, - number_of_slots_per_epoch = 60, - slot_duration = 1, - leaders = [ LEADER_1, LEADER_2, LEADER_3, LEADER_4 ], - initials = [ - "account" "Alice" with 500_000_000, - ], - committees = [ "Alice" ], - legacy = [ - "David" address DAVID_ADDRESS mnemonics DAVID_MNEMONICS with 500_000_000, - "Edgar" address EDGAR_ADDRESS mnemonics EDGAR_MNEMONICS with 500_000_000, - "Filip" address FILIP_ADDRESS mnemonics FILIP_MNEMONICS with 500_000_000, - ], - vote_plans = [ - "fund1" from "Alice" through epochs 0->1->2 as "public" contains proposals = [ - proposal adds 100 to "rewards" with 3 vote options, - ] - ], - } - }; +pub async fn public_vote_e2e_flow() -> std::result::Result<(), crate::Error> { + let endpoint = "127.0.0.1:8080"; + let testing_directory = TempDir::new().unwrap().into_persistent(); + let mut quick_setup = QuickVitBackendSettingsBuilder::new(); + quick_setup + .initials(Initials(vec![ + InitialEntry::Wallet { + name: "david".to_string(), + funds: 10_000, + pin: "1234".to_string(), + }, + InitialEntry::Wallet { + name: "edgar".to_string(), + funds: 10_000, + pin: "1234".to_string(), + }, + InitialEntry::Wallet { + name: "filip".to_string(), + funds: 10_000, + pin: "1234".to_string(), + }, + ])) + .vote_start_epoch(0) + .tally_start_epoch(1) + .tally_end_epoch(2) + .slot_duration_in_seconds(2) + .slots_in_epoch_count(30) + .proposals_count(10) + .voting_power(8_000) + .private(false); - let vit_controller = VitController::new(VitSettings::new(&mut context)); - let mut controller = scenario_settings.build(context).unwrap(); + let mut template_generator = ArbitraryValidVotingTemplateGenerator::new(); - // bootstrap network - let leader_1 = controller - .spawn_node_custom( - SpawnParams::new(LEADER_1) - .leader() - .persistence_mode(PersistenceMode::Persistent) - .explorer(Explorer { enabled: true }), - ) + let (mut vit_controller, mut controller, vit_parameters, fund_name) = + vitup_setup(quick_setup, testing_directory.path().to_path_buf()); + let (nodes, vit_station, wallet_proxy) = setup_network( + &mut controller, + &mut vit_controller, + vit_parameters, + &mut template_generator, + endpoint.to_string(), + &Protocol::Http, + ) + .unwrap(); + + let leader_1 = &nodes[0]; + let wallet_node = &nodes[4]; + let mut committee = controller.wallet("committee_1").unwrap(); + + let mut qr_codes_folder = testing_directory.path().to_path_buf(); + qr_codes_folder.push("vit_backend/qr-codes"); + wait_until_folder_contains_all_qrs(3, &qr_codes_folder); + + let david_qr_code = Path::new(&qr_codes_folder).join("wallet_david_1234.png"); + let edgar_qr_code = Path::new(&qr_codes_folder).join("wallet_edgar_1234.png"); + let filip_qr_code = Path::new(&qr_codes_folder).join("wallet_filip_1234.png"); + + // start mainnet wallets + let mut david = vit_controller + .iapyx_wallet_from_qr(&david_qr_code, "1234", &wallet_proxy) .unwrap(); - leader_1.wait_for_bootstrap().unwrap(); - controller.monitor_nodes(); - - //start bft node 2 - let leader_2 = controller - .spawn_node( - LEADER_2, - LeadershipMode::Leader, - PersistenceMode::Persistent, - ) + david.retrieve_funds().unwrap(); + david.convert_and_send().unwrap(); + + let fund1_vote_plan = controller.vote_plan(&fund_name).unwrap(); + + // start voting + david + .vote_for(fund1_vote_plan.id(), 0, Vote::YES as u8) .unwrap(); - leader_2.wait_for_bootstrap().unwrap(); - - //start bft node 3 - let leader_3 = controller - .spawn_node( - LEADER_3, - LeadershipMode::Leader, - PersistenceMode::Persistent, - ) + + let mut edgar = vit_controller + .iapyx_wallet_from_qr(&edgar_qr_code, "1234", &wallet_proxy) .unwrap(); - leader_3.wait_for_bootstrap().unwrap(); - - //start bft node 4 - let leader_4 = controller - .spawn_node( - LEADER_4, - LeadershipMode::Leader, - PersistenceMode::Persistent, - ) + edgar.retrieve_funds().unwrap(); + edgar.convert_and_send().unwrap(); + + edgar + .vote_for(fund1_vote_plan.id(), 0, Vote::YES as u8) .unwrap(); - leader_4.wait_for_bootstrap().unwrap(); - - // start passive node - let wallet_node = controller - .spawn_node_custom( - SpawnParams::new(WALLET_NODE) - .passive() - .persistence_mode(PersistenceMode::Persistent) - .explorer(Explorer { enabled: true }), - ) + + let mut filip = vit_controller + .iapyx_wallet_from_qr(&filip_qr_code, "1234", &wallet_proxy) .unwrap(); - wallet_node.wait_for_bootstrap().unwrap(); - let fund1_vote_plan = controller.vote_plan("fund1").unwrap(); + filip.retrieve_funds().unwrap(); + filip.convert_and_send().unwrap(); - let blockchain_configuration = controller - .settings() - .network_settings - .block0 - .blockchain_configuration - .clone(); + filip + .vote_for(fund1_vote_plan.id(), 0, Vote::NO as u8) + .unwrap(); - let mut vote_plan_parameters_builder = QuickVitBackendSettingsBuilder::new(); - vote_plan_parameters_builder + let target_date = BlockDate { + epoch: 1, + slot_id: 5, + }; + time::wait_for_date(target_date.into(), leader_1.explorer()); + + controller + .fragment_sender() + .send_public_vote_tally(&mut committee, &fund1_vote_plan.clone().into(), wallet_node) + .unwrap(); + + time::wait_for_epoch(2, leader_1.explorer()); + + let active_vote_plans = leader_1.vote_plans().unwrap(); + let vote_plan_status = active_vote_plans + .iter() + .find(|c_vote_plan| c_vote_plan.id == Hash::from_str(&fund1_vote_plan.id()).unwrap().into()) + .unwrap(); + + for proposal in vote_plan_status.proposals.iter() { + assert!( + proposal.tally.is_some(), + "Proposal is not tallied {:?}", + proposal + ); + } + + vit_station.shutdown(); + wallet_proxy.shutdown(); + for node in nodes { + node.shutdown()?; + } + controller.finalize(); + Ok(()) +} + +#[tokio::test] +pub async fn private_vote_e2e_flow() -> std::result::Result<(), crate::Error> { + let endpoint = "127.0.0.1:8080"; + let testing_directory = TempDir::new().unwrap().into_persistent(); + let mut quick_setup = QuickVitBackendSettingsBuilder::new(); + quick_setup + .initials(Initials(vec![ + InitialEntry::Wallet { + name: "david".to_string(), + funds: 10_000, + pin: "1234".to_string(), + }, + InitialEntry::Wallet { + name: "edgar".to_string(), + funds: 10_000, + pin: "1234".to_string(), + }, + InitialEntry::Wallet { + name: "filip".to_string(), + funds: 10_000, + pin: "1234".to_string(), + }, + ])) .vote_start_epoch(0) .tally_start_epoch(1) .tally_end_epoch(2) - .slot_duration_in_seconds(blockchain_configuration.slot_duration.into()) - .slots_in_epoch_count(blockchain_configuration.slots_per_epoch.into()) - .proposals_count(1); - - vote_plan_parameters_builder - .recalculate_voting_periods_if_needed(blockchain_configuration.block0_date); + .slot_duration_in_seconds(2) + .slots_in_epoch_count(60) + .proposals_count(1) + .voting_power(8_000) + .private(true); - let settings = controller.settings().clone(); - let parameters = vote_plan_parameters_builder.vote_plan_parameters(fund1_vote_plan, settings); - // start proxy and vit station let mut template_generator = ArbitraryValidVotingTemplateGenerator::new(); - let vit_station = vit_controller - .spawn_vit_station(&mut controller, parameters, &mut template_generator) - .unwrap(); - let wallet_proxy = vit_controller - .spawn_wallet_proxy(&mut controller, WALLET_NODE) - .unwrap(); + let (mut vit_controller, mut controller, vit_parameters, fund_name) = + vitup_setup(quick_setup, testing_directory.path().to_path_buf()); + let (nodes, vit_station, wallet_proxy) = setup_network( + &mut controller, + &mut vit_controller, + vit_parameters, + &mut template_generator, + endpoint.to_string(), + &Protocol::Http, + ) + .unwrap(); - // wait for spin off - std::thread::sleep(std::time::Duration::from_secs(1)); + let mut committee = controller.wallet("committee_1").unwrap(); + + let leader_1 = &nodes[0]; + let wallet_node = &nodes[4]; + + let mut qr_codes_folder = testing_directory.path().to_path_buf(); + qr_codes_folder.push("vit_backend/qr-codes"); + wait_until_folder_contains_all_qrs(3, &qr_codes_folder); + let david_qr_code = Path::new(&qr_codes_folder).join("wallet_david_1234.png"); + let edgar_qr_code = Path::new(&qr_codes_folder).join("wallet_edgar_1234.png"); + let filip_qr_code = Path::new(&qr_codes_folder).join("wallet_filip_1234.png"); // start mainnet wallets let mut david = vit_controller - .iapyx_wallet(DAVID_MNEMONICS, &wallet_proxy) + .iapyx_wallet_from_qr(&david_qr_code, "1234", &wallet_proxy) .unwrap(); david.retrieve_funds().unwrap(); david.convert_and_send().unwrap(); - let fund1_vote_plan = controller.vote_plan("fund1").unwrap(); + let fund1_vote_plan = controller.vote_plan(&fund_name).unwrap(); + + println!( + "Controller: {}: {:?}", + fund1_vote_plan.id(), + fund1_vote_plan + ); + + let vote_plan = &leader_1.vote_plans().unwrap()[0]; + println!("Blockchain: {:?}", vote_plan); // start voting david @@ -193,7 +229,7 @@ pub async fn vote_e2e_flow() -> std::result::Result<(), crate::Error> { .unwrap(); let mut edgar = vit_controller - .iapyx_wallet(EDGAR_MNEMONICS, &wallet_proxy) + .iapyx_wallet_from_qr(&edgar_qr_code, "1234", &wallet_proxy) .unwrap(); edgar.retrieve_funds().unwrap(); edgar.convert_and_send().unwrap(); @@ -203,7 +239,7 @@ pub async fn vote_e2e_flow() -> std::result::Result<(), crate::Error> { .unwrap(); let mut filip = vit_controller - .iapyx_wallet(FILIP_MNEMONICS, &wallet_proxy) + .iapyx_wallet_from_qr(&filip_qr_code, "1234", &wallet_proxy) .unwrap(); filip.retrieve_funds().unwrap(); filip.convert_and_send().unwrap(); @@ -218,60 +254,65 @@ pub async fn vote_e2e_flow() -> std::result::Result<(), crate::Error> { }; time::wait_for_date(target_date.into(), leader_1.explorer()); - //tally the vote and observe changes - let rewards_before = leader_1 - .explorer() - .status() - .unwrap() - .data - .unwrap() - .status - .latest_block - .treasury - .unwrap() - .rewards - .parse::() + controller + .fragment_sender() + .send_encrypted_tally(&mut committee, &fund1_vote_plan.clone().into(), wallet_node) + .unwrap(); + + let target_date = BlockDate { + epoch: 1, + slot_id: 30, + }; + time::wait_for_date(target_date.into(), leader_1.explorer()); + + let active_vote_plans = leader_1.vote_plans().unwrap(); + let vote_plan_status = active_vote_plans + .iter() + .find(|c_vote_plan| c_vote_plan.id == Hash::from_str(&fund1_vote_plan.id()).unwrap().into()) .unwrap(); - let mut alice = controller.wallet("Alice").unwrap(); + println!("{:?}", active_vote_plans); + + println!("{:?}", leader_1.fragment_logs().unwrap()); + + let shares = controller + .settings() + .private_vote_plans + .get(&fund_name) + .unwrap() + .decrypt_tally(&vote_plan_status.clone().into()); + controller .fragment_sender() - .send_public_vote_tally(&mut alice, &fund1_vote_plan.into(), &wallet_node) + .send_private_vote_tally( + &mut committee, + &fund1_vote_plan.clone().into(), + shares, + wallet_node, + ) .unwrap(); time::wait_for_epoch(2, leader_1.explorer()); - let rewards_after = leader_1 - .explorer() - .status() - .unwrap() - .data - .unwrap() - .status - .latest_block - .treasury - .unwrap() - .rewards - .parse::() + let active_vote_plans = leader_1.vote_plans().unwrap(); + let vote_plan_status = active_vote_plans + .iter() + .find(|c_vote_plan| c_vote_plan.id == Hash::from_str(&fund1_vote_plan.id()).unwrap().into()) .unwrap(); - utils::assert_equals( - &rewards_before, - &(rewards_after - 100), - &format!( - "{} <> {} rewards were not increased", - rewards_before, rewards_after - ), - ) - .unwrap(); + for proposal in vote_plan_status.proposals.iter() { + assert!( + proposal.tally.is_some(), + "Proposal is not tallied {:?}", + proposal + ); + } - wallet_node.shutdown().unwrap(); vit_station.shutdown(); wallet_proxy.shutdown(); - leader_4.shutdown().unwrap(); - leader_3.shutdown().unwrap(); - leader_2.shutdown().unwrap(); - leader_1.shutdown().unwrap(); + for node in nodes { + node.shutdown()?; + } controller.finalize(); Ok(()) } From 4d10c7b5729caacd10113aa1ef56c334a233ec7f Mon Sep 17 00:00:00 2001 From: dkijania Date: Fri, 26 Feb 2021 10:26:38 +0100 Subject: [PATCH 4/8] clean up code --- Cargo.lock | 110 ++++++++++++++++-- integration-tests/Cargo.toml | 6 +- integration-tests/src/lib.rs | 5 +- .../src/non_functional/load_test.rs | 2 +- 4 files changed, 105 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 87781890..f3f8f6ae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2075,8 +2075,8 @@ dependencies = [ "hex", "hyper 0.13.10", "image", - "jormungandr-lib", - "jormungandr-testing-utils", + "jormungandr-lib 0.10.0-alpha.3 (git+https://github.com/input-output-hk/jormungandr.git?rev=7a201c6694118561f08e9140b9899888e6c6d993)", + "jormungandr-testing-utils 0.10.0-alpha.3 (git+https://github.com/input-output-hk/jormungandr.git?rev=7a201c6694118561f08e9140b9899888e6c6d993)", "jortestkit", "rand 0.7.3", "rand_core 0.5.1", @@ -2213,9 +2213,9 @@ dependencies = [ "cfg-if 1.0.0", "chain-impl-mockchain", "iapyx", - "jormungandr-lib", + "jormungandr-lib 0.10.0-alpha.3 (git+https://github.com/input-output-hk/jormungandr.git?rev=04e065d055d6ca7bb0b0237a60ac5036c190569e)", "jormungandr-scenario-tests", - "jormungandr-testing-utils", + "jormungandr-testing-utils 0.10.0-alpha.3 (git+https://github.com/input-output-hk/jormungandr.git?rev=04e065d055d6ca7bb0b0237a60ac5036c190569e)", "jortestkit", "rand 0.7.3", "rand_chacha 0.2.2", @@ -2265,6 +2265,34 @@ version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +[[package]] +name = "jormungandr-lib" +version = "0.10.0-alpha.3" +source = "git+https://github.com/input-output-hk/jormungandr.git?rev=04e065d055d6ca7bb0b0237a60ac5036c190569e#04e065d055d6ca7bb0b0237a60ac5036c190569e" +dependencies = [ + "base64 0.13.0", + "bech32", + "cardano-legacy-address", + "chain-addr", + "chain-core", + "chain-crypto", + "chain-impl-mockchain", + "chain-time", + "chain-vote", + "chrono", + "hex", + "http", + "humantime", + "parity-multiaddr", + "poldercast", + "rand 0.7.3", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "serde", + "thiserror", + "typed-bytes", +] + [[package]] name = "jormungandr-lib" version = "0.10.0-alpha.3" @@ -2296,7 +2324,7 @@ dependencies = [ [[package]] name = "jormungandr-scenario-tests" version = "0.10.0-alpha.3" -source = "git+https://github.com/input-output-hk/jormungandr.git?rev=7a201c6694118561f08e9140b9899888e6c6d993#7a201c6694118561f08e9140b9899888e6c6d993" +source = "git+https://github.com/input-output-hk/jormungandr.git?rev=04e065d055d6ca7bb0b0237a60ac5036c190569e#04e065d055d6ca7bb0b0237a60ac5036c190569e" dependencies = [ "assert_fs", "chain-addr", @@ -2313,8 +2341,8 @@ dependencies = [ "futures 0.3.13", "hex", "indicatif", - "jormungandr-lib", - "jormungandr-testing-utils", + "jormungandr-lib 0.10.0-alpha.3 (git+https://github.com/input-output-hk/jormungandr.git?rev=04e065d055d6ca7bb0b0237a60ac5036c190569e)", + "jormungandr-testing-utils 0.10.0-alpha.3 (git+https://github.com/input-output-hk/jormungandr.git?rev=04e065d055d6ca7bb0b0237a60ac5036c190569e)", "jortestkit", "json", "lazy_static", @@ -2335,6 +2363,68 @@ dependencies = [ "yaml-rust", ] +[[package]] +name = "jormungandr-testing-utils" +version = "0.10.0-alpha.3" +source = "git+https://github.com/input-output-hk/jormungandr.git?rev=04e065d055d6ca7bb0b0237a60ac5036c190569e#04e065d055d6ca7bb0b0237a60ac5036c190569e" +dependencies = [ + "assert_fs", + "base64 0.13.0", + "bech32", + "bytesize", + "cardano-legacy-address", + "chain-addr", + "chain-core", + "chain-crypto", + "chain-impl-mockchain", + "chain-storage", + "chain-time", + "chain-vote", + "chrono", + "custom_debug", + "flate2", + "fs_extra", + "futures 0.3.13", + "graphql_client", + "hex", + "humantime", + "image", + "jormungandr-lib 0.10.0-alpha.3 (git+https://github.com/input-output-hk/jormungandr.git?rev=04e065d055d6ca7bb0b0237a60ac5036c190569e)", + "jortestkit", + "json", + "lazy_static", + "os_info 3.0.1", + "poldercast", + "prost", + "qrcodegen", + "quircs", + "rand 0.7.3", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "regex 1.4.3", + "reqwest 0.10.10", + "semver 0.11.0", + "serde", + "serde_derive", + "serde_json", + "serde_yaml", + "slog", + "slog-async", + "slog-json", + "symmetric-cipher", + "sysinfo 0.15.9", + "tar", + "thiserror", + "tokio 1.2.0", + "tokio-codec", + "tokio-stream", + "tonic", + "tonic-build", + "typed-bytes", + "url", + "zip", +] + [[package]] name = "jormungandr-testing-utils" version = "0.10.0-alpha.3" @@ -2361,7 +2451,7 @@ dependencies = [ "hex", "humantime", "image", - "jormungandr-lib", + "jormungandr-lib 0.10.0-alpha.3 (git+https://github.com/input-output-hk/jormungandr.git?rev=7a201c6694118561f08e9140b9899888e6c6d993)", "jortestkit", "json", "lazy_static", @@ -5138,9 +5228,9 @@ dependencies = [ "iapyx", "image", "indicatif", - "jormungandr-lib", + "jormungandr-lib 0.10.0-alpha.3 (git+https://github.com/input-output-hk/jormungandr.git?rev=04e065d055d6ca7bb0b0237a60ac5036c190569e)", "jormungandr-scenario-tests", - "jormungandr-testing-utils", + "jormungandr-testing-utils 0.10.0-alpha.3 (git+https://github.com/input-output-hk/jormungandr.git?rev=04e065d055d6ca7bb0b0237a60ac5036c190569e)", "jortestkit", "json", "lazy_static", diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 5c6ea5c8..0002a470 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -7,9 +7,9 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -jormungandr-scenario-tests = { git = "https://github.com/input-output-hk/jormungandr.git", rev = "7a201c6694118561f08e9140b9899888e6c6d993" } -jormungandr-testing-utils = { git = "https://github.com/input-output-hk/jormungandr.git", rev = "7a201c6694118561f08e9140b9899888e6c6d993" } -jormungandr-lib = { git = "https://github.com/input-output-hk/jormungandr.git", rev = "7a201c6694118561f08e9140b9899888e6c6d993" } +jormungandr-scenario-tests = { git = "https://github.com/input-output-hk/jormungandr.git", rev = "04e065d055d6ca7bb0b0237a60ac5036c190569e" } +jormungandr-testing-utils = { git = "https://github.com/input-output-hk/jormungandr.git", rev = "04e065d055d6ca7bb0b0237a60ac5036c190569e" } +jormungandr-lib = { git = "https://github.com/input-output-hk/jormungandr.git", rev = "04e065d055d6ca7bb0b0237a60ac5036c190569e" } vit-servicing-station-tests = { git = "https://github.com/input-output-hk/vit-servicing-station.git", rev = "700c4d06b366c920e6daf46885d98d74d3791d0a" } vit-servicing-station-lib = { git = "https://github.com/input-output-hk/vit-servicing-station.git", rev = "700c4d06b366c920e6daf46885d98d74d3791d0a" } jortestkit = { git = "https://github.com/input-output-hk/jortestkit.git", branch = "master" } diff --git a/integration-tests/src/lib.rs b/integration-tests/src/lib.rs index b8bf77ab..b56f75c5 100644 --- a/integration-tests/src/lib.rs +++ b/integration-tests/src/lib.rs @@ -1,9 +1,6 @@ cfg_if::cfg_if! { if #[cfg(test)] { - - #[macro_use] - extern crate jormungandr_scenario_tests; - + pub mod setup; pub mod public; #[cfg(feature = "non-functional")] pub mod non_functional; diff --git a/integration-tests/src/non_functional/load_test.rs b/integration-tests/src/non_functional/load_test.rs index fb4a2b4a..c2c07562 100644 --- a/integration-tests/src/non_functional/load_test.rs +++ b/integration-tests/src/non_functional/load_test.rs @@ -27,7 +27,7 @@ pub fn load_test_public_100_000_votes() { let no_of_wallets = 3_000; let mut template_generator = ArbitraryValidVotingTemplateGenerator::new(); - let (mut vit_controller, mut controller, vit_parameters, fund_name) = + let (mut vit_controller, mut controller, vit_parameters, _fund_name) = vitup_setup(false, no_of_wallets, testing_directory.path().to_path_buf()); let (nodes, vit_station, wallet_proxy) = setup_network( From bc88b4f5f3129fd3adb6724608195061163a2708 Mon Sep 17 00:00:00 2001 From: dkijania Date: Fri, 26 Feb 2021 12:53:04 +0100 Subject: [PATCH 5/8] clean up code --- integration-tests/src/public.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/integration-tests/src/public.rs b/integration-tests/src/public.rs index 5a7553ef..0196679d 100644 --- a/integration-tests/src/public.rs +++ b/integration-tests/src/public.rs @@ -4,7 +4,6 @@ use chain_impl_mockchain::block::BlockDate; use chain_impl_mockchain::key::Hash; use iapyx::Protocol; use jormungandr_testing_utils::testing::node::time; -use rand::rngs::OsRng; use std::path::Path; use std::str::FromStr; use tokio; From 6003e987bf81541d29be1b7ab553427f5b67bd64 Mon Sep 17 00:00:00 2001 From: dkijania Date: Fri, 26 Feb 2021 19:04:56 +0100 Subject: [PATCH 6/8] limit test threads to 1 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cac0f955..83abff3f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -114,7 +114,7 @@ commands: environment: RUST_BACKTRACE: 1 command: | - cargo test + cargo test -- --test-threads=1 workflows: version: 2 From 3c645ad411f44d103b18ccc4e5b9b4645c16e21f Mon Sep 17 00:00:00 2001 From: dkijania Date: Fri, 26 Feb 2021 22:19:40 +0100 Subject: [PATCH 7/8] install jcli also --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 83abff3f..d06abe5e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -94,6 +94,7 @@ commands: command: | cd jormungandr cargo install --path jormungandr --locked + cargo install --path jcli --locked - run: name: checkout vit-station-service command: | From 4515c216d6780c02d78d9b01b58e8a0101447cc7 Mon Sep 17 00:00:00 2001 From: dkijania Date: Mon, 1 Mar 2021 14:19:14 +0100 Subject: [PATCH 8/8] update iapyx warp deps update vit-servicing-station version --- Cargo.lock | 595 +++-------------------------------- iapyx/Cargo.toml | 6 +- integration-tests/Cargo.toml | 4 +- vitup/Cargo.toml | 4 +- 4 files changed, 55 insertions(+), 554 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f3f8f6ae..844b5057 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,15 +1,5 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex 1.4.3", -] - [[package]] name = "addr2line" version = "0.14.1" @@ -169,108 +159,6 @@ dependencies = [ "tempfile", ] -[[package]] -name = "async-channel" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" -dependencies = [ - "concurrent-queue", - "event-listener", - "futures-core", -] - -[[package]] -name = "async-graphql" -version = "2.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdbe5d0b3e10ba57422209c94b1ad9e38eebb2530f2898e163d0f18f0b2e3ed6" -dependencies = [ - "async-graphql-derive", - "async-graphql-parser", - "async-graphql-value", - "async-stream", - "async-trait", - "blocking", - "bson", - "chrono", - "chrono-tz", - "fnv", - "futures-channel", - "futures-timer", - "futures-util", - "http", - "indexmap", - "log", - "lru", - "multer", - "num-traits", - "once_cell", - "pin-project-lite 0.2.4", - "regex 1.4.3", - "serde", - "serde_json", - "sha2", - "spin 0.7.1", - "static_assertions", - "tempfile", - "thiserror", - "tracing", - "url", - "uuid", -] - -[[package]] -name = "async-graphql-derive" -version = "2.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4acb9b57a51fe179e8b4b6eeebe25bd8ebf60a8f0e692a3746b700c8b693ac5" -dependencies = [ - "Inflector", - "async-graphql-parser", - "darling", - "proc-macro-crate", - "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", - "thiserror", -] - -[[package]] -name = "async-graphql-parser" -version = "2.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928bf3e2d8e7cac1701a61fe8f12a8e60433c97731e224884bbaf04738c40dca" -dependencies = [ - "async-graphql-value", - "pest", - "pest_derive", - "serde", - "serde_json", -] - -[[package]] -name = "async-graphql-value" -version = "2.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d3aa3cd3696ffd8decb10f5053affc78cb33ecfc545e480072bbc600e6723d" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "async-graphql-warp" -version = "2.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c1bf21c7bcdd7f9b2a01f6bd6ff1349dc88ae8b563d9d6feb45e382da31959" -dependencies = [ - "async-graphql", - "futures-util", - "serde_json", - "warp 0.3.0", -] - [[package]] name = "async-stream" version = "0.3.0" @@ -292,12 +180,6 @@ dependencies = [ "syn 1.0.60", ] -[[package]] -name = "async-task" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91831deabf0d6d7ec49552e489aed63b7456a7a3c46cff62adad428110b0af0" - [[package]] name = "async-trait" version = "0.1.42" @@ -309,12 +191,6 @@ dependencies = [ "syn 1.0.60", ] -[[package]] -name = "atomic-waker" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" - [[package]] name = "atty" version = "0.2.14" @@ -438,43 +314,12 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" -[[package]] -name = "blocking" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e170dbede1f740736619b776d7251cb1b9095c435c34d8ca9f57fcd2f335e9" -dependencies = [ - "async-channel", - "async-task", - "atomic-waker", - "fastrand", - "futures-lite", - "once_cell", -] - [[package]] name = "bs58" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" -[[package]] -name = "bson" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2abd828df036867b89a07c5a4824df1168b42d74f41af7253f20e55a32e5ca4b" -dependencies = [ - "base64 0.12.3", - "chrono", - "hex", - "lazy_static", - "linked-hash-map", - "rand 0.7.3", - "serde", - "serde_json", - "uuid", -] - [[package]] name = "bstr" version = "0.2.15" @@ -570,12 +415,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "cache-padded" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" - [[package]] name = "cardano-legacy-address" version = "0.1.1" @@ -764,16 +603,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "chrono-tz" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2554a3155fec064362507487171dcc4edc3df60cb10f3a1fb10ed8094822b120" -dependencies = [ - "chrono", - "parse-zoneinfo", -] - [[package]] name = "clap" version = "2.33.3" @@ -783,7 +612,7 @@ dependencies = [ "ansi_term 0.11.0", "atty", "bitflags", - "strsim 0.8.0", + "strsim", "textwrap", "unicode-width", "vec_map", @@ -808,15 +637,6 @@ dependencies = [ "unreachable", ] -[[package]] -name = "concurrent-queue" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" -dependencies = [ - "cache-padded", -] - [[package]] name = "console" version = "0.11.3" @@ -1062,41 +882,6 @@ dependencies = [ "synstructure", ] -[[package]] -name = "darling" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2 1.0.24", - "quote 1.0.9", - "strsim 0.9.3", - "syn 1.0.60", -] - -[[package]] -name = "darling_macro" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" -dependencies = [ - "darling_core", - "quote 1.0.9", - "syn 1.0.60", -] - [[package]] name = "data-encoding" version = "2.3.2" @@ -1122,17 +907,6 @@ dependencies = [ "byteorder", ] -[[package]] -name = "derive_more" -version = "0.99.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cb0e6161ad61ed084a36ba71fbba9e3ac5aee3606fb607fe08da6acbcf3d8c" -dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", -] - [[package]] name = "dialoguer" version = "0.6.2" @@ -1322,12 +1096,6 @@ dependencies = [ "version_check 0.9.2", ] -[[package]] -name = "event-listener" -version = "2.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59" - [[package]] name = "failure" version = "0.1.8" @@ -1367,15 +1135,6 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" -[[package]] -name = "fastrand" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca5faf057445ce5c9d4329e382b2ce7ca38550ef3b73a5348362d5f24e0c7fe3" -dependencies = [ - "instant", -] - [[package]] name = "filetime" version = "0.2.14" @@ -1552,21 +1311,6 @@ version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d71c2c65c57704c32f5241c1223167c2c3294fd34ac020c807ddbe6db287ba59" -[[package]] -name = "futures-lite" -version = "1.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4481d0cd0de1d204a4fa55e7d45f07b1d958abcb06714b3446438e2eff695fb" -dependencies = [ - "fastrand", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite 0.2.4", - "waker-fn", -] - [[package]] name = "futures-macro" version = "0.3.13" @@ -1591,12 +1335,6 @@ version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa189ef211c15ee602667a6fcfe1c1fd9e07d42250d2156382820fba33c9df80" -[[package]] -name = "futures-timer" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" - [[package]] name = "futures-util" version = "0.3.13" @@ -1979,7 +1717,7 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project 1.0.5", + "pin-project", "socket2", "tokio 0.2.25", "tower-service", @@ -2003,7 +1741,7 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project 1.0.5", + "pin-project", "socket2", "tokio 1.2.0", "tower-service", @@ -2044,15 +1782,15 @@ dependencies = [ [[package]] name = "hyper-tls" -version = "0.4.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d979acc56dcb5b8dddba3917601745e877576475aa046df3226eabdecef78eed" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ - "bytes 0.5.6", - "hyper 0.13.10", + "bytes 1.0.1", + "hyper 0.14.4", "native-tls", - "tokio 0.2.25", - "tokio-tls", + "tokio 1.2.0", + "tokio-native-tls", ] [[package]] @@ -2086,20 +1824,14 @@ dependencies = [ "serde_json", "structopt", "thiserror", - "tokio 0.2.25", + "tokio 1.2.0", "url", "wallet", "wallet-core", - "warp 0.2.5", + "warp", "warp-reverse-proxy", ] -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - [[package]] name = "idna" version = "0.2.2" @@ -2178,15 +1910,6 @@ dependencies = [ "regex 1.4.3", ] -[[package]] -name = "input_buffer" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19a8a95243d5a0398cae618ec29477c6e3cb631152be5c19481f80bc71559754" -dependencies = [ - "bytes 0.5.6", -] - [[package]] name = "input_buffer" version = "0.4.0" @@ -2524,7 +2247,7 @@ dependencies = [ "tar", "thiserror", "tokio 1.2.0", - "warp 0.3.0", + "warp", "zip", ] @@ -2636,12 +2359,6 @@ dependencies = [ "hashbrown", ] -[[package]] -name = "maplit" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" - [[package]] name = "matchers" version = "0.0.1" @@ -2792,25 +2509,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "multer" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99851e6ad01b0fbe086dda2dea00d68bb84fc7d7eae2c39ca7313da9197f4d31" -dependencies = [ - "bytes 0.5.6", - "derive_more", - "encoding_rs", - "futures 0.3.13", - "http", - "httparse", - "lazy_static", - "log", - "mime", - "regex 1.4.3", - "twoway 0.2.1", -] - [[package]] name = "multihash" version = "0.11.4" @@ -2847,7 +2545,7 @@ dependencies = [ "rand 0.7.3", "safemem", "tempfile", - "twoway 0.1.8", + "twoway", ] [[package]] @@ -3082,12 +2780,6 @@ dependencies = [ "url", ] -[[package]] -name = "parking" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" - [[package]] name = "parking_lot" version = "0.11.1" @@ -3113,15 +2805,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "parse-zoneinfo" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c705f256449c60da65e11ff6626e0c16a0a0b96aaa348de61376b249bc340f41" -dependencies = [ - "regex 1.4.3", -] - [[package]] name = "percent-encoding" version = "2.1.0" @@ -3137,40 +2820,6 @@ dependencies = [ "ucd-trie", ] -[[package]] -name = "pest_derive" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", -] - -[[package]] -name = "pest_meta" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d" -dependencies = [ - "maplit", - "pest", - "sha-1 0.8.2", -] - [[package]] name = "petgraph" version = "0.5.1" @@ -3181,33 +2830,13 @@ dependencies = [ "indexmap", ] -[[package]] -name = "pin-project" -version = "0.4.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffbc8e94b38ea3d2d8ba92aea2983b503cd75d0888d75b86bb37970b5698e15" -dependencies = [ - "pin-project-internal 0.4.27", -] - [[package]] name = "pin-project" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96fa8ebb90271c4477f144354485b8068bd8f6b78b428b01ba892ca26caf0b63" dependencies = [ - "pin-project-internal 1.0.5", -] - -[[package]] -name = "pin-project-internal" -version = "0.4.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65ad2ae56b6abe3a1ee25f15ee605bacadb9a764edaba9c2bf4103800d4a1895" -dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "pin-project-internal", ] [[package]] @@ -3740,23 +3369,20 @@ dependencies = [ "http-body 0.3.1", "hyper 0.13.10", "hyper-rustls 0.21.0", - "hyper-tls", "ipnet", "js-sys", "lazy_static", "log", "mime", "mime_guess", - "native-tls", "percent-encoding", "pin-project-lite 0.2.4", "rustls 0.18.1", "serde", "serde_json", - "serde_urlencoded 0.7.0", + "serde_urlencoded", "tokio 0.2.25", "tokio-rustls 0.14.1", - "tokio-tls", "url", "wasm-bindgen", "wasm-bindgen-futures", @@ -3780,17 +3406,20 @@ dependencies = [ "http-body 0.4.0", "hyper 0.14.4", "hyper-rustls 0.22.1", + "hyper-tls", "ipnet", "js-sys", "lazy_static", "log", "mime", + "native-tls", "percent-encoding", "pin-project-lite 0.2.4", "rustls 0.19.0", "serde", - "serde_urlencoded 0.7.0", + "serde_urlencoded", "tokio 1.2.0", + "tokio-native-tls", "tokio-rustls 0.22.0", "url", "wasm-bindgen", @@ -3809,7 +3438,7 @@ dependencies = [ "cc", "libc", "once_cell", - "spin 0.5.2", + "spin", "untrusted", "web-sys", "winapi 0.3.9", @@ -4022,24 +3651,11 @@ version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea1c6153794552ea7cf7cf63b1231a25de00ec90db326ba6264440fa08e31486" dependencies = [ - "indexmap", "itoa", "ryu", "serde", ] -[[package]] -name = "serde_urlencoded" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" -dependencies = [ - "dtoa", - "itoa", - "serde", - "url", -] - [[package]] name = "serde_urlencoded" version = "0.7.0" @@ -4223,7 +3839,7 @@ dependencies = [ "tokio 1.2.0", "uuid", "walkdir", - "warp 0.3.0", + "warp", ] [[package]] @@ -4248,12 +3864,6 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" -[[package]] -name = "spin" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13287b4da9d1207a4f4929ac390916d64eacfe236a487e9a9f5b3be392be5162" - [[package]] name = "static_assertions" version = "1.1.0" @@ -4266,12 +3876,6 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" -[[package]] -name = "strsim" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" - [[package]] name = "structopt" version = "0.3.21" @@ -4564,7 +4168,6 @@ dependencies = [ "num_cpus", "pin-project-lite 0.1.11", "slab", - "tokio-macros 0.2.6", ] [[package]] @@ -4582,7 +4185,7 @@ dependencies = [ "once_cell", "pin-project-lite 0.2.4", "signal-hook-registry", - "tokio-macros 1.1.0", + "tokio-macros", "winapi 0.3.9", ] @@ -4610,9 +4213,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "0.2.6" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e44da00bfc73a25f814cd8d7e57a68a5c31b74b3152a0a1d1f590c97ed06265a" +checksum = "caf7b11a536f46a809a8a9f0bb4237020f70ecbf115b842360afb127ea2fda57" dependencies = [ "proc-macro2 1.0.24", "quote 1.0.9", @@ -4620,14 +4223,13 @@ dependencies = [ ] [[package]] -name = "tokio-macros" -version = "1.1.0" +name = "tokio-native-tls" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caf7b11a536f46a809a8a9f0bb4237020f70ecbf115b842360afb127ea2fda57" +checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.9", - "syn 1.0.60", + "native-tls", + "tokio 1.2.0", ] [[package]] @@ -4664,29 +4266,6 @@ dependencies = [ "tokio 1.2.0", ] -[[package]] -name = "tokio-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a70f4fcd7b3b24fb194f837560168208f669ca8cb70d0c4b862944452396343" -dependencies = [ - "native-tls", - "tokio 0.2.25", -] - -[[package]] -name = "tokio-tungstenite" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d9e878ad426ca286e4dcae09cbd4e1973a7f8987d97570e2469703dd7f5720c" -dependencies = [ - "futures-util", - "log", - "pin-project 0.4.27", - "tokio 0.2.25", - "tungstenite 0.11.1", -] - [[package]] name = "tokio-tungstenite" version = "0.13.0" @@ -4695,9 +4274,9 @@ checksum = "e1a5f475f1b9d077ea1017ecbc60890fda8e54942d680ca0b1d2b47cfa2d861b" dependencies = [ "futures-util", "log", - "pin-project 1.0.5", + "pin-project", "tokio 1.2.0", - "tungstenite 0.12.0", + "tungstenite", ] [[package]] @@ -4763,7 +4342,7 @@ dependencies = [ "http-body 0.4.0", "hyper 0.14.4", "percent-encoding", - "pin-project 1.0.5", + "pin-project", "prost", "prost-derive", "tokio 1.2.0", @@ -4796,7 +4375,7 @@ dependencies = [ "futures-core", "futures-util", "indexmap", - "pin-project 1.0.5", + "pin-project", "rand 0.8.3", "slab", "tokio 1.2.0", @@ -4858,7 +4437,7 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" dependencies = [ - "pin-project 1.0.5", + "pin-project", "tracing", ] @@ -4917,25 +4496,6 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" -[[package]] -name = "tungstenite" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0308d80d86700c5878b9ef6321f020f29b1bb9d5ff3cab25e75e23f3a492a23" -dependencies = [ - "base64 0.12.3", - "byteorder", - "bytes 0.5.6", - "http", - "httparse", - "input_buffer 0.3.1", - "log", - "rand 0.7.3", - "sha-1 0.9.4", - "url", - "utf-8", -] - [[package]] name = "tungstenite" version = "0.12.0" @@ -4947,7 +4507,7 @@ dependencies = [ "bytes 1.0.1", "http", "httparse", - "input_buffer 0.4.0", + "input_buffer", "log", "rand 0.8.3", "sha-1 0.9.4", @@ -4964,16 +4524,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "twoway" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b40075910de3a912adbd80b5d8bad6ad10a23eeb1f5bf9d4006839e899ba5bc" -dependencies = [ - "memchr", - "unchecked-index", -] - [[package]] name = "typed-bytes" version = "0.1.0" @@ -4997,12 +4547,6 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c85f514e095d348c279b1e5cd76795082cf15bd59b93207832abe0b1d8fed236" -[[package]] -name = "unchecked-index" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eeba86d422ce181a719445e51872fa30f1f7413b62becb52e95ec91aa262d85c" - [[package]] name = "unicase" version = "2.6.0" @@ -5087,12 +4631,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "urlencoding" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9232eb53352b4442e40d7900465dfc534e8cb2dc8f18656fcb2ac16112b5593" - [[package]] name = "utf-8" version = "0.7.5" @@ -5142,10 +4680,8 @@ checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" [[package]] name = "vit-servicing-station-lib" version = "0.2.0" -source = "git+https://github.com/input-output-hk/vit-servicing-station.git?rev=700c4d06b366c920e6daf46885d98d74d3791d0a#700c4d06b366c920e6daf46885d98d74d3791d0a" +source = "git+https://github.com/input-output-hk/vit-servicing-station.git?rev=160f09c7a26fe31628b7573e8c326e3d90f1ab47#160f09c7a26fe31628b7573e8c326e3d90f1ab47" dependencies = [ - "async-graphql", - "async-graphql-warp", "async-trait", "base64 0.12.3", "chrono", @@ -5164,13 +4700,13 @@ dependencies = [ "tracing", "tracing-futures", "tracing-subscriber", - "warp 0.3.0", + "warp", ] [[package]] name = "vit-servicing-station-tests" version = "0.2.0" -source = "git+https://github.com/input-output-hk/vit-servicing-station.git?rev=700c4d06b366c920e6daf46885d98d74d3791d0a#700c4d06b366c920e6daf46885d98d74d3791d0a" +source = "git+https://github.com/input-output-hk/vit-servicing-station.git?rev=160f09c7a26fe31628b7573e8c326e3d90f1ab47#160f09c7a26fe31628b7573e8c326e3d90f1ab47" dependencies = [ "askama", "askama_shared", @@ -5249,7 +4785,7 @@ dependencies = [ "vit-servicing-station-lib", "vit-servicing-station-tests", "walkdir", - "warp 0.3.0", + "warp", "yaml-rust", ] @@ -5268,12 +4804,6 @@ dependencies = [ "libc", ] -[[package]] -name = "waker-fn" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" - [[package]] name = "walkdir" version = "2.3.1" @@ -5338,35 +4868,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "warp" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f41be6df54c97904af01aa23e613d4521eed7ab23537cede692d4058f6449407" -dependencies = [ - "bytes 0.5.6", - "futures 0.3.13", - "headers", - "http", - "hyper 0.13.10", - "log", - "mime", - "mime_guess", - "multipart", - "pin-project 0.4.27", - "scoped-tls", - "serde", - "serde_json", - "serde_urlencoded 0.6.1", - "tokio 0.2.25", - "tokio-rustls 0.14.1", - "tokio-tungstenite 0.11.0", - "tower-service", - "tracing", - "tracing-futures", - "urlencoding", -] - [[package]] name = "warp" version = "0.3.0" @@ -5383,15 +4884,15 @@ dependencies = [ "mime_guess", "multipart", "percent-encoding", - "pin-project 1.0.5", + "pin-project", "scoped-tls", "serde", "serde_json", - "serde_urlencoded 0.7.0", + "serde_urlencoded", "tokio 1.2.0", "tokio-rustls 0.22.0", "tokio-stream", - "tokio-tungstenite 0.13.0", + "tokio-tungstenite", "tokio-util 0.6.3", "tower-service", "tracing", @@ -5400,16 +4901,16 @@ dependencies = [ [[package]] name = "warp-reverse-proxy" -version = "0.1.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b09d85b4cc956c8ce25422ea55070b15cd9ff889b0a2301c6b9d5d72694191" +checksum = "aa91183f89706b331c4639d6d5a8586bba6f770866ddf91e84d4c892f6860a4e" dependencies = [ - "http", - "hyper 0.13.10", + "hyper 0.14.4", "lazy_static", - "reqwest 0.10.10", + "reqwest 0.11.1", + "thiserror", "unicase", - "warp 0.2.5", + "warp", ] [[package]] diff --git a/iapyx/Cargo.toml b/iapyx/Cargo.toml index 7c1d5f85..90bd06d6 100644 --- a/iapyx/Cargo.toml +++ b/iapyx/Cargo.toml @@ -34,9 +34,9 @@ regex = "*" dialoguer = "0.6.2" structopt = "0.3" console = "0.11" -warp = { version = "0.2.5", features = ["tls"] } -warp-reverse-proxy = "0.1.0" -tokio = { version = "0.2", features = ["macros"] } +warp = { version = "0.3", features = ["tls"] } +warp-reverse-proxy = "0.3.1" +tokio = { version = "^1.0", features = ["macros", "signal", "rt", "fs", "sync"] } url = "2.1.1" image = "0.23.12" diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 0002a470..95e3cf68 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -10,8 +10,8 @@ edition = "2018" jormungandr-scenario-tests = { git = "https://github.com/input-output-hk/jormungandr.git", rev = "04e065d055d6ca7bb0b0237a60ac5036c190569e" } jormungandr-testing-utils = { git = "https://github.com/input-output-hk/jormungandr.git", rev = "04e065d055d6ca7bb0b0237a60ac5036c190569e" } jormungandr-lib = { git = "https://github.com/input-output-hk/jormungandr.git", rev = "04e065d055d6ca7bb0b0237a60ac5036c190569e" } -vit-servicing-station-tests = { git = "https://github.com/input-output-hk/vit-servicing-station.git", rev = "700c4d06b366c920e6daf46885d98d74d3791d0a" } -vit-servicing-station-lib = { git = "https://github.com/input-output-hk/vit-servicing-station.git", rev = "700c4d06b366c920e6daf46885d98d74d3791d0a" } +vit-servicing-station-tests = { git = "https://github.com/input-output-hk/vit-servicing-station.git", rev = "160f09c7a26fe31628b7573e8c326e3d90f1ab47" } +vit-servicing-station-lib = { git = "https://github.com/input-output-hk/vit-servicing-station.git", rev = "160f09c7a26fe31628b7573e8c326e3d90f1ab47" } jortestkit = { git = "https://github.com/input-output-hk/jortestkit.git", branch = "master" } vitup = { path = "../vitup"} iapyx = { path = "../iapyx"} diff --git a/vitup/Cargo.toml b/vitup/Cargo.toml index e2edba56..f536e56d 100644 --- a/vitup/Cargo.toml +++ b/vitup/Cargo.toml @@ -23,8 +23,8 @@ jormungandr-scenario-tests = { git = "https://github.com/input-output-hk/jormung jormungandr-testing-utils = { git = "https://github.com/input-output-hk/jormungandr.git", rev = "04e065d055d6ca7bb0b0237a60ac5036c190569e" } jormungandr-lib = { git = "https://github.com/input-output-hk/jormungandr.git", rev = "04e065d055d6ca7bb0b0237a60ac5036c190569e" } jortestkit = { git = "https://github.com/input-output-hk/jortestkit.git", branch = "master" } -vit-servicing-station-tests = { git = "https://github.com/input-output-hk/vit-servicing-station.git", rev = "700c4d06b366c920e6daf46885d98d74d3791d0a" } -vit-servicing-station-lib = { git = "https://github.com/input-output-hk/vit-servicing-station.git", rev = "700c4d06b366c920e6daf46885d98d74d3791d0a" } +vit-servicing-station-tests = { git = "https://github.com/input-output-hk/vit-servicing-station.git", rev = "160f09c7a26fe31628b7573e8c326e3d90f1ab47" } +vit-servicing-station-lib = { git = "https://github.com/input-output-hk/vit-servicing-station.git", rev = "160f09c7a26fe31628b7573e8c326e3d90f1ab47" } iapyx = { path = "../iapyx" } poldercast = { git = "https://github.com/primetype/poldercast.git", rev = "8305f1560392a9d26673ca996e7646c8834533ef" } rand = "0.7"