Commit Graph

67 Commits

Author SHA1 Message Date
Lukas Korba 179f960bea [#1537] Birthdate estimate based on a given date 2025-04-03 19:10:32 +02:00
Lukas Korba 8858e46dc9 Mocks generated 2025-03-21 11:11:06 +01:00
Jack Grigg 8f9cb314d5 Merge branch 'main' into ffi-0.13.0 2025-02-28 02:48:46 +13:00
Jack Grigg 07b33f11a2 Migrate to second preview of FFI 0.13.0 2025-02-28 02:46:47 +13:00
Lukas Korba 3e788fa6e1 Offline tests fixes 2025-02-17 12:37:47 +01:00
Jack Grigg 57e12e2332 Migrate to first preview of FFI 0.13.0 2025-02-14 15:27:49 +13:00
Lukas Korba da00a69b49 Pczt typealias and clean up
- The comments were provided
- Changelog updated
- Code cleaned up
- Tests fixed
- Error codes for the Pczt
2024-12-13 10:13:01 +01:00
Lukas Korba f499898ff5 Create and submit PCZT 2024-12-12 12:07:25 +01:00
Lukas Korba 30af9c6e82 PCZT API updated
- ufvk removed from the parameters
2024-12-10 20:57:59 +01:00
Lukas Korba 0fba7f2f3a PCZT methods updated
- Refactored to the proper types
2024-12-10 20:24:41 +01:00
Lukas Korba 6bab337568 PCZT methods
- also attempt to fix _uuid in views
2024-12-10 14:39:39 +01:00
Lukas Korba 8c099e3572 seedFingerprint and zip32AccountIndex parameters in importAccount added 2024-12-09 13:29:07 +01:00
Lukas Korba f69aa19fed Public importAccount method
- importAccount(ufvk, purpose, name, keySource) API
2024-12-09 12:12:13 +01:00
Lukas Korba 5179f4e1b0 getAccount for UUID
- rust backend `getAccount` method implemented, it returns Account with associated data
- `listAccount()` has been modified to return an array of Accounts instead of AccountUUIDs
2024-12-06 11:43:20 +01:00
Lukas Korba 05002a8a8f Generated mocks
OfflineTests fixes
2024-12-05 12:15:46 +01:00
Lukas Korba 27af6f134c PR Comments addressed and code cleaned up
- Comments in the code updated and cleaned up
- OfflineTests passes again, those failing has been removed from the bundle and marked to be fixed with a TODO

Fixes of build

- The SDK builds again
2024-12-05 10:31:13 +01:00
Lukas Korba 7a6bd7283e AccountUUID refactor - phase 2
- SDK builds again, UUIDs refactored everywhere in the SDK and demo app
- tests will follow in the next phase
- refactor of documented code in the follow up
2024-12-04 19:11:11 +01:00
Lukas Korba 35ddf87a1b [#1512] Ensure that the SDK does not assume a default account anywhere
- The SDK no longer assumes a default account. All business logic with instances of Zip32AccountIndex(<index>) has been refactored.
2024-12-03 13:01:44 +01:00
Lukas Korba 97137510b2 Zip32AccountIndex UInt32 refactor
- Zip32Account(Int32) has been refactored to Zip32AccountIndex(UIn32)
2024-11-25 11:32:55 +01:00
Lukas Korba a0535a6a82 [#1511] Refactor account representation from Int to a dedicated Account structure
- First iteration of all Int account references to an instance of an Account
2024-11-19 11:11:36 +01:00
Kris Nuttycombe 27aac3d035 Regenerate testing mocks. 2024-10-10 22:23:38 -06:00
Lukas Korba 35c31a4317 [#1475] Adopt transaction data requests
- RustBackend extended for the new 2 rust methods 'transactionDataRequests' and 'setTransactionStatus'
- lightwalletservice extended to add a new method 'getTaddressTxids'
- Enhance action has been refactored to handle transactionDataRequests

[#1475] Adopt transaction data requests

- fixes

[#1475] Adopt transaction data requests

- Error codes for specific rust and service errors defined
- Fix for the txId

[#1475] Adopt transaction data requests

- Checkpoints added
- Code cleanup

[#1475] Adopt transaction data requests

- bugfixes in the ffi

[#1475] Adopt transaction data requests

- FFI with fixes

[#1475] Adopt transaction data requests

- Another FFI update with fixes, this time the final

[#1475] Adopt transaction data requests

- Fix for the not recognized state of the transaction for FetchTransaction(txId:)

[#1475] Adopt transaction data requests

- Code cleaned up and polished

[#1475] Adopt transaction data requests

- Changelog updated

[#1475] Adopt transaction data requests

- DemoApp settings reverted
2024-08-18 19:20:30 +02:00
Lukas Korba 99c46d0979 refresh-rates
- API refactored to Combine's CurrentValueSubject

refresh-rate

- FiatCurrencyResult is now Equatable

refresh-rates

- cleanup

refresh-rates

- The API has been refactored to follow the same principles as for state and events.
- Review comments addressed

refresh-rates

- The API has been extended to send a result of the operation, success or failure

refresh-rates

- bugfix of the try vs try?

refresh-rates

- reverted the error state

Update CHANGELOG.md

- changelog updated
2024-08-01 13:28:37 +02:00
Jack Grigg bce8085690 Add APIs for fetching the ZEC-USD exchange rate over Tor. 2024-07-30 11:02:10 +01:00
Jack Grigg a7f73c39f3 Migrate to first pre-release of FFI 0.9.0
Includes:
- Initialization changes to enable log filter customization. We now
  connect the Rust log level to the Swift log level, and always run
  other Rust initialization steps.
- ZIP 320 support (TEX addresses).
2024-07-30 11:01:41 +01:00
Lukas Korba 528f380484 [#1452] TX Resubmission-the wallet has to periodically resubmit unmined transactions
- functional version is done

[#1452] TX Resubmission-the wallet has to periodically resubmit unmined transactions

- code cleanup

[#1452] TX Resubmission-the wallet has to periodically resubmit unmined transactions

- changelog updated

[#1452] TX Resubmission-the wallet has to periodically resubmit unmined transactions

- unit tests fixed
- mocks generated
2024-07-03 14:31:43 +02:00
Lukas Korba 9de9ea5e78 [#1429] Get memos for rawID
- New API for getting the memos by transaction's rawID

[#1429] Get memos for rawID

- Mock regenerated to have unique names

[#1429] Get memos for rawID

- Offlinetest fixed
2024-05-28 18:42:53 +02:00
Kris Nuttycombe 0cf08c6a59 Update to zcash-light-client-ffi version 0.8.0. 2024-04-17 17:21:37 -06:00
Lukas Korba ffc7fd1be9 [#1412] Review wipe function and in memory values
- The wipe() is now resetting local in memory values of latestBlocksDataProvider. In some case this could cause a reset of CBP's state machine context sooner than it was supposed to, resulting in corrupted sync.
2024-04-16 16:48:20 +02:00
Lukas Korba 3429afa9dc [#1177] Remove globalDBLock
- globalDBLock has been removed and replaced with global DBActor

[#1177] Remove globalDBLock (#1409)

- linter issues
2024-04-09 18:58:20 +02:00
Jack Grigg 006861595d Fetch and store Orchard subtree roots 2024-03-28 10:52:17 -04:00
Jack Grigg 43534d26d9 Integrate Orchard support and latest Rust updates 2024-03-25 23:19:44 -04:00
Lukas Korba e1c600b8ff Public API isSeedRelevantToWallet
- New public API `isSeedRelevantToWallet` has been implemented
- 2 swiftlint error have been resolved
- Mocks generated
2024-03-18 14:45:30 +01:00
Jack Grigg a5a0ef0ac1 Migrate to latest in-progress revision of Rust crates
- New backend method `ZcashRustBackend.isSeedRelevantToWallet`
- `ZcashRustBackend.scanBlocks` now takes a `fromState` argument.

Co-authored-by: Lukas Korba <lukas.korba@seznam.cz>
2024-03-15 16:01:39 +00:00
Jack Grigg 86defc8b4a Remove `AccountRepository`
This removes the last direct access to the `accounts` table; all access
now goes through the Rust FFI.
2024-03-15 15:26:44 +00:00
Francisco Gindre c873e208c4
[#1379] Fulfill Payment from a valid ZIP-321 request
Closes #1379

Adds test for parsing error
Adds test for successful tx creation
Public API changes in CHANGELOG.md
2024-03-08 18:38:50 -03:00
Jack Grigg e9177a28f7 Migrate to in-progress version of FFI backend 0.6.0
Includes:
- Multi-step transaction proposals.
- Changes to support `Synchronizer.proposeShielding` API changes.
2024-03-06 03:06:57 +00:00
Jack Grigg 84ac6252fe Adjust `Synchronizer.proposeShielding` API
- Returns `null` when there are no funds to shield or the shielding
  threshold is not met.
- Throws an exception if there are funds to shield in more than one
  transparent receiver within the account.
- Has an optional parameter for specifying which transparent receiver
  to shield funds from.

This commit only alters the API to support the above; the functional
changes require modifying the FFI and Rust backend, which will happen
in a separate commit.
2024-03-06 02:53:34 +00:00
Jack Grigg 8145248285 Expose APIs for working with transaction proposals
Closes Electric-Coin-Company/zcash-swift-wallet-sdk#1204.
2024-03-06 02:53:33 +00:00
Lukas Korba e51f425c54 [#1369] SynchronizerState refactor
- plural of account balances refactor to singular

[#1369] SynchronizerState refactor

- transaprent balance removed from SynchronizerState
- all balances are now handled with AccountBalance

[#1369] SynchronizerState refactor and balances cleanup

- WalletBalance has been removed from the SDK, replaced with AccountBalance
- public APIs for individual balances (getTransparent, getShielded, getShieldedVerfied) have been removed from the SDK, replaced with getAccountBalance
- tests refactored

[#1369] SynchronizerState refactor and balances cleanup

- dark side tests refactored

[#1369] SynchronizerState refactor and balances cleanup (#1372)

- addressed comments

[#1369] SynchronizerState refactor

- ZcashError for spending key does not belong to the wallet
2024-02-12 17:41:26 +01:00
Lukas Korba c7369057f1 [#1153] Allow runtime switch of lightwalletd servers
- new public API switchTo(endpoint:) implemented

[#1153] Allow runtime switch of lightwalletd servers

- API documented
- code cleaned up

[#1153] Allow runtime switch of lightwalletd servers

- mocks generated

[#1153] Allow runtime switch of lightwalletd servers (#1373)

- sever validation added

[#1153] Allow runtime switch of lightwalletd servers (#1373)

- enhanced validation of the server

[#1153] Allow runtime switch of lightwalletd servers (#1373)

- new ZcashError.synchronizerServerSwitch that represents the state when the endpoint fails validation

[#1153] Allow runtime switch of lightwalletd servers (#1373)

- ZcashError definition update

[#1153] Allow runtime switch of lightwalletd servers (#1373)

- addressed comments

[#1153] Allow runtime switch of lightwalletd servers (#1373)

- changelog revert according to proposal
2024-02-12 17:13:08 +01:00
Lukas Korba 9fab46a2d1 [#1363] Expose PoolBalance Zatoshi values
- new public API with returning AccountBalance

[#1363] Expose PoolBalance Zatoshi values

- accountBalances exposed into the SynchronizationState

[#1363] Expose PoolBalance Zatoshi values

- public vs. internal

[1363] Account balances in the SynchronizerState

- changelog update
- scanAction reports the initial after-scan value immediately instead of after X scans
- SynchronizerState has been refactored, we no longer call 2 rust methods to get shielded verified + total balances
 - tests refactored to reflect this change
- mocks regenerated
- Sourcery version bumped

[#1363] Account balances in the SynchronizerState

- changelog typo fixed

[#1363] Account balances in the SynchronizerState

- internal vs. public
2024-01-31 17:05:13 -08:00
Jack Grigg ded20fe7b0 Migrate to in-progress version of FFI backend 0.5.0
Includes:
- Exposed `WalletSummary`.
- Exposed transaction proposals.
- `ScanSummary` returned from `ZcashRustBackend.scanBlocks`.

Closes Electric-Coin-Company/zcash-swift-wallet-sdk#1259.
Closes Electric-Coin-Company/zcash-swift-wallet-sdk#1299.
2024-01-29 09:47:14 -08:00
Lukas Korba 1dde31e41a [#1336] Tweaks for sdk metrics
- the logs are split so it's not a huge string
- the log method is async
- added a new log with balances

[#1336] Tweaks for sdk metrics

- wait a bit so the logs are sorted in time

[#1336] Tweaks for sdk metrics

- wait a bit so the logs are sorted in time

[#1336] Tweaks for sdk metrics

- wait a bit so the logs are sorted in time

[#1336] Tweaks for sdk metrics

- cleanup

[#1336] Tweaks for sdk metrics

- changelog update

[#1336] Tweaks for sdk metrics

- checkpoints updated

[#1336] Tweaks for sdk metrics

- changelog typos fixed

[#1336] Tweaks for sdk metrics

- mocks generated
2023-12-15 09:01:04 +01:00
Lukas Korba 3e263f0c35 [#1325] Log metrics
- the logger has been extended to log the level as well
- there is only partial match of levels between SDK logger levels, OSLogEntryLogLevel and OSLogType so only debug, info, error are fully matched
- this is a base for the exporter on client's side

[#1325] Log metrics

- typos fixed

[#1325] Log metrics

- scan metric logs added

[#1325] Log metrics

- Scan & Enhance logs

[#1325] Log metrics

- checkpoints updated
- every CBP action is measured separately and collects the data, when the sync is done it dumps overview of the run to the logger
- next run clears out the previous data and starts to collect fresh reports for the run

[#1325] Log metrics (#1327)

- changelog update

[#1325] Log metrics (#1327)

- SDKMetrics updated to be mockable
- unit test updated

[#1325] Log metrics (#1327)

- performance tests cleaned out

[#1325] Log metrics (#1327)

- Network tests buildable again
2023-12-12 08:59:52 +01:00
Kris Nuttycombe 2c526dbcd6 Update `zcash-light-client-ffi` to adopt fix for missing transparent history.
Fixes #1271

Co-Authored-By: Jack Grigg <jack@electriccoin.co>
Co-Authored-By: Lukas Korba <lukas.korba@seznam.cz>
2023-09-19 08:26:03 -06:00
Lukas Korba 6b8d95906a [#1273] SynchronizerState not always up to date
- latestBlockHeight (chain tip) reported in the SynchronizerState to the clients is now updated every 10mins at most, typically with every sync run (10-30s)
- fully and max scanned heights update fixed
- new mocks provided and tests fixed
2023-09-18 11:01:58 +02:00
Lukas Korba 4e2af5da68 Addressed comments batch 2
- more comments resolved
- totalProgressRange removed from the SDK
- ScanRange now takes into account the given value and properly initializes, + added tests
- tests fixed
2023-09-13 17:33:37 +02:00
Lukas Korba 4b45c15a96 Comments addressed
- all comments from the review (round 1) resolved
2023-09-13 09:24:26 +02:00
Lukas Korba dc5cbd8dec [#1236] Use of recoverUntil
- SDKSynchronizer's public API prepareWith() now requires a parameter WalletInitMode
- tests fixed
- changelog updated
2023-09-08 15:44:48 +02:00