diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -228,6 +228,12 @@ "generic-array", ] +[[package]] +name = "bumpalo" +version = "3.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" + [[package]] name = "byteorder" version = "1.5.0" @@ -535,6 +541,18 @@ "crypto-common", ] +[[package]] +name = "ecash-lib-wasm" +version = "0.1.0" +dependencies = [ + "abc-rust-lint", + "ripemd", + "secp256k1-abc", + "sha2", + "thiserror", + "wasm-bindgen", +] + [[package]] name = "either" version = "1.10.0" @@ -1574,6 +1592,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +[[package]] +name = "secp256k1-abc" +version = "0.20.3" +source = "git+https://github.com/raipay/secp256k1-abc?rev=b23e742#b23e74219f5c425eada0f53a52f9b51fdb3b23b2" +dependencies = [ + "secp256k1-sys-abc", +] + +[[package]] +name = "secp256k1-sys-abc" +version = "0.4.1" +source = "git+https://github.com/raipay/secp256k1-abc?rev=b23e742#b23e74219f5c425eada0f53a52f9b51fdb3b23b2" +dependencies = [ + "cc", +] + [[package]] name = "semver" version = "1.0.22" @@ -2005,6 +2039,60 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasm-bindgen" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.58", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.58", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.92" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" + [[package]] name = "which" version = "4.4.2" diff --git a/Cargo.toml b/Cargo.toml --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,13 @@ "chronik/chronik-plugin", "chronik/chronik-proto", "chronik/chronik-util", + "modules/ecash-lib-wasm", ] [workspace.package] rust-version = "1.76.0" + +[profile.release-wasm] +inherits = "release" +lto = true +opt-level = "z" diff --git a/chronik/CMakeLists.txt b/chronik/CMakeLists.txt --- a/chronik/CMakeLists.txt +++ b/chronik/CMakeLists.txt @@ -95,6 +95,8 @@ FLAGS ${CHRONIK_CARGO_FLAGS} ${CHRONIK_FEATURE_FLAGS} + CRATES + chronik-lib ) set(Rust_TRIPLE diff --git a/modules/ecash-lib-wasm/Cargo.toml b/modules/ecash-lib-wasm/Cargo.toml --- a/modules/ecash-lib-wasm/Cargo.toml +++ b/modules/ecash-lib-wasm/Cargo.toml @@ -8,10 +8,6 @@ edition = "2021" rust-version = "1.76.0" -[workspace] -# Not a workspace member -members = [] - [lib] crate-type = ["cdylib"] @@ -36,8 +32,3 @@ rev = "b23e742" default-features = false features = ["alloc"] - -[profile.release-wasm] -inherits = "release" -lto = true -opt-level = "z"