PR: #41 (feat/executor: transaction builder + eth_call simulator)
File: crates/charon-executor/src/simulation.rs
Refs #41
Problem
CLAUDE.md safety invariant: "every liquidation transaction passes an eth_call simulation gate before broadcast."
simulation.rs contains one test: simulator_holds_addresses, which asserts that two addresses are stored in a struct. It does not call simulate() at all. There is no test that:
- Runs simulate() with valid liquidation calldata against a BSC fork — expecting Ok.
- Runs simulate() with invalid calldata (wrong protocolId, zero repay) — expecting Err.
- Verifies that an onlyOwner revert is correctly surfaced when sender != owner.
- Verifies that the gas_limit forwarding (once fixed per the companion issue) gates OOG scenarios.
Without these tests, the gate is structurally present but its correctness against real-world revert conditions is entirely unverified.
Fix
Add fork tests gated behind BSC_FORK_URL env var, following the pattern in crates/charon-protocols/tests/venus_live.rs:
#[tokio::test]
#[ignore = "requires BSC_FORK_URL"]
async fn simulate_valid_liquidation_succeeds() { ... }
#[tokio::test]
#[ignore = "requires BSC_FORK_URL"]
async fn simulate_wrong_sender_fails_onlyowner() { ... }
PR: #41 (feat/executor: transaction builder + eth_call simulator)
File: crates/charon-executor/src/simulation.rs
Refs #41
Problem
CLAUDE.md safety invariant: "every liquidation transaction passes an eth_call simulation gate before broadcast."
simulation.rs contains one test: simulator_holds_addresses, which asserts that two addresses are stored in a struct. It does not call simulate() at all. There is no test that:
Without these tests, the gate is structurally present but its correctness against real-world revert conditions is entirely unverified.
Fix
Add fork tests gated behind BSC_FORK_URL env var, following the pattern in crates/charon-protocols/tests/venus_live.rs: