Skip to content

fix(#838,#837,#836,#835): wire commit_ip RPC, document registry.rs, a… - #941

Open
ahmadrabiumustapha wants to merge 1 commit into
AtomicIP:mainfrom
ahmadrabiumustapha:issue/838-837-836-835
Open

fix(#838,#837,#836,#835): wire commit_ip RPC, document registry.rs, a…#941
ahmadrabiumustapha wants to merge 1 commit into
AtomicIP:mainfrom
ahmadrabiumustapha:issue/838-837-836-835

Conversation

@ahmadrabiumustapha

Copy link
Copy Markdown

…dd rollback+fee-asset tests

#838 - Wire commit_ip handler to Soroban RPC

  • Add api-server/src/soroban_rpc.rs with commit_ip client, SorobanError enum, and error classifier (maps contract error codes to typed variants)
  • Replace TODO stub in handlers::commit_ip with full soroban_rpc::commit_ip call; map every SorobanError variant to the correct HTTP status code (400 ZeroHash, 409 Conflict duplicate, 403 Forbidden, 410 Gone, etc.)
  • Register soroban_rpc module in lib.rs and main.rs
  • Add commit_ip integration tests: payload validation, zero-hash guard, hash-length check, error→HTTP mapping table, success type check

#837 - Document registry.rs role and relationship to ip_registry

  • Add module-level doc comment to registry.rs clarifying it is a cross-contract adapter, not an independent registry
  • Add '🗂️ registry.rs' section to docs/architecture.md with a function table and ASCII call-graph showing the adapter→ip_registry relationship

#836 - Multi-currency and cross-contract rollback tests

  • Add multi-currency rollback tests (XLM, USDC, EURC) in rollback_tests.rs confirming the 90% buyer refund works for every settlement token
  • Add contract-balance check: no residual buyer funds after rollback
  • Add cross-contract rollback tests: IP ownership stays with seller, ActiveSwap index is cleared (re-listing allowed), RolledBack ≠ Cancelled

#835 - Fee-asset consistency for multi-currency swaps

  • Document fee-asset policy in multi_currency.rs module header with rationale, policy rules, and a scenario table
  • Add fee_asset field to MultiCurrencyConfig (defaults to XLM)
  • Add validate_fee_asset() (panics with InvalidFeeAsset on mismatch)
  • Add is_valid_fee_asset() boolean predicate for off-chain callers
  • Add InvalidFeeAsset = 66 to ContractError in lib.rs and errors.rs
  • Add 11 fee-asset tests covering XLM/USDC/EURC accepted and rejected combinations, reconfiguration, and the settlement-vs-fee independence invariant

.gitignore - expand to exclude wasm outputs, .stellar/, node_modules/, coverage/, criterion/, fuzz corpus subdirs
closes #835
closes #836
closes #837
closes #838

…_ip RPC, document registry.rs, add rollback+fee-asset tests

AtomicIP#838 - Wire commit_ip handler to Soroban RPC
- Add api-server/src/soroban_rpc.rs with commit_ip client, SorobanError
  enum, and error classifier (maps contract error codes to typed variants)
- Replace TODO stub in handlers::commit_ip with full soroban_rpc::commit_ip
  call; map every SorobanError variant to the correct HTTP status code
  (400 ZeroHash, 409 Conflict duplicate, 403 Forbidden, 410 Gone, etc.)
- Register soroban_rpc module in lib.rs and main.rs
- Add commit_ip integration tests: payload validation, zero-hash guard,
  hash-length check, error→HTTP mapping table, success type check

AtomicIP#837 - Document registry.rs role and relationship to ip_registry
- Add module-level doc comment to registry.rs clarifying it is a
  cross-contract adapter, not an independent registry
- Add '🗂️ registry.rs' section to docs/architecture.md with a function
  table and ASCII call-graph showing the adapter→ip_registry relationship

AtomicIP#836 - Multi-currency and cross-contract rollback tests
- Add multi-currency rollback tests (XLM, USDC, EURC) in rollback_tests.rs
  confirming the 90% buyer refund works for every settlement token
- Add contract-balance check: no residual buyer funds after rollback
- Add cross-contract rollback tests: IP ownership stays with seller,
  ActiveSwap index is cleared (re-listing allowed), RolledBack ≠ Cancelled

AtomicIP#835 - Fee-asset consistency for multi-currency swaps
- Document fee-asset policy in multi_currency.rs module header with
  rationale, policy rules, and a scenario table
- Add fee_asset field to MultiCurrencyConfig (defaults to XLM)
- Add validate_fee_asset() (panics with InvalidFeeAsset on mismatch)
- Add is_valid_fee_asset() boolean predicate for off-chain callers
- Add InvalidFeeAsset = 66 to ContractError in lib.rs and errors.rs
- Add 11 fee-asset tests covering XLM/USDC/EURC accepted and rejected
  combinations, reconfiguration, and the settlement-vs-fee independence
  invariant

.gitignore - expand to exclude wasm outputs, .stellar/, node_modules/,
coverage/, criterion/, fuzz corpus subdirs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant