Commit Graph

1616 Commits

Author SHA1 Message Date
str4d b5ee057e03
Merge pull request #328 from nuttycom/note_id_enum
Use an enum to distinguish between sent and received notes in sqlite backend.
2021-02-03 09:17:16 +13:00
Kris Nuttycombe 5cb48fa962 Fix documentation of get_received_note 2021-02-02 13:16:16 -07:00
str4d 820b184f71
Merge pull request #335 from huitseeker/warts
Small cleanups
2021-02-02 07:58:48 +13:00
François Garillot f5b6fa6dfb
Removes a panic in synthesis
The error case - a witness_256 failure - is folded in the SynthesisError case of its enclosing result.

The panic was found with [comby-rust](https://github.com/huitseeker/comby-rust/blob/master/nopanic.toml) (using the nopanic template).
2021-02-01 13:37:56 -05:00
François Garillot 45f3f5a945
Simplify a few pattern matches
A few pattern-matches correspond directly to standard combinators on
`Result`, `Option`. This uses them for concision / clarity.

Refactorings reviewed by the author after suggestion from [comby-rust](https://github.com/huitseeker/comby-rust).
2021-02-01 13:37:54 -05:00
str4d 1a3b5c1750
Merge pull request #332 from ebfull/faster-scanning
Use wNAF multiplication for Sapling key agreement.
2021-01-23 12:25:17 +13:00
Sean Bowe 6315f7dc28
Use wNAF multiplication for Sapling key agreement. 2021-01-22 15:16:06 -07:00
Kris Nuttycombe df09877b11 Use an enum to distinguish between sent and received notes in sqlite backend. 2021-01-20 10:51:27 -07:00
str4d 47348afd50
Merge pull request #307 from nuttycom/data_access_api
Data Access API (Low-level wallet persistence API)
2021-01-20 13:33:58 +13:00
Kris Nuttycombe 7f43b05e21 Update protobuf dependency version. 2021-01-19 13:01:51 -07:00
Kris Nuttycombe 779a5670e0 Improve data access api method documentation. 2021-01-19 12:45:55 -07:00
Kris Nuttycombe f8ce44ff0b Add convenience method for CompactSpend -> Nullifier. 2021-01-19 10:09:36 -07:00
Kris Nuttycombe 8fe6f0fdfd Remove default get_balance method.
Recommended by @str4d
2021-01-19 08:25:10 -07:00
Kris Nuttycombe 8e8ed2bb4f Rename get_verified_balance -> get_balance_at 2021-01-15 12:00:14 -07:00
Kris Nuttycombe c70a9ed81f Apply suggestions from code review
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: str4d <thestr4d@gmail.com>
2021-01-15 11:57:58 -07:00
Kris Nuttycombe f59124ce19 Pass account ID with IVK. 2021-01-15 10:18:43 -07:00
Kris Nuttycombe 120ee25e1d Fix argument to decrypt_and_store_transaction 2021-01-15 10:02:24 -07:00
Kris Nuttycombe 8a7d051138 Rustfmt 2021-01-13 18:06:42 -07:00
Kris Nuttycombe da8b7bdb8f Work around doctest sqlite IO errors. 2021-01-13 16:14:26 -07:00
Kris Nuttycombe a3f9fa788d Update data_api doctests for error handling changes. 2021-01-13 15:43:39 -07:00
Kris Nuttycombe 5a21580f13 Correct the hierarchy of errors. 2021-01-13 15:20:11 -07:00
Kris Nuttycombe aa72e070ce Fix MockWalletDB 2021-01-12 21:51:08 -07:00
Kris Nuttycombe 6c6b05fa9b Trivial rename. 2021-01-12 21:32:46 -07:00
Kris Nuttycombe 1a0301d122
Update zcash_client_backend/src/data_api/chain.rs
Co-authored-by: str4d <thestr4d@gmail.com>
2021-01-12 21:14:40 -07:00
Kris Nuttycombe 37b82e1c3b
Update zcash_client_backend/src/data_api.rs 2021-01-12 21:12:28 -07:00
Kris Nuttycombe ce06db197a Rustfmt. 2021-01-12 21:10:34 -07:00
Kris Nuttycombe db9eb29eba Merge remote-tracking branch 'upstream/master' into data_access_api 2021-01-12 21:09:40 -07:00
Kris Nuttycombe eef2d5944b Use a slice literal instead of a vec in put_received_note 2021-01-12 21:06:57 -07:00
Kris Nuttycombe fcb2f7a433 Use collect instead of collecting a vec manually. 2021-01-12 21:04:42 -07:00
Kris Nuttycombe fd3468b4f5 Remove unnecessary map_err's 2021-01-12 20:53:09 -07:00
Kris Nuttycombe 7acc75249b Fix documentation of human-readable prefixes. 2021-01-12 20:45:28 -07:00
Kris Nuttycombe 011eda364f Add get_spendable_notes method to WalletRead 2021-01-12 20:42:04 -07:00
Kris Nuttycombe 48f226f8b5 Move decoding errors to sqlite crate.
Also move dependency on params out of wallet read/write methods.
The result is cleaner because these parameters are only required
for backend-specific encoding and decoding operations.
2021-01-12 20:07:02 -07:00
Kris Nuttycombe 5927e32059 Document error types. 2021-01-12 14:59:42 -07:00
Kris Nuttycombe ca4567b275 More data api documentation. 2021-01-12 13:55:22 -07:00
Kris Nuttycombe 34bc655f64 Add MockBlockSource and MockWalletDB
These can readily be made into an in-memory wallet implementation.
2021-01-12 12:55:24 -07:00
str4d 1a1576008b
Merge pull request #327 from str4d/fix-diversify-address-example
zcash_client_backend: Fix testnet bug in diversify-address example
2021-01-13 02:05:31 +13:00
Jack Grigg 10f5dddb79 zcash_client_backend: Fix testnet bug in diversify-address example
I misunderstood the meanings of Err(_) vs Ok(None), which indicates that
we need to refactor this API! In the meantime, this enables the example
to work with testnet Sapling viewing keys.
2021-01-12 12:59:04 +00:00
Kris Nuttycombe 7d92150965 Fix test compilation with WalletWrite changes. 2021-01-11 18:13:40 -07:00
str4d 0540d4156b
Merge pull request #325 from str4d/example-diversify-address
zcash_client_backend: Add example to generate diversified addresses
2021-01-10 07:42:26 +13:00
Kris Nuttycombe aad2e174c1 Consistently use nullifier and AccountId newtypes. 2021-01-08 21:49:38 -07:00
Kris Nuttycombe 27d7b6c569 A few doc updates. 2021-01-08 18:08:02 -07:00
Kris Nuttycombe 56adbbb545 Make `WalletWrite` depend upon `WalletRead`. 2021-01-08 12:49:10 -07:00
Jack Grigg 258e3d31ad zcash_client_backend: Add example to generate diversified addresses 2021-01-08 16:08:03 +00:00
str4d 04a2bd4ad8
Merge pull request #309 from nuttycom/test_utils
Make transaction builder more useful for testing.
2020-12-17 14:41:25 +00:00
Kris Nuttycombe 472dac7a22
Revert intra_doc_link_resolution_failure flag change. 2020-12-17 07:36:18 -07:00
Kris Nuttycombe cf0c3ea90f Relax RngCore type constraints.
The intent of this change is to permit tests to use deterministic
random sources, rather than cryptographically strong ones.
2020-12-14 13:44:05 -07:00
str4d c289cf9d4b
Merge pull request #304 from nuttycom/zip_tze-cargo-feature-flag
Use rust feature flagging to allow conditionally enabling TZE-related code.
2020-12-14 15:23:58 +00:00
Kris Nuttycombe c24f663e40 Use methods on sigversion to gate ZIP-243 and TZE signature parts. 2020-12-14 14:54:29 +00:00
Kris Nuttycombe 790071953c Use rust feature flagging to allow conditionally enabling TZE-related code.
This also uses the test-dependencies feature flag for conditional
inclusion of proptest-related modules which may be used by
dependent crates for generation of samples in testing.
2020-12-14 14:54:12 +00:00