Skip to content

Fix unreachable JSON validation in upgrade.sh - #479

Closed
SrvFernandes wants to merge 1 commit into
ChainLearnOfficial:mainfrom
SrvFernandes:fix/upgrade-sh-json-validation-muntff6z
Closed

SrvFernandes wants to merge 1 commit into
ChainLearnOfficial:mainfrom
SrvFernandes:fix/upgrade-sh-json-validation-muntff6z

Conversation

@SrvFernandes

Copy link
Copy Markdown

Closes #477

Summary

The JSON validation fallback in scripts/upgrade.sh was unreachable due to set -e causing immediate script termination on jq empty failure.

Changes

  • Replaced the $? check with a direct conditional on the jq empty command to ensure the else branch is reachable under set -euo pipefail.
  • Added a success message for deployment file updates.

Testing

  • Verified that invalid JSON triggers the warning and preserves the existing deployment file.
  • Verified that valid JSON updates the deployment file and continues execution.

Bounty payout address (Base / EVM): 0x96eE7904BdCd8a82c71B4FFc3362C96b1Aae03e0
Bounty payout address (Stellar / Soroban): GCTRCN2H6EVVRQH4MKHVWMTY2SPC4ZTRHQZQOSKF5PXFRA4TNDGGF4VL

Signed-off-by: Sérgio <sveronezfernandes@gmail.com>
@DeFiVC DeFiVC closed this Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

scripts/upgrade.sh JSON validation is unreachable due to set -e

2 participants