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

Sketch integration test framework #130

Merged
merged 33 commits into from
Nov 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
33808d7
Define handler interface
ethanfrey Oct 18, 2020
58f0d3f
Start with router design
ethanfrey Oct 18, 2020
2c3aed2
Manage contract lookup, storage inside router
ethanfrey Oct 18, 2020
0df5f9b
A bit of cleanup
ethanfrey Oct 18, 2020
21ec806
Add init, query. Cleanup Contract types
ethanfrey Oct 18, 2020
c1308d9
Complete WasmRouter implementation
ethanfrey Oct 18, 2020
62b392f
Sketch out higher-level router implementation
ethanfrey Oct 18, 2020
ae432eb
Build out router - issue with lifetimes
ethanfrey Oct 19, 2020
033658b
Try without lifetimes
ethanfrey Oct 19, 2020
1f12c45
Compiles using ExternRef and ExternMut stubs
ethanfrey Oct 19, 2020
429866f
Flesh out types
ethanfrey Oct 19, 2020
b0219f9
Add wasm query
ethanfrey Oct 19, 2020
f64aae2
Added bank module as well
ethanfrey Oct 19, 2020
e54de08
Clean up lint errors
ethanfrey Oct 19, 2020
28ec7da
Add mint functionality
ethanfrey Oct 19, 2020
9e9518c
Move multi test code into own package
ethanfrey Nov 3, 2020
2c08ae5
Multi-test on cosmwasm 0.12 pre-release
ethanfrey Nov 3, 2020
e6aa4d4
Compile with 0.12 Deps types
ethanfrey Nov 3, 2020
8f6c496
Add multi-test to CI
ethanfrey Nov 3, 2020
d2a8311
Implement Bank
ethanfrey Nov 3, 2020
1a63955
Fix CI
ethanfrey Nov 3, 2020
3d9aca0
Break out code a bit more
ethanfrey Nov 3, 2020
cc142e7
Start bank tests
ethanfrey Nov 4, 2020
5850e19
more bank tests
ethanfrey Nov 4, 2020
67d3c3a
Simple test that WasmRouter can register and call init
ethanfrey Nov 4, 2020
b86bd45
Expose helpers to update blocks
ethanfrey Nov 4, 2020
db319fd
Test wasm router with success contract
ethanfrey Nov 4, 2020
d4c3673
test bank send with Router
ethanfrey Nov 4, 2020
6f23f91
Calling contract passes
ethanfrey Nov 4, 2020
651fa35
Simplify contract calling api
ethanfrey Nov 4, 2020
4f19188
Test reflect contract - success
ethanfrey Nov 4, 2020
650bb35
Test reflect error, no partial rollback
ethanfrey Nov 4, 2020
f06e57f
Router working, minus rollback on error
ethanfrey Nov 4, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ workflows:
- package_cw4
- package_cw20
- package_cw721
- package_multi_test
- package_storage_plus
- lint
- wasm-build
Expand Down Expand Up @@ -644,6 +645,30 @@ jobs:
- target
key: cargocache-wasm-rust:1.47.0-{{ checksum "~/project/Cargo.lock" }}

package_multi_test:
docker:
- image: rust:1.47.0
working_directory: ~/project/packages/multi-test
steps:
- checkout:
path: ~/project
- run:
name: Version information
command: rustc --version; cargo --version; rustup --version; rustup target list --installed
- restore_cache:
keys:
- cargocache-v2-multi-test:1.47.0-{{ checksum "~/project/Cargo.lock" }}
- run:
name: Build library for native target
command: cargo build --locked
- run:
name: Run unit tests
command: cargo test --locked
- save_cache:
paths:
- /usr/local/cargo/registry
- target
key: cargocache-v2-multi-test:1.47.0-{{ checksum "~/project/Cargo.lock" }}

package_storage_plus:
docker:
Expand Down
57 changes: 39 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions packages/multi-test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "cw-multi-test"
version = "0.3.2"
authors = ["Ethan Frey <[email protected]>"]
edition = "2018"
description = "Test helpers for multi-contract interactions"
license = "Apache-2.0"
repository = "https://github.com/CosmWasm/cosmwasm-plus"
homepage = "https://cosmwasm.com"
documentation = "https://docs.cosmwasm.com"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
#cosmwasm-std = { version = "0.12.0" }
cosmwasm-std = { git = "https://github.com/CosmWasm/cosmwasm.git", rev = "3cf2f51ecedbf89d01d01e9282d398671fd37791" }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
14 changes: 14 additions & 0 deletions packages/multi-test/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CW Multi Test: Test helpers for multi-contract interactions
Copyright (C) 2020 Confio OÜ

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
4 changes: 4 additions & 0 deletions packages/multi-test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Multi Test: Test helpers for multi-contract interactions

Let us run unit tests with contracts calling contracts, and calling
in and out of bank.
Loading