Skip to content

Commit

Permalink
fix: integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
veeso committed Apr 16, 2024
1 parent 7d473a7 commit f3b6b42
Show file tree
Hide file tree
Showing 39 changed files with 2,426 additions and 226 deletions.
1,130 changes: 1,105 additions & 25 deletions Cargo.lock

Large diffs are not rendered by default.

26 changes: 7 additions & 19 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
[package]
name = "dip721-canister"
[workspace]
members = ["integration-tests", "src/dip721_canister"]
resolver = "2"

[workspace.package]
authors = ["Christian Visintin <christian.visintin@veeso.dev>"]
edition = "2021"
license = "MIT"
readme = "README.md"
repository = "https://github.com/veeso-dev/dip721-template-canister"
repository = "https://github.com/EKOKEtoken/ekoke"
version = "0.1.0"

[[bin]]
name = "dip721-canister-did"
path = "src/lib.rs"

[lib]
crate-type = ["cdylib"]

[dependencies]
[workspace.dependencies]
async-trait = "0.1"
candid = "0.10"
dip721-rs = "0.1"
Expand All @@ -28,14 +24,6 @@ num-traits = "0.2"
serde = { version = "1", features = ["derive"] }
thiserror = "1.0"

[dev-dependencies]
pretty_assertions = "1"
tokio = { version = "1", features = ["full"] }

[features]
default = []
did = []

[profile.dev]
debug = false

Expand Down
2 changes: 1 addition & 1 deletion Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ workspace = false

[tasks.dip721-canister-did]
description = "Generate did files for dip721-canister"
script = "cargo run --bin dip721-canister-did --features did > src/dip721-canister.did"
script = "cargo run --bin dip721-canister-did --features did > src/dip721_canister/dip721-canister.did"
workspace = false

[tasks.dfx-generate]
Expand Down
4 changes: 2 additions & 2 deletions dfx.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"canisters": {
"dip721-canister": {
"candid": "src/dip721-canister.did",
"package": "dip721-canister",
"candid": "src/dip721_canister/dip721-canister.did",
"package": "dip721_canister",
"type": "rust"
}
},
Expand Down
21 changes: 21 additions & 0 deletions integration-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "integration-tests"
version = { workspace = true }
authors = { workspace = true }
edition = { workspace = true }
license = { workspace = true }
repository = { workspace = true }

[dependencies]
anyhow = "1"
candid = { workspace = true }
dip721-rs = { workspace = true }
pocket-ic = "2"
serde = { workspace = true }
serde_bytes = "0.11"
serde_json = "1"

[dev-dependencies]
pretty_assertions = "1"
serial_test = "3"
tokio = { version = "1", features = ["full"] }
17 changes: 17 additions & 0 deletions integration-tests/src/actor.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
use candid::Principal;

pub fn alice() -> Principal {
Principal::from_text("be2us-64aaa-aaaaa-qaabq-cai").unwrap()
}

pub fn admin() -> Principal {
Principal::from_text("rrkah-fqaaa-aaaaa-aaaaq-cai").unwrap()
}

pub fn bob() -> Principal {
Principal::from_text("bs5l3-6b3zu-dpqyj-p2x4a-jyg4k-goneb-afof2-y5d62-skt67-3756q-dqe").unwrap()
}

pub fn charlie() -> Principal {
Principal::from_text("bkyz2-fmaaa-aaaaa-qaaaq-cai").unwrap()
}
3 changes: 3 additions & 0 deletions integration-tests/src/client.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mod dip721;

pub use dip721::Dip721Client;
Loading

0 comments on commit f3b6b42

Please sign in to comment.