Skip to content

[mainnet]: Increase Elasticity to 3 and Decrease Gas Target to 25Mgas/s #90

[mainnet]: Increase Elasticity to 3 and Decrease Gas Target to 25Mgas/s

[mainnet]: Increase Elasticity to 3 and Decrease Gas Target to 25Mgas/s #90

name: Check Post-Check Implementation
on:
pull_request:
paths:
- "**/*.sol"
jobs:
check-post-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
ref: ${{ github.event.pull_request.head.ref }}
- name: Fetch base branch
run: |
git fetch origin ${{ github.event.pull_request.base.ref }}:${{ github.event.pull_request.base.ref }}
- name: Check for _postCheck implementation
run: |
# Get all Solidity files that have been modified or added in the PR
FILES=$(git diff --name-only --diff-filter=AMR ${{ github.event.pull_request.base.ref }} | grep '\.sol$')
# Initialize error flag
ERROR=0
for file in $FILES; do
# Skip if file doesn't exist (was deleted)
if [ ! -f "$file" ]; then
continue
fi
# Create a temporary file with comments removed
# This removes both single-line and multi-line comments
sed -E '/\/\*/,/\*\//d' "$file" | sed '/\/\//d' > "${file}.tmp"
# Check if _postCheck function is properly implemented (not in comments)
# Look for a line that starts with "function _postCheck" (ignoring whitespace)
# and contains an opening brace anywhere after it
if ! grep -A10 -E '^\s*function\s+_postCheck' "${file}.tmp" | grep -q '{'; then
echo "❌ Error: $file is missing the required _postCheck function implementation"
ERROR=1
fi
# Clean up temporary file
rm "${file}.tmp"
done
if [ $ERROR -eq 1 ]; then
echo "::error::Some script files are missing the required _postCheck function implementation"
exit 1
fi
echo "✅ All script files properly implement the _postCheck function"