Commit Graph

939 Commits

Author SHA1 Message Date
Lukas Korba 587977d1d1
[#818] Swift 5.7 syntax update (#828)
- code updated
2023-03-14 09:11:17 -03:00
Michal Fousek b34ae033ae
Merge pull request #827 from Chlup/826_change_initialisation
[#826] Change how the SDK is initialised
2023-03-14 12:30:42 +01:00
Michal Fousek cb31acdd81 [#826] Change how the SDK is initialised
Closes #826

- `viewingKeys` and `walletBirthday` are removed from `Initializer`
  constuctor. These parameters are moved to `SDKSynchronizer.prepare`
  function.
- Constructor of the `SDKSynchronizer` no longer throws exception.
- Any value emitted from `lastState` stream before `SDKSynchronizer.prepare`
  is called has `latestScannedHeight` set to 0.
- `Initializer.initialize` function isn't public anymore. To initialize
  SDK call `SDKSynchronizer.prepare` instead.
- Real birthday is now known after the `SDKSynchronizer.prepare` is
  called. But this function isn't async and therefore it's hard to
  pass birthday from here to `CompactBlockProcessor` in synchronous
  manner. We must be sure that it's safe to call start() after prepare
  function finishes.
    For this reason `CompactBlockProcessor` has `walletBirthdayProvider`
  instead of `walletBirthday`. And this new parameter is closure which
  reads birthday from `Initiliazer` on each call. Thanks to this
  `CompactBlockProcessor` has always the right birthday.
- Some cleanup is done in `TestCoordinator`.
2023-03-13 15:32:55 +01:00
Francisco Gindre f600a3f066
[#824] Release 0.19.1-beta (#825) 2023-03-10 11:16:12 -03:00
Francisco Gindre 24da80d36b
[#821] `failedToWriteMetadata` at sync startup (#822)
contains no public API changes.

Adds `func shouldClearBlockCacheAndUpdateInternalState() -> BlockHeight?` to `SyncRanges`
so that the compact block processor can advert internal states that are not consistent and
recover from such state.

Closes #821
2023-03-09 15:40:06 -03:00
Michal Fousek de473a3958
Merge pull request #823 from Chlup/linter_change
Remove linter binary from repository
2023-03-09 16:07:02 +01:00
Michal Fousek adcc8a2263 Remove linter binary from repository 2023-03-09 14:51:02 +01:00
Francisco Gindre 763d3eaeee
Release 0.19.0 beta (#815)
* Add Mainnet Checkpoints

* Add testnet checkpoints

* Add Changelog update for 0.19.0-beta
2023-03-02 18:51:36 -03:00
Francisco Gindre 172dd9fd6f
Merge pull request #817 from Chlup/816_fix_rewind
[#816] Improve how rewind(policy:) call can be used
2023-03-02 18:02:03 -03:00
Michal Fousek 7e646adba0 [#816] Improve how rewind(policy:) call can be used
Closes #816

- `SDKSynchronizer.rewind(policy:)` can be now called anytime.
- If the sync is in progress then the sync is first stopped and then rewind is executed.
- Rewind now returns AnyPublisher which completes or fails when wipe is done.
- `AgterSyncHooksManager` is used to execute rewind after sync process
  is stopped.
2023-03-02 13:19:25 +01:00
Michal Fousek 9bfbdcb4c5
Merge pull request #811 from Chlup/logger_small_fix
Set oslog inside OSLogger public for read
2023-03-01 14:13:48 +01:00
Michal Fousek ea4d56536e Set oslog inside OSLogger public for read
- This is necessary to finish https://github.com/zcash/secant-ios-wallet/issues/529.
  The Secant has special log method for logging tca stuff. And this
  method will be in extension of `OSLogger` and it needs to access
  `oslog`.
2023-03-01 14:07:14 +01:00
Michal Fousek d87fc1fec6
Merge pull request #808 from Chlup/789_fix_testRescanToHeight_test
[#789] Fix testRescanToHeight test
2023-02-27 17:33:40 +01:00
Michal Fousek b4b0eadbf4
Merge pull request #807 from Chlup/790_fix_testRescanToTransaction_test
[#790] Fix testRescanToTransaction test
2023-02-27 17:33:31 +01:00
Michal Fousek 21d07aba49
Merge pull request #809 from Chlup/644_enable_testReOrgRemovesIncomingTxForever_test
[#644] Enable test testReOrgRemovesIncomingTxForever
2023-02-27 17:33:20 +01:00
Michal Fousek 8385c22100 [#644] Enable test testReOrgRemovesIncomingTxForever
- Test works with currently used lightwalletd. It doesn't work with
  newer. It can be enabled for now.
2023-02-27 14:44:37 +01:00
Michal Fousek 27f0efa0a7 [#789] Fix testRescanToHeight test
Closes #789
2023-02-27 14:39:07 +01:00
Michal Fousek 1fe7b494d5 [#790] Fix testRescanToTransaction test
Closes #790
2023-02-27 14:36:32 +01:00
Michal Fousek 137788d81c
Merge pull request #805 from Chlup/show_values_in_zec
[#803] Fix how transaction value is showed in the SDK sample app
2023-02-23 19:34:28 +01:00
Michal Fousek 3b2d972b2d [#803] Fix how transaction value is showed in the SDK sample app
Closes #803
2023-02-23 11:50:21 +01:00
Michal Fousek e3c9530416
Merge pull request #802 from Chlup/801_improve_wipe
[#801] Improve wipe implementation
2023-02-23 09:38:58 +01:00
Michal Fousek c1b640b44e [#801] Improve wipe implementation
Closes #801

- `SDKSynchronizer.wipe()` can be now called anytime.
- If the sync is in progress then the sync is first stopped and then
  wipe is executed.
- Wipe now returns AnyPublisher which completes or fails when wipe is
  done.
- Majority of wipe's work is to delete files. That is only operation
  that can throw error during wipe. This operation should succeed every
  time. If it fails that something is seriously wrong. When this happens
  the SDK can happen in inconsistent state. There is no recovery for
  now. Only way how to fix this is to reinstall the app in the device.
- Added hooks mechanism. This is implemented in `AfterSyncHooksManager`
  and it is used by `CompactBlockProcessor`. It's just more organized
  way how to track what should happen when the sync process is canceled.
2023-02-22 10:36:33 +01:00
Michal Fousek e439e66896
Merge pull request #798 from Chlup/795_sapling_files_tests_locally
[#795] Include sapling-spend file into bundle for tests
2023-02-20 22:32:10 +01:00
Michal Fousek f0827fc775
Merge pull request #800 from Chlup/784_fix_test_testVerifyBalanceAfterExpiredTransaction
[#784] Fix testVerifyBalanceAfterExpiredTransaction test
2023-02-20 22:31:57 +01:00
Michal Fousek d09b00cabe [#795] Include sapling-spend file into bundle for tests
Closes #795

- Added structure `SaplingParamsSourceURL` which holds source URLs for
  sapling-spend file and sapling-output file. URLs are ultimately passed
  to `SaplingParameterDownloader`.
- This is done so it's possible to pass different URLs when running
  tests.
- sapling-spend file and sapling-output file are in tests bundle. And
  when running tests these files are loaded from bundle and not from
  network.
2023-02-20 10:03:16 +01:00
Michal Fousek c80ef173f8 [#784] Fix testVerifyBalanceAfterExpiredTransaction test
Closes #784
2023-02-20 09:53:06 +01:00
Michal Fousek bb0e27dc93
Merge pull request #794 from Chlup/793_fix_stop_notifications
[#793] Send synchronizerStopped notification only when sync process stops
2023-02-20 09:45:37 +01:00
Michal Fousek 699b374193
Merge pull request #799 from Chlup/788_fix_test_testSmallDownloadAsync
[#788] Fix testSmallDownloadAsync test
2023-02-20 09:45:14 +01:00
Michal Fousek 6db7f88f0f [#788] Fix testSmallDownloadAsync test
Closes #788
2023-02-17 11:02:24 +01:00
Michal Fousek 3aad1470f1 [#793] Send synchronizerStopped notification only when sync process stops
Closes #793
2023-02-17 08:49:55 +01:00
Michal Fousek c7574b81a2
Merge pull request #797 from Chlup/796_fix_memory_tests
[#796] Fix tests
2023-02-17 08:48:19 +01:00
Michal Fousek 65a096d6cd [#796] Fix tests 2023-02-16 17:14:31 +01:00
Michal Fousek a7a6755f81
Merge pull request #792 from Chlup/780_green_policy_baseline
[#780] Disable tests that aren't currently working
2023-02-15 09:57:18 +01:00
Michal Fousek 3edcfe853b [#780] Disable tests that aren't currently working 2023-02-15 09:33:31 +01:00
Michal Fousek 753e3bf605
Merge pull request #779 from Chlup/two_swiftlint_configs
[#778] Add swiflint config file only for tests
2023-02-15 09:31:41 +01:00
Michal Fousek 27b99013f7
Merge pull request #775 from Chlup/715_parametrize_seedPhrase_tests
[#715] Move seed phrase from specific tests to Environment
2023-02-13 15:10:07 +01:00
Michal Fousek 663a785b8f
Merge pull request #776 from Chlup/713_remove_unusedMethods_testcoordinator
[#713] Remove unused methods from TestCoordinator
2023-02-13 13:42:35 +01:00
Michal Fousek 65d6347bcf [#778] Add swiflint config file only for tests
Closes #778

- .swiftlint.yml is now used to lint only the code of the SDK.
- .swiftlint_tests.yml is now used to lint only the code of the tests.
  This config disables rules that were previously disabled in the code
  in lot of tests.
2023-02-13 13:36:58 +01:00
Michal Fousek 71e5e37eec [#715] Move seed phrade from specific tests to Environment
Closes #715
2023-02-13 13:36:38 +01:00
Michal Fousek 02e4968ea3
Merge pull request #777 from Chlup/handle_linter_disables
Update code to to comply better with linter rules
2023-02-13 13:32:36 +01:00
Michal Fousek 44732b179b Update code to to comply better with linter rules
- Removed some disabled linter rules from code and update code to comply
  with those.
- No logic was changed.
2023-02-13 12:18:08 +01:00
Michal Fousek 2718b6c19b [#713] Remove unused methods from TestCoordinator 2023-02-13 10:39:37 +01:00
Francisco Gindre a57d302c5a
Merge pull request #773 from Chlup/770_update_grpc
[#770] Update GRPC swift library
2023-02-10 15:42:16 -03:00
Michal Fousek 84fb032185
Merge pull request #768 from Chlup/764_notifications_gone_inside
[#764] Stop using Notifications inside the SDK
2023-02-09 20:33:09 +01:00
Michal Fousek 1ec12269ae [#764] Stop using Notifications inside the SDK
Closes #764

- All notification that were previously sent from CompactBlockProcessor are now gone.
- `CompactBlockProcessor` now provides `eventStream` to communicate with `SDKSynchronizer`.
- Added `synchronizerStoredUTXOs` notification.
- Tests are updated to not use notifications anymore. Some tests there
  weren't working before are now fixed.
- Added `CompactBlockProcessorEventHandler` utility class. Previously
  expectations were subscribing to notifications. This class replaces
  this functionality. It subscribes to events from
  `CompactBlockProcessor` and fullfill expectations.
2023-02-09 20:09:51 +01:00
Michal Fousek be8afabec4 [#770] Update GRPC swift library
Closes #770
2023-02-09 19:55:46 +01:00
Michal Fousek e83bec6db7
Merge pull request #772 from Chlup/rename_fsmeta_param
[#771] Fix tests failing because of different paths passed to `FSCompactBlockRepository` and `FSMetadataStore`
2023-02-09 15:19:50 +01:00
Michal Fousek 34c08a3a81 [#771] Fix tests failing because of different paths passed to `FSCompactBlockRepository` and `FSMetadataStore`
Closes #771

- Renamed `cacheDirectory` param in `FSCompactBlockRepository`
  constructor to `fsBlockDbRoot`.
- Pass same paths to `FSCompactBlockRepository` and `FSMetadataStore`
  from tests.
2023-02-09 13:58:49 +01:00
Francisco Gindre cf60f44aa8
Merge pull request #769 from zcash/release/0.18.1-beta
implement getRecipients() for Synchronizer and Release 0.18.1 beta
2023-02-08 13:26:57 -03:00
Francisco Gindre 67dd061523 Merge branch 'main' into release/0.18.1-beta 2023-02-08 12:48:20 -03:00