Completed clean root directory structure: - Root now contains only: .git, .env, docs/, orig/ - Moved all remaining files and directories to orig/: - Config files (.claude, .dockerignore, .drone.yml, etc.) - All .env variants (except active .env) - Git config (.gitconfig, .github, .gitignore, etc.) - Tool configs (.golangci.yml, .revive.toml, etc.) - Documentation (*.md files, @prompts) - Build files (Dockerfiles, Makefile, go.mod, go.sum) - Docker compose files - All source directories (scripts, tests, tools, etc.) - Runtime directories (logs, monitoring, reports) - Dependency files (node_modules, lib, cache) - Special files (--delete) - Removed empty runtime directories (bin/, data/) V2 structure is now clean: - docs/planning/ - V2 planning documents - orig/ - Complete V1 codebase preserved - .env - Active environment config (not in git) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
73 lines
1.7 KiB
Bash
Executable File
73 lines
1.7 KiB
Bash
Executable File
#!/bin/bash
|
|
# Run all MEV bot tests
|
|
|
|
set -e
|
|
|
|
echo "🧪 Starting MEV Bot Test Suite"
|
|
|
|
# Configuration
|
|
ARBITRUM_RPC_URL="https://arb1.arbitrum.io/rpc"
|
|
FORK_BLOCK_NUMBER="latest"
|
|
ANVIL_PORT="8545"
|
|
ANVIL_CHAIN_ID="31337"
|
|
|
|
# Start Anvil in background
|
|
echo "🔄 Starting Anvil fork..."
|
|
anvil \
|
|
--fork-url "$ARBITRUM_RPC_URL" \
|
|
--fork-block-number "$FORK_BLOCK_NUMBER" \
|
|
--port "$ANVIL_PORT" \
|
|
--chain-id "$ANVIL_CHAIN_ID" \
|
|
--accounts 10 \
|
|
--balance 1000 \
|
|
--gas-limit 30000000 \
|
|
--code-size-limit 50000 \
|
|
--silent \
|
|
> ../logs/anvil.log 2>&1 &
|
|
|
|
ANVIL_PID=$!
|
|
echo "📡 Anvil started with PID: $ANVIL_PID"
|
|
|
|
# Wait for Anvil to be ready
|
|
sleep 3
|
|
|
|
# Function to cleanup
|
|
cleanup() {
|
|
echo "🧹 Cleaning up..."
|
|
kill $ANVIL_PID 2>/dev/null || true
|
|
exit
|
|
}
|
|
|
|
# Set trap for cleanup
|
|
trap cleanup EXIT INT TERM
|
|
|
|
# Check if Anvil is responding
|
|
echo "🔍 Checking Anvil connection..."
|
|
if ! curl -s -X POST --data '{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":1}' http://localhost:$ANVIL_PORT > /dev/null; then
|
|
echo "❌ Anvil is not responding"
|
|
exit 1
|
|
fi
|
|
|
|
echo "✅ Anvil is ready"
|
|
|
|
# Set environment variables for tests
|
|
export ARBITRUM_RPC_URL="$ARBITRUM_RPC_URL"
|
|
export ARBITRUM_RPC_ENDPOINT="http://localhost:$ANVIL_PORT"
|
|
export TEST_MODE="true"
|
|
|
|
# Run Solidity tests
|
|
echo "🔍 Running Solidity tests..."
|
|
cd ..
|
|
if command -v forge &> /dev/null; then
|
|
forge test -vv --fork-url "http://localhost:$ANVIL_PORT"
|
|
else
|
|
echo "⚠️ Foundry not found, skipping Solidity tests"
|
|
fi
|
|
|
|
# Run Go tests against forked environment
|
|
echo "🐹 Running Go integration tests..."
|
|
|
|
cd ..
|
|
go test ./tests/integration/... -v -timeout 300s
|
|
|
|
echo "✅ All tests completed successfully!" |