Skip to content

Commit

Permalink
refactor!: stop exposing data-mutating functions on uniffi core crypt…
Browse files Browse the repository at this point in the history
…o type

These were deprecated for some time now. They created a
transaction internally. Now, an explicit transaction
created on the core crypto transaction context must be
used.
  • Loading branch information
SimonThormeyer committed Jan 20, 2025
1 parent b4a0536 commit 30f4a72
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 783 deletions.
22 changes: 0 additions & 22 deletions crypto-ffi/src/generic/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,28 +188,6 @@ impl CoreCrypto {
}
}
}
impl CoreCrypto {
/// For internal use in deprecated functions.
pub(crate) async fn deprecated_transaction<F, Fut, R, E>(&self, callback: F) -> CoreCryptoResult<R>
where
F: FnOnce(CentralContext) -> Fut,
Fut: Future<Output = Result<R, E>>,
E: Into<core_crypto::Error>,
{
let context = self.central.new_transaction().await?;
let result = callback(context.clone()).await;
match result {
Ok(result) => {
context.finish().await?;
Ok(result)
}
Err(err) => {
context.abort().await?;
Err(<E as Into<core_crypto::Error>>::into(err).into())
}
}
}
}

#[uniffi::export]
impl CoreCryptoContext {
Expand Down
Loading

0 comments on commit 30f4a72

Please sign in to comment.