From aa84fd6c66a832c3c841df8acf52494cb232833c Mon Sep 17 00:00:00 2001 From: xevisalle Date: Wed, 15 Nov 2023 13:43:54 +0100 Subject: [PATCH] Fix errors --- README.md | 1 - integration-tests/tests/blockchain/get_crs.rs | 3 +-- integration-tests/tests/blockchain/retrieve_txs.rs | 12 ++++-------- .../tests/blockchain/stake_add_owner.rs | 3 +-- integration-tests/tests/citadel/int_test_lp.rs | 9 +++------ integration-tests/tests/citadel/int_test_user.rs | 3 +-- integration-tests/tests/citadel/issue_license.rs | 3 +-- integration-tests/tests/citadel/license_queries.rs | 12 ++++-------- integration-tests/tests/citadel/retrieve_requests.rs | 12 ++++-------- integration-tests/tests/citadel/send_request.rs | 3 +-- license-provider/tests/config/lp.json | 4 ---- license-provider/tests/config/test_secret_key_lp | 1 + license-provider/tests/test_lp.rs | 2 +- 13 files changed, 22 insertions(+), 46 deletions(-) delete mode 100644 license-provider/tests/config/lp.json create mode 100644 license-provider/tests/config/test_secret_key_lp diff --git a/README.md b/README.md index 25e67a2..8142211 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,6 @@ You can test if the environment you set up and the library are working properly by executing the following: ``` -cd integration-tests cargo t --release --features="exp_tests" -- --test-threads=1 cargo t --release --features="int_tests" -- --test-threads=1 ``` diff --git a/integration-tests/tests/blockchain/get_crs.rs b/integration-tests/tests/blockchain/get_crs.rs index f94e1e3..3cdba0f 100644 --- a/integration-tests/tests/blockchain/get_crs.rs +++ b/integration-tests/tests/blockchain/get_crs.rs @@ -15,8 +15,7 @@ const MIN_CRS_SIZE: usize = 10 * 1024 * 1024; #[tokio::test(flavor = "multi_thread")] #[cfg_attr(not(feature = "int_tests"), ignore)] async fn get_crs() -> Result<(), Error> { - let config_path = - concat!(env!("CARGO_MANIFEST_DIR"), "/tests/config/config.toml"); + let config_path = "../config.toml"; let cfg = BlockchainAccessConfig::load_path(config_path)?; diff --git a/integration-tests/tests/blockchain/retrieve_txs.rs b/integration-tests/tests/blockchain/retrieve_txs.rs index 6a1afaa..bad7d5c 100644 --- a/integration-tests/tests/blockchain/retrieve_txs.rs +++ b/integration-tests/tests/blockchain/retrieve_txs.rs @@ -13,8 +13,7 @@ use wallet_accessor::BlockchainAccessConfig; #[tokio::test(flavor = "multi_thread")] #[cfg_attr(not(feature = "int_tests"), ignore)] async fn retrieve_txs_from_block() -> Result<(), Error> { - let config_path = - concat!(env!("CARGO_MANIFEST_DIR"), "../../config.toml"); + let config_path = "../config.toml"; let cfg = BlockchainAccessConfig::load_path(config_path)?; @@ -32,8 +31,7 @@ async fn retrieve_txs_from_block() -> Result<(), Error> { #[tokio::test(flavor = "multi_thread")] #[cfg_attr(not(feature = "int_tests"), ignore)] async fn retrieve_txs_from_block_range() -> Result<(), Error> { - let config_path = - concat!(env!("CARGO_MANIFEST_DIR"), "../../config.toml"); + let config_path = "../config.toml"; let cfg = BlockchainAccessConfig::load_path(config_path)?; @@ -58,8 +56,7 @@ async fn retrieve_txs_from_block_range() -> Result<(), Error> { #[tokio::test(flavor = "multi_thread")] #[cfg_attr(not(feature = "int_tests"), ignore)] async fn retrieve_txs_from_last_n_blocks() -> Result<(), Error> { - let config_path = - concat!(env!("CARGO_MANIFEST_DIR"), "../../config.toml"); + let config_path = "../config.toml"; let cfg = BlockchainAccessConfig::load_path(config_path)?; @@ -79,8 +76,7 @@ async fn retrieve_tx_by_id() -> Result<(), Error> { const TXID: &str = "44fe2c6407fc400a2dee6e30c62a02b82f3980da18d3b6306e80f9f83730520d"; - let config_path = - concat!(env!("CARGO_MANIFEST_DIR"), "../../config.toml"); + let config_path = "../config.toml"; let config = BlockchainAccessConfig::load_path(config_path)?; diff --git a/integration-tests/tests/blockchain/stake_add_owner.rs b/integration-tests/tests/blockchain/stake_add_owner.rs index f42bc71..52dd3e6 100644 --- a/integration-tests/tests/blockchain/stake_add_owner.rs +++ b/integration-tests/tests/blockchain/stake_add_owner.rs @@ -28,8 +28,7 @@ pub const ADD_OWNER_METHOD_NAME: &str = "add_owner"; #[tokio::test(flavor = "multi_thread")] #[cfg_attr(not(feature = "int_tests"), ignore)] async fn stake_add_owner() -> Result<(), Error> { - let blockchain_config_path = - concat!(env!("CARGO_MANIFEST_DIR"), "../../config.toml"); + let blockchain_config_path = "../config.toml"; let blockchain_config = BlockchainAccessConfig::load_path(blockchain_config_path)?; diff --git a/integration-tests/tests/citadel/int_test_lp.rs b/integration-tests/tests/citadel/int_test_lp.rs index 42734fe..b947696 100644 --- a/integration-tests/tests/citadel/int_test_lp.rs +++ b/integration-tests/tests/citadel/int_test_lp.rs @@ -12,8 +12,7 @@ use wallet_accessor::BlockchainAccessConfig; #[tokio::test(flavor = "multi_thread")] #[cfg_attr(not(feature = "exp_tests"), ignore)] async fn lp_scan() -> Result<(), Error> { - let blockchain_config_path = - concat!(env!("CARGO_MANIFEST_DIR"), "../../config.toml"); + let blockchain_config_path = "../config.toml"; let lp_config_path = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/config/test_secret_key_lp"); @@ -29,8 +28,7 @@ async fn lp_scan() -> Result<(), Error> { #[tokio::test(flavor = "multi_thread")] #[cfg_attr(not(feature = "exp_tests"), ignore)] async fn lp_scan_last_blocks() -> Result<(), Error> { - let blockchain_config_path = - concat!(env!("CARGO_MANIFEST_DIR"), "../../config.toml"); + let blockchain_config_path = "../config.toml"; let lp_config_path = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/config/test_secret_key_lp_2"); @@ -48,8 +46,7 @@ async fn lp_scan_last_blocks() -> Result<(), Error> { #[tokio::test(flavor = "multi_thread")] #[cfg_attr(not(feature = "exp_tests"), ignore)] async fn lp_scan_2_lps() -> Result<(), Error> { - let blockchain_config_path = - concat!(env!("CARGO_MANIFEST_DIR"), "../../config.toml"); + let blockchain_config_path = "../config.toml"; let lp1_config_path = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/config/test_secret_key_lp"); let lp2_config_path = diff --git a/integration-tests/tests/citadel/int_test_user.rs b/integration-tests/tests/citadel/int_test_user.rs index 92e43dc..78c2fed 100644 --- a/integration-tests/tests/citadel/int_test_user.rs +++ b/integration-tests/tests/citadel/int_test_user.rs @@ -121,8 +121,7 @@ async fn user_round_trip() -> Result<(), Error> { // PUB_PARAMS initialization code let mut rng = StdRng::seed_from_u64(0xbeef); - let blockchain_config_path = - concat!(env!("CARGO_MANIFEST_DIR"), "../../config.toml"); + let blockchain_config_path = "../config.toml"; let blockchain_config = BlockchainAccessConfig::load_path(blockchain_config_path)?; diff --git a/integration-tests/tests/citadel/issue_license.rs b/integration-tests/tests/citadel/issue_license.rs index c9f2248..2f5ce6b 100644 --- a/integration-tests/tests/citadel/issue_license.rs +++ b/integration-tests/tests/citadel/issue_license.rs @@ -25,8 +25,7 @@ const GAS_PRICE: u64 = 1; async fn issue_license() -> Result<(), Error> { let request_path = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/request/request.json"); - let blockchain_config_path = - concat!(env!("CARGO_MANIFEST_DIR"), "../../config.toml"); + let blockchain_config_path = "../config.toml"; let lp_config_path = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/config/test_secret_key_lp_2"); diff --git a/integration-tests/tests/citadel/license_queries.rs b/integration-tests/tests/citadel/license_queries.rs index d60aa62..cc1422c 100644 --- a/integration-tests/tests/citadel/license_queries.rs +++ b/integration-tests/tests/citadel/license_queries.rs @@ -14,8 +14,7 @@ use wallet_accessor::BlockchainAccessConfig; #[tokio::test(flavor = "multi_thread")] #[cfg_attr(not(feature = "int_tests"), ignore)] async fn call_get_licenses() -> Result<(), Error> { - let config_path = - concat!(env!("CARGO_MANIFEST_DIR"), "../../config.toml"); + let config_path = "../config.toml"; let config = BlockchainAccessConfig::load_path(config_path)?; let client = RuskHttpClient::new(config.rusk_address); @@ -33,8 +32,7 @@ async fn call_get_licenses() -> Result<(), Error> { #[tokio::test(flavor = "multi_thread")] #[cfg_attr(not(feature = "int_tests"), ignore)] async fn call_get_merkle_opening() -> Result<(), Error> { - let config_path = - concat!(env!("CARGO_MANIFEST_DIR"), "../../config.toml"); + let config_path = "../config.toml"; let config = BlockchainAccessConfig::load_path(config_path)?; let client = RuskHttpClient::new(config.rusk_address); @@ -49,8 +47,7 @@ async fn call_get_merkle_opening() -> Result<(), Error> { #[tokio::test(flavor = "multi_thread")] #[cfg_attr(not(feature = "int_tests"), ignore)] async fn call_get_session() -> Result<(), Error> { - let config_path = - concat!(env!("CARGO_MANIFEST_DIR"), "../../config.toml"); + let config_path = "../config.toml"; let config = BlockchainAccessConfig::load_path(config_path)?; let client = RuskHttpClient::new(config.rusk_address); @@ -69,8 +66,7 @@ async fn call_get_session() -> Result<(), Error> { #[tokio::test(flavor = "multi_thread")] #[cfg_attr(not(feature = "int_tests"), ignore)] async fn call_get_info() -> Result<(), Error> { - let config_path = - concat!(env!("CARGO_MANIFEST_DIR"), "../../config.toml"); + let config_path = "../config.toml"; let config = BlockchainAccessConfig::load_path(config_path)?; let client = RuskHttpClient::new(config.rusk_address); diff --git a/integration-tests/tests/citadel/retrieve_requests.rs b/integration-tests/tests/citadel/retrieve_requests.rs index 5f0d252..e5eca4c 100644 --- a/integration-tests/tests/citadel/retrieve_requests.rs +++ b/integration-tests/tests/citadel/retrieve_requests.rs @@ -17,8 +17,7 @@ async fn retrieve_payload() -> Result<(), Error> { const TXID: &str = "8d45a9fb7196f322282d522ff4bb2d2e926ddd96b858b91d59f228b27250ef03"; - let config_path = - concat!(env!("CARGO_MANIFEST_DIR"), "../../config.toml"); + let config_path = "../config.toml"; let config = BlockchainAccessConfig::load_path(config_path)?; let client = RuskHttpClient::new(config.rusk_address); @@ -32,8 +31,7 @@ async fn retrieve_payload() -> Result<(), Error> { #[tokio::test(flavor = "multi_thread")] #[cfg_attr(not(feature = "exp_tests"), ignore)] async fn scan_all_requests() -> Result<(), Error> { - let config_path = - concat!(env!("CARGO_MANIFEST_DIR"), "../../config.toml"); + let config_path = "../config.toml"; let cfg = BlockchainAccessConfig::load_path(config_path)?; let mut height = 0; loop { @@ -58,8 +56,7 @@ async fn scan_all_requests() -> Result<(), Error> { #[tokio::test(flavor = "multi_thread")] #[cfg_attr(not(feature = "int_tests"), ignore)] async fn scan_requests_in_last_blocks() -> Result<(), Error> { - let config_path = - concat!(env!("CARGO_MANIFEST_DIR"), "../../config.toml"); + let config_path = "../config.toml"; let cfg = BlockchainAccessConfig::load_path(config_path)?; @@ -77,8 +74,7 @@ async fn scan_requests_in_last_blocks() -> Result<(), Error> { #[tokio::test(flavor = "multi_thread")] #[cfg_attr(not(feature = "int_tests"), ignore)] async fn scan_requests_in_block_range() -> Result<(), Error> { - let config_path = - concat!(env!("CARGO_MANIFEST_DIR"), "../../config.toml"); + let config_path = "../config.toml"; let cfg = BlockchainAccessConfig::load_path(config_path)?; diff --git a/integration-tests/tests/citadel/send_request.rs b/integration-tests/tests/citadel/send_request.rs index 14b24b6..483025e 100644 --- a/integration-tests/tests/citadel/send_request.rs +++ b/integration-tests/tests/citadel/send_request.rs @@ -37,8 +37,7 @@ async fn send_request() -> Result<(), Error> { let request_path = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/request/request.json"); - let config_path = - concat!(env!("CARGO_MANIFEST_DIR"), "../../config.toml"); + let config_path = "../config.toml"; let request_json: RequestJson = RequestJson::from_file(request_path)?; diff --git a/license-provider/tests/config/lp.json b/license-provider/tests/config/lp.json deleted file mode 100644 index 5c6f643..0000000 --- a/license-provider/tests/config/lp.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "psk_lp": "29c4336ef24e585f4506e32e269c5363a71f7dcd74586b210c56e569ad2644e832c785f102dd3c985c705008ec188be819bac85b65c9f70decb9adcf4a72cc43", - "ssk_lp": "530046f569d26740eaa703b7f88bfb82a31aae1cef96732609e4b8f1e59802039f5afb7c1d5576e51c71d5afe8f6e06977c68641fae11abd3ce0b2196d1f3608" -} diff --git a/license-provider/tests/config/test_secret_key_lp b/license-provider/tests/config/test_secret_key_lp new file mode 100644 index 0000000..7f67cb9 --- /dev/null +++ b/license-provider/tests/config/test_secret_key_lp @@ -0,0 +1 @@ +530046f569d26740eaa703b7f88bfb82a31aae1cef96732609e4b8f1e59802039f5afb7c1d5576e51c71d5afe8f6e06977c68641fae11abd3ce0b2196d1f3608 \ No newline at end of file diff --git a/license-provider/tests/test_lp.rs b/license-provider/tests/test_lp.rs index 88f5887..730b349 100644 --- a/license-provider/tests/test_lp.rs +++ b/license-provider/tests/test_lp.rs @@ -10,7 +10,7 @@ use moat_core::{Error, JsonLoader, RequestScanner, Transactions}; #[test] fn lp_filter_requests() -> Result<(), Error> { let lp_config_path = - concat!(env!("CARGO_MANIFEST_DIR"), "/tests/config/lp.json"); + concat!(env!("CARGO_MANIFEST_DIR"), "/tests/config/test_secret_key_lp"); let reference_lp = ReferenceLP::create(&lp_config_path)?; let txs_path =