datahaven/test/moonwall/helpers
Steve Degosserie 506471db24
feat(test): expand Moonwall test coverage with balance and precompile tests (#414)
## Summary

- Import and adapt balance tests from Moonbeam's test suite for
DataHaven runtime compatibility
- Add comprehensive precompile tests covering ERC20, modexp, proxy,
identity, and cryptographic precompiles
- Add helper utilities for precompile testing including address
constants and contract call wrappers

## Changes

### Balance Tests
- `test-balance-existential.ts` - Existential deposit behavior
- `test-balance-extrinsics.ts` - Balance extrinsics (transfer,
force_transfer)
- `test-balance-genesis.ts` - Genesis balance verification
- `test-balance-transfer.ts` - Various transfer scenarios

### Precompile Tests
- **ERC20**: Native token interface tests including overflow handling
- **Modexp**: Comprehensive modular exponentiation tests with extensive
test vectors
- **Proxy**: Proxy account management and proxy call tests
- **Identity**: Full identity precompile test coverage (14 test files)
- **Cryptographic**: blake2, bn128add, bn128mul, bn128pairing,
ecrecover, ripemd160, sha3fips
- **Preimage**: Preimage noting and unnoting tests

### Helper Utilities
- `precompile-addresses.ts` - Precompile address constants
- `precompile-contract-calls.ts` - Typed contract call helpers (Preimage
class)
- `modexp.ts` - Modexp test utilities

### Runtime Fixes
- Fix Ethan's address in genesis presets to match Moonwall util
constants

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Ahmad Kaouk <56095276+ahmadkaouk@users.noreply.github.com>
Co-authored-by: Ahmad Kaouk <ahmadkaouk.93@gmail.com>
2026-02-02 15:42:14 +01:00
..
block.ts refactor(test): reorganize e2e test suites (#373) 2026-01-20 15:52:33 +02:00
constants.ts feat(test): expand Moonwall test coverage with balance and precompile tests (#414) 2026-02-02 15:42:14 +01:00
contracts.ts refactor(test): reorganize e2e test suites (#373) 2026-01-20 15:52:33 +02:00
eth-transactions.ts refactor(test): reorganize e2e test suites (#373) 2026-01-20 15:52:33 +02:00
evm.ts refactor(test): reorganize e2e test suites (#373) 2026-01-20 15:52:33 +02:00
expect.ts refactor(test): reorganize e2e test suites (#373) 2026-01-20 15:52:33 +02:00
fees.ts refactor(test): reorganize e2e test suites (#373) 2026-01-20 15:52:33 +02:00
index.ts feat(test): expand Moonwall test coverage with balance and precompile tests (#414) 2026-02-02 15:42:14 +01:00
modexp.ts feat(test): expand Moonwall test coverage with balance and precompile tests (#414) 2026-02-02 15:42:14 +01:00
parameters.ts refactor(test): reorganize e2e test suites (#373) 2026-01-20 15:52:33 +02:00
precompile-addresses.ts feat(test): expand Moonwall test coverage with balance and precompile tests (#414) 2026-02-02 15:42:14 +01:00
precompile-contract-calls.ts feat(test): expand Moonwall test coverage with balance and precompile tests (#414) 2026-02-02 15:42:14 +01:00
transactions.ts refactor(test): reorganize e2e test suites (#373) 2026-01-20 15:52:33 +02:00