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

Enable contracts to import contracts #32

Merged
merged 3 commits into from
Aug 11, 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
12 changes: 6 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
command: cargo unit-test --locked
- run:
name: Build Wasm
command: cargo wasm-debug --locked
command: cargo wasm --locked
- run:
name: Build and run schema generator
command: cargo schema --locked
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
command: cargo unit-test --locked
- run:
name: Build Wasm
command: cargo wasm-debug --locked
command: cargo wasm --locked
- run:
name: Build and run schema generator
command: cargo schema --locked
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
command: cargo unit-test --locked
- run:
name: Build Wasm
command: cargo wasm-debug --locked
command: cargo wasm --locked
- run:
name: Build and run schema generator
command: cargo schema --locked
Expand Down Expand Up @@ -157,7 +157,7 @@ jobs:
command: cargo unit-test --locked
- run:
name: Build Wasm
command: cargo wasm-debug --locked
command: cargo wasm --locked
- run:
name: Build and run schema generator
command: cargo schema --locked
Expand Down Expand Up @@ -197,7 +197,7 @@ jobs:
command: cargo build --locked
- run:
name: Build library for wasm target
command: cargo wasm-debug --locked
command: cargo wasm --locked
- run:
name: Run unit tests
command: cargo test --locked
Expand Down Expand Up @@ -240,7 +240,7 @@ jobs:
command: cargo build --locked
- run:
name: Build library for wasm target
command: cargo wasm-debug --locked
command: cargo wasm --locked
- run:
name: Run unit tests
command: cargo test --locked
Expand Down
4 changes: 3 additions & 1 deletion contracts/cw1-subkeys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ crate-type = ["cdylib", "rlib"]

[features]
backtraces = ["cosmwasm-std/backtraces"]
# use library feature to disable all init/handle/query exports
library = []

[dependencies]
cosmwasm-std = { version = "0.10.0", features = ["iterator"] }
cosmwasm-storage = { version = "0.10.0", features = ["iterator"] }
cw20 = { path = "../../packages/cw20", version = "0.1.0" }
cw1-whitelist = { path = "../cw1-whitelist", version = "0.1.0" }
cw1-whitelist = { path = "../cw1-whitelist", version = "0.1.0", features = ["library"] }
schemars = "0.7"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
snafu = { version = "0.6.3" }
Expand Down
2 changes: 1 addition & 1 deletion contracts/cw1-subkeys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ pub mod contract;
pub mod msg;
pub mod state;

#[cfg(target_arch = "wasm32")]
#[cfg(all(target_arch = "wasm32", not(feature = "library")))]
cosmwasm_std::create_entry_points!(contract);
3 changes: 2 additions & 1 deletion contracts/cw1-whitelist/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ crate-type = ["cdylib", "rlib"]

[features]
backtraces = ["cosmwasm-std/backtraces"]
# use library feature to disable all init/handle/query exports
library = []

[dependencies]
#cw1 = { path = "../../packages/cw1", version = "0.1.0" }
cosmwasm-std = { version = "0.10.0", features = ["iterator"] }
cosmwasm-storage = { version = "0.10.0", features = ["iterator"] }
schemars = "0.7"
Expand Down
2 changes: 1 addition & 1 deletion contracts/cw1-whitelist/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ pub mod contract;
pub mod msg;
pub mod state;

#[cfg(target_arch = "wasm32")]
#[cfg(all(target_arch = "wasm32", not(feature = "library")))]
cosmwasm_std::create_entry_points!(contract);
12 changes: 2 additions & 10 deletions contracts/cw20-base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,9 @@ license = "AGPL-3.0"
crate-type = ["cdylib", "rlib"]

[features]
#default = ["cranelift", "entrypoint"]
default = ["entrypoint"]
# entrypoint means to expose init, handle, query extern "C" functions
# disable this (default-features = false) if importing code for use in another contract
entrypoint = []
# for quicker tests, cargo test --lib
# for more explicit tests, cargo test --features=backtraces
backtraces = ["cosmwasm-std/backtraces"]
#backtraces = ["cosmwasm-std/backtraces", "cosmwasm-vm/backtraces"]
#cranelift = ["cosmwasm-vm/default-cranelift"]
#singlepass = ["cosmwasm-vm/default-singlepass"]
# use library feature to disable all init/handle/query exports
library = []

[dependencies]
cw20 = { path = "../../packages/cw20", version = "0.1.0" }
Expand Down
2 changes: 1 addition & 1 deletion contracts/cw20-base/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ pub mod contract;
pub mod msg;
pub mod state;

#[cfg(all(target_arch = "wasm32", feature = "entrypoint"))]
#[cfg(all(target_arch = "wasm32", not(feature = "library")))]
cosmwasm_std::create_entry_points!(contract);
2 changes: 2 additions & 0 deletions contracts/cw20-escrow/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ crate-type = ["cdylib", "rlib"]

[features]
backtraces = ["cosmwasm-std/backtraces"]
# use library feature to disable all init/handle/query exports
library = []

[dependencies]
cw20 = { path = "../../packages/cw20", version = "0.1.0" }
Expand Down
2 changes: 1 addition & 1 deletion contracts/cw20-escrow/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ pub mod contract;
pub mod msg;
pub mod state;

#[cfg(target_arch = "wasm32")]
#[cfg(all(target_arch = "wasm32", not(feature = "library")))]
cosmwasm_std::create_entry_points!(contract);