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
- 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
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
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
- await/async APIs provided
- async throws unit tests using new API implemented
[464] CompactBlockStorage To async/await (494)
- removed deprecated closure APIs
- upgraded use of the async APIs
- tests updated
This change removes responsibility for maintaining the state of
the wallet database from `ZcashLightClientKit` in favor of using
the migration system now provided by librustzcash. This will help
to ensure that the structure of the database is kept consistent with
the functions that query and update the database state.
Co-authored-by: Francisco Gindre <francisco.gindre@gmail.com>
This also brings in various associated changes to the FFI methods in
zcash-light-client-kit as a result of moving to the main branch of
zcash/librustzcash.
This commit makes Renames `WalletBirthday` to `Checkpoint` and
makes Checkpoint an internal type. Public ocurrences of this
type is replaced by `BlockHeight` (Int) and then retrieval of the
Checkpoint is deferred to the appropiate place in the code
Add an extension method to `BlockHeight` to get latest checkpoint
height present in the SDK's bundle
PR Suggestions:
Add test for integer overflow on JSON
File renamed from WalletBirthday to Checkpoint
* [#397] Checkpoint format that supports NU5 TreeStates
Closes#397
This commit adds `orchardTree` value to WalletBirthday and renames
the value `tree` to `saplingTree`. It also modifies the checkpoint
JSON files accordingly. It adds `.testnet` and `.mainnet` checkpoints
for orchard activation height.
* rename `sapling-checkpoints` to `checkpoints`
Closes#381
This commit brings a Zatoshi type developed on the Secant project,
helper classes like Clamped and tests.
Zatoshi has been incorporated as a Codable type for SQLite Swift
to allow serialization into the pending database.
FIXES on Demo App
fix comments
* [#382] ZIP-302 compliant memo type
Test Implemented and Passed
Move struct to the SDK
Make even more type safe by Wrapping Strings into TextMemo
PR Suggestions
PR Suggestions
PR suggestions
* PR suggestions to make all cases explicit
Closes#326
Implements loading checkpoints from the bundle the same way the android SDK does.
* Add checkpoint files
* Add checkpoint files as resources to package
* Remove stencil files
* Update wallet birthday methods to use bundled checkpoints
* [clean up] Fix test build failure
* Add Cocoapods support
* Fix for behaviour across SPM and Cocoapods
* Add test for checkpoint retrieval
* Use latest GRPC v1.x
* update checkpoint files to match android sdk
Fix Travis CI builds
fix travis build
Fix Travis CI
fix travis
Fix Travis CI
Delete unneeded test
Change scheme
Fix Project file so that it compile and tests for Travis CI
restore Demo app scheme
fix dumb typo
Fix Tests. Add workflow
fix workflow for github action
blank line