Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Root .editorconfig file
root = true

[*.{kt,kts}]
indent_style = space
max_line_length = 120

ktlint_standard_trailing-comma-on-call-site = disabled
ktlint_standard_multiline-expression-wrapping = disabled
ktlint_standard_string-template-indent = disabled
ktlint_function_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = 5
ktlint_function_naming_ignore_when_annotated_with=Composable
ktlint_standard_function-expression-body = disabled
ktlint_standard_class-signature = disabled
21 changes: 21 additions & 0 deletions .github/workflows/ktlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Ktlint Check

on: [workflow_dispatch, pull_request]

jobs:
ktlint:
name: "Run Ktlint Check"
runs-on: ubuntu-22.04

steps:
- name: "Checkout branch"
uses: actions/checkout@v4

- name: "Set up JDK 17"
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17

- name: "Run Ktlint Check"
run: ./gradlew ktlintCheck
28 changes: 19 additions & 9 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType

plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.google.protobuf")
id("org.jetbrains.kotlin.plugin.compose")
id("org.jetbrains.kotlin.plugin.serialization")
id("com.android.application") version "8.7.1"
id("org.jetbrains.kotlin.android") version "2.1.10"
id("org.jetbrains.kotlin.plugin.compose") version "2.1.10"
id("org.jetbrains.kotlin.plugin.serialization") version "2.1.10"
id("com.google.protobuf") version "0.9.4"
id("org.jlleitschuh.gradle.ktlint") version "12.1.2"
}

// This is the version of the app that is displayed in the UI on the drawer.
Expand Down Expand Up @@ -43,7 +46,6 @@ android {
kotlinOptions {
jvmTarget = "17"
}

}

dependencies {
Expand Down Expand Up @@ -83,9 +85,9 @@ dependencies {
implementation("com.google.zxing:core:3.4.1")

// Tests
testImplementation ("junit:junit:4.13.2")
androidTestImplementation ("androidx.test.ext:junit:1.2.1")
androidTestImplementation ("androidx.test.espresso:espresso-core:3.6.1")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.2.1")
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
}

protobuf {
Expand All @@ -103,3 +105,11 @@ protobuf {
}
}
}

ktlint {
version = "1.5.0"
ignoreFailures = false
reporters {
reporter(ReporterType.PLAIN).apply { outputToConsole = true }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ package org.bitcoindevkit.devkitwallet.domain
import org.bitcoindevkit.FullScanRequest
import org.bitcoindevkit.SyncRequest
import org.bitcoindevkit.Transaction
import org.bitcoindevkit.EsploraClient as BdkEsploraClient
import org.bitcoindevkit.Update
import org.bitcoindevkit.EsploraClient as BdkEsploraClient

interface BlockchainClient {
fun clientId(): String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ class BlockchainClientsConfig {

fun addClient(client: BlockchainClient, setDefault: Boolean) {
allClients.forEach {
if (it.clientId() == client.clientId()) throw IllegalArgumentException("Client with url ${client.clientId()} already exists")
if (it.clientId() == client.clientId()) {
throw IllegalArgumentException(
"Client with url ${client.clientId()} already exists"
)
}
}
if (allClients.size >= 8) throw IllegalArgumentException("Maximum number of clients (8) reached")
allClients.add(client)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ package org.bitcoindevkit.devkitwallet.domain

enum class CurrencyUnit {
Bitcoin,
Satoshi
Satoshi,
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright 2021-2025 thunderbiscuit and contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the ./LICENSE file.
*/

package org.bitcoindevkit.devkitwallet.domain

object DwLogger {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ class UserPreferencesRepository(
wallet
}
}
currentPreferences.toBuilder()
currentPreferences
.toBuilder()
.clearWallets()
.addAllWallets(updatedWalletsList)
.build()
Expand Down
Loading
Loading