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

Add cargo workspace for test-cases #100

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
16 changes: 16 additions & 0 deletions test-cases/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[workspace]
members = ["*"]
exclude = [".cargo", "target", "template", "tmp"]
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"] }

[profile.dev]
overflow-checks = false

[profile.release]
overflow-checks = false
14 changes: 4 additions & 10 deletions test-cases/account-id/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,9 @@ ink-as-dependency = []
e2e-tests = []

[dependencies]
ink = { version = "4.2.1", default-features = false }
scale = { package = "parity-scale-codec", version = "=3.6.5", default-features = false, features = ["derive"] }
scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true }
ink = { workspace = true }
scale = { workspace = true, package = "parity-scale-codec" }
scale-info = { workspace = true, optional = true }

[dev-dependencies]
ink_e2e = "4.2.1"

[profile.dev]
overflow-checks = false

[profile.release]
overflow-checks = false
ink_e2e = { workspace = true }
16 changes: 5 additions & 11 deletions test-cases/balance/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "get_balance"
name = "balance"
version = "0.1.0"
edition = "2021"
authors = ["[your_name] <[your_email]>"]
Expand All @@ -18,15 +18,9 @@ ink-as-dependency = []
e2e-tests = []

[dependencies]
ink = { version = "4.3", default-features = false }
scale = { package = "parity-scale-codec", version = "=3.6.5", default-features = false, features = ["derive"] }
scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true }
ink = { workspace = true }
scale = { workspace = true, package = "parity-scale-codec" }
scale-info = { workspace = true, optional = true }

[dev-dependencies]
ink_e2e = "4.3"

[profile.dev]
overflow-checks = false

[profile.release]
overflow-checks = false
ink_e2e = { workspace = true }
16 changes: 5 additions & 11 deletions test-cases/block-number/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "get-block-number"
name = "block-number"
version = "0.1.0"
edition = "2021"
authors = ["[your_name] <[your_email]>"]
Expand All @@ -18,15 +18,9 @@ ink-as-dependency = []
e2e-tests = []

[dependencies]
ink = { version = "4.3", default-features = false }
scale = { package = "parity-scale-codec", version = "=3.6.5", default-features = false, features = ["derive"] }
scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true }
ink = { workspace = true }
scale = { workspace = true, package = "parity-scale-codec" }
scale-info = { workspace = true, optional = true }

[dev-dependencies]
ink_e2e = "4.3"

[profile.dev]
overflow-checks = false

[profile.release]
overflow-checks = false
ink_e2e = { workspace = true }
9 changes: 4 additions & 5 deletions test-cases/call-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@ edition = "2021"
publish = false

[dependencies]
ink = { version = "4.3", default-features = false, features = ["call-runtime"] }

scale = { package = "parity-scale-codec", version = "=3.6.5", default-features = false, features = ["derive"] }
scale-info = { version = "2.5", default-features = false, features = ["derive"], optional = true }
ink = { workspace = true, features = ["call-runtime"] }
scale = { workspace = true, package = "parity-scale-codec" }
scale-info = { workspace = true, optional = true }

# Substrate
#
Expand All @@ -21,7 +20,7 @@ sp-io = { version = "23.0.0", default-features = false, features = ["disable_pan
sp-runtime = { version = "24.0.0", default-features = false }

[dev-dependencies]
ink_e2e = { version = "4.3" }
ink_e2e = { workspace = true }

[lib]
path = "lib.rs"
Expand Down
20 changes: 8 additions & 12 deletions test-cases/caller-is-origin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "invoke_contract"
name = "caller-is-origin"
version = "0.1.0"
edition = "2021"
authors = ["[your_name] <[your_email]>"]
Expand All @@ -13,21 +13,17 @@ std = [
"ink/std",
"scale/std",
"scale-info/std",
"caller-is-origin-contract-to-call/std",
]
ink-as-dependency = []
e2e-tests = []

[dependencies]
ink = { version = "4.2.1", default-features = false }
scale = { package = "parity-scale-codec", version = "=3.6.5", default-features = false, features = ["derive"] }
scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true }
contract_to_call = { path = "./contract_to_call", default-features = false, features = ["ink-as-dependency"] }
ink = { workspace = true }
scale = { workspace = true, package = "parity-scale-codec" }
scale-info = { workspace = true, optional = true }

[dev-dependencies]
ink_e2e = "4.2.1"

[profile.dev]
overflow-checks = false
caller-is-origin-contract-to-call = { path = "./contract-to-call", default-features = false, features = ["ink-as-dependency"] }

[profile.release]
overflow-checks = false
[dev-dependencies]
ink_e2e = { workspace = true }
26 changes: 26 additions & 0 deletions test-cases/caller-is-origin/contract-to-call/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "caller-is-origin-contract-to-call"
version = "0.1.0"
edition = "2021"
authors = ["[your_name] <[your_email]>"]

[lib]
path = "lib.rs"

[features]
default = ["std"]
std = [
"ink/std",
"scale/std",
"scale-info/std",
]
ink-as-dependency = []
e2e-tests = []

[dependencies]
ink = { workspace = true }
scale = { workspace = true, package = "parity-scale-codec" }
scale-info = { workspace = true, optional = true }

[dev-dependencies]
ink_e2e = { workspace = true }
32 changes: 0 additions & 32 deletions test-cases/caller-is-origin/contract_to_call/Cargo.toml

This file was deleted.

2 changes: 1 addition & 1 deletion test-cases/caller-is-origin/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ mod invoke_contract {
#[cfg(test)]
mod tests {
use super::*;
use contract_to_call::ContractToCall;
use caller_is_origin_contract_to_call::ContractToCall;

// TODO: this test shouldn't panic when ink integration test is improved.
#[ink::test]
Expand Down
14 changes: 4 additions & 10 deletions test-cases/caller/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,9 @@ ink-as-dependency = []
e2e-tests = []

[dependencies]
ink = { version = "4.3.0", default-features = false }
scale = { package = "parity-scale-codec", version = "=3.6.5", default-features = false, features = ["derive"] }
scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true }
ink = { workspace = true }
scale = { workspace = true, package = "parity-scale-codec" }
scale-info = { workspace = true, optional = true }

[dev-dependencies]
ink_e2e = "4.3.0"

[profile.dev]
overflow-checks = false

[profile.release]
overflow-checks = false
ink_e2e = { workspace = true }
20 changes: 8 additions & 12 deletions test-cases/code-hash/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "code_hash"
name = "code-hash"
version = "0.1.0"
edition = "2021"
authors = ["[your_name] <[your_email]>"]
Expand All @@ -13,21 +13,17 @@ std = [
"ink/std",
"scale/std",
"scale-info/std",
"code-hash-other-contract/std"
]
ink-as-dependency = []
e2e-tests = []

[dependencies]
ink = { version = "4.2.1", default-features = false }
scale = { package = "parity-scale-codec", version = "=3.6.5", default-features = false, features = ["derive"] }
scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true }
other_contract = { path = "./other_contract", default-features = false, features = ["ink-as-dependency"] }
ink = { workspace = true }
scale = { workspace = true, package = "parity-scale-codec" }
scale-info = { workspace = true, optional = true }

[dev-dependencies]
ink_e2e = "4.2.1"

[profile.dev]
overflow-checks = false
code-hash-other-contract = { path = "./other-contract", default-features = false, features = ["ink-as-dependency"] }

[profile.release]
overflow-checks = false
[dev-dependencies]
ink_e2e = { workspace = true }
2 changes: 1 addition & 1 deletion test-cases/code-hash/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ mod code_hash {
#[cfg(all(test, feature = "e2e-tests"))]
mod e2e_tests {
use ink_e2e::build_message;
use other_contract::OtherContractRef;
use code_hash_other_contract::OtherContractRef;

use super::*;

Expand Down
26 changes: 26 additions & 0 deletions test-cases/code-hash/other-contract/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[package]
name = "code-hash-other-contract"
version = "0.1.0"
edition = "2021"
authors = ["[your_name] <[your_email]>"]

[lib]
path = "lib.rs"

[features]
default = ["std"]
std = [
"ink/std",
"scale/std",
"scale-info/std",
]
ink-as-dependency = []
e2e-tests = []

[dependencies]
ink = { workspace = true }
scale = { workspace = true, package = "parity-scale-codec" }
scale-info = { workspace = true, optional = true }

[dev-dependencies]
ink_e2e = { workspace = true }
32 changes: 0 additions & 32 deletions test-cases/code-hash/other_contract/Cargo.toml

This file was deleted.

14 changes: 4 additions & 10 deletions test-cases/default-accounts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,9 @@ ink-as-dependency = []
e2e-tests = []

[dependencies]
ink = { version = "4.2.1", default-features = false }
scale = { package = "parity-scale-codec", version = "=3.6.5", default-features = false, features = ["derive"] }
scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true }
ink = { workspace = true }
scale = { workspace = true, package = "parity-scale-codec" }
scale-info = { workspace = true, optional = true }

[dev-dependencies]
ink_e2e = "4.2.1"

[profile.dev]
overflow-checks = false

[profile.release]
overflow-checks = false
ink_e2e = { workspace = true }
14 changes: 4 additions & 10 deletions test-cases/ecdsa-recover/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,9 @@ ink-as-dependency = []
e2e-tests = []

[dependencies]
ink = { version = "4.2.1", default-features = false }
scale = { package = "parity-scale-codec", version = "=3.6.5", default-features = false, features = ["derive"] }
scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true }
ink = { workspace = true }
scale = { workspace = true, package = "parity-scale-codec" }
scale-info = { workspace = true, optional = true }

[dev-dependencies]
ink_e2e = "4.2.1"

[profile.dev]
overflow-checks = false

[profile.release]
overflow-checks = false
ink_e2e = { workspace = true }
Loading
Loading