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

feat(test): Skeleton binding crates #3866

Merged
merged 12 commits into from
Dec 17, 2024
Merged
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
23 changes: 23 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
members = [
"src/backend",
"src/cycles_ledger/client",
"src/cycles_ledger/pic",
"src/cycles_ledger/types",
"src/shared"
bitdivine marked this conversation as resolved.
Show resolved Hide resolved
]
resolver = "2"
Expand All @@ -11,6 +13,8 @@ ic-cdk = "0.16.0"
ic-cdk-macros = "0.16.0"
ic-cdk-timers = "0.9.0"
ic-cycles-ledger-client = { path = "src/cycles_ledger/client" }
ic-cycles-ledger-pic = { path = "src/cycles_ledger/pic" }
ic-cycles-ledger-types = { path = "src/cycles_ledger/types" }
ic-ledger-types = "0.13.0"
ic-stable-structures = "0.6.7"
ic-metrics-encoder = "1.1.1"
Expand Down
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,18 @@ COPY Cargo.lock .
COPY Cargo.toml .
COPY src/backend/Cargo.toml src/backend/Cargo.toml
COPY src/cycles_ledger/client/Cargo.toml src/cycles_ledger/client/Cargo.toml
COPY src/cycles_ledger/pic/Cargo.toml src/cycles_ledger/pic/Cargo.toml
COPY src/cycles_ledger/types/Cargo.toml src/cycles_ledger/types/Cargo.toml
COPY src/shared/Cargo.toml src/shared/Cargo.toml
ENV CARGO_TARGET_DIR=/cargo_target
RUN mkdir -p src/backend/src \
&& touch src/backend/src/lib.rs \
&& mkdir -p src/cycles_ledger/client/src \
&& touch src/cycles_ledger/client/src/lib.rs \
&& mkdir -p src/cycles_ledger/pic/src \
&& touch src/cycles_ledger/pic/src/lib.rs \
&& mkdir -p src/cycles_ledger/types/src \
&& touch src/cycles_ledger/types/src/lib.rs \
&& mkdir -p src/shared/src \
&& touch src/shared/src/lib.rs \
&& ./docker/build --only-dependencies \
Expand Down
6 changes: 4 additions & 2 deletions scripts/lint.rust.sh
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
12 changes: 12 additions & 0 deletions src/cycles_ledger/pic/Cargo.toml
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 }
1 change: 1 addition & 0 deletions src/cycles_ledger/pic/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//! TODO: Generate pic bindings.
10 changes: 10 additions & 0 deletions src/cycles_ledger/types/Cargo.toml
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 }
1 change: 1 addition & 0 deletions src/cycles_ledger/types/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//! TODO: generate types
1 change: 1 addition & 0 deletions src/shared/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ edition = "2021"

[dependencies]
candid = { workspace = true }
getrandom = { workspace = true }
ic-canister-sig-creation = { workspace = true }
ic-cdk = { workspace = true }
ic-cdk-macros = { workspace = true }
Expand Down
Loading