-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* feature: check contracts in workspace * fixes in CI * fixes in CI * fixes in CI: s/steps/step * fixes in CI: enable examples step * wip CI/CD: run contracts along regular ones, but with different step * wip CI/CD: log changed files also use the right variable to check for them * wip CI/CD: hopefuly preventing error on invalid character.. * wip CI/CD: changed approach to run both workspace contracts on same runner.. * wip CI/CD: whole workspace at once * wip CI/CD: specify workspace cargo * wip CI/CD: no test on workspace * wip CI/CD: removed debug info/vars * wip CI/CD: removed debug info/vars * updated the CI/CD to be ready when using/having cargo-contract v 4.0. * fix unnoticed error in contract * Update ci.yml removed redundant configuration Update ci.yml removed redundant configuration
- Loading branch information
Showing
7 changed files
with
181 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Ignore build artifacts from the local tests sub-crate. | ||
/target/ | ||
|
||
# Ignore backup files creates by cargo fmt. | ||
**/*.rs.bk | ||
|
||
# Remove Cargo.lock when creating an executable, leave it for libraries | ||
# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock | ||
Cargo.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[workspace] | ||
members = ["*"] | ||
exclude = [".cargo", "target"] | ||
resolver = "2" | ||
|
||
[workspace.dependencies] | ||
ink = { version = "4.3.0", default-features = false } | ||
ink_e2e = "4.3.0" | ||
scale = { package = "parity-scale-codec", version = "=3.6.5", default-features = false, features = ["derive"] } | ||
scale-info = { version = "2.6", default-features = false, features = ["derive"] } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[package] | ||
name = "flipper" | ||
version = "4.3.0" | ||
authors = ["Parity Technologies <[email protected]>"] | ||
edition = "2021" | ||
publish = false | ||
|
||
[dependencies] | ||
ink = { workspace = true } | ||
|
||
scale = { workspace = true, package = "parity-scale-codec" } | ||
scale-info = { workspace = true, optional = true } | ||
|
||
[dev-dependencies] | ||
ink_e2e = { workspace = true } | ||
|
||
[lib] | ||
path = "lib.rs" | ||
|
||
[features] | ||
default = ["std"] | ||
std = [ | ||
"ink/std", | ||
"scale/std", | ||
"scale-info/std", | ||
] | ||
ink-as-dependency = [] | ||
e2e-tests = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#![cfg_attr(not(feature = "std"), no_std, no_main)] | ||
|
||
#[ink::contract] | ||
pub mod flipper { | ||
#[ink(storage)] | ||
pub struct Flipper { | ||
value: bool, | ||
} | ||
|
||
impl Flipper { | ||
/// Creates a new flipper smart contract initialized with the given value. | ||
#[ink(constructor)] | ||
pub fn new(init_value: bool) -> Self { | ||
Self { value: init_value } | ||
} | ||
|
||
/// Creates a new flipper smart contract initialized to `false`. | ||
#[ink(constructor)] | ||
pub fn new_default() -> Self { | ||
Self::new(Default::default()) | ||
} | ||
|
||
/// Flips the current value of the Flipper's boolean. | ||
#[ink(message)] | ||
pub fn flip(&mut self) { | ||
self.value = !self.value; | ||
} | ||
|
||
/// Returns the current value of the Flipper's boolean. | ||
#[ink(message)] | ||
pub fn get(&self) -> bool { | ||
self.value | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
[package] | ||
name = "incrementer" | ||
version = "4.3.0" | ||
authors = ["Parity Technologies <[email protected]>"] | ||
edition = "2021" | ||
publish = false | ||
|
||
[dependencies] | ||
ink = { workspace = true } | ||
|
||
scale = { workspace = true, package = "parity-scale-codec" } | ||
scale-info = { workspace = true, optional = true } | ||
|
||
[lib] | ||
path = "lib.rs" | ||
|
||
[features] | ||
default = ["std"] | ||
std = [ | ||
"ink/std", | ||
"scale/std", | ||
"scale-info/std", | ||
] | ||
ink-as-dependency = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#![cfg_attr(not(feature = "std"), no_std, no_main)] | ||
|
||
#[ink::contract] | ||
mod incrementer { | ||
#[ink(storage)] | ||
pub struct Incrementer { | ||
value: i32, | ||
} | ||
|
||
impl Incrementer { | ||
#[ink(constructor)] | ||
pub fn new(init_value: i32) -> Self { | ||
Self { value: init_value } | ||
} | ||
|
||
#[ink(constructor)] | ||
pub fn new_default() -> Self { | ||
Self::new(Default::default()) | ||
} | ||
|
||
#[ink(message)] | ||
pub fn inc(&mut self, by: i32) { | ||
self.value = self.value.saturating_add(by); | ||
} | ||
|
||
#[ink(message)] | ||
pub fn get(&self) -> i32 { | ||
self.value | ||
} | ||
} | ||
} |