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

consolidation script #351

Merged
merged 3 commits into from
May 17, 2024
Merged

consolidation script #351

merged 3 commits into from
May 17, 2024

Conversation

MissingNO57
Copy link
Contributor

No description provided.

@MissingNO57 MissingNO57 requested a review from pbukva May 16, 2024 10:36
Copy link

github-actions bot commented May 16, 2024

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

Comment on lines 60 to 61
original_code_hash_to_code[code["code_info"]["code_hash"]] = code
original_code_id_to_hash[code["code_id"]] = code["code_info"]["code_hash"]
Copy link
Collaborator

@pbukva pbukva May 17, 2024

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:

Suggested change
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"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
contract["contract_info"]["code_id"] = new_code_id
contract_struct["code_id"] = new_code_id

Copy link
Collaborator

@pbukva pbukva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MissingNO57 MissingNO57 merged commit b80f0f0 into master May 17, 2024
4 checks passed
@MissingNO57 MissingNO57 deleted the scripts/consolidation branch May 17, 2024 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants