Commit Graph

73 Commits

Author SHA1 Message Date
Kevin Gorham 7e9127538f
Update memo to accept bytes instead of a string. 2019-11-17 23:49:14 -05:00
Kevin Gorham 1f18042d52
Implement versioning and other cleanup.
- Correct typo and compiler warning in Rust.
'trait objects without an explicity dyn' are deprecated and this is a warning as of Rust 1.37
- update dependencies
- update documentation

docs
2019-09-12 01:31:23 -04:00
Jack Grigg f4843bc25d
More descriptive value errors in sendToAddress 2019-08-29 18:57:05 +01:00
Jack Grigg 221c882589
Migrate to note-spending-v6 2019-08-29 18:04:53 +01:00
Jack Grigg 09c51b7654
Update RecipientAddress to fix transparent address support 2019-07-10 14:55:38 -04:00
Jack Grigg 1acf472d33
RustBackend.isValid[Shielded|Transparent]Address() 2019-07-10 14:54:39 -04:00
Jack Grigg 54dbf8e0ff
Add transparent address send support to backend 2019-05-24 17:10:20 +01:00
Kevin Gorham c3f57d5e2f
Rename JniConverter to RustBackend
Turns out JNI classes are hard to mock due to the way sytem libraries
are loaded. So it became easier to put the JniConverter class behind an
interface. Once that refactor was necessary, it was a good time to
update the name of this class because it retained its original PoC name
for far too long.
2019-05-24 16:33:43 +01:00
Jack Grigg 4948617d6d
Add JNI methods for handling chain validity and reorgs 2019-05-14 17:30:09 +01:00
Jack Grigg 0591784ce4
Add mainnet support to Rust backend via a feature flag 2019-05-14 17:10:03 +01:00
Jack Grigg e69f4b6003
Migrate to refactored librustzcash branch 2019-05-14 17:10:03 +01:00
Kevin Gorham e7108ca818 Cleanup
This commit will get iteratively polished until the PR is ready
- Addresses PR feedback https://github.com/zcash/zcash-android-wallet-sdk/pull/16#discussion_r264948336
2019-03-27 01:37:46 -04:00
Kevin Gorham 1501f1a7d2 Add data access layer for dataDb
Update the scanBlocks request and integrate with the data that it generates inside dataDb
2019-03-27 01:37:46 -04:00
Jack Grigg 1474fae4b8
Move SQL backend into librustzcash
Also some tweaks due to error-handling changes in librustzcash.
2019-03-13 06:56:28 +00:00
Kevin Gorham 245841807c add hex as required dependency, then use it inside init_blocks_table 2019-02-23 20:16:45 -05:00
Kevin Gorham 2c4a48b772 modify update_sapling_tree utility to output JSON 2019-02-22 10:04:32 -05:00
Kevin Gorham 148563b7e6 modify scan operation to start from sapling activation.
Rather than starting from zero because we do not need non-sapling blocks, prior to sapling's activation.
2019-02-22 10:04:32 -05:00
Jack Grigg 870283c8ea
JniConverter.getVerifiedBalance() 2019-02-19 01:45:38 +00:00
Jack Grigg 2a091a1da1
crate::sql::get_verified_balance() 2019-02-19 01:39:36 +00:00
Jack Grigg 4c901fc21f
Exclude spendable notes from selection that aren't verified 2019-02-19 01:25:25 +00:00
Jack Grigg 2695e8f6fd
Mark notes as unspent when the transaction they are spent in expires 2019-02-19 00:59:09 +00:00
Jack Grigg 273881c3b6
Re-introduce requirement that scanned blocks are height-sequential
This prevents the data DB from getting into a state where the Sapling
commitment tree is invalid, which was occurring too easily in testing.
2019-02-18 12:47:16 +00:00
Jack Grigg d145091139
Debug logging in note selection 2019-02-18 12:31:57 +00:00
Jack Grigg 1cd1a4d2f1
Lock notes after transaction creation to prevent serial double-spends
Does not prevent parallel double-spends.
2019-02-18 12:27:14 +00:00
Jack Grigg 208a9497dd
Ensure we always select anchors from blocks that we have 2019-02-18 11:55:34 +00:00
Jack Grigg b95f0b1fc9
Fix witness-updating bug, and enforce witness validity 2019-02-14 19:47:18 +00:00
Jack Grigg 966b6a9df5
Include fee in target value 2019-02-13 10:16:56 +00:00
Jack Grigg e3ecc6f7dc
Fix underflow in target height when selecting anchor
This won't occur in practice because Sapling activated at a height well
above ANCHOR_OFFSET, but good to fix anyway.
2019-02-13 10:10:23 +00:00
Jack Grigg 6842c293fe
Ensure we have sufficient balance before using transaction::Builder
The Builder does return an error if insufficient spend value is
provided, but we can give a more meaningful error here.
2019-02-12 20:55:43 +00:00
Jack Grigg 9b29276dba
Return a more useful error if send_to_address() is called with no blocks 2019-02-12 20:49:35 +00:00
Jack Grigg 8eeddb2de0
Test that send_to_address() fails with incorrect ExtendedSpendingKeys 2019-02-12 19:46:16 +00:00
Jack Grigg 933fb07f42
Wrap all exceptions and panics to relay them over JNI 2019-02-12 02:56:17 +00:00
Jack Grigg 25e79f042b
Use failure::Error in utils::exception instead of jni::errors::Error 2019-02-11 16:52:00 +00:00
Jack Grigg 42b2076dc1
Add exception utilities to the crate 2019-02-11 16:35:44 +00:00
Jack Grigg 37c0efad77
Utilities for conveying Rust exceptions and panics to Java
Source: affa85c026/exonum-java-binding/core/rust/src/utils/exception.rs
License: Apache-2.0
2019-02-11 16:33:11 +00:00
Jack Grigg 6d86b2cf16
Extract rust_vec_to_java() utility function 2019-02-11 16:20:11 +00:00
Jack Grigg 5dfadd4393
Extract java_string_to_rust() utility function 2019-02-11 15:44:49 +00:00
Jack Grigg 1163c557a8
Use spending_key helper instead of manually constructing account path 2019-02-11 15:36:34 +00:00
Jack Grigg 886017a4f5
Migrate to Rust 2018 edition
Requires a minimum of Rust 1.31.
2019-02-11 15:11:09 +00:00
Jack Grigg c4231fb404
Fix bug in collect() return type 2019-02-11 15:03:27 +00:00
Jack Grigg eca0bbc697
Explicitly panic instead of unwrapping when an invariant is broken 2019-02-11 14:28:19 +00:00
Jack Grigg e3ccb73a99
Remove unnecessary unwraps 2019-02-11 14:28:18 +00:00
Jack Grigg d1c3c55b0d
Test that scan_cached_blocks finds change notes 2019-02-11 14:28:17 +00:00
Jack Grigg 70f9ab54c6
Simple binary to calculate the latest Sapling commitment tree
The gRPC Rust bindings are committed instead of requiring protoc to build.
2019-02-11 14:27:43 +00:00
Jack Grigg b78a611f7b
JNI APIs to fetch memo fields as UTF8 2019-02-08 21:06:25 +00:00
Jack Grigg 6ae75baf35
Test that scan_cached_blocks finds received notes 2019-02-08 21:06:24 +00:00
Jack Grigg e8eda3db33
Test that init_accounts_table stores the correct address 2019-02-08 21:06:23 +00:00
Jack Grigg 5dea1dbc04
Test that initialisation APIs are one-shot 2019-02-08 21:06:22 +00:00
Jack Grigg 8d9124fab5
Pass paths into the SQL API using AsRef<Path> instead of &str
This enables both &str and &Path to be used, depending on how the API is
being called.
2019-02-08 21:06:21 +00:00
Jack Grigg 45adb0af4a
Store creation time and expiry height in transactions table
- Creation time can be used in the UI before a transaction gets mined.
- Expiry height enables the UI to indicate expired transactions.
2019-02-07 14:39:50 +00:00