datahaven/operator/scripts/test_message_encoding.sh
Ahmad Kaouk 5db1f4ee74
refactor: cleanup obsolete test folder (#166)
### Summary
Removes the obsolete `operator/test` folder that was no longer being
used and contained outdated test scripts.

### Changes
-  Deleted `operator/test/` directory and all contents
-  Moved `test_message_encoding.sh` script to `operator/scripts/` for
proper organization
-  Updated comment reference in `contracts/test/MessageEncoding.t.sol`
to point to new script location

### Impact
- **No breaking changes** - All legitimate test files remain properly
organized within their respective pallets
- **Cleaner codebase** - Removes unused/obsolete code
2025-09-17 14:21:55 +02:00

30 lines
No EOL
1.1 KiB
Bash
Executable file

#!/bin/bash
# This script is used to test the message encoding for the snowbridge message processor.
# You can pass the -v flag to run the test with a more verbose output.
set -e
echo "🚀 Starting message encoding test..."
cd ../../../
echo "📁 Changed to contracts directory"
cd contracts
echo "🔨 Compiling contracts with forge..."
forge build --force
echo "✅ Contracts compiled successfully"
mkdir -p ../operator/primitives/bridge/test_data
echo "📂 Create test_data directory if doesn't exist"
echo "🔧 Running forge test to generate ReceiveValidators encoded message..."
forge test --match-test testEncodeReceiveValidatorsMessage -vvv | grep -A 10 "Logs:" | grep -E "0x[a-fA-F0-9]+" | tail -n 1 | sed 's/0x//' | xxd -r -p > ../operator/primitives/bridge/test_data/receive_validators_message.bin
echo "💾 Generated receive_validators_message.bin file"
cd ../operator
echo "📁 Changed to operator directory"
echo "🧪 Running cargo test for snowbridge message processor..."
cargo test --test snowbridge_message_processor ${1:+-v -- --nocapture}
echo "✅ Cargo test completed successfully!"