Skip to content

Commit

Permalink
ffi: fix "'unsigned' is a keyword" error on Swift Package
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Kishimoto <[email protected]>
  • Loading branch information
yukibtc committed Nov 16, 2024
1 parent 7e60284 commit 72078df
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions bindings/nostr-sdk-ffi/src/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ impl NostrSigner for NostrConnect {
Ok(Some(Arc::new(self.inner.get_public_key().await?.into())))
}

async fn sign_event(&self, unsigned: Arc<UnsignedEvent>) -> Result<Option<Arc<Event>>> {
async fn sign_event(&self, unsigned_event: Arc<UnsignedEvent>) -> Result<Option<Arc<Event>>> {
Ok(Some(Arc::new(
self.inner
.sign_event(unsigned.as_ref().deref().clone())
.sign_event(unsigned_event.as_ref().deref().clone())
.await?
.into(),
)))
Expand Down
4 changes: 2 additions & 2 deletions bindings/nostr-sdk-ffi/src/protocol/key/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,10 @@ impl NostrSigner for Keys {
Ok(Some(Arc::new(self.inner.get_public_key().await?.into())))
}

async fn sign_event(&self, unsigned: Arc<UnsignedEvent>) -> Result<Option<Arc<Event>>> {
async fn sign_event(&self, unsigned_event: Arc<UnsignedEvent>) -> Result<Option<Arc<Event>>> {
Ok(Some(Arc::new(
self.inner
.sign_event(unsigned.as_ref().deref().clone())
.sign_event(unsigned_event.as_ref().deref().clone())
.await?
.into(),
)))
Expand Down
10 changes: 5 additions & 5 deletions bindings/nostr-sdk-ffi/src/protocol/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub trait NostrSigner: Send + Sync {
async fn get_public_key(&self) -> Result<Option<Arc<PublicKey>>>;

/// Sign an unsigned event
async fn sign_event(&self, unsigned: Arc<UnsignedEvent>) -> Result<Option<Arc<Event>>>;
async fn sign_event(&self, unsigned_event: Arc<UnsignedEvent>) -> Result<Option<Arc<Event>>>;

/// NIP04 encrypt (deprecate and unsecure)
async fn nip04_encrypt(&self, public_key: Arc<PublicKey>, content: String) -> Result<String>;
Expand Down Expand Up @@ -101,11 +101,11 @@ impl NostrSignerFFI2Rust {
}

pub struct NostrSignerRust2FFI {
pub(super) inner: Arc<dyn nostr::signer::NostrSigner>,
pub(super) inner: Arc<dyn signer::NostrSigner>,
}

impl NostrSignerRust2FFI {
pub fn new(inner: Arc<dyn nostr::signer::NostrSigner>) -> Self {
pub fn new(inner: Arc<dyn signer::NostrSigner>) -> Self {
Self { inner }
}
}
Expand All @@ -120,10 +120,10 @@ impl NostrSigner for NostrSignerRust2FFI {
Ok(Some(Arc::new(self.inner.get_public_key().await?.into())))
}

async fn sign_event(&self, unsigned: Arc<UnsignedEvent>) -> Result<Option<Arc<Event>>> {
async fn sign_event(&self, unsigned_event: Arc<UnsignedEvent>) -> Result<Option<Arc<Event>>> {
Ok(Some(Arc::new(
self.inner
.sign_event(unsigned.as_ref().deref().clone())
.sign_event(unsigned_event.as_ref().deref().clone())
.await?
.into(),
)))
Expand Down

0 comments on commit 72078df

Please sign in to comment.