datahaven/operator/.gitignore
Ahmad Kaouk 3acbc06c74
test: Native token transfer e2e tests (#120)
### Summary
- **Add** `test/suites/native-token-transfer.test.ts` focused on the
HAVE native token lifecycle via Snowbridge v2.
- **Validate** registration, DataHaven → Ethereum mints, Ethereum →
DataHaven unlocks, event emission, and 1:1 backing invariant.

### Tests added
- should register DataHaven native token on Ethereum
- should transfer tokens from DataHaven to Ethereum
- should maintain 1:1 backing ratio
- should emit transfer events
- should transfer tokens from Ethereum to DataHaven (Snowbridge v2)

### What the suite covers
- **Registration**: Sudo-registers the native token; confirms
`ForeignTokenRegistered` on the Gateway; verifies ERC-20 metadata
(`HAVE`/`wHAVE`, 18 decimals).
- **DataHaven → Ethereum**: Executes `transfer_to_ethereum`; asserts
Substrate events (`TokensLocked`, `TokensTransferredToEthereum`);
observes Ethereum `Transfer` mint (from zero address); validates sender
balance delta, sovereign account increase, and ERC-20 recipient credit.
- **Backing invariant**: Ensures sovereign account balance ≥ ERC-20
total supply.
- **Event emission**: Confirms key Substrate events without polling
delays.
- **Ethereum → DataHaven**: Approves and calls `Gateway.sendToken`; if
unsupported locally, the test skips; otherwise asserts burn on Ethereum
and unlock on DataHaven with corresponding balance deltas.

---------

Co-authored-by: Steve Degosserie <723552+stiiifff@users.noreply.github.com>
2025-08-22 18:27:14 +02:00

34 lines
No EOL
377 B
Text

# MacOS thing
**/.DS_Store
# Rust directories
target
# Typescript directories
**/node_modules
**/.yarn
# Spec/Wasm build directory
/build/
# Moonbeam-Launch
*.log
tools/specFiles
tools/*-local.json
tools/*-local-raw.json
tools/build
# RustRover
.idea/
# VSCode
.vscode/
# Environment variables
.env
# Temporary files
**/tmp
# Local CLAUDE configuration
CLAUDE.local.md