Files
go-sip/scripts/check-contracts.sh

14 lines
564 B
Bash
Executable File

#!/bin/sh
set -eu
root=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
manifest="$root/contracts/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/contracts/upstream/$bundle" ] || { echo "missing pinned contract directory: $bundle" >&2; exit 1; }
cd "$root"
grep '^sha256=' "$manifest" | sed 's/^sha256=//' | sha256sum -c -
go test ./contracts ./internal/contract ./internal/ai