Skip to content

Commit

Permalink
Fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
xevisalle committed Nov 15, 2023
1 parent ac7560e commit aa84fd6
Show file tree
Hide file tree
Showing 13 changed files with 22 additions and 46 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
Expand Down
3 changes: 1 addition & 2 deletions integration-tests/tests/blockchain/get_crs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;

Expand Down
12 changes: 4 additions & 8 deletions integration-tests/tests/blockchain/retrieve_txs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;

Expand All @@ -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)?;

Expand All @@ -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)?;

Expand All @@ -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)?;

Expand Down
3 changes: 1 addition & 2 deletions integration-tests/tests/blockchain/stake_add_owner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down
9 changes: 3 additions & 6 deletions integration-tests/tests/citadel/int_test_lp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand All @@ -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");

Expand All @@ -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 =
Expand Down
3 changes: 1 addition & 2 deletions integration-tests/tests/citadel/int_test_user.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
Expand Down
3 changes: 1 addition & 2 deletions integration-tests/tests/citadel/issue_license.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
12 changes: 4 additions & 8 deletions integration-tests/tests/citadel/license_queries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand All @@ -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);
Expand Down
12 changes: 4 additions & 8 deletions integration-tests/tests/citadel/retrieve_requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 {
Expand All @@ -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)?;

Expand All @@ -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)?;

Expand Down
3 changes: 1 addition & 2 deletions integration-tests/tests/citadel/send_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;

Expand Down
4 changes: 0 additions & 4 deletions license-provider/tests/config/lp.json

This file was deleted.

1 change: 1 addition & 0 deletions license-provider/tests/config/test_secret_key_lp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
530046f569d26740eaa703b7f88bfb82a31aae1cef96732609e4b8f1e59802039f5afb7c1d5576e51c71d5afe8f6e06977c68641fae11abd3ce0b2196d1f3608
2 changes: 1 addition & 1 deletion license-provider/tests/test_lp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit aa84fd6

Please sign in to comment.