Closes#677
- Previously when keychain wanted to do wipe wallet had to do it on it's
own. Which isn't good. Now wallet can simply call
`synchronizer.wipe()` and it's done.
- This change brings support for wipe. `Synchronizer` has new method
`wipe()` which takes care of everything. All the database connections
are closed. Databases are removed. `InternalSyncProgress` is reset.
Change condition when wipe can run
Closes#657
- Now SDK downloads N downloads and scan those. And repeat until sync is
done. This safes lot of space of disk used to store downloaded blocks.
- Most changes are done in `CompactBlockProcessor.processNewBlocks`.
- `SyncRanges` structure is changed a bit.
- `SyncStatus` is changed. SDK now report that it's syncing with
progress. It doesn't report each phase of the sync process separately.
Also appropriate notifications were updated.
Address review comments
- Small changes
- Add tests to check computation of processing ranges for single loop
- Previously we had one range for each sync which was used for each
phase of sync process. Newly there is separate range for each phase of
the sync process.
- I added `InternalSyncProgress` utility. This utility tracks progress
of some phases. And it is able to compute right ranges which should be
used for syncing.
- Some unused download code from `CompactBlockProcessor` is removed.
Fix tests
Address review comments
- Rebase to master
- Update how range for `processBatchFinished()` is computed.
- Refactor `InternalSyncProgress`
- Add tests for `InternalSyncProgress`
Address review comments
Change how latest downloaded block is tracked
- Cache DB is no longer used to track which block was downloaded as
latest. `InternalSyncProgress` is used to do that.
- Thanks to that #660 is fixed. And cache DB can be completely removed
after sync process.
- Added sleep(1) to some darkside tests when latest block height is set.
Otherwise lightwalletd in darkside mode doesn't have time to setup and
tests are flaky.
Fix TransactionEnhancementTests.testBasicEnhancement test
There's a problem withstanding:
````
▿ RustWeldingError
▿ genericError : 1 element
- message : "Error while fetching transparent balances for AccountId(0): Invalid column type Null at index: 0, name: address"
````
Which is fixed by commit `d0297bff0cdaaff42ad26f3be5bc261f6c828e8f` of "https://github.com/zcash/librustzcash".
nil-coalesce thrown errors on test so it reaches the end.
Make balance calls throwing to show underlying errors but nil-coalesce in non-throwing APIs
Add missing fulfill() calls
Add changelog entry
document and handle errors on getting shielded balance before
attempting to download sapling parameters.
- sync process enhanced to try to download sapling params if needed
- tests fixed
- failing import Crypto -> import CryptoKit
- download params only if there are sapling funds
This provides a method for clients to handle UI for text memo
limit correctly handling memos that are visibly fit within the
capacity defined in ZIP-302 but when encoded into UTF-8 bytes
their size exceeds such limit.
Closes#639
Closes#616
- Added small helper `NotificationSender` which is used to send
notifications.
- No notificaiton is sent on main thread.
- Change how `status` is stored and update in `SDKSynchronizer`. It is
now protected by lock. Before this wasn't needed because status was
updated from main thread everywhere.
- `SyncBlocksViewController` in the sample app now uses
`SDKSynchronizer` instead of `CompactBlockProcessor` directly.
Closes#488
- When sync process is finished cache DB is removed from disk.
- Latest downloaded block is preserved becuase it's required to computes
in which phase to resume sync process.
- `SDKSynchronizer.latestDownloadedHeight` public API is removed
it makes no longer sense. This API was reading from cache DB.
state for this synchronizer.
also reports the SychronizerState on synchonizerStarted notification.
Add tests that verify the state being reported properly
Fix `BlockBatchValidationTests`
Closes#614
fixes travis ci
Removed `setStartHeight` function
I’m going back in time and this setHeight is not something we are using anywhere else than in the prepare function. This comes from the times we had `initialize(seed:birthday) and we don’t have that anymore
See diff 246d10edaa (diff-414771774e10bc81260094ffcdc7b310a3be48758b2abd2bfae831c83912c02c)
The `func setStartHeight(_ startHeight: BlockHeight)` function assumes that
there might not be a wallet birthday set up or that it might be changed
in-flight which are things that are no longer happening.
remove test warning
Fix test compiler error
`XCAsyncTestCase` does not work as intended but `wait {}` does what
we need.
restored `needsToStartScanningWhenStopped` as a Bool var on actor
fixed Enhancement test
- Test was failling with:
generalError(message: "block not found in cache, should always be in cache in darkside mode")
- There was no wait so lightwalletd in darkside mode didn't have enough time to accept mocked state.
- Sample app refactored for the processor being an actor
- tests refactored as well
- dark side tests fixed
- utilities separated to new file
- synchronizer's start and stop are no longer in async context
- updating the UI for the scan fixed
Fix tests.
Fix tests.
Use Account 6 vectors on testListTransparentReceivers
only use first tree addresses from the vector for testListTransparentReceivers
Fix unified address generation tests.
Fix build and PR suggestions
- blocking API removed, only latestBlockHeight() stayed
- non-blocking closure based API removed
- unit tests updated to use async API
[#492] Get rid of blocking API (#551)
- forgotten commented code cleaned up
- some comments were still mentioning result (completion closure), removed
MultiThreadedEventLoopGroup has been replaced with NIOTSEventLoopGroup. It's recommended by authors of grpc-swift especially for iOS platform and it allows us to set the priority because NIOTSEventLoopGroup is GCD based while MultiThreadedEventLoopGroup is pthread based.
[#541] Initialise gRPC on a separate thread (#545)
- priority increased to .default
[#534] Use UnifiedSpendingKey for shielding and Spending
This commit implements the use of Unified Spending Keys for shielding
and spending as well as rolling Unified Addresses.
Users should obtain addresses by rolling them from the SDK.
USKs replace Sapling Extended Spending keys and TransparentAccountPrivKeys
when shielding or spending
Closes#534
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
* Fix rebase issues
* PR Suggestion. Make `lastError` an Optional
* Fix test `testReOrgRemovesOutboundTxAndIsNeverMined`
Co-authored-by: Kris Nuttycombe <kris@nutty.land>
- sendToAddress and SaplingParameterDownloader refactored to async
- unit tests WIP
[486] sendToAddress async/await
- testing code cleanup
[#486] sendToAddress async/await
- reducing number of Tasks in Sample app
[#486] sendToAddress async/await
- I finally figure out how to make the dark side tests async, using new sendToAddress APIs and pass, POC done, 18 more tests to refactor
[#486] sendToAddress async/await
- async sendToAddress unit test refactored except NetworkUpgradeTests
[#486] sendToAddress async/await
- NetworkUpgradeTests refactored to async API
[#486] sendToAddress async/await
- cleanup
[#486] sendToAddress async/await (#536)
- PR comments resolved
this introduces several types under UnifiedAddress `ReceiverTypecodes`
and `UnifiedAddress.Errors` to host possible errors on third-party
generated UAs and their composition
Implement extracting the typecodes from a UA
Issue Reported:
When the synchronizer is stopped, the processor does not cancel
the download correctly. Then when attempting to resume sync, the
synchronizer is not on .stopped and can't be resumed
this doesn't appear to happen in master branch that uses
structured concurrency for operations.
Fix:
This commit makes sure that the download streamer checks cancelation
before processing any block, or getting called back to report progress