-
Notifications
You must be signed in to change notification settings - Fork 41
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
consolidation script #351
consolidation script #351
Conversation
Visit the preview URL for this PR (updated for commit e8c14b2): https://fetch-docs-preview--pr351-scripts-consolidatio-uhuy3311.web.app (expires Wed, 22 May 2024 12:21:20 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: f2de39fd4e81249941960b74fbab0a62d90d69f8 |
scripts/prune_genesis_codes.py
Outdated
original_code_hash_to_code[code["code_info"]["code_hash"]] = code | ||
original_code_id_to_hash[code["code_id"]] = code["code_info"]["code_hash"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that it would matter much, feel fre to ignore:
original_code_hash_to_code[code["code_info"]["code_hash"]] = code | |
original_code_id_to_hash[code["code_id"]] = code["code_info"]["code_hash"] | |
code_hash = code["code_info"]["code_hash"] | |
original_code_hash_to_code[code_hash] = code | |
original_code_id_to_hash[code["code_id"]] = code_hash |
print("Replacing code IDs") | ||
# Replace old code IDs with new ones | ||
for contract in contracts: | ||
code_id = contract["contract_info"]["code_id"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code_id = contract["contract_info"]["code_id"] | |
contract_struct = contract["contract_info"] | |
code_id = contract_struct["code_id"] |
# Convert old code ID to new one | ||
new_code_id = new_code_hash_to_code[code_hash]["code_id"] | ||
|
||
contract["contract_info"]["code_id"] = new_code_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
contract["contract_info"]["code_id"] = new_code_id | |
contract_struct["code_id"] = new_code_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.