From f4ab2ed98034e540f7ff9dce78bf9362d2d3a7fd Mon Sep 17 00:00:00 2001 From: Dominic Woerner Date: Tue, 19 Dec 2023 20:47:11 +0100 Subject: [PATCH] simplify project structure Signed-off-by: Dominic Woerner --- Cargo.lock | 2 +- Cargo.toml | 22 +++++++++++++++---- deploy.sh | 4 ++-- dfx.json | 11 +++++++--- ...nister_backend.did => schnorr_canister.did | 0 src/{schnorr_canister_backend/src => }/lib.rs | 0 src/schnorr_canister_backend/Cargo.toml | 18 --------------- 7 files changed, 29 insertions(+), 28 deletions(-) rename src/schnorr_canister_backend/schnorr_canister_backend.did => schnorr_canister.did (100%) rename src/{schnorr_canister_backend/src => }/lib.rs (100%) delete mode 100644 src/schnorr_canister_backend/Cargo.toml diff --git a/Cargo.lock b/Cargo.lock index 7f5bb11..2609b49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -541,7 +541,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] -name = "schnorr_canister_backend" +name = "schnorr_canister" version = "0.1.0" dependencies = [ "bip32", diff --git a/Cargo.toml b/Cargo.toml index af167e8..8cbf879 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,18 @@ -[workspace] -members = [ - "src/schnorr_canister_backend", -] +[package] +name = "schnorr_canister" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[lib] +crate-type = ["cdylib"] + +[dependencies] +bip32 = { "version" = "0.5.1", features = ["k256"] } +candid = "0.10.1" +ic-cdk = "0.12.0" +ic-stable-structures = "0.6" +getrandom = { version = "0.2.11", features = ["custom"] } +k256 = { "version" = "0.13.2", features = ["schnorr"] } +serde = "1" \ No newline at end of file diff --git a/deploy.sh b/deploy.sh index b472a98..2b04e36 100755 --- a/deploy.sh +++ b/deploy.sh @@ -1,4 +1,4 @@ #!/bin/bash -cargo build --release --target wasm32-unknown-unknown --package schnorr_canister_backend -candid-extractor target/wasm32-unknown-unknown/release/schnorr_canister_backend.wasm > src/schnorr_canister_backend/schnorr_canister_backend.did +cargo build --release --target wasm32-unknown-unknown --package schnorr_canister +candid-extractor target/wasm32-unknown-unknown/release/schnorr_canister.wasm > schnorr_canister.did dfx deploy \ No newline at end of file diff --git a/dfx.json b/dfx.json index cb7b498..5778243 100644 --- a/dfx.json +++ b/dfx.json @@ -1,9 +1,14 @@ { "canisters": { "schnorr_canister_backend": { - "candid": "src/schnorr_canister_backend/schnorr_canister_backend.did", - "package": "schnorr_canister_backend", - "type": "rust" + "candid": "schnorr_canister.did", + "package": "schnorr_canister", + "type": "rust", + "pullable": { + "dependencies": [], + "wasm_url": "https://github.com/domwoe/pullable/releases/latest/download/schnorr_canister.wasm", + "init_guide": "Call method `init_key` after installation." + } } }, "output_env_file": ".env", diff --git a/src/schnorr_canister_backend/schnorr_canister_backend.did b/schnorr_canister.did similarity index 100% rename from src/schnorr_canister_backend/schnorr_canister_backend.did rename to schnorr_canister.did diff --git a/src/schnorr_canister_backend/src/lib.rs b/src/lib.rs similarity index 100% rename from src/schnorr_canister_backend/src/lib.rs rename to src/lib.rs diff --git a/src/schnorr_canister_backend/Cargo.toml b/src/schnorr_canister_backend/Cargo.toml deleted file mode 100644 index e9ab80e..0000000 --- a/src/schnorr_canister_backend/Cargo.toml +++ /dev/null @@ -1,18 +0,0 @@ -[package] -name = "schnorr_canister_backend" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[lib] -crate-type = ["cdylib"] - -[dependencies] -bip32 = { "version" = "0.5.1", features = ["k256"] } -candid = "0.10.1" -ic-cdk = "0.12.0" -ic-stable-structures = "0.6" -getrandom = { version = "0.2.11", features = ["custom"] } -k256 = { "version" = "0.13.2", features = ["schnorr"] } -serde = "1" \ No newline at end of file