#!/usr/bin/env bash
# WEIGHT=5
# CHECK: Wrapper Author dispatches to V2 engine for V2 blocks (NF-0 / C10)
# REF: xdpos.go Author method calls c.EngineV2.Author or similar
set -e
xdp="$PATIENT/consensus/XDPoS/xdpos.go"
[[ -f "$xdp" ]] || exit 1
# Find the Author method body (definition through the next top-level func).
awk '/^func \(c \*XDPoS\) Author\(/{flag=1; next} flag && /^}/{print; flag=0; next} flag' "$xdp" | \
  grep -qE '(EngineV2\.Author|c\.EngineV2\.Author|x\.EngineV2\.Author)'
