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

Implement "struct Contract" in cosmwasm_vm::testing #85

Closed
loloicci opened this issue Mar 18, 2021 · 0 comments · Fixed by #87
Closed

Implement "struct Contract" in cosmwasm_vm::testing #85

loloicci opened this issue Mar 18, 2021 · 0 comments · Fixed by #87
Assignees
Labels
enhancement New feature or request

Comments

@loloicci
Copy link
Contributor

loloicci commented Mar 18, 2021

We have the motivation to export some functions in #81 and #84. But, it can be solved by implementing a structure like.

pub struct Contract {
    module: Module,
    backend: Backend,
    options: MockInstanceOptions,
}

This is like cosmwasm_vm::Cache without disk cache and for a single contract.

I suggest implementing this in cosmwasm_vm::testing and close #81 and #84 by this.

@loloicci loloicci added the enhancement New feature or request label Mar 18, 2021
@loloicci loloicci self-assigned this Mar 18, 2021
@loloicci loloicci changed the title Implement "struct Contract" in cosmwasm_vm::testing Implement "struct MockModule" in cosmwasm_vm::testing Mar 18, 2021
@loloicci loloicci changed the title Implement "struct MockModule" in cosmwasm_vm::testing Implement "struct MockCache" in cosmwasm_vm::testing Mar 18, 2021
@loloicci loloicci changed the title Implement "struct MockCache" in cosmwasm_vm::testing Implement "struct Contract" in cosmwasm_vm::testing Mar 19, 2021
loloicci added a commit that referenced this issue Mar 19, 2021
Add vm::testing::Contract which represents a contract in
integration tests.
It enables integration tests instantiate a new instance every time
before execute init/handle/query/migrate.

See #85 for detail.
loloicci added a commit that referenced this issue Mar 19, 2021
Add vm::testing::Contract which represents a contract in
integration tests.
It enables integration tests instantiate a new instance every time
before execute init/handle/query/migrate.

See #85 for detail.
loloicci added a commit that referenced this issue Mar 19, 2021
Add vm::testing::Contract which represents a contract in
integration tests.
It enables integration tests instantiate a new instance every time
before execute init/handle/query/migrate.

See #85 for detail.
loloicci added a commit that referenced this issue Mar 25, 2021
…integration tests (#87)

* feat: add vm::testing::Contract

Add vm::testing::Contract which represents a contract in
integration tests.
It enables integration tests instantiate a new instance every time
before execute init/handle/query/migrate.

See #85 for detail.

* feat: improve the errors with Contract and add tests

* refactor: rename some functions

rename as following.
get_instance -> generate_instance
recycle -> recycle_instance

* refactor: cargo fmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
1 participant