Skip to content

Commit

Permalink
Update usage of SyncAlgorithm in Demo-app
Browse files Browse the repository at this point in the history
  • Loading branch information
HonzaR committed Sep 3, 2023
1 parent a84584b commit 2a2a473
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cash.z.ecc.android.sdk.demoapp

import android.content.Context
import cash.z.ecc.android.sdk.WalletCoordinator
import cash.z.ecc.android.sdk.block.processor.CompactBlockProcessor
import cash.z.ecc.android.sdk.demoapp.preference.EncryptedPreferenceKeys
import cash.z.ecc.android.sdk.demoapp.preference.EncryptedPreferenceSingleton
import cash.z.ecc.android.sdk.demoapp.util.LazyWithArgument
Expand All @@ -20,7 +21,11 @@ private val lazy = LazyWithArgument<Context, WalletCoordinator> {
emitAll(EncryptedPreferenceKeys.PERSISTABLE_WALLET.observe(encryptedPreferenceProvider))
}

WalletCoordinator(it, persistableWalletFlow)
WalletCoordinator(
context = it,
persistableWallet = persistableWalletFlow,
syncAlgorithm = CompactBlockProcessor.SyncAlgorithm.SPEND_BEFORE_SYNC
)
}

fun WalletCoordinator.Companion.getInstance(context: Context) = lazy.getInstance(context)
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import java.util.UUID
class WalletCoordinator(
context: Context,
val persistableWallet: Flow<PersistableWallet?>,
val syncAlgorithm: CompactBlockProcessor.SyncAlgorithm = CompactBlockProcessor.SyncAlgorithm.SPEND_BEFORE_SYNC
val syncAlgorithm: CompactBlockProcessor.SyncAlgorithm = CompactBlockProcessor.SyncAlgorithm.LINEAR
) {

private val applicationContext = context.applicationContext
Expand Down

0 comments on commit 2a2a473

Please sign in to comment.