From 52c59164039c8f908a9745b7716d89c78a21e27f Mon Sep 17 00:00:00 2001 From: jar-o Date: Fri, 30 Jan 2026 12:31:43 -0700 Subject: [PATCH] minor fixups to script gen --- scripts/stage-oracles/generate | 3 ++- scripts/stage-oracles/generate.py | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/stage-oracles/generate b/scripts/stage-oracles/generate index 4d6f5e8..62cd11a 100755 --- a/scripts/stage-oracles/generate +++ b/scripts/stage-oracles/generate @@ -6,11 +6,12 @@ rm -fr tmp/chronicles # NOTE you need to have your Github auth setup or this will fail git clone https://github.com/chronicleprotocol/chronicles.git tmp/chronicles -python scripts/stage-oracles/generate.py +python scripts/stage-oracles/generate.py # Test run [[ "$?" = "0" ]] || { echo echo "!!!! Something went wrong, not updating ..." exit 1 } +# Do for realz python scripts/stage-oracles/generate.py > ./docs/Developers/testnet.md git status diff --git a/scripts/stage-oracles/generate.py b/scripts/stage-oracles/generate.py index f02ee23..df96fbb 100644 --- a/scripts/stage-oracles/generate.py +++ b/scripts/stage-oracles/generate.py @@ -24,15 +24,19 @@ from string import Template from pathlib import Path -import os, re, json +import os, re, json, sys data = {} +def err(m): + print(m, file=sys.stderr) + with open('tmp/chronicles/deployments/chains.json') as json_data: o = json.load(json_data) for chain in o['chains']: # We may get a chain from chains.json which does not have any contracts # deployed. We do not want a section for these - if not os.path.exists(f"tmp/chronicles/deployments/stage/{chain['name']}"): + if chain['mainnet'] is False and not os.path.exists(f"tmp/chronicles/deployments/stage/{chain['name']}"): + err(f"Path does not seem to exist? tmp/chronicles/deployments/stage/{chain['name']}") continue data[chain['name']] = {} data[chain['name']]['info'] = chain