Closes#876.
- Add `testMultipleSynchronizersCanRunAtOnce()` test which creates
multiple instances of the `SDKSynchronizer` and then executes sync in
parallel.
- To achieve this it's required to have multiple instances of the
lightwalletd in the darkside mode. Because of this new test is in the
new target `AliasDarksideTests`. It's little bit harder to run this
test than to run regular darkside tests. So it has it's own target.
- Fix bug when all the instances of the `SDKSynchronizer` used same data
DB even with different aliases.
- Add script to run multiple instances of the lightwalletd in
darkside mode. And add script to stop these instances and clean after
those.
- Update `DarksideWalletService` a little so the endpoint can be passed
to it. Without this it would always use default endpoint when created
with service.
- Small cleanup in `TestCoordinator`.
Closes#209.
[#845] Introduce ZcashSynchronizerAlias enum
Closes#845.
[#852] SDKSynchronizer using queues label based on the alias
Closes#852.
[#847] Remove posibility to use DatabaseStorageManager as singleton
Closes#847.
[#850] Remove synchronizerConnectionStateChanged notification
Closes#850.
[#855] Add check if the Alias is already used
Closes#855
- Added `UsedAliasesChecker` utility which is used to register aliases
that are in use.
- `prepare()` and `wipe()` methods now check if the current alias can't
be used and if not then `InitializerError.aliasAlreadyInUse` is
thrown/emitted.
- Some public methods that could cause harm if used with the Alias that
is already in use now throw `SynchronizerError.notPrepared`. Thanks to
this the client app is forced to call `prepare()` first. And
`prepare()` does check for the Alias.
- Added tests for new conditions.
[#849] Make InternalSyncProgress aware of the Alias
Closes#849.
[#853] Only instance with default Alias migrates legacy cache DB
Closes#853.
[#851] Apply the Alias to the URLs
Closes#851.
- `Initializer` now updates paths according to alias before paths are
used anywhere in the SDK.
- Paths update can fail. It would be incovenient for the client apps to
handle errors thrown from `Initiliazer` constructor. So the error is
then handled in `SDKSynchronizer.prepare()` or `SDKSynchronizer.wipe()`.
[#846] Stop using SDKMetrics as singleton (#862)
- metrics are not longer a singleton
- tests fixed
- metrics outside init of the synchronizer
[#848] Make logger aware of the alias
- logger is now an instance passed throughout the sdk instead of a static proxy
[#848] Make logger aware of the alias (#868)
- comments addressed
[#848] Make logger aware of the alias (#868)
- returning protocol back
Fix typos
[#856] Add possibility to test multiple synchronizers in the sample app
Closes#856.
- Added `alias` property to `Synchronizer`.
- Added `SyncBlocksListViewController` which provides UI to use multiple
synchronizers at once.
[#209] Add changelog
- Add changelog for #209.
- Overall improve readability of the rendered changelog. Tickets
references are now prefixed with `###` instead of `- `.
Fix compilation
Closes#746
- `LightWalletGRPCService` is no longer public. `LightWalletService` is no longer public.
- `LightWalletGRPCService` shouldn't be used dicrectly. Use `LightWalletServiceFactory` to create instance of the service.
- Moved sending of `blockProcessorConnectivityStateChanged` notification to `Initilizer`.
- All the errors from GRPC are mapped to `LightWalletServiceError`. Handling of `GRPCStatus` in the SDK is no longer required.
- `Service` directory (that contains GRPC code) is moved to `Modules/Service`. We can put more code to `Modules/` if we decide
to modularize more code.
Closes https://github.com/zcash/ZcashLightClientKit/issues/697
Closes https://github.com/zcash/ZcashLightClientKit/issues/720
Closes https://github.com/zcash/ZcashLightClientKit/issues/587
Closes https://github.com/zcash/ZcashLightClientKit/issues/667
Closes https://github.com/zcash/ZcashLightClientKit/issues/443
Closes https://github.com/zcash/ZcashLightClientKit/issues/754
- [#790] Fix ShieldFundsTests
Closes#790
Removes comments on `ShieldFundsTests` since those issues have been fixed
Depends on zcash-light-client-ffi changes that adopt newer versions of
librustzcash crates `zcash_primitives 0.10`, `zcash_client_backend 0.7`,
`zcash_proofs 0.10`, `zcash_client_sqlite 0.5.0`.
Also allows wallets to define a shielding_threshold and will set
foundations to customize minimum confirmations for balances, spends
and shielding operations.
**Test Bootstrapping**
- `ZcashCompactBlockDescriptor`: struct that holds functions to
describe blocks as filenames and compare those filenames
`ZcashCompactBlockDescriptor.live` has the actual implementation
but it can be replaced by mocks if needed on Tests
main implementations are held under `FSCompactBlockRepository.filenameDescription` and `FSCompactBlockRepository.filenameComparison` on a separate extention
`DirectoryListingProviders` provide two default implementations of listing a
directory deterministically. `FileManager` does not define a sorting and needs to be done in-memory by calling `.sorted()` on the resulting collection. If this
is a big toll on performance it can be changed to a POSIX implementation but
this is good for now.
`ZcashCompactBlockDescriptor` adds a `height` helper function to
turn a filename into the height of the block stored.
Implemented `func latestHeight() throws -> BlockHeight ` that
returns the blockheight by querying the cache directory in a sorted
fashion and getting the last value and turning the filename into a
`BlockHeight`
Added `Meta` struct to ZcashCompactBlock.
Tests implemented:
- `filterBlockFiles`
- `testClearTheCache`
- `testLatestHeightEmptyCacheThrows`
- `testLatestHeightEmptyCacheThrowsAsync`
- `testRewindEmptyCacheDoesNothing`
- `testRewindEmptyCacheDoesNothingAsync`
- `testWhenBlockIsStoredItFollowsTheDescribedFormat`
- `testWhenBlockIsStoredItFollowsTheFilenameConvention`
- `testGetLatestHeight`
- `testRewindDeletesTheRightBlocks` test
- `testPerformanceExample` test. This isn't a real performance test because the API doesn't work with async/await yet
adopts `shield_funds` shielding threshold parameter
Implements `initBlockMetadataDb` and fix tests
Renames dbCache parameter to `fsBlockDbRoot`. Builds but tests don't pass.
Removes cacheDb uses from code. Testing utilities still persist.
Added needed information in MIGRATING and CHANGELOG.
Added helper to perform deletion of legacy db and creation a the
new file system backed cache.
Renames parameters and changes code where needed.
Network Constants turned into `enum` with static methods.
DeletelastDownloadedBlock helper from initializer
Removes CompactBlockStorage and CompactBlockEntity.
Implements `latestCachedBlockHeight` on rustbackend.
*Replaces dependencies on ZcashRustWelding with `FSMetadataStore`*
This allows the tests to not depend in a particular implementation
of either the MockRustBackend of or ZcashRustBackend. Also provides
a way to test errors properly and switch implementations of critical
areas like `writeBlocks`.
- Removed `Transaction` struct and `TransactionEntity` protocol.
- Removed some other protocols from `TransactionEntity.swift`.
Use correct default fee and memo count
- 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
- migration of the protocol's methods done
- split the code so there's blocking and non-blocking API separately
[463] Migrate LightwalletService to Async/Await
- draft
[463] Migrate LightwalletService to Async/Await
- failing tests under investigation
[463] Migrate LightwalletService to Async/Await
- code cleanup
- tests cleanup
- async throws unit tests added
[463] Migrate LightwalletService to Async/Await
- sample app updated to the latest API
[463] Migrate LightwalletService to Async/Await
- cleanup
[463] Migrate LightwalletService to Async/Await
- cleanup
[463] Migrate LightwalletService to Async/Await
- fixed non-building tests
[463] Migrate LightwalletService to Async/Await
- reverting back to lastHeight()
[463] Migrate LightwalletService to Async/Await
updated code to AsyncStream
[463] Migrate LightwalletService to Async/Await (493)
- tests fixed
- blockRange reimplemented to use AsyncStream
- grpc proto files regenerated to exclude Server