Removed mock synchronizer docs

This commit is contained in:
Kevin Gorham 2020-01-15 08:10:09 -05:00
parent 028b541823
commit 6976427fba
No known key found for this signature in database
GPG Key ID: CCA55602DF49FC38
22 changed files with 51 additions and 228 deletions

View File

@ -1,27 +0,0 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.data](../index.md) / [MockSynchronizer](index.md) / [<init>](./-init-.md)
# <init>
`MockSynchronizer(transactionInterval: `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)` = 30_000L, initialLoadDuration: `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)` = 5_000L, activeTransactionUpdateFrequency: `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)` = 3_000L, isFirstRun: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` = Random.nextBoolean(), isStale: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`? = null, onSynchronizerErrorListener: ((`[`Throwable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)`?) -> `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)? = null)`
Utility for building UIs. It does the best it can to mock the SDKSynchronizer so that it can be dropped into any
project and drive the UI. It generates active transactions in response to funds being sent and generates random
received transactions, periodically.
### Parameters
`transactionInterval` - the time in milliseconds between receive transactions being added because those are the
only ones auto-generated. Send transactions are triggered by the UI. Transactions are polled at half this interval.
`initialLoadDuration` - the time in milliseconds it should take to simulate the initial load. The progress channel
will send regular updates such that it reaches 100 in this amount of time.
`activeTransactionUpdateFrequency` - the amount of time in milliseconds between updates to an active
transaction's state. Active transactions move through their lifecycle and increment their state at this rate.
`isFirstRun` - whether this Mock should return `true` for isFirstRun. Defaults to a random boolean.
`isStale` - whether this Mock should return `true` for isStale. When null, this will follow the default behavior
of returning true about 10% of the time.
`onSynchronizerErrorListener` - presently ignored because there are not yet any errors in mock.

View File

@ -1,56 +0,0 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.data](../index.md) / [MockSynchronizer](./index.md)
# MockSynchronizer
`open class MockSynchronizer : `[`Synchronizer`](../-synchronizer/index.md)`, CoroutineScope`
Utility for building UIs. It does the best it can to mock the SDKSynchronizer so that it can be dropped into any
project and drive the UI. It generates active transactions in response to funds being sent and generates random
received transactions, periodically.
### Parameters
`transactionInterval` - the time in milliseconds between receive transactions being added because those are the
only ones auto-generated. Send transactions are triggered by the UI. Transactions are polled at half this interval.
`initialLoadDuration` - the time in milliseconds it should take to simulate the initial load. The progress channel
will send regular updates such that it reaches 100 in this amount of time.
`activeTransactionUpdateFrequency` - the amount of time in milliseconds between updates to an active
transaction's state. Active transactions move through their lifecycle and increment their state at this rate.
`isFirstRun` - whether this Mock should return `true` for isFirstRun. Defaults to a random boolean.
`isStale` - whether this Mock should return `true` for isStale. When null, this will follow the default behavior
of returning true about 10% of the time.
`onSynchronizerErrorListener` - presently ignored because there are not yet any errors in mock.
### Constructors
| Name | Summary |
|---|---|
| [&lt;init&gt;](-init-.md) | `MockSynchronizer(transactionInterval: `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)` = 30_000L, initialLoadDuration: `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)` = 5_000L, activeTransactionUpdateFrequency: `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)` = 3_000L, isFirstRun: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)` = Random.nextBoolean(), isStale: `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`? = null, onSynchronizerErrorListener: ((`[`Throwable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)`?) -> `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)? = null)`<br>Utility for building UIs. It does the best it can to mock the SDKSynchronizer so that it can be dropped into any project and drive the UI. It generates active transactions in response to funds being sent and generates random received transactions, periodically. |
### Properties
| Name | Summary |
|---|---|
| [coroutineContext](coroutine-context.md) | `open val coroutineContext: `[`CoroutineContext`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.coroutines/-coroutine-context/index.html)<br>Coroutine context used for the CoroutineScope implementation, used to mock asynchronous behaviors. |
| [onSynchronizerErrorListener](on-synchronizer-error-listener.md) | `open var onSynchronizerErrorListener: ((`[`Throwable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)`?) -> `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)?`<br>presently ignored because there are not yet any errors in mock. |
### Functions
| Name | Summary |
|---|---|
| [activeTransactions](active-transactions.md) | `open fun activeTransactions(): ReceiveChannel<`[`Map`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html)`<`[`ActiveTransaction`](../-active-transaction/index.md)`, `[`TransactionState`](../-transaction-state/index.md)`>>`<br>A stream of all the active transactions. |
| [allTransactions](all-transactions.md) | `open fun allTransactions(): ReceiveChannel<`[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`WalletTransaction`](../../cash.z.wallet.sdk.dao/-wallet-transaction/index.md)`>>`<br>A stream of all the wallet transactions. |
| [balance](balance.md) | `open fun balance(): ReceiveChannel<`[`Wallet.WalletBalance`](../../cash.z.wallet.sdk.secure/-wallet/-wallet-balance/index.md)`>`<br>A stream of balance values. |
| [cancelSend](cancel-send.md) | `open fun cancelSend(transaction: `[`ActiveSendTransaction`](../-active-send-transaction/index.md)`): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Sets the state of the given transaction to 'Cancelled'. |
| [getAddress](get-address.md) | `open fun getAddress(accountId: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)<br>Returns the [mockAddress](#). This address is not usable. |
| [isFirstRun](is-first-run.md) | `open suspend fun isFirstRun(): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Returns [isFirstRun](is-first-run.md) as provided during initialization of this MockSynchronizer. |
| [isStale](is-stale.md) | `open suspend fun isStale(): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Returns true roughly 10% of the time and then resets to false after some delay. |
| [progress](progress.md) | `open fun progress(): ReceiveChannel<`[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`>`<br>A stream of progress values, typically corresponding to this Synchronizer downloading blocks. Typically, any non- zero value below 100 indicates that progress indicators can be shown and a value of 100 signals that progress is complete and any progress indicators can be hidden. |
| [sendToAddress](send-to-address.md) | `open suspend fun sendToAddress(zatoshi: `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`, toAddress: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, memo: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, fromAccountId: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Uses the [forge](#) to fabricate a transaction and then walk it through the transaction lifecycle in a useful way. This method will validate the zatoshi amount and toAddress a bit to help with UI validation. |
| [start](start.md) | `open fun start(parentScope: CoroutineScope): `[`Synchronizer`](../-synchronizer/index.md)<br>Starts this mock Synchronizer. |
| [stop](stop.md) | `open fun stop(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Stops this mock Synchronizer by cancelling its primary job. |

View File

@ -1,10 +0,0 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.data](../index.md) / [MockSynchronizer](index.md) / [activeTransactions](./active-transactions.md)
# activeTransactions
`open fun activeTransactions(): ReceiveChannel<`[`Map`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-map/index.html)`<`[`ActiveTransaction`](../-active-transaction/index.md)`, `[`TransactionState`](../-transaction-state/index.md)`>>`
Overrides [Synchronizer.activeTransactions](../-synchronizer/active-transactions.md)
A stream of all the active transactions.

View File

@ -1,10 +0,0 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.data](../index.md) / [MockSynchronizer](index.md) / [allTransactions](./all-transactions.md)
# allTransactions
`open fun allTransactions(): ReceiveChannel<`[`List`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html)`<`[`WalletTransaction`](../../cash.z.wallet.sdk.dao/-wallet-transaction/index.md)`>>`
Overrides [Synchronizer.allTransactions](../-synchronizer/all-transactions.md)
A stream of all the wallet transactions.

View File

@ -1,10 +0,0 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.data](../index.md) / [MockSynchronizer](index.md) / [balance](./balance.md)
# balance
`open fun balance(): ReceiveChannel<`[`Wallet.WalletBalance`](../../cash.z.wallet.sdk.secure/-wallet/-wallet-balance/index.md)`>`
Overrides [Synchronizer.balance](../-synchronizer/balance.md)
A stream of balance values.

View File

@ -1,10 +0,0 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.data](../index.md) / [MockSynchronizer](index.md) / [cancelSend](./cancel-send.md)
# cancelSend
`open fun cancelSend(transaction: `[`ActiveSendTransaction`](../-active-send-transaction/index.md)`): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
Overrides [Synchronizer.cancelSend](../-synchronizer/cancel-send.md)
Sets the state of the given transaction to 'Cancelled'.

View File

@ -1,8 +0,0 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.data](../index.md) / [MockSynchronizer](index.md) / [coroutineContext](./coroutine-context.md)
# coroutineContext
`open val coroutineContext: `[`CoroutineContext`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.coroutines/-coroutine-context/index.html)
Coroutine context used for the CoroutineScope implementation, used to mock asynchronous behaviors.

View File

@ -1,10 +0,0 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.data](../index.md) / [MockSynchronizer](index.md) / [getAddress](./get-address.md)
# getAddress
`open fun getAddress(accountId: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)
Overrides [Synchronizer.getAddress](../-synchronizer/get-address.md)
Returns the [mockAddress](#). This address is not usable.

View File

@ -1,10 +0,0 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.data](../index.md) / [MockSynchronizer](index.md) / [isFirstRun](./is-first-run.md)
# isFirstRun
`open suspend fun isFirstRun(): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
Overrides [Synchronizer.isFirstRun](../-synchronizer/is-first-run.md)
Returns [isFirstRun](./is-first-run.md) as provided during initialization of this MockSynchronizer.

View File

@ -1,10 +0,0 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.data](../index.md) / [MockSynchronizer](index.md) / [isStale](./is-stale.md)
# isStale
`open suspend fun isStale(): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)
Overrides [Synchronizer.isStale](../-synchronizer/is-stale.md)
Returns true roughly 10% of the time and then resets to false after some delay.

View File

@ -1,10 +0,0 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.data](../index.md) / [MockSynchronizer](index.md) / [onSynchronizerErrorListener](./on-synchronizer-error-listener.md)
# onSynchronizerErrorListener
`open var onSynchronizerErrorListener: ((`[`Throwable`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)`?) -> `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)`)?`
Overrides [Synchronizer.onSynchronizerErrorListener](../-synchronizer/on-synchronizer-error-listener.md)
presently ignored because there are not yet any errors in mock.

View File

@ -1,12 +0,0 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.data](../index.md) / [MockSynchronizer](index.md) / [progress](./progress.md)
# progress
`open fun progress(): ReceiveChannel<`[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`>`
Overrides [Synchronizer.progress](../-synchronizer/progress.md)
A stream of progress values, typically corresponding to this Synchronizer downloading blocks. Typically, any non-
zero value below 100 indicates that progress indicators can be shown and a value of 100 signals that progress is
complete and any progress indicators can be hidden.

View File

@ -1,20 +0,0 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.data](../index.md) / [MockSynchronizer](index.md) / [sendToAddress](./send-to-address.md)
# sendToAddress
`open suspend fun sendToAddress(zatoshi: `[`Long`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`, toAddress: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, memo: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, fromAccountId: `[`Int`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
Overrides [Synchronizer.sendToAddress](../-synchronizer/send-to-address.md)
Uses the [forge](#) to fabricate a transaction and then walk it through the transaction lifecycle in a useful way.
This method will validate the zatoshi amount and toAddress a bit to help with UI validation.
### Parameters
`zatoshi` - the amount to send. A transaction will be created matching this amount.
`toAddress` - the address to use. An active transaction will be created matching this address.
`memo` - the memo to use. This field is ignored.
`fromAccountId` - the account. This field is ignored.

View File

@ -1,10 +0,0 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.data](../index.md) / [MockSynchronizer](index.md) / [start](./start.md)
# start
`open fun start(parentScope: CoroutineScope): `[`Synchronizer`](../-synchronizer/index.md)
Overrides [Synchronizer.start](../-synchronizer/start.md)
Starts this mock Synchronizer.

View File

@ -1,10 +0,0 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.data](../index.md) / [MockSynchronizer](index.md) / [stop](./stop.md)
# stop
`open fun stop(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
Overrides [Synchronizer.stop](../-synchronizer/stop.md)
Stops this mock Synchronizer by cancelling its primary job.

View File

@ -1,4 +1,4 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.data](../index.md) / [Twig](index.md) / [clip](./clip.md)
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.ext](../index.md) / [Twig](index.md) / [clip](./clip.md)
# clip

38
docs/-twig/index.md Normal file
View File

@ -0,0 +1,38 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.ext](../index.md) / [Twig](./index.md)
# Twig
`interface Twig`
A tiny log.
### Functions
| Name | Summary |
|---|---|
| [plus](plus.md) | `open operator fun plus(twig: `[`Twig`](./index.md)`): `[`Twig`](./index.md) |
| [twig](twig.md) | `abstract fun twig(logMessage: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)` = ""): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) |
### Companion Object Functions
| Name | Summary |
|---|---|
| [clip](clip.md) | `fun clip(leaf: Leaf): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Clip a leaf from the bush. Clipped leaves no longer appear in logs. |
| [plant](plant.md) | `fun plant(rootTwig: `[`Twig`](./index.md)`): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Plants the twig, making it the one and only bush. Twigs can be bundled together to create the appearance of multiple bushes (i.e `Twig.plant(twigA + twigB + twigC)`) even though there's only ever one bush. |
| [prune](prune.md) | `fun prune(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)<br>Clip all leaves from the bush. |
| [sprout](sprout.md) | `fun sprout(leaf: Leaf): `[`Boolean`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html)<br>Generate a leaf on the bush. Leaves show up in every log message as tags until they are clipped. |
### Extension Functions
| Name | Summary |
|---|---|
| [twig](../twig.md) | `fun <R> `[`Twig`](./index.md)`.twig(logMessage: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, block: () -> `[`R`](../twig.md#R)`): `[`R`](../twig.md#R)<br>Times a tiny log. Execute the block of code on the clock. |
| [twigTask](../twig-task.md) | `fun <R> `[`Twig`](./index.md)`.twigTask(logMessage: `[`String`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)`, block: () -> `[`R`](../twig-task.md#R)`): `[`R`](../twig-task.md#R)<br>A tiny log task. Execute the block of code with some twigging around the outside. For silent twigs, this adds a small amount of overhead at the call site but still avoids logging. |
### Inheritors
| Name | Summary |
|---|---|
| [CompositeTwig](../-composite-twig/index.md) | `open class CompositeTwig : `[`Twig`](./index.md)<br>Since there can only ever be one trunk on the bush of twigs, this class lets you cheat and make that trunk be a bundle of twigs. |
| [SilentTwig](../-silent-twig/index.md) | `class SilentTwig : `[`Twig`](./index.md)<br>A tiny log that does nothing. No one hears this twig fall in the woods. |
| [TroubleshootingTwig](../-troubleshooting-twig/index.md) | `open class TroubleshootingTwig : `[`Twig`](./index.md)<br>A tiny log for detecting troubles. Aim at your troubles and pull the twigger. |

View File

@ -1,4 +1,4 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.data](../index.md) / [Twig](index.md) / [plant](./plant.md)
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.ext](../index.md) / [Twig](index.md) / [plant](./plant.md)
# plant

View File

@ -1,4 +1,4 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.data](../index.md) / [Twig](index.md) / [plus](./plus.md)
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.ext](../index.md) / [Twig](index.md) / [plus](./plus.md)
# plus

8
docs/-twig/prune.md Normal file
View File

@ -0,0 +1,8 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.ext](../index.md) / [Twig](index.md) / [prune](./prune.md)
# prune
`fun prune(): `[`Unit`](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)
Clip all leaves from the bush.

View File

@ -1,4 +1,4 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.data](../index.md) / [Twig](index.md) / [sprout](./sprout.md)
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.ext](../index.md) / [Twig](index.md) / [sprout](./sprout.md)
# sprout

View File

@ -1,4 +1,4 @@
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.data](../index.md) / [Twig](index.md) / [twig](./twig.md)
[zcash-android-wallet-sdk](../../index.md) / [cash.z.wallet.sdk.ext](../index.md) / [Twig](index.md) / [twig](./twig.md)
# twig