Description
Integration test suites need a faucet_reset(seed) primitive that deterministically restores the faucet to an initial state, so tests can be re-run without stale state.
Requirements and context
- Must be secure, tested, and documented
- Should be efficient and easy to review
- Relevant code:
src/test_faucet_seed.rs, TESTNET_MODE.md
- Reset must only be callable when testnet_mode is enabled
Suggested execution
- Fork the repo and create a branch
git checkout -b feat/faucet-reset
- Implement changes
- Add
faucet_reset(seed) gated on testnet_mode
- Clear per-address cooldowns and metrics
- Emit
faucet_reset event with seed
- Validate security and correctness assumptions
Test and commit
- Run tests
- Cover edge cases
- Reset called on mainnet must revert
- Include test output and security notes
Example commit message
feat: add deterministic faucet reset primitive
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Description
Integration test suites need a
faucet_reset(seed)primitive that deterministically restores the faucet to an initial state, so tests can be re-run without stale state.Requirements and context
src/test_faucet_seed.rs,TESTNET_MODE.mdSuggested execution
git checkout -b feat/faucet-resetfaucet_reset(seed)gated on testnet_modefaucet_resetevent with seedTest and commit
cargo test --allExample commit message
feat: add deterministic faucet reset primitiveGuidelines