Skip to content

Commit 1512be2

Browse files
chore(swift/kotlin): override transactionFfi() to hide it from docs
1 parent 6e31631 commit 1512be2

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

crypto-ffi/bindings/shared/src/commonMain/kotlin/com/wire/crypto/CoreCrypto.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class CoreCrypto(private val cc: CoreCryptoFfi) : CoreCryptoFfiInterface by cc {
6969
var result: R? = null
7070
var error: Throwable? = null
7171
try {
72-
this@CoreCrypto.cc.transaction(object : CoreCryptoCommand {
72+
this@CoreCrypto.cc.transactionFfi(object : CoreCryptoCommand {
7373
override suspend fun execute(context: CoreCryptoContext) {
7474
try {
7575
result = block(context)
@@ -93,6 +93,10 @@ class CoreCrypto(private val cc: CoreCryptoFfi) : CoreCryptoFfiInterface by cc {
9393
return@withContext result as R
9494
}
9595

96+
@Deprecated("Use transaction(block) instead", level = DeprecationLevel.HIDDEN)
97+
@JvmSynthetic
98+
override suspend fun transactionFfi(command: CoreCryptoCommand) = cc.transactionFfi(command)
99+
96100
/**
97101
* Register an Epoch Observer which will be notified every time a conversation's epoch changes.
98102
*

crypto-ffi/bindings/swift/WireCoreCrypto/WireCoreCrypto/CoreCrypto.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,18 @@ public final class CoreCrypto: CoreCryptoFfi, CoreCryptoProtocol, @unchecked Sen
7474
let transactionExecutor = try TransactionExecutor<Result>(
7575
keystorePath: filePath, block)
7676
do {
77-
try await self.transaction(command: transactionExecutor)
77+
try await super.transactionFfi(command: transactionExecutor)
7878
} catch {
7979
throw await transactionExecutor.innerError ?? error
8080
}
8181
return await transactionExecutor.result!
8282
}
8383

84+
@available(*, unavailable, message: "Use transaction(_:) instead.")
85+
public override func transactionFfi(command: CoreCryptoCommand) async throws {
86+
try await super.transactionFfi(command: command)
87+
}
88+
8489
public func registerEpochObserver(_ epochObserver: EpochObserver) async throws {
8590
// we want to wrap the observer here to provide async indirection, so that no matter what
8691
// the observer that makes its way to the Rust side of things doesn't end up blocking

0 commit comments

Comments
 (0)