Skip to content

Commit

Permalink
Fix static code analysis warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
HonzaR committed Dec 3, 2024
1 parent 4da404f commit 4409e65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import cash.z.ecc.android.sdk.internal.model.JniAccountBalance
/**
* This is a test fixture for [JniAccountBalance] class. It holds mocked values that are only used within
* [JniWalletSummaryTest].
*/
*/
object JniAccountBalanceFixture {
val ACCOUNT_UUID: ByteArray = "random_uuid_16_b".toByteArray()
const val SAPLING_VERIFIED_BALANCE: Long = 0L
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ object AccountFixture {
)
}

private const val UUID_V4_BYTE_SIZE = 16

// This provides us with a way to convert [UUID] to [ByteArray]
private fun UUID.toByteArray(): ByteArray =
ByteBuffer
.allocate(16)
.allocate(UUID_V4_BYTE_SIZE)
.putLong(mostSignificantBits)
.putLong(leastSignificantBits)
.array()
.array()

0 comments on commit 4409e65

Please sign in to comment.