Commit Graph

37 Commits

Author SHA1 Message Date
Francisco Gindre bb015008cf 0.17.0-alpha.4 2022-11-04 15:28:13 -03:00
Michal Fousek d3291a6664 Fix Package.resolved file for Sample SDK app 2022-11-03 17:12:09 +01:00
Francisco Gindre dbd4b8934c Merge branch 'master' into merge-master 2022-10-31 09:34:38 -03:00
Francisco Gindre 245f2324b5 [#597] SDK does not build with SQLite 0.14 2022-10-28 14:20:52 -03: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
Francisco Gindre 1d97ad920b [#581] getTransparentBalanceForAccount error not handled 2022-10-26 20:26:37 -03:00
Michal Fousek d4dc571f27 Fix compilation 2022-10-04 17:32:32 +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 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 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
Kris Nuttycombe 905ee401d1 Use zcash_client_sqlite to manage migrations for the wallet db.
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>
2022-08-24 09:38:42 -06:00
Francisco Gindre b9ae012e09
[#381] Move Zatoshi and Amount Types to the SDK (#396)
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
2022-06-22 16:45:37 -03:00
Francisco Gindre 605a3e9881 Update changelog.md and podspec version
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
2022-03-03 19:07:03 -03:00
Daniel Haight 86d1257ab5 Remove dependecy on rust sources 2022-02-28 17:03:20 +00:00
Adam Stener 054ab3936a Remove build setting warning 2021-09-27 07:15:34 -05:00
Francisco Gindre 6e64b32810 remove code generation for zcashsdk constants 2021-07-28 16:37:05 -03:00
Francisco Gindre 09ac2c5877 remove WalletBirthday as generated file and add it as constants in the sdk 2021-07-28 15:46:45 -03:00
Francisco Gindre 7cb4750f29 Get UTXOs screen 2021-03-03 18:09:13 -03:00
Francisco Gindre 60dc7ae6c5 Horrible looking derivation screen 2021-03-03 18:09:13 -03:00
Francisco Gindre af8ee1ef12 Add SaplingParameterDownloader 2020-10-08 17:29:38 -03:00
Francisco Gindre bfc717dc07 Fix build problems 2020-10-08 17:29:27 -03:00
Francisco Gindre 1a4a3a7f6d fix podfile on demo app 2020-10-08 15:45:45 -03:00
Francisco Gindre 890a4eb5a9 fix script. update sample app. update pod version 2020-10-01 16:17:13 -03:00
Francisco Gindre 86b20c4236
Xcode 12 cocoapods error fix (#193)
* add arm64 damn apple

* fix: exclude arm from simulator builds

* change built platform depending on target architecture

* exclude arm64 for simulator builds
2020-09-24 12:00:15 -03:00
Kevin Gorham a45f056242
Enable heartwood. (#138)
* Enable heartwood.

We might want to make further adjustments to conditionally enable this only on testnet.

* add consensus branch Id code

* better address validation

Co-authored-by: Francisco Gindre <francisco.gindre@gmail.com>
2020-06-09 21:23:46 -03:00
Francisco Gindre 462ce0f5d7
Decrypt transactions. Full wallet restore (#110)
* Add enhancement [WIP]

* Added enhance and decrypt transaction step

* modify logging

* Enhancement tests scaffolding
2020-04-23 14:11:03 -03:00
Francisco Gindre 72c3cb59ef
Integrate logging capabilities (#93)
* Integrate logging capabilities

* Relocate file
2020-03-09 17:25:27 -03:00
Francisco Gindre 750108252f
Feature/single pod mainnet (#60)
* Mainnet changes [WIP]

* Separate pods approach [WIP]

* Create a single podfile and scripts to build mainnet or testnet [WIP]

* Added test spec to pod with TESTNET Script [WIP]

* pod install + sample app testnet build worked

* add prefix to database names

* Fix constants in tests

* fix plist

* fix stencils

* Force environment variable

* Get config from environment variable

* Save project settings and create new DemoAppConfig settings

* Fix Template. change demoApp config port

* Add extra warning when building to see environment in logs

* New Readme! + enhanced messaging on build_librustzcash_xcode.sh

* Fix Stencil if statement

* add our domain names to the demo app endpoints

* clean up Podfile

* fix: mainnet not building properly

* improve cleanup

* fixed weird seed change

* remove duplicated file reference

* Improve error handling on LightWalletService

* Improve error handling on Latest block height. fix get address pasteboard gesture

* fix mainnet walletbirthday stencil

* fix: demo app not syncing on mainnet

* Verified Balances and Send Max Funds fixed

* Add paths to preserve when installing pod

* add Stencil to preserved paths

* Fix $ZCASH_SDK_GENERATED_SOURCES_FOLDER not writable error

* Fixes from PR Comments

* Fixed TransactionId string generation

* Fixed Test build scripts + PR comments

* fix indentation

* Changes to script_commons

* fixes per PR

* remove else from mismatch function

* Add comment to poorly named function
2020-01-14 19:25:14 -03:00
Francisco Gindre 4f6e15bd9a
Add SampleStorage (#58) 2019-12-20 17:52:53 -03:00
Francisco Gindre a139ffbdfe
Transaction Listing + send funds + synchronizer implementation (#47)
* Create UIKit subfolder

* add offset to transaction repository

* mock repository and tests [WIP]

* Paged transaction DAO

* Paged transaction repository by kind

* update protobuf files

* move SDKSynchronizer to UIKit folder

* created some health check test on transactions

* Build release version of librustzcash

* Add Send on main thread button for troubleshooting purposes

* fix submit method by using RawTransaction factory method

* fix transactions table mapping

* fix transactions table mapping

* fix get balance sample

* FIX: cosensus branch ID for Blossom

* SDKSynchronizer integration for Send Funds

* fix rawTransactionId mistaken by raw field

* fix testEncodeSpend

* Transaction submission failed tests

* unpaged transaction listings

* renamed method, fixed typo

* stupid xcode misplaced folders again

* add PaginatedTableView Dependency to Example and hook it up [WIP]

* fix  unit test target not being shared

* removed performance test

* fix get address, paged transactions nulled, added type of transaction

* added kind of transaction to transaction repo builder, fixed transaction builder

* Transaction Detail screen

* add transaction details to paginated transaction
2019-12-16 19:25:45 -03:00
Francisco Gindre 561ea7b620
Feature/sending ui (#39)
* [WIp} Send View Controller + Synchronizer methods to send and cancel tx +  builders

* Send Funds scaffold

* project changes

* initializer and synchronizer enhancements. removed dummy file

* fix bitcode issue, add Progress HUD

* Pending Transactions, send transactions

* create_to_address tests + sending UI
2019-12-06 09:38:47 -03:00
Francisco Gindre c772934d3d
Transaction data access improvements + Create Spend + Get Balance Screen (#33)
* Transaction encoder implementation tests WIP

* Create Spend and Create Transaction + Test [WIP]

* New! Get Balance Screen

* Send to address
2019-11-26 19:32:20 -03:00
Francisco Gindre 2c23875607
Synchronizer + Handle reorgs (#27)
* Compact Block Synchronizer first impl

* Synchronizer

* Basic Reorg logic. Moved tests to cocoapods

* Remote Carthage Support

* remove Carthage support from readme

* RustBackendMock

* RustBackend Stub for testing reorgs. Tests (fail). Download retry logic

* Simple reorgTest passed
2019-11-14 11:38:54 -03:00
Francisco Gindre d757a1337f
Compact Block Processor Sync (#11)
* Compact Block Processor demo + tests

* fix latest block sync glitch

* fix Compact Block Processor tests

* fix lint
2019-11-04 20:18:07 -03:00
Francisco Gindre bce2bd0d7e
Get Address Example, API improvements, test fixes (#10) 2019-11-01 16:59:16 -03:00
Francisco Gindre b1887cc1b6
GetBlockHeight demo app (#9) 2019-10-31 19:43:09 -03:00
Francisco Gindre 3806526aaf Cocoapods Support + Example Project 2019-09-09 12:30:38 -03:00