-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(test): Skeleton binding crates (#3866)
# Motivation We would like comprehensive pocket-ic tests for Oisy. To that end, we would like to generate canister bindings to be used in pocket-ic tests rather than maintaining the bindings manually. We will start with the ledger bindings, then move on to the chain fusion signer and rewards canisters. There already bindings for use inside a canister. There is a TODO to autogenerate them. However it is inconvenient and sometimes very confusing if the API types are generated twice, with identical names. We will therefore make `didc` generate a file with just Rust types, and the two (pocket-ic and canister) bindings will use those shared types. A further constraint is that pocket-ic and canister bindings cannot be compiled together into the same crate. We therefore need three separate crates for types, pocket-ic bindings and internal canister bindings. There is quite a lot to do here, so we break it down into small steps. # Changes - Create the Rust crates needed to support pocket-ic and types bindings. # Tests - Existing CI should verify that the crates are well formed. - The crates are currently empty, so there is nothing else to test at this time. --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
90d529b
commit 35d499b
Showing
9 changed files
with
62 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
# Lint the rust code | ||
cargo clippy --locked --target wasm32-unknown-unknown --all-features -- -D warnings -W clippy::pedantic -A clippy::module-name-repetitions -A clippy::struct-field-names -A deprecated | ||
# Lint the Rust canister code, excluding the autogenerated crates. | ||
for crate in src/backend/Cargo.toml src/shared/Cargo.toml; do | ||
cargo clippy --manifest-path "$crate" --locked --target wasm32-unknown-unknown --all-features -- -D warnings -W clippy::pedantic -A clippy::module-name-repetitions -A clippy::struct-field-names -A deprecated | ||
done |
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,12 @@ | ||
[package] | ||
name = "ic-cycles-ledger-pic" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
candid = { workspace = true } | ||
ic-cdk = { workspace = true } | ||
ic-cycles-ledger-types = { workspace = true } | ||
pocket-ic = { workspace = true } | ||
serde = { workspace = true } | ||
serde_bytes = { workspace = true } |
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 @@ | ||
//! TODO: Generate pic bindings. |
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 @@ | ||
[package] | ||
name = "ic-cycles-ledger-types" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
candid = { workspace = true } | ||
ic-cdk = { workspace = true } | ||
serde = { workspace = true } | ||
serde_bytes = { workspace = true } |
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 @@ | ||
//! TODO: generate types |
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