Commit Graph

112 Commits

Author SHA1 Message Date
Francisco Gindre ee9bf85557 [WIP] - [#616] move notification off the main queue into their own queue
Use combine current value subject instead to maintain retrocompatibility
with clients relying on status variable.

Move all the notifications to the dedicated queue.
2022-11-10 21:04:12 -03:00
Francisco Gindre 380425e4e0 [#616] Download Stream generates too many updates on the main thread
Closes #616
2022-11-09 20:58:22 -03:00
Francisco Gindre 9607f0cefa - [#610] Release 0.17.0-beta.rc1 2022-11-07 14:21:22 -03:00
Francisco Gindre 59dc56c9b4 Merge branch 'feature/zip-316-and-latest-upstream' into release/0.17.0-alpha.3 2022-11-01 15:09:39 -03:00
Francisco Gindre a12666e932 [#602] Improve error logging for InitializerError and RustWeldingError 2022-11-01 13:57:42 -03:00
Francisco Gindre c0f1aa959a Fix SendViewController `viewDidLoad` 2022-10-31 20:45:58 -03:00
Francisco Gindre a0d02c4d57 PR Suggestions
`XCAsyncTestCase` does not work as intended but `wait {}` does what
we need.

restored `needsToStartScanningWhenStopped` as a Bool var on actor

fixed Enhancement test
2022-10-31 20:17:21 -03:00
Francisco Gindre 01d85f5748 Fix compiler errors 2022-10-31 09:57:10 -03:00
Francisco Gindre dbd4b8934c Merge branch 'master' into merge-master 2022-10-31 09:34:38 -03:00
Michal Fousek 571166cc8a [#579] Fix database lock
Closes #579

This is what happens when database was locked:
- App is syncing.
- While rustBackend.scanBlocks(…) is in progress app goes to background. Background task is launched and
  ECC works for some time in background.
- When background task is finished synchronizer.stop() is called.
- Inside CompactBlockProcessor.stop()is called. In this method cancelableTask is canceled and state is
  set to stopped no matter what. And this is the problem. Because even when canceled is called rust
  scanning isn’t canceled. But state doesn’t care about it. And next time when app is launched new
  synchronisation is started and now you have processing code running in two threads causing DB lock.

So I moved setting state to stopped to processNewBlocks method. It's set
after the work is canceled and really stopped. When doing this there is
still one problem. When app goes to foreground new sync is not started
and current one is just stopped.
    So I added new variable and condition. And when this variable is set
to true new syncing process starts when the previous one is canceled.
This should cover all the problems.
2022-10-31 09:57:32 +01:00
Francisco Gindre b5d659e8a8 Fix various tests and deleted some that are not useful anymore
Closes #588
Closes #584
Closes #589
Closes #591
2022-10-27 20:09:08 -03:00
Lukas Korba cfe71d5da2
[#523] Make a CompactBlockProcessor an Actor (#565)
- 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
2022-10-27 12:51:38 +02:00
Francisco Gindre 1d97ad920b [#581] getTransparentBalanceForAccount error not handled 2022-10-26 20:26:37 -03:00
Francisco Gindre 545380b3e2 [#577] Fix: reduce batch size when reaching increased load part of the chain
Currently a 100 batch can take up to 3 minutes to scan. decrease the size of the batches when the increased load part of the chain is reached until a faster sync is implemented

See related counterpart to remove it issue #576

Closes #577
2022-10-25 18:21:32 -03:00
Francisco Gindre 5de1b50b29 make Memo and MemoBytes parameters nullable so they can be omitted when sending to transparent receivers.
update libzcashlc
2022-10-24 22:49:04 -03:00
Francisco Gindre b7528b4bf8
Merge pull request #573 from zcash/release/0.16.12-beta
[#572] release 0.16.12-beta with new checkpoints
2022-10-24 16:45:43 -03:00
Francisco Gindre bbe5a577d5 [#572] release 0.16.12-beta with new checkpoints 2022-10-21 18:47:47 -03:00
Francisco Gindre 37b060852c
Merge pull request #567 from nuttycom/pending_transaction_entity_recipient
Add internal recipient information to `PendingTransactionEntity`
2022-10-21 18:27:52 -03:00
Francisco Gindre 2fb25dcd35 Fix: Transaction repository tests pass 2022-10-21 18:19:08 -03:00
Kris Nuttycombe 1273d303ec Clarify & make regular how migrations are applied. 2022-10-20 10:57:57 -06:00
Francisco Gindre 78856c658a Fix: successive launches of the application fail because the closed range of the migrations to apply would be invalid (lower range > that upper range) 2022-10-20 11:17:34 -03:00
Kris Nuttycombe 7847a7195e Fix incorrect encoding of optional strings in PendingTransaction. 2022-10-19 14:58:51 -06:00
Francisco Gindre 789cf01188 Add Fee field to Transaction, ConfirmedTransaction, ReceivedTransactions and Pen
dingTransactions.
Update Notes DAOs with new fields.

Make Zatoshi Codable

add tests for Recipient.forEncodedAddress
2022-10-19 17:37:06 -03:00
Kris Nuttycombe 849083ffd9 Fix UInt32 conversions to SQL in PendingTransactionDao 2022-10-19 14:13:18 -06:00
Kris Nuttycombe fae15ce268 Fix sent_notes.to_address column reference. 2022-10-19 13:51:10 -06:00
Francisco Gindre 30a9c066ad Replace `db.run` with `db.execute` to fix migration issues 2022-10-19 11:29:15 -03:00
Kris Nuttycombe 0fbf90dc82 Add migration to re-create pending_transactions table with nullable columns. 2022-10-18 19:44:34 -06:00
Kris Nuttycombe 36932a21dd Use PendingTransactionEntity.internalAccount for shielding. 2022-10-18 10:17:07 -06:00
Kris Nuttycombe f5d7aa0f17 Modify PendingTransactionEntity to be able to represent internal shielding tx. 2022-10-18 10:07:23 -06:00
Francisco Gindre 923eca19ce [#561] Fix unified typecodes tests
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
2022-10-18 11:40:36 -03:00
Kris Nuttycombe 91ea6f5476 Update to latest librustzcash 2022-10-17 15:00:08 -06:00
Francisco Gindre 3613dfcf06
Merge pull request #558 from zcash/release/0.16.11-beta
[#557] Update checkpoints and release 0.16.11-beta
2022-10-06 03:44:48 -07:00
Francisco Gindre fe90ef0010 [#557] Update checkpoints and release 0.16.11-beta
Closes #557
2022-10-04 19:52:27 -03:00
Francisco Gindre 8a26e2e469 UFVK validation was validating sapling keys 2022-10-03 21:12:10 -03:00
Francisco Gindre 33f2f787e7 fix merge errors 2022-10-03 20:39:54 -03:00
Francisco Gindre 7f480e417d Merge branch 'master' into merge-master 2022-10-03 20:15:40 -03:00
Lukas Korba 9b6ff51b29
[#492] Get rid of blocking API (#551)
- 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
2022-10-03 20:05:11 -03:00
Lukas Korba fa5bbbb2bf
[#541] Initialise gRPC on a separate thread (#545)
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
2022-10-03 15:54:43 -03:00
Lukas Korba 46d8c04afc
[#546] TransactionEncoder To Async/Await (#547)
- async/await API update
- code cleaned up from the unused APIs
2022-10-03 12:44:33 +02:00
Francisco Gindre 7806b5114f
Use UnifiedSpendingKey for shielding and Spending (#535)
[#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>
2022-10-02 23:11:17 -03:00
Francisco Gindre ca5221ac75 Merge branch 'master' into merge-master-to-zip-316 2022-09-30 09:53:34 -03:00
Francisco Gindre 28985a4e38
Merge pull request #536 from LukasKorba/486_sendToAddress_async_await
[#486] sendToAddress async/await
2022-09-23 12:08:31 -07:00
Francisco Gindre 9e41fb4375 Fix: [#539] 0.16.10-beta not in Podspec of that version 2022-09-21 13:27:35 -03:00
Lukas Korba 2c93802828 [#487] shieldFunds to async/await
- API refactored to async

[#487] shieldFunds to async/await

- unit tests refactored
2022-09-21 16:36:41 +02:00
Lukas Korba 61683a85f3 [486] sendToAddress async/await
- 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
2022-09-21 13:47:17 +02:00
Francisco Gindre 38b8fd09d8
Merge pull request #531 from zcash/receiver_type_codes
Receiver type codes
2022-09-20 10:27:54 -07:00
Francisco Gindre a9805cfe7e [#530] Implement ability to extract available typecodes from UA
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
2022-09-19 14:52:30 -03:00
Francisco Gindre d8ee9ff277 - [#532] Download does not stop correctly
Issue Reported on [0.16.x-beta]

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

Fix:
This commit makes sure that the download streamer checks cancelation
before processing any block, or getting called back to report progress
2022-09-16 18:08:31 -03:00
Francisco Gindre db15465ebe Merge branch 'master' into release/0.16.10-beta 2022-09-16 18:04:14 -03:00
Francisco Gindre 044d7d99d5 Bump version and add new checkpoints 2022-09-16 17:41:47 -03:00