diff --git a/hook/genesis/build_xahau_h.sh b/hook/genesis/build_xahau_h.sh index b930cd259..438b1ee72 100755 --- a/hook/genesis/build_xahau_h.sh +++ b/hook/genesis/build_xahau_h.sh @@ -42,7 +42,7 @@ trap cleanup EXIT INT TERM # Tool verification echo -e "${BLUE}==> Checking required tools...${NC}" -REQUIRED_TOOLS=("make" "xxd" "sed" "clang-format") +REQUIRED_TOOLS=("make" "xxd" "sed" "clang-format" "wasm-opt") for tool in "${REQUIRED_TOOLS[@]}"; do if ! command -v "${tool}" &> /dev/null; then echo -e "${RED}Error: Required tool '${tool}' not found${NC}" >&2 @@ -51,6 +51,14 @@ for tool in "${REQUIRED_TOOLS[@]}"; do echo -e "${GREEN} ✓ ${tool}${NC}" done +# Verify wasm-opt version is exactly 100 +WASM_OPT_VERSION=$(wasm-opt --version | grep -oE '[0-9]+' | head -1) +if [ "${WASM_OPT_VERSION}" != "100" ]; then + echo -e "${RED}Error: wasm-opt version must be 100, but found ${WASM_OPT_VERSION}${NC}" >&2 + exit 1 +fi +echo -e "${GREEN} ✓ wasm-opt version 100${NC}" + # Verify xahau.h exists if [ ! -f "${XAHAU_H}" ]; then echo -e "${RED}Error: xahau.h not found at ${XAHAU_H}${NC}" >&2