Skip to content

Commit 09da683

Browse files
committed
Lint
1 parent 60eb9b7 commit 09da683

File tree

10 files changed

+12
-13
lines changed

10 files changed

+12
-13
lines changed

sdk/src/androidTest/java/network/xyo/client/account/WalletTestVectors.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ data class TestVector(
88
val address: String,
99
val privateKey: String,
1010
val publicKey: String
11-
) {}
11+
)
1212

1313
class WalletTestVectors {
1414
val phrase = "later puppy sound rebuild rebuild noise ozone amazing hope broccoli crystal grief"

sdk/src/androidTest/java/network/xyo/client/lib/Constants.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class DebugPayload(val nonce: Int) : XyoPayload() {
99
set(value) = Unit
1010
}
1111

12-
class BasicPayload(): XyoPayload() {
12+
class BasicPayload : XyoPayload() {
1313
override var schema: String
1414
get() = "network.xyo.basic"
1515
set(value) = Unit

sdk/src/androidTest/java/network/xyo/client/node/client/NodeClientTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import org.junit.Before
1313
import org.junit.Test
1414
import org.junit.jupiter.api.Assertions.*
1515

16-
class DiscoverPayload(): XyoPayload() {
16+
class DiscoverPayload : XyoPayload() {
1717
override var schema = "network.xyo.query.module.discover"
1818
}
1919

sdk/src/main/java/network/xyo/client/account/Account.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import java.security.SecureRandom
1515

1616
open class Account private constructor (private val _privateKey: PrivateKey, private var _previousHash: ByteArray? = null): AccountInstance {
1717

18-
constructor(privateKey: ByteArray, previousHash: ByteArray? = null) : this(PrivateKey.fromBytes(privateKey, secp256k1Curve), previousHash) {}
19-
constructor(privateKey: BigInteger, previousHash: ByteArray? = null) : this(privateKey.toByteArray(), previousHash) {}
18+
constructor(privateKey: ByteArray, previousHash: ByteArray? = null) : this(PrivateKey.fromBytes(privateKey, secp256k1Curve), previousHash)
19+
constructor(privateKey: BigInteger, previousHash: ByteArray? = null) : this(privateKey.toByteArray(), previousHash)
2020

2121
private val _address = addressFromUncompressedPublicKey(publicKeyUncompressed)
2222

sdk/src/main/java/network/xyo/client/archivist/wrapper/ArchivistInsertQueryPayload.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package network.xyo.client.archivist.wrapper
33
import network.xyo.client.payload.XyoPayload
44

55

6-
class ArchivistInsertQueryPayload(): XyoPayload() {
6+
class ArchivistInsertQueryPayload : XyoPayload() {
77
override var schema = ArchivistInsertQueryPayload.schema
88

99
companion object {

sdk/src/main/java/network/xyo/client/datastore/previous_hash_store/PreviousHashDataStore.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import network.xyo.data.PreviousHashPrefsDataStoreProtos
1313
import network.xyo.data.PreviousHashPrefsDataStoreProtos.PreviousHashPrefsDataStore
1414
import java.io.File
1515

16-
fun Context.xyoPreviousHashDataStore(name: String?, path: String?): DataStore<PreviousHashPrefsDataStoreProtos.PreviousHashPrefsDataStore> {
16+
fun Context.xyoPreviousHashDataStore(name: String?, path: String?): DataStore<PreviousHashPrefsDataStore> {
1717
val resolvedName = name ?: defaultXyoSdkSettings.previousHashStorePreferences.fileName
1818
val resolvedPath = path ?: defaultXyoSdkSettings.previousHashStorePreferences.storagePath
1919

sdk/src/main/java/network/xyo/client/lib/XyoSerializable.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ abstract class XyoSerializable: Serializable {
4040
fun sortJson(jsonArray: JSONArray, removeMeta: Boolean = false): JSONArray {
4141
val newJsonArray = JSONArray()
4242
for (i in 0 until jsonArray.length()) {
43-
val value = jsonArray[i]
44-
when (value) {
43+
when (val value = jsonArray[i]) {
4544
is JSONArray -> {
4645
newJsonArray.put(sortJson(value, removeMeta))
4746
}

sdk/src/main/java/network/xyo/client/payload/XyoPayload.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ open class XyoValidationException(message: String): XyoException(message)
88
open class XyoInvalidSchemaException(val schema: String): XyoValidationException("'schema' must be lowercase [${schema}]")
99

1010
@JsonClass(generateAdapter = true)
11-
open class XyoPayload(): Payload, XyoSerializable() {
11+
open class XyoPayload : Payload, XyoSerializable() {
1212
// Note: Has to be var because "Moshi does not consider a val as a serializable member because
1313
// it cannot be symmetrically deserialized."
1414
// see - https://github.com/square/moshi/issues/1803

sdk/src/main/java/network/xyo/client/settings/Defaults.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package network.xyo.client.settings
33
const val DefaultStoragePath = "__xyo-client-sdk__"
44
const val DefaultFileName = "network-xyo-sdk-prefs"
55

6-
open class DefaultXyoSdkSettings(): SettingsInterface {
6+
open class DefaultXyoSdkSettings : SettingsInterface {
77
override val accountPreferences: AccountPreferences = DefaultAccountPreferences()
88
override val previousHashStorePreferences: PreviousHashStorePreferences = DefaultPreviousHashStorePreferences()
99
}

sdk/src/main/java/network/xyo/client/settings/SettingsInterface.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ interface StorageLocationPreference {
1010
val storagePath: String?
1111
}
1212

13-
interface AccountPreferences: StorageLocationPreference {}
13+
interface AccountPreferences: StorageLocationPreference
1414

15-
interface PreviousHashStorePreferences: StorageLocationPreference {}
15+
interface PreviousHashStorePreferences: StorageLocationPreference

0 commit comments

Comments
 (0)