Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

when snapshots can't be found for version, just pick the most recent #611

Merged
merged 2 commits into from
Nov 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion mkchain/tqchain/mkchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ def main():
for key_type in keys:
accounts[key_type][account] = {
"key": keys[key_type],
"is_bootstrap_baker_account": False if account == "authorized-key-0" else True,
"is_bootstrap_baker_account": False
if account == "authorized-key-0"
else True,
"bootstrap_balance": "4000000000000",
}

Expand Down
5 changes: 4 additions & 1 deletion utils/config-generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,11 +762,14 @@ def create_node_snapshot_config_json(history_mode):
and s.get("chain_name") == network_name
]
if octez_version:
matching_snapshots = [
version_matching_snapshots = [
s
for s in matching_snapshots
if int(octez_version) == s.get("tezos_version").get("version").get("major")
]
if len(version_matching_snapshots):
# If we can't find snapshots of the right octez version, we just pick the most recent available.
matching_snapshots = version_matching_snapshots
matching_snapshots = sorted(matching_snapshots, key=lambda s: s.get("block_height"))

return matching_snapshots[-1] if len(matching_snapshots) else None
Expand Down
Loading