feat: add integration tests for stellar contracts#105
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (20)
📝 WalkthroughWalkthroughThis pull request introduces Stellar/Soroban integration test infrastructure for ProofBridge, including fixture generation for cryptographic proofs, test snapshots, comprehensive integration tests across four smart contracts, and supporting configuration updates. Changes
Sequence DiagramsequenceDiagram
participant FG as Fixture Generator
participant CC as Noir Circuit
participant PM as Proof Manager
participant IT as Integration Test
participant SC as Stellar Contracts
participant PV as Proof Verifier
FG->>FG: Load deposit circuit & init Barretenberg
FG->>FG: Derive test secrets & compute order hashes
FG->>PM: Build MMR & compute proofs
FG->>CC: Execute circuit (bridger & ad-creator variants)
FG->>PM: Generate UltraHonk proofs
FG->>FG: Write proof/params binaries & JSON fixtures
IT->>SC: Deploy TokenContract (deterministic address)
IT->>SC: Deploy & register merkle-manager
IT->>SC: Deploy & initialize ad-manager
IT->>SC: Deploy & initialize order-portal
IT->>SC: Lock order in ad-manager
IT->>SC: Retrieve Merkle root & order hash
IT->>PV: Submit bridger proof + public inputs
PV->>PV: Verify proof signature & nullifier
PV-->>IT: Proof valid
IT->>SC: Unlock order with bridger proof
SC-->>IT: Order status = Filled
IT->>PV: Submit ad-creator proof + public inputs
PV->>PV: Verify proof signature & nullifier
PV-->>IT: Proof valid
IT->>SC: Unlock order in order-portal
SC-->>IT: Order status = Filled
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Suggested reviewers
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Title: Add Stellar/Soroban contracts with end-to-end integration tests
Summary
generate_fixtures.ts) that produces deterministic UltraHonk ZK proofs, Poseidon2-based MMR roots, and EIP-712 order hashes — all using native Stellar strkey addresses (C... for contracts/tokens, G... for users)What's tested (5 e2e tests)
test_ad_manager_lock_for_order— locks an order on the ad chain, verifies order hash and merkle root match fixturestest_ad_manager_unlock_with_bridger_proof— unlocks with the bridger's ZK proof, verifies order status transitions to Filledtest_order_portal_create_and_unlock— creates order on the order chain, unlocks with the ad creator's ZK prooftest_full_cross_chain_flow— full round-trip across both chains: lock → create → bridger unlock → ad creator unlocktest_nullifier_prevents_double_unlock— verifies nullifier replay protectionKey design decisions
verify_ed25519_signature(not mockable viamock_all_auths)stellar-tokenscrate'sFungibleTokentrait for test tokens deployed at deterministic addressestest_params.json, so regenerating fixtures doesn't require Rust code changesTest plan
cargo test --test integration_test)cargo test)npx tsx generate_fixtures.ts)Summary by CodeRabbit
Tests
Chores