Files
mev-beta/scripts/test-fixes.sh

70 lines
1.8 KiB
Bash
Executable File

#!/bin/bash
# Test script for MEV Bot fixes
echo "Testing MEV Bot fixes..."
# Run the setup script
./setup-env.sh
# Test environment variables
echo "Testing environment variables..."
if [ -f .env ]; then
source .env
echo "✓ .env file exists"
else
echo "✗ .env file missing"
exit 1
fi
# Check required variables
required_vars=("ARBITRUM_RPC_ENDPOINT" "MEV_BOT_ENCRYPTION_KEY")
missing_vars=()
for var in "${required_vars[@]}"; do
if [ -z "${!var}" ]; then
missing_vars+=("$var")
fi
done
if [ ${#missing_vars[@]} -eq 0 ]; then
echo "✓ All required environment variables are set"
else
echo "✗ Missing environment variables: ${missing_vars[*]}"
exit 1
fi
# Test configuration files
echo "Testing configuration files..."
if [ -f config/config.yaml ]; then
echo "✓ config.yaml exists"
else
echo "✗ config.yaml missing"
exit 1
fi
if [ -f config/initial_markets.yaml ]; then
echo "✓ initial_markets.yaml exists"
else
echo "✗ initial_markets.yaml missing"
exit 1
fi
# Test rate limiting configuration
echo "Checking rate limiting configuration..."
requests_per_second=$(grep "requests_per_second:" config/config.yaml | awk '{print $2}' | head -1)
if [ "$requests_per_second" -le 5 ]; then
echo "✓ Rate limiting is properly configured (RPS: $requests_per_second)"
else
echo "✗ Rate limiting may be too high (RPS: $requests_per_second)"
fi
# Test market scan configuration
echo "Checking market scan configuration..."
max_blocks_back=$(grep "max_blocks_back:" config/initial_markets.yaml | awk '{print $2}')
if [ "$max_blocks_back" -le 1000 ]; then
echo "✓ Market scan block range is properly configured ($max_blocks_back blocks)"
else
echo "✗ Market scan block range may be too high ($max_blocks_back blocks)"
fi
echo "All tests completed!"