Skip to content

Commit

Permalink
Revert "ffi: remove arg from uniffi::setup_scaffolding macro"
Browse files Browse the repository at this point in the history
Removing the `nostr_sdk` arg from `uniffi::setup_scaffolding` caused issues with Swift Bindings, so revert commit 64c592a

Fixes rust-nostr/nostr-sdk-swift#3

Signed-off-by: Yuki Kishimoto <[email protected]>
  • Loading branch information
yukibtc committed Nov 18, 2024
1 parent 5fa3d7c commit bb8a711
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bindings/nostr-sdk-ffi/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ darwin-universal: swift-deps
assemble-swift-package:
mkdir -p swift/Sources/NostrSDK
cargo run -p uniffi-bindgen generate --library ../../target/aarch64-apple-ios/release/libnostr_sdk_ffi.a --no-format --language swift --out-dir swift/Sources/NostrSDK
mv swift/Sources/NostrSDK/nostr_sdk_ffi.swift swift/Sources/NostrSDK/NostrSDK.swift
mv swift/Sources/NostrSDK/nostr_sdk.swift swift/Sources/NostrSDK/NostrSDK.swift
cp swift/Sources/NostrSDK/nostr_sdkFFI.h swift/nostr_sdkFFI.xcframework/ios-arm64/nostr_sdkFFI.framework/Headers
cp swift/Sources/NostrSDK/nostr_sdkFFI.h swift/nostr_sdkFFI.xcframework/ios-arm64_x86_64-simulator/nostr_sdkFFI.framework/Headers
cp swift/Sources/NostrSDK/nostr_sdkFFI.h swift/nostr_sdkFFI.xcframework/macos-arm64_x86_64/nostr_sdkFFI.framework/Headers
Expand Down
2 changes: 1 addition & 1 deletion bindings/nostr-sdk-ffi/python/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ libnostr_sdk_ffi.dylib

*.swp

src/nostr-sdk/nostr_sdk_ffi.py
src/nostr-sdk/nostr_sdk.py
src/nostr-sdk/*.so
*.whl
build/
Expand Down
4 changes: 2 additions & 2 deletions bindings/nostr-sdk-ffi/python/src/nostr-sdk/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from nostr_sdk.nostr_sdk_ffi import *
from nostr_sdk.nostr_sdk_ffi import uniffi_set_event_loop
from nostr_sdk.nostr_sdk import *
from nostr_sdk.nostr_sdk import uniffi_set_event_loop
4 changes: 3 additions & 1 deletion bindings/nostr-sdk-ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,6 @@ impl NostrLibrary {
}
}

uniffi::setup_scaffolding!();
// Changes to this arg will break binding packages (in particular Swift).
// If this is removed, make sure to update `uniffi.toml`
uniffi::setup_scaffolding!("nostr_sdk");
2 changes: 1 addition & 1 deletion bindings/nostr-sdk-ffi/tests/test_equality.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from nostr_sdk_ffi import *
from nostr_sdk import *

# Test PublicKey
pk1 = PublicKey.from_hex("b2d670de53b27691c0c3400225b65c35a26d06093bcc41f48ffc71e0907f9d4a")
Expand Down
4 changes: 2 additions & 2 deletions bindings/nostr-sdk-ffi/tests/test_nip05.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import asyncio
from nostr_sdk_ffi import *
from nostr_sdk import *

async def main():
nip_05 = "[email protected]"
Expand All @@ -11,4 +11,4 @@ async def main():
print(f" Unable to verify NIP05, for {public_key.to_bech32()}")

if __name__ == '__main__':
asyncio.run(main())
asyncio.run(main())
2 changes: 1 addition & 1 deletion bindings/nostr-sdk-ffi/tests/test_to_string.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from nostr_sdk_ffi import *
from nostr_sdk import *

addr = "30023:aa4fc8665f5696e33db7e1a572e3b0f5b3d615837b0f362dcb1c8068b098c7b4:ipsum"
coordinate = Coordinate.parse(addr)
Expand Down

0 comments on commit bb8a711

Please sign in to comment.