From 35181c7c6072f5b5fc080686efedf7e379a16faf Mon Sep 17 00:00:00 2001 From: Kevin Pease Date: Tue, 14 May 2024 15:10:40 +0200 Subject: [PATCH 1/4] Add command to change directory --- code-coverage.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/code-coverage.sh b/code-coverage.sh index 2a4d747..25e58da 100755 --- a/code-coverage.sh +++ b/code-coverage.sh @@ -1,3 +1,4 @@ +cd stellar_rust_sdk CARGO_INCREMENTAL=0 RUSTFLAGS='-Cinstrument-coverage' LLVM_PROFILE_FILE='cargo-test-%p-%m.profraw' cargo test grcov . --binary-path ./target/debug/deps/ -s . -t html --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o target/coverage/html rm *.profraw From f5ffbda0941826d85a0906aec7d3d84bbc114506 Mon Sep 17 00:00:00 2001 From: Kevin Pease Date: Wed, 15 May 2024 09:53:28 +0200 Subject: [PATCH 2/4] Remove command and integrate new path in commands --- code-coverage.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/code-coverage.sh b/code-coverage.sh index 25e58da..f612174 100755 --- a/code-coverage.sh +++ b/code-coverage.sh @@ -1,6 +1,5 @@ -cd stellar_rust_sdk -CARGO_INCREMENTAL=0 RUSTFLAGS='-Cinstrument-coverage' LLVM_PROFILE_FILE='cargo-test-%p-%m.profraw' cargo test -grcov . --binary-path ./target/debug/deps/ -s . -t html --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o target/coverage/html -rm *.profraw +CARGO_INCREMENTAL=0 RUSTFLAGS='-Cinstrument-coverage' LLVM_PROFILE_FILE='cargo-test-%p-%m.profraw' cargo test --manifest-path=stellar_rust_sdk/Cargo.toml +grcov . --binary-path stellar_rust_sdk/target/debug/deps/ -s . -t html --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o stellar_rust_sdk/target/coverage/html +rm stellar_rust_sdk/*.profraw # open the coverage report in the browser -xdg-open target/coverage/html/index.html +xdg-open target/coverage/html/index.html \ No newline at end of file From 81ef5d18481f89c1e6f0349d99d4f14dd4bc7e15 Mon Sep 17 00:00:00 2001 From: Kevin Pease Date: Fri, 24 May 2024 13:37:59 +0200 Subject: [PATCH 3/4] Fix path for xdg-open, add ./ for paths --- code-coverage.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code-coverage.sh b/code-coverage.sh index f612174..0386f12 100755 --- a/code-coverage.sh +++ b/code-coverage.sh @@ -1,5 +1,5 @@ -CARGO_INCREMENTAL=0 RUSTFLAGS='-Cinstrument-coverage' LLVM_PROFILE_FILE='cargo-test-%p-%m.profraw' cargo test --manifest-path=stellar_rust_sdk/Cargo.toml -grcov . --binary-path stellar_rust_sdk/target/debug/deps/ -s . -t html --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o stellar_rust_sdk/target/coverage/html -rm stellar_rust_sdk/*.profraw +CARGO_INCREMENTAL=0 RUSTFLAGS='-Cinstrument-coverage' LLVM_PROFILE_FILE='cargo-test-%p-%m.profraw' cargo test --manifest-path=./stellar_rust_sdk/Cargo.toml +grcov . --binary-path ./stellar_rust_sdk/target/debug/deps/ -s . -t html --branch --ignore-not-existing --ignore '../*' --ignore "/*" -o ./stellar_rust_sdk/target/coverage/html +rm ./stellar_rust_sdk/*.profraw # open the coverage report in the browser -xdg-open target/coverage/html/index.html \ No newline at end of file +xdg-open ./stellar_rust_sdk/target/coverage/html/index.html \ No newline at end of file From 3c3b1185808bffd840f539debf8827b0f513ccaa Mon Sep 17 00:00:00 2001 From: Thomas Luijken Date: Thu, 30 May 2024 11:42:56 +0200 Subject: [PATCH 4/4] Test fixes --- stellar_rust_sdk/src/order_book/details_request.rs | 5 ++--- stellar_rust_sdk/src/order_book/mod.rs | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/stellar_rust_sdk/src/order_book/details_request.rs b/stellar_rust_sdk/src/order_book/details_request.rs index 1615f2e..9690ff0 100644 --- a/stellar_rust_sdk/src/order_book/details_request.rs +++ b/stellar_rust_sdk/src/order_book/details_request.rs @@ -1,5 +1,4 @@ -use crate::{models::Request}; - +use crate::models::Request; pub struct SellingAsset(AssetType); pub struct NoSellingAsset; pub struct BuyingAsset(AssetType); @@ -157,7 +156,7 @@ impl Request for DetailsRequest { mod tests { use crate::models::Request; - use crate::order_book::prelude::{Asset, AssetType, DetailsRequest}; + use super::{Asset, AssetType, DetailsRequest}; #[test] fn test_details_request() { diff --git a/stellar_rust_sdk/src/order_book/mod.rs b/stellar_rust_sdk/src/order_book/mod.rs index aac907a..0499655 100644 --- a/stellar_rust_sdk/src/order_book/mod.rs +++ b/stellar_rust_sdk/src/order_book/mod.rs @@ -14,9 +14,9 @@ pub mod tests { #[tokio::test] async fn get_order_bookdetails() { - const BIDS_N: &u32 = &250000; - const BIDS_D: &u32 = &21749; - const BIDS_PRICE: &str = "11.4947814"; + const BIDS_N: &u32 = &1000; + const BIDS_D: &u32 = &87; + const BIDS_PRICE: &str = "11.4942529"; const BIDS_AMOUNT: &str = "2556626.8467920"; const ASKS_N: &u32 = &2299;