diff --git a/Cargo.toml b/Cargo.toml index 63472c1..7ec3982 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,10 +8,7 @@ members = [ ] exclude = [ - "examples/counter", - "examples/flipper", - "examples/cross-contract-call-tracing", - "examples/mocking", + "examples/", ] [workspace.package] @@ -21,7 +18,7 @@ homepage = "https://github.com/Cardinal-Cryptography/drink" license = "Apache-2.0" readme = "README.md" repository = "https://github.com/Cardinal-Cryptography/drink" -version = "0.5.3" +version = "0.5.4" [workspace.dependencies] anyhow = { version = "1.0.71" } @@ -59,5 +56,5 @@ sp-runtime-interface = { version = "19.0.0" } # Local dependencies -drink = { version = "0.5.3", path = "drink" } -drink-test-macro = { version = "0.5.3", path = "drink/test-macro" } +drink = { version = "0.5.4", path = "drink" } +drink-test-macro = { version = "0.5.4", path = "drink/test-macro" } diff --git a/Makefile b/Makefile index e31a687..e7f8484 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ EXAMPLES = ./examples EXAMPLES_PATHS := $(shell find $(EXAMPLES) -mindepth 1 -maxdepth 1 -type d) +EXAMPLES_TARGET = ./examples/target run: ## Run the project cargo run --release @@ -14,9 +15,10 @@ lint: ## Run the linter cargo clippy --release -- -D warnings test_examples: ## Run tests for the examples + @mkdir -p $(EXAMPLES_TARGET) @for dir in $(EXAMPLES_PATHS); do \ echo "Processing $$dir" ; \ - cargo test --quiet --manifest-path $$dir/Cargo.toml --release; \ + cargo test --quiet --manifest-path $$dir/Cargo.toml --release --target-dir $(EXAMPLES_TARGET); \ done clean: ## Clean all the workspace build files diff --git a/examples/counter/Cargo.toml b/examples/counter/Cargo.toml deleted file mode 100755 index 92ec16b..0000000 --- a/examples/counter/Cargo.toml +++ /dev/null @@ -1,25 +0,0 @@ -[package] -name = "counter" -authors = ["Cardinal", "Aleph Zero Foundation"] -edition = "2021" -homepage = "https://alephzero.org" -repository = "https://github.com/Cardinal-Cryptography/drink" -version = "0.1.0" - -[dependencies] -ink = { version = "=4.2.1", default-features = false, features = ["ink-debug"] } - -scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] } -scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true } - -[lib] -path = "lib.rs" - -[features] -default = ["std"] -std = [ - "ink/std", - "scale/std", - "scale-info/std", -] -ink-as-dependency = [] diff --git a/examples/counter/lib.rs b/examples/counter/lib.rs deleted file mode 100755 index 56d0125..0000000 --- a/examples/counter/lib.rs +++ /dev/null @@ -1,31 +0,0 @@ -#![cfg_attr(not(feature = "std"), no_std, no_main)] - -#[ink::contract] -mod counter { - use ink::env::debug_println; - - #[ink(storage)] - pub struct Counter { - value: u32, - } - - impl Counter { - #[ink(constructor)] - pub fn new() -> Self { - Self { value: 0 } - } - - #[ink(message)] - pub fn bump(&mut self, by: u32) { - debug_println!("Previous value: `{}`", self.value); - self.value += by; - debug_println!("Bumped to: `{}`", self.value); - } - - #[ink(message)] - pub fn get(&self) -> u32 { - debug_println!("Reading value from storage"); - self.value - } - } -}