Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

contracts: Simplify instantiate_with_code logic #14494

Closed
athei opened this issue Jul 3, 2023 · 0 comments · Fixed by #14503
Closed

contracts: Simplify instantiate_with_code logic #14494

athei opened this issue Jul 3, 2023 · 0 comments · Fixed by #14503
Labels
Z2-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase.

Comments

@athei
Copy link
Member

athei commented Jul 3, 2023

Right now, we implement some optimizations when a code is uploaded and instantiation at the same time. That adds a lot of complexity to our code. The right move would be to only support instantiate and upload_code and let users use batch_all if they want to bundle them. It would massively simplify our code.

That said, we can't remove the instantiate_with_code dispatchable for backwards compatibility. But we can refactor it to just emulate batch_all by doing upload_code and instantiate back to back in a storage transaction.

@athei athei added the Z2-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase. label Jul 3, 2023
@github-project-automation github-project-automation bot moved this to Backlog 🗒 in Smart Contracts Jul 3, 2023
@github-project-automation github-project-automation bot moved this from Backlog 🗒 to Done ✅ in Smart Contracts Jul 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Z2-medium Can be fixed by a coder with good Rust knowledge but little knowledge of the codebase.
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

1 participant