fix(scripts): add submit_prices.sh with strict env validation and consistent SOURCE defaults - #496
Merged
abayomicornelius merged 2 commits intoJul 25, 2026
Conversation
…sistent defaults Closes SO4-Markets#386 Closes SO4-Markets#387 Closes SO4-Markets#388 Closes SO4-Markets#405
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #386
Closes #387
Closes #388
Closes #405
Summary
Adds
scripts/submit_prices.shandmx/oracle.mkwith strict guard-and-die validation to address the silent false-success and inconsistent SOURCE default issues reported in #405.Root causes fixed:
die()s immediately ifTOKENis unset, instead of pricing a dummy address and printing a false success.ORACLEmust be exported explicitly; there is no default contract ID. BothORACLEandTOKENuse[[ -v VAR && -n "${VAR}" ]]guards so even an empty-string export is rejected.SOURCEdefault —SOURCE="${2:-alice}"matches every other operator script and everymakeexample. No personal identity names are baked in.set -euo pipefailis set at the top of the script; the success line only prints ifstellar contract invokeexits 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:
scripts/submit_prices.shset_prices_simple; requiresORACLE,TOKEN,MIN_PRICE,MAX_PRICEenv varsmx/oracle.mksubmit-pricesandgrant-keeperMake targets; consistentSOURCE ?= aliceinherited fromcommon.mkMakefileandmx/README.mdupdated with oracle workflow docs.