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

contracts: Simplify instantiate_with_code logic #14494

@athei

Description

@athei

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Z2-mediumCan be fixed by a coder with good Rust knowledge but little knowledge of the codebase.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions