Skip to content

Add testnet faucet hook generating deterministic test holders for integration suites #476

Description

@thlpkee20-wq

Description

Integration tests today wire up holders manually. Add a testnet-only faucet_seed_holders(offering_id, count) that allocates deterministic addresses with documented BPS distribution, so external test suites can pin against a known seed.

Requirements and context

  • Must be secure, tested, and documented
  • Should be efficient and easy to review
  • Relevant code: Revora-Contracts/src/test_utils.rs, TESTNET_MODE.md
  • Faucet must reject when testnet_mode == false

Suggested execution

  • Fork the repo and create a branch
  • git checkout -b feat/testnet-faucet-seed
  • Implement changes
    • Gate behind is_testnet_mode() and panic on mainnet
    • Use env.crypto().sha256(seed || idx) to derive addresses
    • Emit faucet_seed events
  • Validate security and correctness assumptions

Test and commit

  • Run tests
    • cargo test --all
  • Cover edge cases
    • Invocation outside testnet must error TestnetOnly
  • Include test output and security notes

Example commit message

feat: add testnet-only faucet_seed_holders for integration suites

Guidelines

  • Minimum 95 percent test coverage
  • Clear documentation
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions