File tree Expand file tree Collapse file tree 3 files changed +2
-10
lines changed
kotlin/wallet-core-kotlin/src/iosMain/kotlin/com/trustwallet/core Expand file tree Collapse file tree 3 files changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ actual object AnySigner {
1010
1111 actual fun sign (input : ByteArray , coin : CoinType ): ByteArray {
1212 val inputData = TWDataCreateWithBytes (input.toUByteArray().toCValues(), input.size.toULong())
13- val result = TWAnySignerSign (input.toTwData() , coin.value)!! .readTwBytes()!!
13+ val result = TWAnySignerSign (inputData , coin.value)!! .readTwBytes()!!
1414 TWDataDelete (inputData)
1515 return result
1616 }
@@ -29,7 +29,7 @@ actual object AnySigner {
2929
3030 actual fun plan (input : ByteArray , coin : CoinType ): ByteArray {
3131 val inputData = TWDataCreateWithBytes (input.toUByteArray().toCValues(), input.size.toULong())
32- val result = TWAnySignerPlan (input.toTwData() , coin.value)?.readTwBytes()!!
32+ val result = TWAnySignerPlan (inputData , coin.value)?.readTwBytes()!!
3333 TWDataDelete (inputData)
3434 return result
3535 }
Original file line number Diff line number Diff line change @@ -15,7 +15,3 @@ internal fun COpaquePointer?.readTwBytes(): ByteArray? =
1515 TWDataDelete (it)
1616 result
1717 }
18-
19- @OptIn(ExperimentalUnsignedTypes ::class )
20- internal fun ByteArray?.toTwData (): COpaquePointer ? =
21- TWDataCreateWithBytes (this ?.toUByteArray()?.toCValues(), this ?.size?.toULong() ? : 0u )
Original file line number Diff line number Diff line change 44
55package com.trustwallet.core
66
7- import kotlinx.cinterop.COpaquePointer
87import kotlinx.cinterop.CValuesRef
98import kotlinx.cinterop.toKString
109
11- internal fun String?.toTwString (): COpaquePointer ? =
12- this ?.let { TWStringCreateWithUTF8Bytes (it) }
13-
1410// Build String from TWString, and then delete TWString
1511internal fun CValuesRef <* >?.fromTwString (): String? =
1612 this ?.let {
You can’t perform that action at this time.
0 commit comments