parent
a77f3a629c
commit
c3e41a68c2
|
@ -9,6 +9,7 @@ import java.util.Locale
|
||||||
|
|
||||||
fun ZcashNetwork.Companion.fromResources(context: Context): ZcashNetwork {
|
fun ZcashNetwork.Companion.fromResources(context: Context): ZcashNetwork {
|
||||||
val networkNameFromResources = context.getString(R.string.network_name).lowercase(Locale.ROOT)
|
val networkNameFromResources = context.getString(R.string.network_name).lowercase(Locale.ROOT)
|
||||||
|
@Suppress("UseRequire")
|
||||||
return if (networkNameFromResources == Testnet.networkName) {
|
return if (networkNameFromResources == Testnet.networkName) {
|
||||||
Testnet
|
Testnet
|
||||||
} else if (networkNameFromResources.lowercase(Locale.ROOT) == Mainnet.networkName) {
|
} else if (networkNameFromResources.lowercase(Locale.ROOT) == Mainnet.networkName) {
|
||||||
|
|
|
@ -75,7 +75,7 @@ ANDROID_COMPILE_SDK_VERSION=33
|
||||||
ANDROID_NDK_VERSION=22.1.7171670
|
ANDROID_NDK_VERSION=22.1.7171670
|
||||||
|
|
||||||
ANDROID_GRADLE_PLUGIN_VERSION=7.3.0
|
ANDROID_GRADLE_PLUGIN_VERSION=7.3.0
|
||||||
DETEKT_VERSION=1.21.0
|
DETEKT_VERSION=1.22.0
|
||||||
DOKKA_VERSION=1.7.20
|
DOKKA_VERSION=1.7.20
|
||||||
EMULATOR_WTF_GRADLE_PLUGIN_VERSION=0.0.12
|
EMULATOR_WTF_GRADLE_PLUGIN_VERSION=0.0.12
|
||||||
FLANK_VERSION=22.10.0
|
FLANK_VERSION=22.10.0
|
||||||
|
|
|
@ -32,10 +32,10 @@ internal fun <T> SQLiteDatabase.queryAndMap(
|
||||||
cursorParser: CursorParser<T>
|
cursorParser: CursorParser<T>
|
||||||
) = flow<T> {
|
) = flow<T> {
|
||||||
// TODO [#703]: Support blobs for argument binding
|
// TODO [#703]: Support blobs for argument binding
|
||||||
// https://github.com/zcash/zcash-android-wallet-sdk/issues/703
|
// TODO [#703]: https://github.com/zcash/zcash-android-wallet-sdk/issues/703
|
||||||
val mappedSelectionArgs = selectionArgs?.onEach {
|
val mappedSelectionArgs = selectionArgs?.onEach {
|
||||||
if (it is ByteArray) {
|
require(it !is ByteArray) {
|
||||||
throw IllegalArgumentException("ByteArray is not supported")
|
"ByteArray is not supported"
|
||||||
}
|
}
|
||||||
}?.map { it.toString() }?.toTypedArray()
|
}?.map { it.toString() }?.toTypedArray()
|
||||||
|
|
||||||
|
|
|
@ -24,16 +24,16 @@ data class BlockHeight internal constructor(val value: Long) : Comparable<BlockH
|
||||||
operator fun plus(other: BlockHeight) = BlockHeight(value + other.value)
|
operator fun plus(other: BlockHeight) = BlockHeight(value + other.value)
|
||||||
|
|
||||||
operator fun plus(other: Int): BlockHeight {
|
operator fun plus(other: Int): BlockHeight {
|
||||||
if (other < 0) {
|
require(other >= 0) {
|
||||||
throw IllegalArgumentException("Cannot add negative value $other to BlockHeight")
|
"Cannot add negative value $other to BlockHeight"
|
||||||
}
|
}
|
||||||
|
|
||||||
return BlockHeight(value + other.toLong())
|
return BlockHeight(value + other.toLong())
|
||||||
}
|
}
|
||||||
|
|
||||||
operator fun plus(other: Long): BlockHeight {
|
operator fun plus(other: Long): BlockHeight {
|
||||||
if (other < 0) {
|
require(other >= 0) {
|
||||||
throw IllegalArgumentException("Cannot add negative value $other to BlockHeight")
|
"Cannot add negative value $other to BlockHeight"
|
||||||
}
|
}
|
||||||
|
|
||||||
return BlockHeight(value + other)
|
return BlockHeight(value + other)
|
||||||
|
|
|
@ -10,6 +10,7 @@ build:
|
||||||
config:
|
config:
|
||||||
validation: true
|
validation: true
|
||||||
warningsAsErrors: false
|
warningsAsErrors: false
|
||||||
|
checkExhaustiveness: false
|
||||||
# when writing own rules with new properties, exclude the property path e.g.: 'my_rule_set,.*>.*>[my_property]'
|
# when writing own rules with new properties, exclude the property path e.g.: 'my_rule_set,.*>.*>[my_property]'
|
||||||
excludes: ''
|
excludes: ''
|
||||||
|
|
||||||
|
@ -78,15 +79,21 @@ comments:
|
||||||
searchInInnerClass: true
|
searchInInnerClass: true
|
||||||
searchInInnerObject: true
|
searchInInnerObject: true
|
||||||
searchInInnerInterface: true
|
searchInInnerInterface: true
|
||||||
|
searchInProtectedClass: false
|
||||||
UndocumentedPublicFunction:
|
UndocumentedPublicFunction:
|
||||||
active: false
|
active: false
|
||||||
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
|
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
|
||||||
|
searchProtectedFunction: false
|
||||||
UndocumentedPublicProperty:
|
UndocumentedPublicProperty:
|
||||||
active: false
|
active: false
|
||||||
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
|
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
|
||||||
|
searchProtectedProperty: false
|
||||||
|
|
||||||
complexity:
|
complexity:
|
||||||
active: true
|
active: true
|
||||||
|
CognitiveComplexMethod:
|
||||||
|
active: false
|
||||||
|
threshold: 15
|
||||||
ComplexCondition:
|
ComplexCondition:
|
||||||
active: true
|
active: true
|
||||||
threshold: 4
|
threshold: 4
|
||||||
|
@ -95,7 +102,8 @@ complexity:
|
||||||
threshold: 10
|
threshold: 10
|
||||||
includeStaticDeclarations: false
|
includeStaticDeclarations: false
|
||||||
includePrivateDeclarations: false
|
includePrivateDeclarations: false
|
||||||
ComplexMethod:
|
ignoreOverloaded: false
|
||||||
|
CyclomaticComplexMethod:
|
||||||
active: true
|
active: true
|
||||||
threshold: 15
|
threshold: 15
|
||||||
ignoreSingleWhenExpression: false
|
ignoreSingleWhenExpression: false
|
||||||
|
@ -386,6 +394,8 @@ performance:
|
||||||
SpreadOperator:
|
SpreadOperator:
|
||||||
active: true
|
active: true
|
||||||
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
|
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
|
||||||
|
UnnecessaryPartOfBinaryExpression:
|
||||||
|
active: false
|
||||||
UnnecessaryTemporaryInstantiation:
|
UnnecessaryTemporaryInstantiation:
|
||||||
active: true
|
active: true
|
||||||
|
|
||||||
|
@ -412,8 +422,6 @@ potential-bugs:
|
||||||
- 'java.util.HashSet'
|
- 'java.util.HashSet'
|
||||||
- 'java.util.LinkedHashMap'
|
- 'java.util.LinkedHashMap'
|
||||||
- 'java.util.HashMap'
|
- 'java.util.HashMap'
|
||||||
DuplicateCaseInWhenExpression:
|
|
||||||
active: true
|
|
||||||
ElseCaseInsteadOfExhaustiveWhen:
|
ElseCaseInsteadOfExhaustiveWhen:
|
||||||
active: false
|
active: false
|
||||||
EqualsAlwaysReturnsTrueOrFalse:
|
EqualsAlwaysReturnsTrueOrFalse:
|
||||||
|
@ -428,12 +436,16 @@ potential-bugs:
|
||||||
active: true
|
active: true
|
||||||
IgnoredReturnValue:
|
IgnoredReturnValue:
|
||||||
active: true
|
active: true
|
||||||
restrictToAnnotatedMethods: true
|
restrictToConfig: true
|
||||||
returnValueAnnotations:
|
returnValueAnnotations:
|
||||||
- '*.CheckResult'
|
- '*.CheckResult'
|
||||||
- '*.CheckReturnValue'
|
- '*.CheckReturnValue'
|
||||||
ignoreReturnValueAnnotations:
|
ignoreReturnValueAnnotations:
|
||||||
- '*.CanIgnoreReturnValue'
|
- '*.CanIgnoreReturnValue'
|
||||||
|
returnValueTypes:
|
||||||
|
- 'kotlin.sequences.Sequence'
|
||||||
|
- 'kotlinx.coroutines.flow.*Flow'
|
||||||
|
- 'java.util.stream.*Stream'
|
||||||
ignoreFunctionCall: []
|
ignoreFunctionCall: []
|
||||||
ImplicitDefaultLocale:
|
ImplicitDefaultLocale:
|
||||||
active: true
|
active: true
|
||||||
|
@ -455,17 +467,14 @@ potential-bugs:
|
||||||
MissingPackageDeclaration:
|
MissingPackageDeclaration:
|
||||||
active: false
|
active: false
|
||||||
excludes: ['**/*.kts']
|
excludes: ['**/*.kts']
|
||||||
MissingWhenCase:
|
|
||||||
active: true
|
|
||||||
allowElseExpression: true
|
|
||||||
NullCheckOnMutableProperty:
|
NullCheckOnMutableProperty:
|
||||||
active: false
|
active: false
|
||||||
NullableToStringCall:
|
NullableToStringCall:
|
||||||
active: false
|
active: false
|
||||||
RedundantElseInWhen:
|
|
||||||
active: true
|
|
||||||
UnconditionalJumpStatementInLoop:
|
UnconditionalJumpStatementInLoop:
|
||||||
active: false
|
active: false
|
||||||
|
UnnecessaryNotNullCheck:
|
||||||
|
active: false
|
||||||
UnnecessaryNotNullOperator:
|
UnnecessaryNotNullOperator:
|
||||||
active: true
|
active: true
|
||||||
UnnecessarySafeCall:
|
UnnecessarySafeCall:
|
||||||
|
@ -488,6 +497,8 @@ potential-bugs:
|
||||||
|
|
||||||
style:
|
style:
|
||||||
active: true
|
active: true
|
||||||
|
AlsoCouldBeApply:
|
||||||
|
active: false
|
||||||
CanBeNonNullable:
|
CanBeNonNullable:
|
||||||
active: false
|
active: false
|
||||||
CascadingCallWrapping:
|
CascadingCallWrapping:
|
||||||
|
@ -499,7 +510,8 @@ style:
|
||||||
active: false
|
active: false
|
||||||
DataClassContainsFunctions:
|
DataClassContainsFunctions:
|
||||||
active: false
|
active: false
|
||||||
conversionFunctionPrefix: 'to'
|
conversionFunctionPrefix:
|
||||||
|
- 'to'
|
||||||
DataClassShouldBeImmutable:
|
DataClassShouldBeImmutable:
|
||||||
active: false
|
active: false
|
||||||
DestructuringDeclarationWithTooManyEntries:
|
DestructuringDeclarationWithTooManyEntries:
|
||||||
|
@ -531,14 +543,10 @@ style:
|
||||||
ForbiddenMethodCall:
|
ForbiddenMethodCall:
|
||||||
active: false
|
active: false
|
||||||
methods:
|
methods:
|
||||||
- 'kotlin.io.print'
|
- reason: 'print does not allow you to configure the output stream. Use a logger instead.'
|
||||||
- 'kotlin.io.println'
|
value: 'kotlin.io.print'
|
||||||
ForbiddenPublicDataClass:
|
- reason: 'println does not allow you to configure the output stream. Use a logger instead.'
|
||||||
active: true
|
value: 'kotlin.io.println'
|
||||||
excludes: ['**']
|
|
||||||
ignorePackages:
|
|
||||||
- '*.internal'
|
|
||||||
- '*.internal.*'
|
|
||||||
ForbiddenSuppress:
|
ForbiddenSuppress:
|
||||||
active: false
|
active: false
|
||||||
rules: []
|
rules: []
|
||||||
|
@ -550,13 +558,7 @@ style:
|
||||||
active: true
|
active: true
|
||||||
ignoreOverridableFunction: true
|
ignoreOverridableFunction: true
|
||||||
ignoreActualFunction: true
|
ignoreActualFunction: true
|
||||||
excludedFunctions: ''
|
excludedFunctions: []
|
||||||
LibraryCodeMustSpecifyReturnType:
|
|
||||||
active: true
|
|
||||||
excludes: ['**']
|
|
||||||
LibraryEntitiesShouldNotBePublic:
|
|
||||||
active: true
|
|
||||||
excludes: ['**']
|
|
||||||
LoopWithTooManyJumpStatements:
|
LoopWithTooManyJumpStatements:
|
||||||
active: true
|
active: true
|
||||||
maxJumpCount: 1
|
maxJumpCount: 1
|
||||||
|
@ -591,12 +593,16 @@ style:
|
||||||
excludePackageStatements: true
|
excludePackageStatements: true
|
||||||
excludeImportStatements: true
|
excludeImportStatements: true
|
||||||
excludeCommentStatements: false
|
excludeCommentStatements: false
|
||||||
|
excludeRawStrings: true
|
||||||
MayBeConst:
|
MayBeConst:
|
||||||
active: true
|
active: true
|
||||||
ModifierOrder:
|
ModifierOrder:
|
||||||
active: true
|
active: true
|
||||||
MultilineLambdaItParameter:
|
MultilineLambdaItParameter:
|
||||||
active: false
|
active: false
|
||||||
|
MultilineRawStringIndentation:
|
||||||
|
active: false
|
||||||
|
indentSize: 4
|
||||||
NestedClassesVisibility:
|
NestedClassesVisibility:
|
||||||
active: true
|
active: true
|
||||||
NewLineAtEndOfFile:
|
NewLineAtEndOfFile:
|
||||||
|
@ -626,7 +632,8 @@ style:
|
||||||
ReturnCount:
|
ReturnCount:
|
||||||
active: true
|
active: true
|
||||||
max: 2
|
max: 2
|
||||||
excludedFunctions: 'equals'
|
excludedFunctions:
|
||||||
|
- 'equals'
|
||||||
excludeLabeled: false
|
excludeLabeled: false
|
||||||
excludeReturnFromLambda: true
|
excludeReturnFromLambda: true
|
||||||
excludeGuardClauses: false
|
excludeGuardClauses: false
|
||||||
|
@ -642,6 +649,8 @@ style:
|
||||||
excludeGuardClauses: false
|
excludeGuardClauses: false
|
||||||
TrailingWhitespace:
|
TrailingWhitespace:
|
||||||
active: false
|
active: false
|
||||||
|
TrimMultilineRawString:
|
||||||
|
active: false
|
||||||
UnderscoresInNumericLiterals:
|
UnderscoresInNumericLiterals:
|
||||||
active: false
|
active: false
|
||||||
acceptableLength: 4
|
acceptableLength: 4
|
||||||
|
@ -664,6 +673,7 @@ style:
|
||||||
active: false
|
active: false
|
||||||
UnnecessaryParentheses:
|
UnnecessaryParentheses:
|
||||||
active: false
|
active: false
|
||||||
|
allowForUnclearPrecedence: false
|
||||||
UntilInsteadOfRangeTo:
|
UntilInsteadOfRangeTo:
|
||||||
active: false
|
active: false
|
||||||
UnusedImports:
|
UnusedImports:
|
||||||
|
@ -698,6 +708,8 @@ style:
|
||||||
active: true
|
active: true
|
||||||
UseRequireNotNull:
|
UseRequireNotNull:
|
||||||
active: true
|
active: true
|
||||||
|
UseSumOfInsteadOfFlatMapSize:
|
||||||
|
active: false
|
||||||
UselessCallOnNotNull:
|
UselessCallOnNotNull:
|
||||||
active: true
|
active: true
|
||||||
UtilityClassWithPublicConstructor:
|
UtilityClassWithPublicConstructor:
|
||||||
|
@ -707,6 +719,5 @@ style:
|
||||||
ignoreLateinitVar: false
|
ignoreLateinitVar: false
|
||||||
WildcardImport:
|
WildcardImport:
|
||||||
active: true
|
active: true
|
||||||
excludes: ['**/test/**', '**/androidTest/**', '**/commonTest/**', '**/jvmTest/**', '**/jsTest/**', '**/iosTest/**']
|
|
||||||
excludeImports:
|
excludeImports:
|
||||||
- 'java.util.*'
|
- 'java.util.*'
|
||||||
|
|
Loading…
Reference in New Issue