Files
gru_emoney_token-factory/tools/validate-storage-layout.sh
defiQUG e8ae376e90 Enhance API services with validation and error handling improvements
- Integrated Zod validation schemas across various API routes to ensure input integrity and improve error handling.
- Updated `mapping-service`, `orchestrator`, `packet-service`, and `webhook-service` to utilize validation middleware for request parameters and bodies.
- Improved error handling in webhook management, packet generation, and compliance routes to provide clearer feedback on request failures.
- Added new validation schemas for various endpoints, enhancing overall API robustness and maintainability.
- Updated dependencies in `package.json` to include the new validation library.
2025-12-12 20:23:45 -08:00

48 lines
1.4 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# Storage Layout Validation Script for eMoneyToken Upgrades
set -e
echo "🔍 Validating storage layout for eMoneyToken upgrade..."
# Check if forge is installed
if ! command -v forge &> /dev/null; then
echo "❌ Error: forge not found. Please install Foundry."
exit 1
fi
# Build contracts
echo "📦 Building contracts..."
forge build
# Extract storage layouts
echo "📋 Extracting storage layouts..."
STORAGE_LAYOUT=$(forge inspect eMoneyToken storage-layout --pretty)
if [ -z "$STORAGE_LAYOUT" ]; then
echo "❌ Error: Could not extract storage layout"
exit 1
fi
echo "$STORAGE_LAYOUT" > storage-layout-current.txt
echo "✅ Storage layout saved to storage-layout-current.txt"
# If reference layout exists, compare
if [ -f "storage-layout-reference.txt" ]; then
echo "🔬 Comparing with reference layout..."
if diff -u storage-layout-reference.txt storage-layout-current.txt > storage-layout-diff.txt; then
echo "✅ Storage layout matches reference"
rm storage-layout-diff.txt
else
echo "⚠️ Storage layout differs from reference. See storage-layout-diff.txt"
cat storage-layout-diff.txt
exit 1
fi
else
echo " No reference layout found. Saving current layout as reference..."
cp storage-layout-current.txt storage-layout-reference.txt
fi
echo "✅ Validation complete"