Context: Hardening pass before the analytics pivot leans on these contracts more heavily for indexing.
Where:
time-locked-transactions/src/test.rs -- time-locked-transactions has an existing time-locked-transactions/src/test.rs
What to do:
- Add test coverage for that a
ScheduledTransfer is rejected if executed before its unlock ledger, and succeeds after.
- Follow the existing test conventions used elsewhere in the workspace (e.g.
escrow/src/test.rs, governance/src/test.rs) for env/contract setup boilerplate.
Suggested approach:
- Read
time-locked-transactions/src/lib.rs end to end first -- write down every state transition and every Result::Err path before writing a single test, so you're testing behavior you've actually verified exists, not behavior you assume exists.
- Cover the happy path first, then the specific edge case named in this issue, then at least one "should fail" case (wrong caller, wrong state, etc.).
- Use Soroban's test
Env with Env::default() and mock auths (env.mock_all_auths() or targeted auth mocking) matching the pattern already used in sibling test files.
- Add your new test function(s) alongside the existing ones in
time-locked-transactions/src/test.rs, matching its existing setup helpers rather than duplicating them.
Watch out for:
Definition of done:
Context: Hardening pass before the analytics pivot leans on these contracts more heavily for indexing.
Where:
time-locked-transactions/src/test.rs-- time-locked-transactions has an existingtime-locked-transactions/src/test.rsWhat to do:
ScheduledTransferis rejected if executed before its unlock ledger, and succeeds after.escrow/src/test.rs,governance/src/test.rs) for env/contract setup boilerplate.Suggested approach:
time-locked-transactions/src/lib.rsend to end first -- write down every state transition and everyResult::Errpath before writing a single test, so you're testing behavior you've actually verified exists, not behavior you assume exists.EnvwithEnv::default()and mock auths (env.mock_all_auths()or targeted auth mocking) matching the pattern already used in sibling test files.time-locked-transactions/src/test.rs, matching its existing setup helpers rather than duplicating them.Watch out for:
Definition of done:
cargo test -p time-locked-transactionspassescargo test