#!/usr/bin/env bash
# Install with: git config core.hooksPath .githooks

set -euo pipefail

echo "Running cargo fmt --all --check..."
cargo fmt --all --check

echo "Running cargo clippy --workspace --all-targets..."
cargo clippy --workspace --all-targets -- -D warnings

echo "Running cargo test --workspace..."
cargo test --workspace

# Ensure dynamic key width compiles and tests at 32 bytes as well.
echo "Running cargo test with ROLLBLOCK_KEY_BYTES=32..."
ROLLBLOCK_KEY_BYTES=32 cargo test --workspace
