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

Move cosmwasm into packages/std #167

Merged
merged 7 commits into from
Mar 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
33 changes: 19 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ workflows:
version: 2
test:
jobs:
- base
- std
- singlepass_vm
- cranelift_vm
- hackatom
Expand All @@ -12,7 +12,7 @@ workflows:
- clippy

jobs:
base:
std:
docker:
- image: rust:1.40.0
steps:
Expand All @@ -25,20 +25,22 @@ jobs:
command: rustc --version; cargo --version; rustup --version; rustup target list --installed
- restore_cache:
keys:
- cargocache-base-rust:1.40.0-{{ checksum "Cargo.lock" }}
- cargocache-std-rust:1.40.0-{{ checksum "Cargo.lock" }}
- run:
name: Build all targets (including workspaces)
name: Build standard library
working_directory: ~/project/packages/std
command: cargo build --locked
- run:
name: Run all tests (including workspaces)
name: Run standard library tests
working_directory: ~/project/packages/std
command: cargo test --locked
- save_cache:
paths:
- /usr/local/cargo/registry
- target/debug/.fingerprint
- target/debug/build
- target/debug/deps
key: cargocache-base-rust:1.40.0-{{ checksum "Cargo.lock" }}
key: cargocache-std-rust:1.40.0-{{ checksum "Cargo.lock" }}

singlepass_vm:
docker:
Expand All @@ -56,11 +58,11 @@ jobs:
- cargocache-singlepass-rust:nightly-{{ checksum "Cargo.lock" }}
- run:
name: Build all targets (including workspaces)
working_directory: ~/project/lib/vm
working_directory: ~/project/packages/vm
command: cargo build --locked
- run:
name: Run all tests (including workspaces)
working_directory: ~/project/lib/vm
working_directory: ~/project/packages/vm
command: cargo test --locked
- save_cache:
paths:
Expand All @@ -86,11 +88,11 @@ jobs:
- cargocache-cranelift-rust:1.40.0-{{ checksum "Cargo.lock" }}
- run:
name: Build all targets (including workspaces)
working_directory: ~/project/lib/vm
working_directory: ~/project/packages/vm
command: cargo build --locked --no-default-features --features default-cranelift
- run:
name: Run all tests (including workspaces)
working_directory: ~/project/lib/vm
working_directory: ~/project/packages/vm
command: cargo test --locked --no-default-features --features default-cranelift
- save_cache:
paths:
Expand Down Expand Up @@ -233,14 +235,17 @@ jobs:
name: Add clippy component
command: rustup component add clippy
- run:
name: Clippy linting
name: Clippy linting on std
working_directory: ~/project/packages/std
command: cargo clippy -- -D warnings
- run:
name: Clippy linting on lib/vm (use flags for stable support)
command: cd lib/vm && cargo clippy --no-default-features --features default-cranelift
name: Clippy linting on vm (use flags for Rust stable support)
working_directory: ~/project/packages/vm
command: cargo clippy --no-default-features --features default-cranelift
- run:
name: Clippy linting on hackatom
command: cd contracts/hackatom && cargo clippy -- -D warnings
working_directory: ~/project/contracts/hackatom
command: cargo clippy -- -D warnings
- save_cache:
paths:
- /usr/local/cargo/registry
Expand Down
32 changes: 2 additions & 30 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,31 +1,3 @@
[package]
name = "cosmwasm"
version = "0.7.1"
authors = ["Ethan Frey <ethanfrey@users.noreply.github.com>"]
edition = "2018"
description = "Wasm smart contracts for Cosmos"
repository = "https://github.com/CosmWasm/cosmwasm"
license = "Apache-2.0"
readme = "README.md"
exclude = [".circleci/*", ".gitignore"]

[badges]
circle-ci = { repository = "CosmWasm/cosmwasm", branch = "master" }
maintenance = { status = "actively-developed" }

[workspace]
members = [ "lib/vm" ]
exclude = [ "contracts" ]

[dependencies]
base64 = "0.11.0"
serde-json-wasm = "0.1.2"
schemars = "0.5"
serde = { version = "1.0.103", default-features = false, features = ["derive", "alloc"] }
snafu = { version = "0.5.0", default-features = false, features = ["rust_1_30"] }

[dev-dependencies]
serde_json = "1.0"

[features]
backtraces = ["snafu/backtraces"]
members = ["packages/*"]
exclude = ["contracts"]
6 changes: 2 additions & 4 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
Confio/CosmWasm
License: Apache2.0

Apache License
Version 2.0, January 2004
Expand Down Expand Up @@ -181,15 +179,15 @@ License: Apache2.0
APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2019 Confio UO and Jehan Tremback
Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
15 changes: 15 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Copyright 2019 Jehan Tremback
Copyright 2019-2020 Confio UO
Copyright 2019-2020 Simon Warta

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.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

[![CircleCI](https://circleci.com/gh/CosmWasm/cosmwasm/tree/master.svg?style=shield)](https://circleci.com/gh/CosmWasm/cosmwasm/tree/master)
[![Docs](https://docs.rs/cosmwasm/badge.svg)](https://docs.rs/cosmwasm)
[![crates.io](https://img.shields.io/crates/v/cosmwasm.svg)](https://crates.io/crates/cosmwasm)

[![cosmwasm on crates.io](https://img.shields.io/crates/v/cosmwasm.svg)](https://crates.io/crates/cosmwasm)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

[![cosmwasm-vm on crates.io](https://img.shields.io/crates/v/cosmwasm-vm.svg)](https://crates.io/crates/cosmwasm-vm)

**WebAssembly Smart Contracts for the Cosmos SDK**

Expand Down Expand Up @@ -36,8 +36,8 @@ around 40% of the code size.

**Executing contracts:**

* [cosmwasm-vm](https://github.com/CosmWasm/cosmwasm/tree/master/lib/vm) - A sub-crate. Uses the [wasmer](https://github.com/wasmerio/wasmer) engine
to execute a given smart contract. Also contains code for gas metering, storing, and caching wasm artifacts. Read more [here](lib/vm/README.md).
* [cosmwasm-vm](https://github.com/CosmWasm/cosmwasm/tree/master/packages/vm) - A sub-crate. Uses the [wasmer](https://github.com/wasmerio/wasmer) engine
to execute a given smart contract. Also contains code for gas metering, storing, and caching wasm artifacts. Read more [here](packages/vm/README.md).
* [go-cosmwasm](https://github.com/CosmWasm/go-cosmwasm) - High-level go bindings to all the power inside `cosmwasm-vm`. Easily allows you to upload, instantiate and execute contracts,
making use of all the optimizations and caching available inside `cosmwasm-vm`.
* [wasmd](https://github.com/CosmWasm/wasmd) - A basic Cosmos SDK app to host WebAssembly smart contracts.
Expand Down Expand Up @@ -180,7 +180,7 @@ You may also want to ensure the compiled contract interacts with the environment
properly. To do so, you will want to create a canonical release build of
the `<contract>.wasm` file and then write tests in with the
same VM tooling we will use in production. This is a bit more complicated but
we added some tools to help in [cosmwasm-vm](https://github.com/CosmWasm/cosmwasm/tree/master/lib/vm)
we added some tools to help in [cosmwasm-vm](https://github.com/CosmWasm/cosmwasm/tree/master/packages/vm)
which can be added as a `dev-dependency`.

You will need to first compile the contract using `cargo wasm`,
Expand Down
4 changes: 2 additions & 2 deletions contracts/hackatom/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ cranelift = ["cosmwasm-vm/default-cranelift"]
singlepass = ["cosmwasm-vm/default-singlepass"]

[dependencies]
cosmwasm = { path = "../..", version = "0.7.1" }
cosmwasm = { path = "../../packages/std", version = "0.7.1" }
schemars = "0.5"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
snafu = { version = "0.5.0", default-features = false, features = ["rust_1_30"] }

[dev-dependencies]
cosmwasm-vm = { path = "../../lib/vm", version = "0.7.1", default-features = false }
cosmwasm-vm = { path = "../../packages/vm", version = "0.7.1", default-features = false }
serde_json = "1.0"
Loading