Contract test: multi-hop router with hybrid on one leg #78

Closed
opened 2026-04-09 03:24:08 +00:00 by PlasticDigits · 5 comments
PlasticDigits commented 2026-04-09 03:24:08 +00:00 (Migrated from gitlab.com)

Evidence

  • smartcontracts/contracts/router/src/contract.rs forwards hybrid per TerraSwap

Acceptance criteria

  • cw-multi-test: 2 hops, one with hybrid: Some(_)

Epic

#59

## Evidence - `smartcontracts/contracts/router/src/contract.rs` forwards `hybrid` per `TerraSwap` ## Acceptance criteria - [ ] cw-multi-test: 2 hops, one with `hybrid: Some(_)` ## Epic #59
PlasticDigits commented 2026-04-09 03:24:09 +00:00 (Migrated from gitlab.com)

marked this issue as related to #59

marked this issue as related to #59
PlasticDigits commented 2026-04-09 03:24:09 +00:00 (Migrated from gitlab.com)

marked this issue as related to #61

marked this issue as related to #61
PlasticDigits commented 2026-04-13 04:48:32 +00:00 (Migrated from gitlab.com)

Multi-hop router + hybrid: Added setup_router_abc_env helper (shared A/B + B/C pairs) and router_two_hop_first_leg_hybrid_matches_simulate: resting bid on A/B, router ExecuteSwapOperations with hybrid on hop 1 and pool-only hop 2; asserts SimulateSwapOperations.amount equals net token C received (L8). @brouie please verify contract test run in CI.

**Multi-hop router + hybrid:** Added `setup_router_abc_env` helper (shared A/B + B/C pairs) and `router_two_hop_first_leg_hybrid_matches_simulate`: resting bid on A/B, router `ExecuteSwapOperations` with hybrid on hop 1 and pool-only hop 2; asserts `SimulateSwapOperations.amount` equals net token C received (L8). @brouie please verify contract test run in CI.
Brouie commented 2026-04-20 06:41:26 +00:00 (Migrated from gitlab.com)

@PlasticDigits Verified on current main. Acceptance criteria:

  • cw-multi-test: 2 hops, one with hybrid: Some(_): smartcontracts/tests/src/limit_order_tests.rs has router_two_hop_first_leg_hybrid_matches_simulate using the setup_router_abc_env helper. Ran locally: 1 passed, 0 failed (limit_order_tests::router_two_hop_first_leg_hybrid_matches_simulate ... ok).

Test covers: resting bid on A/B pair, router ExecuteSwapOperations with hybrid on hop 1 and pool-only hop 2, asserts SimulateSwapOperations.amount equals net token C received (L8 parity).

Closing.

@PlasticDigits Verified on current main. Acceptance criteria: - [x] cw-multi-test: 2 hops, one with hybrid: Some(_): smartcontracts/tests/src/limit_order_tests.rs has router_two_hop_first_leg_hybrid_matches_simulate using the setup_router_abc_env helper. Ran locally: **1 passed, 0 failed** (limit_order_tests::router_two_hop_first_leg_hybrid_matches_simulate ... ok). Test covers: resting bid on A/B pair, router ExecuteSwapOperations with hybrid on hop 1 and pool-only hop 2, asserts SimulateSwapOperations.amount equals net token C received (L8 parity). Closing.
Brouie (Migrated from gitlab.com) closed this issue 2026-04-20 06:41:30 +00:00
Brouie commented 2026-04-20 07:26:42 +00:00 (Migrated from gitlab.com)

mentioned in issue #100

mentioned in issue #100
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic#78
No description provided.