Commit Graph

622 Commits

Author SHA1 Message Date
Francisco Gindre 10a884ba60
Merge pull request #550 from zcash/merge-master-to-zip-316
Merge master to zip 316
2022-09-30 05:56:22 -07: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 c834b13f29
Merge pull request #537 from LukasKorba/487_shieldFunds_to_async_await
[#487] shieldFunds to async/await
2022-09-23 12:08:07 -07:00
Francisco Gindre bdd61be8c5
Merge pull request #540 from zcash/fix/0.16.10-beta
Fix: [#539] 0.16.10-beta not in Podspec of that version
2022-09-21 09:33:30 -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 77d11470d5
Merge pull request #533 from zcash/release/0.16.10-beta
Release/0.16.10 beta
2022-09-19 09:43:21 -07: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
Francisco Gindre 60aa28628b [#532] [0.16.x-beta] Download does not stop correctly
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
2022-09-16 16:59:31 -03:00
Francisco Gindre e82a6d26ee
Merge pull request #518 from zcash/merge_master_to_zip_316
Merge master to zip 316
2022-09-15 08:03:29 -07:00
Francisco Gindre e3743f8ba0 Fix commit SHA pointing to inexintent hash.
now pointing to `fcf3d4b652b67d6a9b9bdc8e5565eb8dd4b46145`
2022-09-15 11:10:10 -03:00
Francisco Gindre bee1c9db80 Merge branch 'master' into merge_master_to_zip_316 2022-09-15 11:04:49 -03:00
Lukas Korba 90f38973ac
Merge pull request #519 from LukasKorba/476_CompactBlockProcessor_async
[476] CompactBlockProcessor to async/await
2022-09-15 15:08:46 +02:00
Lukas Korba 2b65bd46e4 [476] CompactBlockProcessor to async/await
- getting rid of the Operation Queue
- the cleanup is needed
- the update of tests is needed
- tested and it successfully finishes the sync process

[476] CompactBlockProcessor to async/await

- old processNewBlocks() removed

[476] CompactBlockProcessor to async/await

- unused operations removed

[476] CompactBlockProcessor to async/await

- unit tests update

[476] CompactBlockProcessor to async/await

- unit tests refactored

[476] CompactBlockProcessor to async/await

- cleanup of deprecated method

[476] CompactBlockProcessor to async/await

- fail(error) was called even for canceled tasks but that must be excluded

[476] CompactBlockProcessor to async/await

- removal of all ZcashOperations from the code (unit test will follow)

[476] CompactBlockProcessor to async/await

- network tests in building and success order again

[476] CompactBlockProcessor to async/await

- offline tests in building and success order

[476] CompactBlockProcessor to async/await (519)

- cleanup of suspending the task

[476] CompactBlockProcessor to async/await (519)

- most comments resolved

[476] CompactBlockProcessor to async/await (519)

- thread safe state for both sync and async context

[476] CompactBlockProcessor to async/await (519)

- fixed build for a sample project

[476] CompactBlockProcessor to async/await (519)

- func testStartNotifiesSuscriptors() reverted

[476] CompactBlockProcessor to async/await (519)

- TODO added to track why we used NSLock instead of an Actor
- Task priority enhanced

[476] CompactBlockProcessor to async/await (519)

- cleanup in Tasks and priorities
2022-09-15 08:10:12 +02:00
Francisco Gindre 3597d3c019
Merge pull request #355 from zcash/non-consensus-changes-libzcashlc
Issue #335 - Update lib.rs to lastest librustzcash master
2022-09-13 13:41:44 -07:00
Francisco Gindre e179153420 update protobuf files from lightwalletd's commit `68789356fb1a75f62735a529b38389ef08ea7582` 2022-09-12 16:58:30 -06:00
Francisco Gindre 72c1f14aa6 Issue #375 - User can't go twice in a row to SendFundsViewController 2022-09-12 16:58:29 -06:00
Francisco Gindre cd345f6ddc Add test utilities for db Migration 2022-09-12 16:58:29 -06:00
Francisco Gindre a1bc2937d4 Issue #374 - XCTest don't load Resources from the module's bundle
Tests referencing Bundle.module were failing.
Fixed with proposed solution here:
https://stackoverflow.com/questions/47177036/use-resources-in-unit-tests-with-swift-package-manager
2022-09-12 16:58:29 -06:00
Francisco Gindre 23097ac8e0 Add outputPool to NotesDao 2022-09-12 16:58:29 -06:00
Francisco Gindre 1a73985307 Fix Merge Mistakes 2022-09-12 14:36:30 -03:00
Francisco Gindre 91719508ec
Merge pull request #528 from zcash/release/0.16.9-beta
[#525] Release 0.16.9-beta

Approval on https://github.com/zcash/ZcashLightClientKit/pull/526
2022-09-12 10:07:40 -07:00
Francisco Gindre a81a77f494 Merge branch 'master' into merge_master_to_zip_316 2022-09-12 14:00:40 -03:00
Francisco Gindre 4428f9ffb2 Merge branch 'feature/zip-316-and-latest-upstream' into merge_master_to_zip_316 2022-09-12 13:40:05 -03:00
Francisco Gindre a05990b417 [#525] Release 0.16.9-beta 2022-09-12 13:18:40 -03:00
Lukas Korba 9cf2e07d25
Merge pull request #524 from LukasKorba/483_OutboundTransactionManager_Async
[483] OutboundTransactionManager To Async/Await
2022-09-12 14:25:34 +02:00
Lukas Korba 4a2fcde353 [483] OutboundTransactionManager To Async/Await
- protocol methods updated from closure to async APIs
- PersistentTransactionManager updated to implement async APIs
- PersistentTransactionManager deleted closure APIs
- SDKSynchronizer updated to use async APIs
2022-09-12 13:27:52 +02:00
Francisco Gindre 375cf3ce41
Merge pull request #393 from zcash/384_adopt_type_safe_memos 2022-09-09 19:41:33 -07:00
Francisco Gindre 0282d81584 Fix Errors introduced by Merge-Commit 2022-09-08 20:44:38 -03:00
Francisco Gindre 458d3d7106 Merge branch 'feature/zip-316-and-latest-upstream' into merge_master_to_zip_316 2022-09-07 20:58:46 -03:00
Francisco Gindre 9b930391a4 [#384] Adopt Type Safe Memos in the FFI and SDK
Closes #384

This makes the SDK use the Memo and MemoBytes types across the FFI and the
public interface of the SDKSynchronizer. Addresses the comments by @defuse  on
issue https://github.com/zcash/ZcashLightClientKit/issues/378.
These changes depend on zcash-light-client-ffi repo changes managing
memos as byte arrays instead of string encoding of memos.

There are some compromises in terms of database representation of memos
and their exposure in transaction representing entities because we
wanted to avoid changing the database at this moment and be retro-
compatible with earlier versions and maintain deprecated APIs for wallets
to have time to adopt.

Memo and MemoBytes are WIP and subject to change. we are exploring
making Memo an opaque type based on a struct and drop the enum approach
to make the interface less throwing.

Fix: wrap new functions and deprecate old API. catch Memo errors

update get_sent and get_received memo functions from rust welding
point to branch in FFI repo

Fix type Tests/DarksideTests/BalanceTests.swift

Co-authored-by: Carter Jernigan <git@carterjernigan.com>

PR suggestions. Inverted condition

PR Suggestions + cleanup

merge fixes

Suggestions from PR to treat null bytes on TextMemo

refactor unpaddedRawBytes function and add tests

undo change in PendingTransactionSQLDAO

Fix broken import on Swift Package for libzcashlc

Fix libzcashlc url

Fix travis.yml
2022-09-07 14:49:08 -03:00
Kris Nuttycombe a8e6b5b5e4
Merge pull request #491 from zcash/type_safe_address_api
Add type-safe wrappers for address types.
2022-09-07 09:20:18 -06:00
Francisco Gindre 16ec1ebb70 Fix call on `zcashlc_is_valid_sapling_extended_spending_key` with `[CChar](key.utf8CString)` 2022-09-06 15:25:11 -03:00
Francisco Gindre 3f61e182d9 remove unused type `UFVK` 2022-09-06 15:21:20 -03:00
Francisco Gindre 094d660fca Temporarily fix shield funds `initSpend` call with the `accountIndex`
unified address from SDK Synchronizer
2022-09-06 15:12:26 -03:00
Francisco Gindre ed87a2781c [#461] Adopt a Type-Safe Keys and Addresses API
This PR creates data types for Addresses and Keys so that they are
not represented by Strings anymore. This avoids mistakenly use
the wrong keys because they are all alike for the type system.

New Protocols:
=============

StringEncoded -> Protocol that makes a type can be expressed in an
string-encoded fashion either for UI or Interchange purposes.

Undescribable -> A protocol that implements methods that override default
decriptions used by debuggers, loggers and event trackers to avoid types
conforming to it to be leaked to logs.

Deleted Protocols:
==================

UnifiedFullViewingKey --> turned into a struct.
UnifiedAddress --> turned into a struct

new Error Type:
================

````
enum KeyEncodingError: Error {
    case invalidEncoding
}
````

This error is thrown when an Address or Key type (addresses are public
keys in the end) can be decoded from their String representation,
typically upon initialization from a User input.

New Types:
=========

SaplingExtendedSpendingKey -> Type for Sapling Extended Full Viewing Keys
this type will be replaced with Unified Spending Keys soon.

SaplingExtendedFullViewingKey -> Extended Full Viewing Key for Sapling.
Maintains existing funcionality. Will be probably deprecated in favor of
UFVK.

TransparentAccountPrivKey -> Private key for transparent account. Used
only for shielding operations. Note: this will probably be deprecated soon.

UnifiedFullViewingKey -> Replaces the protocol that had the same name.

TransparentAddress -> Replaces a type alias with a struct

SaplingAddress --> Represents a Sapling receiver address. Comonly called zAddress. This address corresponds to the Zcash Sapling shielded pool.
Although this it is fully functional, we encourage developers to
choose `UnifiedAddress` before Sapling or Transparent ones.

UnifiedAddress -> Represents a UA. String-encodable and Equatable. Use of
UAs must be favored instead of individual receivers for different pools.
This type can't be decomposed into their Receiver types yet.

Recipient -> This represents all valid receiver types to be used as
inputs for outgoing transactions.

````
public enum Recipient: Equatable, StringEncoded {
    case transparent(TransparentAddress)
    case sapling(SaplingAddress)
    case unified(UnifiedAddress)
````

The wrapped concrete receiver is a valid receiver type.

Deleted Type Aliases:
=====================

The following aliases were deleted and turned into types
````
public typealias TransparentAddress = String
public typealias SaplingShieldedAddress = String

````

Changes to Derivation Tool
==========================

DerivationTool has been changed to accomodate this new types and
remove Strings whenever possible.

Changes to Synchronizer and CompactBlockProcessor
=================================================
Accordingly these to components have been modified to accept the
new types intead of strings when possible.

Changes to Demo App
===================
The demo App has been patch to compile and work with the new types.
Developers must consider that the use (and abuse) of forced_try and
forced unwrapping is a "license" that maintainers are using for the
sake of brevity. We consider that clients of this SDK do know how to
handle Errors and Optional and it is not the objective of the demo
code to show good practices on those matters.

Closes #461
2022-09-05 15:09:07 -03:00
Francisco Gindre d737ddefa9 Merge branch 'master' into merge_master_to_zip_316 2022-09-01 17:51:46 -03:00
Lukas Korba 7b90e598ad
[#472] CompactBlockBatchScanningOperation to async (#505)
- CompactBlockBatchScanningOperation operation's main reimplemented to be Task based

[472] CompactBlockBatchScanningOperation to async

cleanup

[472] CompactBlockBatchScanningOperation to async (505)

- CompactBlockBatchScanningOperation wrapped to Task
2022-08-30 11:28:00 -03:00
Lukas Korba 87f50a796c
[#473] CompactBlockEnhancementOperation to async/await (#513)
- Wrapped to Task
- Downloader APIs upgraded to async one
2022-08-30 11:07:36 -03:00
Lukas Korba b684a2f486
[#474] FetchUnspentTxOutputsOperation to async/await (#514)
- wrapped to Task
- downloader uses the new async API
2022-08-30 11:00:48 -03:00
Lukas Korba 29f159845d
[#471] CompactBlockValidationOperation to async (#515)
- CompactBlockValidationOperation wrapped to Task
2022-08-30 10:56:39 -03:00
Lukas Korba be24044b51
[#470] CompactBlockStreamDownloadOperation to async (#506)
- using new sync APIs for storage and service
- whole logic wrapped in the Task

Closes #470
2022-08-29 16:53:49 -03:00
Lukas Korba 16d1948b5b
[#465] CompactBlockDownloading to Async/Await (#507)
Closes #465
- CompactBlockDownloading closures removed
- CompactBlockDownloading new async API provided
2022-08-29 16:31:01 -03:00
Francisco Gindre 30bfa6c633
Merge pull request #504 from zcash/release-0.16.8-beta
[#503] Add new checkpoints on top of 0.16.7-beta and release .8
2022-08-26 11:46:51 -07:00