#!/bin/sh set -eu root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd) manifest="$root/docs/archive/upstream/manifest.txt" [ -f "$manifest" ] || { echo "missing contract manifest" >&2; exit 1; } bundle=$(sed -n 's/^active_bundle=//p' "$manifest") [ -n "$bundle" ] || { echo "missing active contract bundle" >&2; exit 1; } [ -d "$root/docs/archive/upstream/$bundle" ] || { echo "missing archived contract directory: $bundle" >&2; exit 1; } cd "$root" grep '^sha256=' "$manifest" | sed -e 's/^sha256=//' -e "s% contracts/upstream/$bundle/% docs/archive/upstream/$bundle/%" | sha256sum -c - bash scripts/check-current-contracts.sh go test ./contracts ./internal/contract ./internal/ai