From 9d48a4b5e0370f945674625b887d139d99be5cd8 Mon Sep 17 00:00:00 2001 From: portable Date: Thu, 20 Aug 2026 17:37:23 +0100 Subject: [PATCH 1/3] test(soroban): add unit tests for looping + rewards and cargo test CI gate - 8 tests for looping contract (open_position ID monotonicity, validation) - 6 tests for rewards contract (accrue/claim accounting, edge cases) - Added cargo test job to soroban.yml CI workflow - Total: 28 tests passing across all contracts Closes #420 --- .github/workflows/soroban.yml | 35 +++++- quantara/soroban/contracts/Cargo.lock | 6 + quantara/soroban/contracts/looping/Cargo.toml | 5 + quantara/soroban/contracts/looping/src/lib.rs | 113 ++++++++++++++++++ quantara/soroban/contracts/rewards/Cargo.toml | 5 + quantara/soroban/contracts/rewards/src/lib.rs | 101 ++++++++++++++++ 6 files changed, 264 insertions(+), 1 deletion(-) diff --git a/.github/workflows/soroban.yml b/.github/workflows/soroban.yml index 0cf262d7..3c2fcc31 100644 --- a/.github/workflows/soroban.yml +++ b/.github/workflows/soroban.yml @@ -115,7 +115,40 @@ jobs: manifest-path: quantara/soroban/contracts/Cargo.toml arguments: --config quantara/soroban/contracts/deny.toml - # ── 4. Build ──────────────────────────────────────────────────────────────── + # ── 4. Test ───────────────────────────────────────────────────────────────── + test: + name: Test (cargo test) + runs-on: ubuntu-latest + permissions: + contents: read + needs: [fmt, clippy] + + steps: + - name: Checkout repository + uses: actions/checkout@v7 + + - name: Install Rust toolchain + uses: dtolnay/rust-toolchain@stable + with: + toolchain: ${{ env.RUST_TOOLCHAIN }} + targets: wasm32-unknown-unknown + + - name: Cache Cargo registry & build artifacts + uses: actions/cache@v4 + with: + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + quantara/soroban/contracts/target/ + key: ${{ runner.os }}-cargo-test-${{ hashFiles('quantara/soroban/contracts/Cargo.toml', 'quantara/soroban/contracts/**/Cargo.toml') }} + restore-keys: | + ${{ runner.os }}-cargo-test- + + - name: Run tests + run: cargo test + + # ── 5. Build ──────────────────────────────────────────────────────────────── build: name: Build (wasm32-unknown-unknown) runs-on: ubuntu-latest diff --git a/quantara/soroban/contracts/Cargo.lock b/quantara/soroban/contracts/Cargo.lock index 02ab1858..2719bcd2 100644 --- a/quantara/soroban/contracts/Cargo.lock +++ b/quantara/soroban/contracts/Cargo.lock @@ -900,6 +900,8 @@ name = "looping" version = "0.1.0" dependencies = [ "common", + "ed25519-dalek", + "rand_core 0.6.4", "soroban-sdk", ] @@ -1181,6 +1183,8 @@ checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" name = "rewards" version = "0.1.0" dependencies = [ + "ed25519-dalek", + "rand_core 0.6.4", "soroban-sdk", ] @@ -1785,6 +1789,8 @@ name = "vault" version = "0.1.0" dependencies = [ "common", + "ed25519-dalek", + "rand_core 0.6.4", "soroban-sdk", ] diff --git a/quantara/soroban/contracts/looping/Cargo.toml b/quantara/soroban/contracts/looping/Cargo.toml index 8571895d..a2bea3e7 100644 --- a/quantara/soroban/contracts/looping/Cargo.toml +++ b/quantara/soroban/contracts/looping/Cargo.toml @@ -12,3 +12,8 @@ doctest = false [dependencies] soroban-sdk = { version = "22.0.0" } common = { path = "../common", version = "0.1.0" } + +[dev-dependencies] +soroban-sdk = { version = "22.0.0", features = ["testutils"] } +ed25519-dalek = "<3" +rand_core = "<0.7" diff --git a/quantara/soroban/contracts/looping/src/lib.rs b/quantara/soroban/contracts/looping/src/lib.rs index fa276e4c..d5dd72a2 100644 --- a/quantara/soroban/contracts/looping/src/lib.rs +++ b/quantara/soroban/contracts/looping/src/lib.rs @@ -58,3 +58,116 @@ impl LoopingContract { // Stub: full unwind logic will be implemented in a future PR. } } + +// --------------------------------------------------------------------------- +// Tests +// --------------------------------------------------------------------------- + +#[cfg(test)] +mod tests { + extern crate std; + + use super::*; + use soroban_sdk::testutils::Address as _; + + struct Fixture { + env: Env, + contract_id: Address, + user: Address, + } + + fn setup() -> Fixture { + let env = Env::default(); + env.mock_all_auths(); + + let user = Address::generate(&env); + let contract_id = env.register(LoopingContract, ()); + + Fixture { + env, + contract_id, + user, + } + } + + #[test] + fn test_open_position_returns_first_id() { + let fx = setup(); + let client = LoopingContractClient::new(&fx.env, &fx.contract_id); + + let id = client.open_position(&fx.user, &1_000, &200); + assert_eq!(id, 1); + } + + #[test] + fn test_open_position_returns_incrementing_ids() { + let fx = setup(); + let client = LoopingContractClient::new(&fx.env, &fx.contract_id); + + assert_eq!(client.open_position(&fx.user, &1_000, &200), 1); + assert_eq!(client.open_position(&fx.user, &2_000, &300), 2); + assert_eq!(client.open_position(&fx.user, &500, &100), 3); + } + + #[test] + fn test_open_position_rejects_zero_collateral() { + let fx = setup(); + let client = LoopingContractClient::new(&fx.env, &fx.contract_id); + + let result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| { + client.open_position(&fx.user, &0, &200); + })); + assert!(result.is_err()); + } + + #[test] + fn test_open_position_rejects_negative_collateral() { + let fx = setup(); + let client = LoopingContractClient::new(&fx.env, &fx.contract_id); + + let result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| { + client.open_position(&fx.user, &-1, &200); + })); + assert!(result.is_err()); + } + + #[test] + fn test_open_position_rejects_leverage_below_100() { + let fx = setup(); + let client = LoopingContractClient::new(&fx.env, &fx.contract_id); + + let result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| { + client.open_position(&fx.user, &1_000, &99); + })); + assert!(result.is_err()); + } + + #[test] + fn test_open_position_rejects_leverage_above_500() { + let fx = setup(); + let client = LoopingContractClient::new(&fx.env, &fx.contract_id); + + let result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| { + client.open_position(&fx.user, &1_000, &501); + })); + assert!(result.is_err()); + } + + #[test] + fn test_open_position_accepts_leverage_boundaries() { + let fx = setup(); + let client = LoopingContractClient::new(&fx.env, &fx.contract_id); + + assert_eq!(client.open_position(&fx.user, &1_000, &100), 1); + assert_eq!(client.open_position(&fx.user, &1_000, &500), 2); + } + + #[test] + fn test_close_position_does_not_panic() { + let fx = setup(); + let client = LoopingContractClient::new(&fx.env, &fx.contract_id); + + let id = client.open_position(&fx.user, &1_000, &200); + client.close_position(&fx.user, &id); + } +} diff --git a/quantara/soroban/contracts/rewards/Cargo.toml b/quantara/soroban/contracts/rewards/Cargo.toml index e943f918..4d60c38e 100644 --- a/quantara/soroban/contracts/rewards/Cargo.toml +++ b/quantara/soroban/contracts/rewards/Cargo.toml @@ -11,3 +11,8 @@ doctest = false [dependencies] soroban-sdk = { version = "22.0.0" } + +[dev-dependencies] +soroban-sdk = { version = "22.0.0", features = ["testutils"] } +ed25519-dalek = "<3" +rand_core = "<0.7" diff --git a/quantara/soroban/contracts/rewards/src/lib.rs b/quantara/soroban/contracts/rewards/src/lib.rs index 573926ff..cbd9d0f6 100644 --- a/quantara/soroban/contracts/rewards/src/lib.rs +++ b/quantara/soroban/contracts/rewards/src/lib.rs @@ -49,3 +49,104 @@ impl RewardsContract { env.storage().persistent().get(&user).unwrap_or(0i128) } } + +// --------------------------------------------------------------------------- +// Tests +// --------------------------------------------------------------------------- + +#[cfg(test)] +mod tests { + extern crate std; + + use super::*; + use soroban_sdk::testutils::Address as _; + + struct Fixture { + env: Env, + contract_id: Address, + user: Address, + } + + fn setup() -> Fixture { + let env = Env::default(); + env.mock_all_auths(); + + let user = Address::generate(&env); + let contract_id = env.register(RewardsContract, ()); + + Fixture { + env, + contract_id, + user, + } + } + + #[test] + fn test_accrue_adds_to_pending_balance() { + let fx = setup(); + let client = RewardsContractClient::new(&fx.env, &fx.contract_id); + + client.accrue(&fx.user, &100); + assert_eq!(client.pending_rewards(&fx.user), 100); + } + + #[test] + fn test_accrue_rejects_negative_accrual() { + let fx = setup(); + let client = RewardsContractClient::new(&fx.env, &fx.contract_id); + + let result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| { + client.accrue(&fx.user, &-1); + })); + assert!(result.is_err()); + assert_eq!(client.pending_rewards(&fx.user), 0); + } + + #[test] + fn test_claim_returns_pending_and_resets_to_zero() { + let fx = setup(); + let client = RewardsContractClient::new(&fx.env, &fx.contract_id); + + client.accrue(&fx.user, &100); + let claimed = client.claim(&fx.user); + + assert_eq!(claimed, 100); + assert_eq!(client.pending_rewards(&fx.user), 0); + } + + #[test] + fn test_claim_on_zero_balance_returns_zero() { + let fx = setup(); + let client = RewardsContractClient::new(&fx.env, &fx.contract_id); + + let claimed = client.claim(&fx.user); + assert_eq!(claimed, 0); + } + + #[test] + fn test_pending_rewards_query_without_claiming() { + let fx = setup(); + let client = RewardsContractClient::new(&fx.env, &fx.contract_id); + + client.accrue(&fx.user, &500); + let pending = client.pending_rewards(&fx.user); + + assert_eq!(pending, 500); + // Pending must still be available after query. + assert_eq!(client.pending_rewards(&fx.user), 500); + } + + #[test] + fn test_multiple_accrue_then_claim() { + let fx = setup(); + let client = RewardsContractClient::new(&fx.env, &fx.contract_id); + + client.accrue(&fx.user, &100); + client.accrue(&fx.user, &200); + client.accrue(&fx.user, &50); + + assert_eq!(client.pending_rewards(&fx.user), 350); + assert_eq!(client.claim(&fx.user), 350); + assert_eq!(client.pending_rewards(&fx.user), 0); + } +} From 8c4e512d4f9c7138695a2a608519c752e10c9676 Mon Sep 17 00:00:00 2001 From: portable Date: Fri, 21 Aug 2026 13:07:56 +0100 Subject: [PATCH 2/3] chore: restore workspace Cargo.lock from main --- quantara/soroban/contracts/Cargo.lock | 319 ++++++-------------------- 1 file changed, 70 insertions(+), 249 deletions(-) diff --git a/quantara/soroban/contracts/Cargo.lock b/quantara/soroban/contracts/Cargo.lock index 28ffc30e..92914a56 100644 --- a/quantara/soroban/contracts/Cargo.lock +++ b/quantara/soroban/contracts/Cargo.lock @@ -16,9 +16,9 @@ dependencies = [ [[package]] name = "android_system_properties" -version = "0.1.6" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae221649c9976a6f6c56ae1facf410f3ddb33cc661c4b7b61020a912d4237fbc" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" dependencies = [ "libc", ] @@ -195,12 +195,6 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - [[package]] name = "bitflags" version = "2.13.1" @@ -254,9 +248,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.4.4" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad534f4357a5264cce5019c989cf66a4f0dc4e0d1b1d15f8aacec0ff7360273" +checksum = "c89588d05638b5b4594a3348a2d6c20277e43a7f5c5202b05cc56888475a47b8" dependencies = [ "find-msvc-tools", "shlex", @@ -284,7 +278,7 @@ dependencies = [ name = "common" version = "0.1.0" dependencies = [ - "ed25519-dalek 2.2.0", + "ed25519-dalek", "proptest", "rand_core 0.6.4", "soroban-sdk", @@ -360,7 +354,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce6e4c961d6cd6c9a86db418387425e8bdeaf05b3c8bc1411e6dca4c252f1453" dependencies = [ "hybrid-array", - "rand_core 0.10.1", ] [[package]] @@ -400,10 +393,8 @@ dependencies = [ "curve25519-dalek-derive", "digest 0.11.3", "fiat-crypto 0.3.0", - "rand_core 0.10.1", "rustc_version", "subtle", - "zeroize", ] [[package]] @@ -488,40 +479,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.11.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4583a4551df46e2792f82ceeac45e850d2e2d5debba0b91f102385cda5b11f06" - -[[package]] -name = "defmt" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2953bfe4f93bbd20cc71198842756f77d161884c99ebbabc41d80231ded88d1" -dependencies = [ - "bitflags 1.3.2", - "defmt-macros", -] - -[[package]] -name = "defmt-macros" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bad9c72e7ca2137e0dc3813245a0d282fd6daad32fd800af018306a9169b5fe8" -dependencies = [ - "defmt-parser", - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "defmt-parser" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10d60334b3b2e7c9d91ef8150abfb6fa4c1c39ebbcf4a81c2e346aad939fee3e" -dependencies = [ - "thiserror 2.0.20", -] +checksum = "a4ae5f15dda3c708c0ade84bfee31ccab44a3da4f88015ed22f63732abe300c8" [[package]] name = "der" @@ -608,7 +568,7 @@ dependencies = [ "digest 0.10.7", "elliptic-curve", "rfc6979", - "signature 2.2.0", + "signature", ] [[package]] @@ -618,16 +578,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ "pkcs8", - "signature 2.2.0", -] - -[[package]] -name = "ed25519" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29fcf32e6c73d1079f83ab4d782de2d81620346a5f38c6237a86a22f8368980a" -dependencies = [ - "signature 3.0.0", + "signature", ] [[package]] @@ -637,34 +588,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9" dependencies = [ "curve25519-dalek 4.1.3", - "ed25519 2.2.3", + "ed25519", "rand_core 0.6.4", "serde", - "sha2 0.10.9", - "subtle", - "zeroize", -] - -[[package]] -name = "ed25519-dalek" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ebaa1a2bf1290ab3bfe5a7b771d050ebffab2711c19a81691c683a5144a25de" -dependencies = [ - "curve25519-dalek 5.0.0", - "ed25519 3.0.0", - "rand_core 0.10.1", - "sha2 0.11.0", - "signature 3.0.0", + "sha2", "subtle", "zeroize", ] [[package]] name = "either" -version = "1.18.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "252afb9ae5eaa683babdc6a068b3f5726eb19e05070c731f9b2a23a7c3e8ed34" +checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" [[package]] name = "elliptic-curve" @@ -742,9 +678,9 @@ checksum = "64cd1e32ddd350061ae6edb1b082d7c54915b5c672c389143b9a63403a109f24" [[package]] name = "find-msvc-tools" -version = "0.1.11" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d45db016d36b838f563236e9193d0ee6ce38f3f68b6c94e914b4929c96bbb890" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" [[package]] name = "fnv" @@ -754,21 +690,21 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "futures-core" -version = "0.3.34" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d699e522242e69e3003b94ecc1f960f3a5e015aa7c5d7486e65ad01dd94f5e" +checksum = "2cd50c473c80f6d7c3670a752354b8e569b1a7cbfdc0419ec88e5edad85e0dc7" [[package]] name = "futures-task" -version = "0.3.34" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd417de3d1d015fc3bfd2b1ea46dfc7bab72ef86f1cc7cc9c78e728b34a6d1fd" +checksum = "b231ed28831efb4a61a08580c4bc233ec56bc009f4cd8f52da2c3cb97df0c109" [[package]] name = "futures-util" -version = "0.3.34" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" +checksum = "a77a90a256fce34da66415271e30f94ee91c57b04b8a2c042d9cf3220179deaa" dependencies = [ "futures-core", "futures-task", @@ -881,9 +817,9 @@ dependencies = [ [[package]] name = "hybrid-array" -version = "0.4.14" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707114b52a152fa7bdb290cd7cd5912d9467273b6d74e21b8d81aca1f8533f6b" +checksum = "818356c5132c1fede50f837ca96afbe78ff42413047f4abb886217845e1b6c8c" dependencies = [ "typenum", ] @@ -962,64 +898,11 @@ version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" -[[package]] -name = "jiff" -version = "0.2.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668b7183bd07af9a4885f5c35b0cc5c83c4607a913c16b7e17291832910d2dcc" -dependencies = [ - "defmt", - "jiff-core", - "jiff-static", - "jiff-tzdb-platform", - "log", - "portable-atomic", - "portable-atomic-util", - "serde_core", - "windows-link", -] - -[[package]] -name = "jiff-core" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7feca88439efe53da3754500c1851dedf3cb36c524dd5cf8225cc0794de95d09" -dependencies = [ - "defmt", -] - -[[package]] -name = "jiff-static" -version = "0.2.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a69dcb3a21cfb32ce1cd056169337ca284af0766dd766e7878819b251a49204" -dependencies = [ - "jiff-core", - "proc-macro2", - "quote", - "syn 2.0.119", -] - -[[package]] -name = "jiff-tzdb" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "142bd39932ad231f10513df9ab62661fead8719872150b7ad02a2df79f4e141e" - -[[package]] -name = "jiff-tzdb-platform" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "875a5a69ac2bab1a891711cf5eccbec1ce0341ea805560dcd90b7a2e925132e8" -dependencies = [ - "jiff-tzdb", -] - [[package]] name = "js-sys" -version = "0.3.104" +version = "0.3.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0c1080212aad755ea003d18543e8768dd432c48819efd73a7bf1e39b7a5a3a" +checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102" dependencies = [ "cfg-if", "futures-util", @@ -1035,7 +918,7 @@ dependencies = [ "cfg-if", "ecdsa", "elliptic-curve", - "sha2 0.10.9", + "sha2", ] [[package]] @@ -1070,7 +953,7 @@ name = "liquidation" version = "0.1.0" dependencies = [ "common", - "ed25519-dalek 2.2.0", + "ed25519-dalek", "rand_core 0.6.4", "soroban-sdk", ] @@ -1086,7 +969,7 @@ name = "looping" version = "0.1.0" dependencies = [ "common", - "ed25519-dalek 2.2.0", + "ed25519-dalek", "rand_core 0.6.4", "soroban-sdk", ] @@ -1126,9 +1009,9 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.47" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ "num-traits", ] @@ -1157,7 +1040,7 @@ dependencies = [ "ecdsa", "elliptic-curve", "primeorder", - "sha2 0.10.9", + "sha2", ] [[package]] @@ -1182,21 +1065,6 @@ dependencies = [ "spki", ] -[[package]] -name = "portable-atomic" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05c8b63e8d9609db387f0324918f81d68fe27748f084ef092fb35954d0539a85" - -[[package]] -name = "portable-atomic-util" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2a106d1259c23fac8e543272398ae0e3c0b8d33c88ed73d0cc71b0f1d902618" -dependencies = [ - "portable-atomic", -] - [[package]] name = "powerfmt" version = "0.2.0" @@ -1248,7 +1116,7 @@ checksum = "4b45fcc2344c680f5025fe57779faef368840d0bd1f42f216291f0dc4ace4744" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.13.1", + "bitflags", "num-traits", "rand 0.9.5", "rand_chacha 0.9.0", @@ -1345,12 +1213,6 @@ dependencies = [ "getrandom 0.3.4", ] -[[package]] -name = "rand_core" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" - [[package]] name = "rand_xorshift" version = "0.4.0" @@ -1362,18 +1224,18 @@ dependencies = [ [[package]] name = "ref-cast" -version = "1.0.27" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e440fb4e4b4147295338efb76001ab9e4efc0e5839df2c47fc5ac2381d365c3" +checksum = "216e8f773d7923bcba9ceb86a86c93cabb3903a11872fc3f138c49630e50b96d" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.27" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92ecd8964f8453721699a1ed72037b0db49ce2f5a5138486ee89bed6f67cdf3a" +checksum = "2c9283685feec7d69af75fb0e858d5e7378f33fe4fc699383b2916ab9273e03c" dependencies = [ "proc-macro2", "quote", @@ -1391,7 +1253,7 @@ name = "rewards" version = "0.1.0" dependencies = [ "common", - "ed25519-dalek 2.2.0", + "ed25519-dalek", "rand_core 0.6.4", "soroban-sdk", ] @@ -1421,7 +1283,7 @@ version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ - "bitflags 2.13.1", + "bitflags", "errno", "libc", "linux-raw-sys", @@ -1460,9 +1322,9 @@ dependencies = [ [[package]] name = "schemars" -version = "1.2.2" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "687274d293b6cdc6e73e0fee520bf2049650090d7164f87672d212a3c530cf4a" +checksum = "a2b42f36aa1cd011945615b92222f6bf73c599a102a300334cd7f8dbeec726cc" dependencies = [ "dyn-clone", "ref-cast", @@ -1534,9 +1396,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.22.0" +version = "3.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee78f1fbe43ac4a0e47aadb3dbd357b69eb0d3793e948624cd03dd2750ab1c0a" +checksum = "76a5c54c7310e7b8b9577c286d7e399ddd876c3e12b3ed917a8aabc4b96e9e8c" dependencies = [ "base64 0.22.1", "bs58", @@ -1544,9 +1406,8 @@ dependencies = [ "hex", "indexmap 1.9.3", "indexmap 2.14.0", - "jiff", "schemars 0.9.0", - "schemars 1.2.2", + "schemars 1.2.1", "serde_core", "serde_json", "serde_with_macros", @@ -1555,9 +1416,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.22.0" +version = "3.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8705578779c2b6bd90d84d66eb2e206b708b1a4d7b9f17641b293545bf1c7e46" +checksum = "84d57bc0c8b9a17920c178daa6bb924850d54a9c97ab45194bb8c17ad66bb660" dependencies = [ "darling 0.23.0", "proc-macro2", @@ -1576,17 +1437,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "sha2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "446ba717509524cb3f22f17ecc096f10f4822d76ab5c0b9822c5f9c284e825f4" -dependencies = [ - "cfg-if", - "cpufeatures 0.3.0", - "digest 0.11.3", -] - [[package]] name = "sha3" version = "0.10.9" @@ -1613,15 +1463,6 @@ dependencies = [ "rand_core 0.6.4", ] -[[package]] -name = "signature" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d567dcbaf0049cb8ac2608a76cd95ff9e4412e1899d389ee400918ca7537f5" -dependencies = [ - "rand_core 0.10.1", -] - [[package]] name = "slab" version = "0.4.12" @@ -1687,7 +1528,7 @@ dependencies = [ "ark-serialize", "curve25519-dalek 5.0.0", "ecdsa", - "ed25519-dalek 3.0.0", + "ed25519-dalek", "elliptic-curve", "generic-array", "getrandom 0.2.17", @@ -1701,7 +1542,7 @@ dependencies = [ "rand 0.8.7", "rand_chacha 0.3.1", "sec1", - "sha2 0.10.9", + "sha2", "sha3", "soroban-builtin-sdk-macros", "soroban-env-common", @@ -1737,7 +1578,7 @@ dependencies = [ "serde_with", "soroban-env-common", "soroban-env-host", - "thiserror 1.0.69", + "thiserror", ] [[package]] @@ -1750,7 +1591,7 @@ dependencies = [ "bytes-lit", "ctor", "derive_arbitrary", - "ed25519-dalek 2.2.0", + "ed25519-dalek", "rand 0.8.7", "rustc_version", "serde", @@ -1774,7 +1615,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version", - "sha2 0.10.9", + "sha2", "soroban-env-common", "soroban-spec", "soroban-spec-rust", @@ -1790,7 +1631,7 @@ checksum = "cb6a16f2de28852c759f4da5f28cda54ec0d8dfa4c0e6e8cb3495234a72b0cea" dependencies = [ "base64 0.13.1", "stellar-xdr", - "thiserror 1.0.69", + "thiserror", "wasmparser", ] @@ -1803,11 +1644,11 @@ dependencies = [ "prettyplease", "proc-macro2", "quote", - "sha2 0.10.9", + "sha2", "soroban-spec", "stellar-xdr", "syn 2.0.119", - "thiserror 1.0.69", + "thiserror", ] [[package]] @@ -1853,7 +1694,7 @@ checksum = "5e3aa3ed00e70082cb43febc1c2afa5056b9bb3e348bbb43d0cd0aa88a611144" dependencies = [ "crate-git-revision", "data-encoding", - "thiserror 1.0.69", + "thiserror", ] [[package]] @@ -1936,16 +1777,7 @@ version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl 1.0.69", -] - -[[package]] -name = "thiserror" -version = "2.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec86235f5fcc2a73650310756d2ac5b138a5780bbbdfae3eeccec992c435ba4f" -dependencies = [ - "thiserror-impl 2.0.20", + "thiserror-impl", ] [[package]] @@ -1959,22 +1791,11 @@ dependencies = [ "syn 2.0.119", ] -[[package]] -name = "thiserror-impl" -version = "2.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc04cd3e1236dd4a98afca4569f2deb3f120e5422a4023be2cb683f8486292af" -dependencies = [ - "proc-macro2", - "quote", - "syn 3.0.3", -] - [[package]] name = "time" -version = "0.3.55" +version = "0.3.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb87b95ec50ddfa440816d227a17b2ccbdda963a316a727fda0fc4334f7d134" +checksum = "3e1d5e639ff6bab73cb6885cc7e7b1de96c3f32c68ec55f3952614bec1092244" dependencies = [ "deranged", "num-conv", @@ -2038,7 +1859,7 @@ name = "vault" version = "0.1.0" dependencies = [ "common", - "ed25519-dalek 2.2.0", + "ed25519-dalek", "rand_core 0.6.4", "soroban-sdk", ] @@ -2075,9 +1896,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.127" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b70935747edd64d89de3efa29d73789b806c15798f8e7dca4d8ac356b50ce70" +checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4" dependencies = [ "cfg-if", "once_cell", @@ -2088,9 +1909,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.127" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77775f8f3f7217702089053b94958f8f54061a3f663417df76e19cbdcca29bc1" +checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2098,9 +1919,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.127" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e11d33f857dc2fb11b8bc75aee111aa9cbeb12cd9f25efd3d4c2a3dd4e235284" +checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e" dependencies = [ "bumpalo", "proc-macro2", @@ -2111,9 +1932,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.127" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef64dbcc55df09c7e5a46182d181c2cfa3e925f3da937ea764728b4bbb9dcbf" +checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24" dependencies = [ "unicode-ident", ] @@ -2231,18 +2052,18 @@ checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" [[package]] name = "zerocopy" -version = "0.8.56" +version = "0.8.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556764e583adb45a9f8d413c2a147fa7e8d821e48e12b14fd560b607998b75eb" +checksum = "b5a105cd7b140f6eeec8acff2ea38135d3cab283ada58540f629fe51e46696eb" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.56" +version = "0.8.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2ab42fc20575779bd240faa45f94a74256f755c0fa9e89f0ede20d91d0cdfc1" +checksum = "0fe976fb70c78cd64cccfe3a6fc142244e8a77b70959b30faf9d0ac37ee228eb" dependencies = [ "proc-macro2", "quote", From 90c13d3e7ef050b251825307c313311aacd4dbcb Mon Sep 17 00:00:00 2001 From: portable Date: Fri, 21 Aug 2026 13:29:25 +0100 Subject: [PATCH 3/3] fix(rewards): fix mock auth args in test_non_admin_cannot_accrue --- quantara/soroban/contracts/rewards/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quantara/soroban/contracts/rewards/src/lib.rs b/quantara/soroban/contracts/rewards/src/lib.rs index 84cb14ca..9f6d5581 100644 --- a/quantara/soroban/contracts/rewards/src/lib.rs +++ b/quantara/soroban/contracts/rewards/src/lib.rs @@ -150,7 +150,7 @@ mod tests { let init = MockAuthInvoke { contract: &contract_id, fn_name: "initialize", - args: vec![&env], + args: vec![&env, symbol_short!("init").to_val()], sub_invokes: &[], }; env.mock_auths(&[MockAuth {