Skip to content

Commit

Permalink
Bump to latest uniffi (#279)
Browse files Browse the repository at this point in the history
* bump to latest uniffi

* fix linter

* update the libraries

* get all tests passing
  • Loading branch information
nplasterer authored Jul 26, 2024
1 parent e97fafb commit feb17b8
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions library/src/main/java/libxmtp-version.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 3df528b5
Version: e08dc95c
Branch: main
Date: 2024-07-25 22:27:46 +0000
Date: 2024-07-26 17:36:50 +0000
22 changes: 11 additions & 11 deletions library/src/main/java/xmtpv3.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

@file:Suppress("NAME_SHADOWING")

package uniffi.xmtpv3;
package uniffi.xmtpv3

// Common helper code.
//
Expand Down Expand Up @@ -250,7 +250,7 @@ internal open class UniffiRustCallStatus : Structure() {
}
}

class InternalException(message: String) : Exception(message)
class InternalException(message: String) : kotlin.Exception(message)

// Each top-level error class has a companion object that can lift the error from the call status's rust buffer
interface UniffiRustCallStatusErrorHandler<E> {
Expand All @@ -262,18 +262,18 @@ interface UniffiRustCallStatusErrorHandler<E> {
// synchronize itself

// Call a rust function that returns a Result<>. Pass in the Error class companion that corresponds to the Err
private inline fun <U, E : Exception> uniffiRustCallWithError(
private inline fun <U, E : kotlin.Exception> uniffiRustCallWithError(
errorHandler: UniffiRustCallStatusErrorHandler<E>,
callback: (UniffiRustCallStatus) -> U,
): U {
var status = UniffiRustCallStatus();
var status = UniffiRustCallStatus()
val return_value = callback(status)
uniffiCheckCallStatus(errorHandler, status)
return return_value
}

// Check UniffiRustCallStatus and throw an error if the call wasn't successful
private fun <E : Exception> uniffiCheckCallStatus(
private fun <E : kotlin.Exception> uniffiCheckCallStatus(
errorHandler: UniffiRustCallStatusErrorHandler<E>,
status: UniffiRustCallStatus,
) {
Expand Down Expand Up @@ -305,7 +305,7 @@ object UniffiNullRustCallStatusErrorHandler : UniffiRustCallStatusErrorHandler<I

// Call a rust function that returns a plain value
private inline fun <U> uniffiRustCall(callback: (UniffiRustCallStatus) -> U): U {
return uniffiRustCallWithError(UniffiNullRustCallStatusErrorHandler, callback);
return uniffiRustCallWithError(UniffiNullRustCallStatusErrorHandler, callback)
}

internal inline fun <T> uniffiTraitInterfaceCall(
Expand All @@ -315,7 +315,7 @@ internal inline fun <T> uniffiTraitInterfaceCall(
) {
try {
writeReturn(makeCall())
} catch (e: Exception) {
} catch (e: kotlin.Exception) {
callStatus.code = UNIFFI_CALL_UNEXPECTED_ERROR
callStatus.error_buf = FfiConverterString.lower(e.toString())
}
Expand All @@ -329,7 +329,7 @@ internal inline fun <T, reified E : Throwable> uniffiTraitInterfaceCallWithError
) {
try {
writeReturn(makeCall())
} catch (e: Exception) {
} catch (e: kotlin.Exception) {
if (e is E) {
callStatus.code = UNIFFI_CALL_ERROR
callStatus.error_buf = lowerError(e)
Expand Down Expand Up @@ -2204,7 +2204,7 @@ internal object uniffiRustFutureContinuationCallbackImpl : UniffiRustFutureConti
}
}

internal suspend fun <T, F, E : Exception> uniffiRustCallAsync(
internal suspend fun <T, F, E : kotlin.Exception> uniffiRustCallAsync(
rustFuture: Long,
pollFunc: (Long, UniffiRustFutureContinuationCallback, Long) -> Unit,
completeFunc: (Long, UniffiRustCallStatus) -> F,
Expand Down Expand Up @@ -7268,7 +7268,7 @@ public object FfiConverterTypeFfiSortDirection : FfiConverterRustBuffer<FfiSortD
}


sealed class GenericException(message: String) : Exception(message) {
sealed class GenericException(message: String) : kotlin.Exception(message) {

class Client(message: String) : GenericException(message)

Expand Down Expand Up @@ -7385,7 +7385,7 @@ public object FfiConverterTypeGenericError : FfiConverterRustBuffer<GenericExcep
}


sealed class SigningException(message: String) : Exception(message) {
sealed class SigningException(message: String) : kotlin.Exception(message) {

class Generic(message: String) : SigningException(message)

Expand Down
Binary file modified library/src/main/jniLibs/arm64-v8a/libuniffi_xmtpv3.so
Binary file not shown.
Binary file modified library/src/main/jniLibs/armeabi-v7a/libuniffi_xmtpv3.so
Binary file not shown.
Binary file modified library/src/main/jniLibs/x86/libuniffi_xmtpv3.so
Binary file not shown.
Binary file modified library/src/main/jniLibs/x86_64/libuniffi_xmtpv3.so
Binary file not shown.

0 comments on commit feb17b8

Please sign in to comment.