Skip to content

Save contract info before calling instantiate entrypoint #2044

@chipshort

Description

@chipshort

Current behaviour

The instantiate entrypoint is called before the contract info is stored.
This results in an error occuring if the contract tries to query that info inside the instantiate entrypoint.

Expected behaviour

We should probably call the entrypoint after saving the info. That should make the data available to query inside the instantiate entrypoint. To me, it doesn't look like there is any specific reason for the current order and it is confusing and a somewhat inconsistent1.
We should just make sure that it gets reverted if the instantiate entrypoint errors. I think that should be the case automatically when returning an error, but a test for that would be good.

Footnotes

  1. See https://github.com/CosmWasm/cw-multi-test/issues/226 and https://discord.com/channels/737637324434833438/737643344712171600/1303704162298630186

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions