Skip to content

fix(scripts): add submit_prices.sh with strict env validation and consistent SOURCE defaults - #496

Merged
abayomicornelius merged 2 commits into
SO4-Markets:mainfrom
Chucks1093:feat/issue-386-387-388-405
Jul 25, 2026
Merged

fix(scripts): add submit_prices.sh with strict env validation and consistent SOURCE defaults#496
abayomicornelius merged 2 commits into
SO4-Markets:mainfrom
Chucks1093:feat/issue-386-387-388-405

Conversation

@Chucks1093

Copy link
Copy Markdown
Contributor

Closes #386
Closes #387
Closes #388
Closes #405

Summary

Adds scripts/submit_prices.sh and mx/oracle.mk with strict guard-and-die validation to address the silent false-success and inconsistent SOURCE default issues reported in #405.

Root causes fixed:

  • No TOKEN placeholder fallback — the script die()s immediately if TOKEN is unset, instead of pricing a dummy address and printing a false success.
  • No hardcoded ORACLE fallbackORACLE must be exported explicitly; there is no default contract ID. Both ORACLE and TOKEN use [[ -v VAR && -n "${VAR}" ]] guards so even an empty-string export is rejected.
  • Consistent SOURCE defaultSOURCE="${2:-alice}" matches every other operator script and every make example. No personal identity names are baked in.
  • Success only on real exit 0set -euo pipefail is set at the top of the script; the success line only prints if stellar contract invoke exits cleanly. If the invoke fails (bad keeper role, wrong contract, RPC error), the script propagates the non-zero exit code and prints nothing extra.

New files:

File Purpose
scripts/submit_prices.sh Keeper price-submission script for set_prices_simple; requires ORACLE, TOKEN, MIN_PRICE, MAX_PRICE env vars
mx/oracle.mk submit-prices and grant-keeper Make targets; consistent SOURCE ?= alice inherited from common.mk

Makefile and mx/README.md updated with oracle workflow docs.

@drips-wave

drips-wave Bot commented Jul 25, 2026

Copy link
Copy Markdown

@Chucks1093 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@abayomicornelius
abayomicornelius merged commit 90c6954 into SO4-Markets:main Jul 25, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment