Skip to content

Commit 40f6664

Browse files
committed
apply binding client to wasp-cli
1 parent 42c6794 commit 40f6664

File tree

43 files changed

+3057
-328
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+3057
-328
lines changed
Lines changed: 569 additions & 34 deletions
Large diffs are not rendered by default.

clients/bindings/bind.sh

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ set -euo pipefail
33

44
root_path=$(git rev-parse --show-toplevel)
55

6-
git clone --depth=1 --branch sdk-bindings --single-branch https://github.com/iotaledger/iota-rust-sdk.git "$root_path/clients/bindings/iota-rust-sdk" || true
6+
# use commit b921ab3e65acbe377cd4da0ec6d8421fecc15ad8
7+
# git clone --branch modify-sdk --single-branch git@github.com:howjmay/iota-rust-sdk.git "$root_path/clients/bindings/iota-rust-sdk" || true
8+
# cd $root_path/clients/bindings/iota-rust-sdk
9+
# git switch --detach b921ab3e65acbe377cd4da0ec6d8421fecc15ad8
10+
# cd ..
711

812
iota_binding_dir="$root_path/clients/bindings"
913
iota_go_ffi_dir="$iota_binding_dir/iota_sdk_ffi"
1014
iota_go_ffi_file="$iota_go_ffi_dir/iota_sdk_ffi.go"
1115

1216
iota_rust_sdk_path="$iota_binding_dir/iota-rust-sdk"
13-
go_ffi_dir="$iota_rust_sdk_path/bindings/go/iota_sdk_ffi/iota_sdk_ffi"
14-
go_ffi_file="$go_ffi_dir/iota_sdk_ffi.go"
15-
16-
go_ffi_target_dir="$root_path/clients/bindings/iota-rust-sdk/target"
17+
iota_rust_go_ffi_dir="$iota_rust_sdk_path/bindings/go/iota_sdk_ffi"
1718

1819
cd "$iota_rust_sdk_path"
1920
cargo build --all-features -p iota-sdk-ffi --lib --release
@@ -27,20 +28,20 @@ case "$(uname -s)" in
2728
esac
2829
lib_path="${lib_base}.${ext}"
2930

30-
command -v uniffi-bindgen-go >/dev/null || {
31-
echo "uniffi-bindgen-go not found in PATH" >&2
32-
exit 1
33-
}
3431
[[ -f "$lib_path" ]] || {
3532
echo "Library not found: $lib_path" >&2
3633
exit 1
3734
}
3835

39-
# Clean up old generated files before generating new ones
40-
rm -rf "$root_path/clients/bindings/iota_sdk_ffi"
41-
42-
uniffi-bindgen-go --library "$lib_path" --out-dir "$iota_binding_dir" --no-format
43-
echo "Generated Go bindings to $iota_binding_dir using $lib_path"
36+
# Overwrite local Go FFI bindings with those from iota-rust-sdk
37+
rm -rf "$iota_go_ffi_dir"
38+
if [[ -d "$iota_rust_go_ffi_dir" ]]; then
39+
cp -R "$iota_rust_go_ffi_dir" "$iota_binding_dir/"
40+
echo "Copied Go bindings from $iota_rust_go_ffi_dir to $iota_binding_dir"
41+
else
42+
echo "Source bindings not found: $iota_rust_go_ffi_dir" >&2
43+
exit 1
44+
fi
4445

4546
if [[ -f "$iota_go_ffi_file" ]]; then
4647
# Only replace if the placeholder include line exists
@@ -58,9 +59,3 @@ else
5859
echo "File not found: $iota_go_ffi_file" >&2
5960
exit 1
6061
fi
61-
62-
63-
# cp -R $go_ffi_target_dir $root_path/clients/bindings/iota_sdk_ffi
64-
65-
66-

clients/bindings/bindings_test.go

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)