Commit Graph

46 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
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
Jack Grigg 870283c8ea
JniConverter.getVerifiedBalance() 2019-02-19 01:45:38 +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 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 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 5dea1dbc04
Test that initialisation APIs are one-shot 2019-02-08 21:06:22 +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
Jack Grigg c51a90f4de
Fix clippy lints 2019-02-07 13:02:50 +00:00
Jack Grigg acd8c395f3
Tidy up imports 2019-02-07 12:58:33 +00:00
Jack Grigg a9674a148b
Remove cfg(target_os="android") restriction
The crate lives inside the Android SDK, and will only ever target
Android devices, so it's fine to simplify here.
2019-02-07 12:56:04 +00:00
Jack Grigg e99ed5bdeb
Extract SQL API into a separate module 2019-02-07 12:50:40 +00:00
Jack Grigg 62b4d43341
Remove seed argument from JniConverter.getAddress(), add account arg 2019-02-01 21:57:13 +00:00
Jack Grigg b608b026ed
Remove seed argument from JniConverter.scanBlocks()
The API now scans cached CompactBlocks using the ExtendedFullViewingKeys
for the internally-tracked accounts.
2019-02-01 21:57:12 +00:00
Jack Grigg d9232c885d
JniConverter.initAccountsTable() 2019-02-01 21:57:11 +00:00
Jack Grigg c26249373d
JniConverter.initBlocksTable() 2019-02-01 21:57:10 +00:00
Jack Grigg 41bb9a1a4b
JniConverter.initDataDb() 2019-02-01 21:57:08 +00:00
Jack Grigg aa391063d1
JniConverter.getBalance() 2019-02-01 21:57:07 +00:00
Jack Grigg d98191d110
JniConverter.sendToAddress() 2019-02-01 21:57:06 +00:00
Jack Grigg 3966798f53
API for creating transactions 2019-02-01 21:57:05 +00:00
Jack Grigg ab2b5903a0
Improvements to JniConverter.scanBlocks()
- Store Sapling tree with blocks
- Store witnesses with full notes
- Track note spends
- Track change notes
- Store index within block for each transaction
  - This will make it easier to request entire blocks of transactions at
    some point, and then filter out only the transactions we care about.
- Store block times while scanning blocks
- Return bool with error state from JniConverter.scanBlocks()
- Support cached blocks that are height-ascending but not sequential
  - Blocks that do not contain Sapling data may be skipped.
- Return error from scan_cached_blocks() if heights are not ascending
2019-02-01 17:41:09 +00:00
Jack Grigg 3188cf8942
Remove now-unused ValueReceived protobuf 2019-01-31 16:09:37 +00:00
Jack Grigg f622a3bcd8
Persist received notes in an SQLite database 2019-01-31 16:09:25 +00:00
Kevin Gorham addcf60fc4
add error logging in Rust
This allows errors to bubble up to the android log file, rather than
having to sift through a tombstone file on the device.
2018-12-01 01:48:02 +00:00
Jack Grigg 83e00e1611
JniConverter.scanBlocks() 2018-12-01 01:47:41 +00:00
Jack Grigg 7bc3f2eede
Generate Rust protobuf representing received value 2018-12-01 01:46:35 +00:00
Jack Grigg fc6c3c6b2b
Split address_from_seed to expose ExtendedFullViewingKey 2018-12-01 01:46:34 +00:00
Jack Grigg 6ab9c6610c
JniConverter.getAddress(seed) 2018-12-01 01:43:05 +00:00
Jack Grigg 193a1f3b22
cargo fmt 2018-11-21 13:51:37 +00:00
Kevin Gorham 19212b14c4 ignore unused variable 2018-11-21 02:04:06 -05:00
Kevin Gorham 32af4b9559 initial commit of sample project code
The next step is to clean this up and integrate it with the latest version of the android app
2018-11-20 12:59:08 -05:00