#!/usr/bin/env bash
# WEIGHT=5
# CHECK: Wrapper Prepare dispatches to V2 engine for V2 blocks (M-1)
set -e
xdp="$PATIENT/consensus/XDPoS/xdpos.go"
[[ -f "$xdp" ]] || exit 1
awk '/^func \(c \*XDPoS\) Prepare\(/{flag=1; next} flag && /^}/{print; flag=0; next} flag' "$xdp" | \
  grep -qE '(EngineV2\.Prepare|c\.EngineV2\.Prepare)'
