Commit Graph

1782 Commits

Author SHA1 Message Date
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
str4d debd5e6f5c
Merge pull request #314 from daira/txid-hashing
zcash_primitives: hash the transaction as it is read, rather than hashing a re-serialization
2020-12-05 00:19:26 +00:00
Daira Hopwood 62675f4b4f Use the SHA-256d HashReader and HashWriter for transaction hashing.
This hashes the transaction as it is read, rather than hashing a re-serialization.

Co-authored-by: Jack Grigg <str4d@electriccoin.co>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-12-03 21:22:58 +00:00
Daira Hopwood 1f18da239f Add HashReader and HashWriter for SHA-256d.
Co-authored-by: Jack Grigg <str4d@electriccoin.co>
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-12-03 21:22:58 +00:00
Kris Nuttycombe e96578195a Not sure how this happened. 2020-12-03 10:10:37 -07:00
Kris Nuttycombe 4e608216c1 Do not create nested transaction in rewind_to_height
Fixes #321
2020-12-02 14:36:56 -07:00
Kris Nuttycombe d77784eba8 Do not update `is_change` in received_notes with null values.
Fixes #322
2020-12-02 13:16:02 -07:00
Kris Nuttycombe 7ac08631b9 Fix doctest imports. 2020-12-02 09:46:17 -07:00
Kris Nuttycombe cf2dae8af0 Add hrp_sapling_extended_spending_key to Parameters trait. 2020-12-02 09:46:17 -07:00
Kris Nuttycombe 1fd74d0a71 Improve naming for wallet/block database connections. 2020-12-02 09:46:17 -07:00
Kris Nuttycombe ee0e059eb3 Add coin_type to consensus parameters. 2020-12-02 09:46:17 -07:00
Kris Nuttycombe 897a70dd9e Simplify block source & clean up chain validation. 2020-12-02 09:46:17 -07:00
Kris Nuttycombe 8a215d67fe Improve wallet "database" trait names. 2020-12-02 09:46:17 -07:00
Kris Nuttycombe b2cc240454 Do not require wallet database for chain scan. 2020-12-02 09:46:17 -07:00
Kris Nuttycombe e6de7c07f0 Use <module_name>.rs instead of <module_name>/mod.rs 2020-12-02 09:46:17 -07:00
Kris Nuttycombe f742895118 Fix test/doctest errors. 2020-12-02 09:46:17 -07:00
Kris Nuttycombe 2e2f34b033 Use named_params macro for query_and_then_named (less error-prone) 2020-12-02 09:46:17 -07:00
Kris Nuttycombe 25b5fc965f Fix broken empty_database_has_no_balance test 2020-12-02 09:46:17 -07:00
Kris Nuttycombe c60b9d3ece Remove database initialization calls from common API. 2020-12-02 09:46:17 -07:00
Kris Nuttycombe 903ef58ec6 Fix transactionality in rewind_to_height 2020-12-02 09:46:17 -07:00
Kris Nuttycombe 4c2cda48e6 Clean up transactional API.
This API is still somewhat unsafe in that it doesn't inhibit nested
transactions, but it's better than it was.
2020-12-02 09:46:17 -07:00
Kris Nuttycombe cd2729bbd0 Move 'create_spend_to_address' to wallet backend.
This required changing a bit about the relationship between
database errors and wallet errors, and opens up the possibility
of now simplifying the error situation a bit.
2020-12-02 09:46:17 -07:00
Kris Nuttycombe e144015558 Reuse sent note insertion for wallet/transact. 2020-12-02 09:46:17 -07:00
Kris Nuttycombe 68737dd1dd Remove duplicate method. 2020-12-02 09:46:17 -07:00
Kris Nuttycombe 8de05f3429 Move transact.rs to wallet module. 2020-12-02 09:46:17 -07:00
Kris Nuttycombe 8967745c22 Push chain & wallet functionality down to child modules. 2020-12-02 09:46:17 -07:00
Kris Nuttycombe 22ef05239c Split init module into chain and wallet-related parts. 2020-12-02 09:46:17 -07:00
Kris Nuttycombe a181203179 Move related functions into the same modules. 2020-12-02 09:46:17 -07:00
Kris Nuttycombe eab2951c99 Move decrypt_and_store_transaction to zcash_client_backend 2020-12-02 09:46:17 -07:00
Kris Nuttycombe 0165ae7003 Minor renamings. 2020-12-02 09:46:17 -07:00
Kris Nuttycombe 746c4c9a00 Move scan_cached_blocks out of sqlite crate. 2020-12-02 09:46:17 -07:00
Kris Nuttycombe d16c124ffe Abstract over data access in scan_cached_blocks. 2020-12-02 09:46:17 -07:00
Kris Nuttycombe 06c1772692 Move traversal of cached blocks to CacheOps 2020-12-02 09:46:17 -07:00
Kris Nuttycombe 604294dd9f Factor out nullifier retrieval into data api. 2020-12-02 09:46:17 -07:00
Kris Nuttycombe ffd503134d Factor out witness retrieval from scan. 2020-12-02 09:46:17 -07:00