Commit Graph

322 Commits

Author SHA1 Message Date
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
str4d 5a67bdae79
Merge pull request #8 from zcash/backend-updates
Backend updates
2019-02-11 09:44:46 -05: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
str4d bc88f5cd2a
Merge pull request #7 from zcash/refactor-sql
Refactor SQL API
2019-02-07 08:06:00 -05: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
str4d c491dc67ad
Merge pull request #6 from zcash/bugfix/jni-signature
bugfix: update JNI method signature to match implementation.
2019-02-05 11:33:59 -05:00
Kevin Gorham 66fff55967 bugfix: update JNI method signature to match implementation.
We removed the need to pass the seed around because that is highly sensitive data. Instead, we work with less sensitive sending keys.
2019-02-05 11:24:40 -05:00
str4d e51fc80920
Merge pull request #5 from zcash/sql-api
SQL API
2019-02-01 17:15:15 -05:00
Jack Grigg a290c9165a
Update package details for Rust crate 2019-02-01 21:57:15 +00:00
Jack Grigg cc53f14f96
cargo update 2019-02-01 21:57:14 +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 e3b85f0e97
build script: Exit if ANDROID_HOME environment variable is not set 2019-02-01 21:57:09 +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
str4d 560638971c
Merge pull request #4 from zcash/scan-blocks
Scan CompactBlocks from an SQLite cache
2018-12-01 01:54:42 +00:00
Kevin Gorham aa0c83a55f
version updates 2018-12-01 01:48:06 +00:00
Kevin Gorham afc9a57d5d
checkpoint. DB works
Updated tests and found the root problem was with the SQL export,
meaning everything is actually working as expected.
2018-12-01 01:48:05 +00:00
Kevin Gorham c9f11c6d2b
allow test to pass 2018-12-01 01:48:04 +00:00
Kevin Gorham b499edd438
test scan blocks 2018-12-01 01:48:03 +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
Kevin Gorham 5df6e95e4f
saving and retrieving data is working and db files are generated 2018-12-01 01:48:01 +00:00
Kevin Gorham 72b594b0d0
added JNI test
I am a little excited about this because it will be a great way to test
Rust functionality quickly and iterate quickly because we will not have
to update and run the full app.
2018-12-01 01:48:00 +00:00
Kevin Gorham 241c646f14
checkpoint. data access object exists 2018-12-01 01:47:59 +00:00
Kevin Gorham 58f5a24a90
checkpoint. database exists 2018-12-01 01:47:58 +00:00
Kevin Gorham 81667f17cc
start with a test and maybe it will actually get used, Eventually. 2018-12-01 01:47:57 +00:00
Kevin Gorham f7263f69c0
manual version bump, still. 2018-12-01 01:47:56 +00:00