Skip to content

feat: resolve issues #714, #715, #716, and #717 - #729

Merged
Jaydbrown merged 1 commit into
conduit-protocol:mainfrom
mhikel66:feat/issues-714-715-716-717
Sep 27, 2026
Merged

Jaydbrown merged 1 commit into
conduit-protocol:mainfrom
mhikel66:feat/issues-714-715-716-717

Conversation

@mhikel66

Copy link
Copy Markdown
Contributor

Summary

This PR addresses and resolves issues #714, #715, #716, and #717 across the contracts:

1. #714: tests/factory_deploy.rs: add test for stream deployment failure on duplicate salt

  • Updated drip_factory::deploy::deploy_stream to record and verify that salt has not already been used (DataKey::SaltUsed(salt)).
  • Returns Error::SaltAlreadyUsed (code 32) when duplicate deployment salt is attempted.
  • Added regression test test_deploy_stream_duplicate_salt_fails in tests/factory_deploy.rs.

2. #715: contracts/stream: add get_stream_summary query returning all state in a single call

  • Added StreamStatus enum (Pending = 0, Active = 1, Paused = 2, Cancelled = 3, Completed = 4) and StreamSummary struct in contracts/stream/src/storage.rs.
  • Implemented get_summary(env: Env) -> StreamSummary and alias get_stream_summary(env: Env) -> StreamSummary returning { sender, recipient, token, total_amount, streamed_amount, status, start_time, stop_time }.
  • Added unit test test_get_summary_returns_consolidated_state in contracts/stream/src/tests.rs.

3. #716: contracts/oracle: add support for inverted price calculation (e.g. XLM/USDC to USDC/XLM)

  • Defined PRICE_PRECISION = 100_000_000 (8 decimals).
  • Added PairPrice(Address, Address) and PairPriceSymbol(Symbol, Symbol) to DataKey.
  • Implemented set_price, get_price, get_price_inverted (and symbol variants set_price_symbol, get_price_symbol, get_price_inverted_symbol).
  • When a direct feed (base, quote) is not present, get_price_inverted computes (PRICE_PRECISION^2 / price) from the reciprocal pair (quote, base). Returns Error::PriceNotFound if neither feed exists.
  • Added comprehensive unit tests in contracts/oracle/src/lib.rs.

4. #717: contracts/batch-processor: implement reentrancy protection on all batch execution paths

  • Added ReentrancyForbidden = 10 error variant and DataKey::ReentrancyLock in contracts/batch-processor/src/lib.rs.
  • Guarded process_batch with a temporary storage reentrancy lock, clearing it upon completion.
  • Added unit test test_reentrancy_lock_blocks_concurrent_execution in contracts/batch-processor/src/tests.rs.

Verification

  • cargo test --workspace: all unit and integration tests passed.
  • cargo clippy --all-targets --all-features -- -D warnings: passed cleanly with zero warnings.
  • cargo fmt --all -- --check: passed cleanly.
  • python3 scripts/validate-error-codes.py: validated with zero errors.

Closes #714
Closes #715
Closes #716
Closes #717

…uit-protocol#716, and conduit-protocol#717

- Issue conduit-protocol#714: tests/factory_deploy.rs: add test for stream deployment failure on duplicate salt
  * Return Error::SaltAlreadyUsed when deployment salt was previously used.
  * Added regression test `test_deploy_stream_duplicate_salt_fails`.

- Issue conduit-protocol#715: contracts/stream: add get_stream_summary query returning all state in a single call
  * Implemented `get_summary` (and alias `get_stream_summary`) returning `StreamSummary`.
  * Returns sender, recipient, token, total_amount, streamed_amount, status, start_time, stop_time.
  * Added unit test `test_get_summary_returns_consolidated_state`.

- Issue conduit-protocol#716: contracts/oracle: add support for inverted price calculation
  * Added `get_price_inverted` and `get_price_inverted_symbol` calculating `PRICE_PRECISION^2 / price` when direct feed is not found.
  * Added `Error::PriceNotFound` for missing pair queries.
  * Added unit tests for direct and inverted price lookups.

- Issue conduit-protocol#717: contracts/batch-processor: implement reentrancy protection on all batch execution paths
  * Set `DataKey::ReentrancyLock` in temporary storage during `process_batch` execution.
  * Return `Error::ReentrancyForbidden` when reentrancy is detected.
  * Added unit test `test_reentrancy_lock_blocks_concurrent_execution`.

Closes conduit-protocol#714, Closes conduit-protocol#715, Closes conduit-protocol#716, Closes conduit-protocol#717
@mhikel66
mhikel66 requested a review from Jaydbrown as a code owner September 27, 2026 22:48
@drips-wave

drips-wave Bot commented Sep 27, 2026

Copy link
Copy Markdown

@mhikel66 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Jaydbrown
Jaydbrown merged commit dabec97 into conduit-protocol:main Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants