Skip to content

test(router-execution): add simulate() success path coverage (Closes #956) - #980

Merged
Maki-Zeninn merged 1 commit into
Maki-Zeninn:mainfrom
believetimothy:router-execution
Aug 3, 2026
Merged

test(router-execution): add simulate() success path coverage (Closes #956)#980
Maki-Zeninn merged 1 commit into
Maki-Zeninn:mainfrom
believetimothy:router-execution

Conversation

@believetimothy

Copy link
Copy Markdown

Summary

Adds test_simulate_success_path to exercise the success branch of simulate() where try_invoke_contract returns Ok(_).

Problem

Existing simulate tests (test_simulate_nonexistent_contract_fails, test_simulate_returns_message_on_failure) only exercise the failure branch, where the target is an address with no deployed contract. The success branch (sim_ok == true, message == "simulation succeeded") is never tested.

A regression that flips or breaks the success-path message, or the success/would_fail flags, would go undetected.

Changes

  • New test test_simulate_success_path in contracts/router-execution/src/lib.rs — reuses the existing MockTarget contract (already defined for the execute() success path tests) and calls client.simulate() against its ping() function with empty args.

Assertions

  • result.success == true
  • result.would_fail == false
  • result.message == "simulation succeeded"
  • A simulation_result event is emitted with success=true

Testing

  • New test passes: cargo test test_simulate_success_path
  • All existing tests continue to pass

Closes #956

Add test_simulate_success_path to exercise the success branch of simulate() where try_invoke_contract returns Ok(_).

The test verifies:

- result.success == true

- result.would_fail == false

- result.message == "simulation succeeded"

- simulation_result event is emitted with success=true

Reuses the existing MockTarget contract (already registered for execute() success path tests) and calls client.simulate() against its ping() function with empty args.

Closes Maki-Zeninn#956
@drips-wave

drips-wave Bot commented Jul 30, 2026

Copy link
Copy Markdown

@believetimothy 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

@Maki-Zeninn
Maki-Zeninn merged commit 05f3e29 into Maki-Zeninn:main Aug 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(router-execution): add test for simulate() success path (message and success flag)

2 participants