Skip to content

Commit

Permalink
Change back to 0.25.0 uniffi, build go lib with 0.2.1 bindgen.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenlu committed Mar 15, 2024
1 parent 7b1f727 commit f4c8d97
Show file tree
Hide file tree
Showing 9 changed files with 1,551 additions and 791 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ edition = "2021"
hex = "0.4.3"
rand_core = { "version" = "0.6.4", features = ["getrandom"] }
getrandom = { version = "0.2", features = ["js"] }
uniffi = "0.26.0"
uniffi = "0.25.0"
wasm-bindgen = "0.2.87"

# The `console_error_panic_hook` crate provides better debugging of panics by
Expand All @@ -29,7 +29,7 @@ bitcoin-bech32 = "0.13.0"
default = ["uniffi/cli"]

[build-dependencies]
uniffi = { version = "0.26.0", features = [ "build" ] }
uniffi = { version = "0.25.0", features = [ "build" ] }

[lib]
crate-type = ["cdylib", "staticlib"]
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ build-darwin-arm64:

code-gen-go:
mkdir -p lightspark-crypto-go/internal
cargo install uniffi-bindgen-go --git https://github.com/NordSecurity/uniffi-bindgen-go --tag v0.1.5+v0.23.0
cargo install uniffi-bindgen-go --git https://github.com/NordSecurity/uniffi-bindgen-go --tag v0.2.1+v0.25.0
uniffi-bindgen-go src/lightspark_crypto.udl --out-dir lightspark-crypto-go
mv lightspark-crypto-go/uniffi/lightspark_crypto/* lightspark-crypto-go/internal
mv lightspark-crypto-go/lightspark_crypto/* lightspark-crypto-go/internal
sed -i '' 's/package lightspark_crypto/package internal/g' lightspark-crypto-go/internal/lightspark_crypto.go
rm -rf lightspark-crypto-go/uniffi

Expand Down
8 changes: 8 additions & 0 deletions lightspark-crypto-go/internal/lightspark_crypto.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <lightspark_crypto.h>

// This file exists beacause of
// https://github.com/golang/go/issues/11263

void cgo_rust_task_callback_bridge_lightspark_crypto(RustTaskCallback cb, const void * taskData, int8_t status) {
cb(taskData, status);
}
Loading

0 comments on commit f4c8d97

Please sign in to comment.