Skip to content

Latest commit

 

History

History
73 lines (46 loc) · 1.91 KB

File metadata and controls

73 lines (46 loc) · 1.91 KB

Testing Guide

Testing Workflows

  1. Fork Testing - Set up fork testing environment.
  2. Default Test Suite - Run comprehensive validation.
  3. Review Snapshot Diffs - Verify state changes.

Testing Stack

Framework: Foundry (Forge)

Key Features:

  • Fork Testing: Test against live network state
  • Snapshot Diffing: Automated before/after state comparison
  • Gas Reporting: Track execution costs

Dependencies: forge-std, aave-helpers, aave-address-book

Running Tests

# Run all tests
forge test

# Test specific contract
make test-contract filter=ProposalName

See Foundry Book for detailed forge commands.

Fork Testing

Steps:

  1. Selecting Fork Block - Choose recent block
  2. RPC Configuration - Configure endpoints in .env

Selecting Fork Block

Get recent block number:

cast block-number --rpc-url $RPC_AVALANCHE

RPC Configuration

Configure RPC endpoints in .env. Format example:

RPC_MAINNET=https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY
RPC_AVALANCHE=https://avax-mainnet.g.alchemy.com/v2/YOUR_KEY
RPC_ARBITRUM=https://arb-mainnet.g.alchemy.com/v2/YOUR_KEY

Default Test Suite

defaultTest() Function

The defaultTest() helper (from ProtocolV3TestBase) captures before/after state, executes the proposal, generates snapshot diffs, and validates parameters.

Snapshot Diffs

After running tests, review generated diffs in diffs/ directory to verify state changes match proposal specifications.

See Also