Commit graph

4 commits

Author SHA1 Message Date
Steve Degosserie
b45009f62d
test: Port Moonbeam Moonwall E2E test suites to DataHaven (#436)
## Summary
- Port 16 Moonbeam Moonwall E2E test suites to DataHaven, covering
proxy, multisig, sudo, txpool, receipts, precompiles, polkadot-js API,
and node RPC
- Adapt all tests for DataHaven runtime differences: 2 inherents
(timestamp + randomness) instead of Moonbeam's 4, different event
ordering/counts from fee/treasury handling, no PoV constraints
- Use resilient event-based lookups (`.find()`/`.some()`) instead of
hardcoded array indices throughout
- Add supporting Solidity contracts: `FailingConstructor`, `StorageLoop`

## New test suites
| Suite | Category | Tests |
|-------|----------|-------|
| `test-proxy-balance` | common/proxy | Proxy with Balances type |
| `test-proxy` | stagenet/proxy | Add/remove proxy, delayed & announced
proxy (7 tests) |
| `test-multisigs` | stagenet/multisig | Creation, approval, execution,
cancellation |
| `test-sudo` | stagenet/sudo | Dispatch, sudoAs, set/remove key |
| `test-polkadot-api` | stagenet/polkadot-js | Genesis, headers,
transfers, extrinsics, events |
| `test-polkadot-chain-info` | stagenet/polkadot-js | Chain name/type
queries |
| `test-node-rpc-peer` | stagenet/node-rpc | `system_peers` RPC |
| `test-precompile-bn128-bounds` | stagenet/precompile | bn128
add/mul/pairing edge cases |
| `test-receipt` | stagenet/receipt | Receipt fields, effective gas
price |
| `test-receipt-revert` | stagenet/receipt | Receipt for reverted
transactions |
| `test-evm-store-storage-growth` | stagenet/storage-growth | EVM SSTORE
storage growth |
| `test-txpool-future` | stagenet/txpool | Future transaction pool |
| `test-txpool-pending` | stagenet/txpool | Pending transaction pool |

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 22:38:38 +02:00
Steve Degosserie
ae5deb41e0
feat(node): add Ethereum pub/sub RPC API (#435)
## Summary

- Wire the Frontier `EthPubSub` module into the node's RPC layer,
enabling WebSocket-based `eth_subscribe`/`eth_unsubscribe` support for
`newHeads`, `logs`, and `newPendingTransactions`
- Use Ethereum-style hex (`0x`-prefixed) subscription IDs via
`EthereumSubIdProvider` for client compatibility
- Add Moonwall test suites (adapted from Moonbeam) covering block header
subscriptions, log filtering (by address, topics, wildcards, conditional
parameters), and pending transaction notifications

## Changes

### `operator/node/src/rpc.rs`
- Import and merge `EthPubSub` / `EthPubSubApiServer` into the RPC
module
- Accept `subscription_task_executor` and `pubsub_notification_sinks`
parameters in `create_full()`
- Remove stale commented-out boilerplate

### `operator/node/src/service.rs`
- Clone `pubsub_notification_sinks` and forward it (along with
`subscription_executor`) into the RPC factory closure
- Set `config.rpc.id_provider` to `EthereumSubIdProvider` for
Ethereum-compatible subscription IDs

### `test/moonwall/suites/dev/stagenet/subscription/`
- `test-subscription.ts` — `newHeads`: subscription ID format, block
header field validation
- `test-subscription-logs.ts` — `logs`: basic log notification on
contract deployment
- `test-subscription-logs2.ts` — `logs`: filtering by single/multiple
addresses, topics, wildcards, conditional and combined parameters (8
cases)
- `test-subscription-pending.ts` — `newPendingTransactions`: pending tx
hash notification

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Ahmad Kaouk <56095276+ahmadkaouk@users.noreply.github.com>
2026-02-10 10:12:16 +01:00
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
Steve Degosserie
17c215d047
refactor(test): reorganize e2e test suites (#373)
## Summary

Reorganizes the test directory structure for better clarity and
maintainability:

- **Rename `test/datahaven/` → `test/moonwall/`**: Clearly identifies
these as Moonwall single-node tests
- **Move `test/framework/` → `test/e2e/framework/`**: Groups e2e test
utilities under a dedicated folder
- **Move `test/suites/` → `test/e2e/suites/`**: Groups e2e test suites
with the framework
- **Add `test/e2e/framework/validators.ts`**: Extracts validator test
helpers from utils into the e2e framework
- **Update documentation**: README.md and E2E_FRAMEWORK_OVERVIEW.md
reflect the new structure

### New Directory Structure

```
test/
├── e2e/
│   ├── suites/          # E2E test suites (Kurtosis-based)
│   └── framework/       # E2E test utilities & helpers
├── moonwall/            # Moonwall single-node tests
├── launcher/            # Network deployment tools
└── ...
```

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-20 15:52:33 +02:00