Commit Graph

982 Commits

Author SHA1 Message Date
Jack Grigg 9efa74fd4c Update test vectors to use UFVKs and UAs as appropriate
UFVKs and UAs contain Sapling and transparent receivers, corresponding
to how keys are currently derived from mnemonic phrases in the wallet.
2022-09-08 13:26:22 +00:00
Kris Nuttycombe 22cf8220b7
Merge pull request #621 from zcash/improve_setup_instructions
Clarify instructions for Android NDK installation.
2022-09-06 17:12:55 -06:00
Honza Rychnovsky 35e38ddb19
[#666] Download sapling files atomically (#707)
- Enhanced implementation of SaplingParamTool component. It got sapling files move from legacy folder to the preferred one functionality. It downloads the sapling files atomically now (through the temporary file names). It contains all related constants now. It works with SaplingParamToolProperties, which allows us to easily test the SaplingParamTool functionalities. It also now checks file hashes. Removed unnecessary clear function from the component. Changed valid function.
- Moved related constants from ZcashSdk class to SaplingParamTool class
- Changed Initializer, WalletTransactionEncoder and RustBackend classes to work with File instead of path String
- Minor changes in comments in other classes
- Added getSha1Hash() extension function to the FileExt class

* Related tests

- Two new test fixtures to simplify our tests
- Test for getSha1Hash() extension function
- Minor changes in existing tests
- Created new SaplingParamToolBasicTest, which covers non-integration functionality of SaplingParamTool
- Moved integration tests of the SaplingParamTool to the new SaplingParamToolIntegrationTest and added some new

* Related manual tests

- Created Download sapling files manual test
- Created Move sapling files to no_backup manual test
- Update existing Move database files to no_bakcup manual test


Co-authored-by: Carter Jernigan <git@carterjernigan.com>
2022-09-06 06:44:33 -04:00
dependabot[bot] b7df183634
Bump google-github-actions/auth from 0.8.0 to 0.8.1 (#709)
Bumps [google-github-actions/auth](https://github.com/google-github-actions/auth) from 0.8.0 to 0.8.1.
- [Release notes](https://github.com/google-github-actions/auth/releases)
- [Changelog](https://github.com/google-github-actions/auth/blob/main/CHANGELOG.md)
- [Commits](ceee102ec2...dac4e13deb)

---
updated-dependencies:
- dependency-name: google-github-actions/auth
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-01 06:36:54 -04:00
dependabot[bot] cf5b762fd1
Bump actions/cache from 3.0.7 to 3.0.8 in /.github/actions/setup (#690)
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.7 to 3.0.8.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](a7c34adf76...fd5de65bc8)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-01 06:36:25 -04:00
Carter Jernigan 251bb4dbfc
[#697] Fix running robo test (#698) 2022-08-31 11:17:47 -04:00
Bruno Wieczorek ec6b714f92
[#288] Replace Deprecated Usage of `ConflatedBroadcastChannel`
Co-authored-by: Carter Jernigan <git@carterjernigan.com>
2022-08-27 08:25:54 -04:00
Honza Rychnovsky 12c23dd054
[#664] Check sapling files size
* [#664] Transfer maximum bytes from remote file
* Tests for limiting sapling files max size
* Address comments from review
* Optimization of sapling files download
* Add units to data class
Co-authored-by: Carter Jernigan <git@carterjernigan.com>
2022-08-26 15:31:56 +02:00
Honza Rychnovsky 1fae5beab6
[#509] Remove OkHttp and Okio dependencies
* [#509] Remove OkHttp and Okio dependencies
- Okio -> Java NIO anf OkHttp -> HttpURLConnection in SaplingParamTool class
- Both replaced also in the test packages
- Removed dependencies to the replaced components
- Again switched a few assertions from JUnit to kotlin.test
- Created readLinesInFlow() function which is now reused in few places and runs without OkHttp
- Added subsequent TODOs to code base
- Wrapped to withContext to move it to an IO thread.
- Added use function on the stream and close() at the end of the channels use.
Co-authored-by: Carter Jernigan <git@carterjernigan.com>
2022-08-25 14:36:57 +02:00
str4d e62db0d2d8
Merge pull request #693 from zcash/merge-detekt-warning-fixes
Merge Detekt warning fixes from `main`
2022-08-24 14:18:25 +01:00
Honza Rychnovsky d15f58142a
[#691] Increase Deploy action Upload artifacts timeout 2022-08-24 08:30:18 +02:00
Jack Grigg 0b80bff23d Merge branch 'main' into merge-detekt-warning-fixes 2022-08-23 21:28:01 +01:00
str4d ab883750c2
Merge pull request #689 from zcash/merge-1.9.0-beta03
Merge v1.9.0-beta03
2022-08-23 20:52:53 +01:00
Honza Rychnovsky 345af7aacc
[#366] Fix Detekt warnings
* Disable baseline file. Too many functions.
* CurrencyFormatter.kt suppress too many functions
* PersistentTransactionManager.kt suppress too many functions
* OutboundTransactionManager suppress too many functions
* Suppress long parameter list
* Too many functions
* Add log to avoid empty block warning
* Fix several magic number warnings
* Solve max line length warnings
* Solve max line length warnings
* Suppress too long method warnings
* Suppress too complex method warnings
* Suppress large class warning
* Fixed empty catch block
* Changed directory path to the file
* Fix too generic and swallowed exception
* Fix print stack trace warning
* Suppressed single top level file name declaration
* Change parameters name
* Suppress Spread operator warning
* Remove unused private code
* Add Locale to suppress default locale used warning
* Solve several forbidden TODOs warnings
* Fixed another max line length warning
* Simplify return statement
* Suppress class to object change
* Make DemoConstants variables const
* Use error() instead of throwing an IllegalStateException
* Solve too complex condition
* Suppress intentionally generic and swallowed exception
* Suppress TooGenericExceptionCaught
* Solve or suppress several TooGenericExceptionCaught
* Fix swallowed exception
* Suppress warning TooGenericExceptionCaught of PersistentTransactionManager
* Suppress warning TooGenericExceptionCaught of WalletTransactionEncoder
* Suppress TooGenericExceptionCaught of SdkSynchronizer
* Suppress TooGenericExceptionCaught in SaplingParamTool
* Suppress TooGenericExceptionCaught in CompactBlockDownloader
* Suppress TooGenericExceptionCaught in CheckpointTool
* Fix TooGenericExceptionCaught in WalletService
* Suppress TooGenericExceptionCaught in DerivedDataDb
* Suppress TooGenericExceptionCaught in CompactBlockProcessor
* Apply ktlint format after all the previous changes
* Remove detekt baseline file
* Set Android studio right margin
* Address comments from review
* Suppress failing tests on CI
2022-08-23 15:49:00 +02:00
Jack Grigg 5db232cba7 Fix mismatched variable names in overridden methods 2022-08-23 00:16:14 +01:00
Jack Grigg 0a2b2d32f6 Merge branch 'main' into merge-1.9.0-beta03 2022-08-22 21:36:51 +01:00
Jack Grigg 609cc861e9 Merge tag 'v1.9.0-beta03' into merge-1.9.0-beta03 2022-08-22 21:23:43 +01:00
Carter Jernigan 8c8fd57b21 Fix pre-existing typos in error messages
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-08-22 20:57:41 +01:00
Carter Jernigan 67f0b156ec [#525] Migrations documentation
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
2022-08-22 20:57:41 +01:00
Jack Grigg 85e9adce14 [#526] Migrate to `zcash_primitives 0.6` 2022-08-22 20:57:41 +01:00
Jack Grigg 46af668449 [#525] Add `AddressType.Unified` and `Synchronizer.isValidUnifiedAddr` 2022-08-22 20:57:41 +01:00
Jack Grigg cfdd3640a9 [#525] Derive transparent account privkey instead of transparent secret key
We need the transparent account privkey in order to be able to derive
the secret key for any leaf transparent address under the ZIP 316
diversified address tree.
2022-08-22 20:57:41 +01:00
Carter Jernigan f7c9bad367 [#525] Replace UnifiedViewingKey with UnifiedFullViewingKey
UnifiedViewingKey had a bug that made it incompatible with ZIP 316.

For compatibility with the current `zcash/librustzcash` revision we use
a temporary fake UFVK encoding that stores sufficient information to use
the current APIs, and a superset of the actual ZIP 316 FVK information.
2022-08-22 20:57:41 +01:00
Honza Rychnovsky 150778f008
[#367] Fix Kotlin compiler warnings
* Fix missing room schema export directory
* Fix returned unused fields from cursor
* Fix missing db column index
* Improved TODO. Added suppress warning
* Changed parameters name to correspond to their supertype
* Changed type to Kotlin variant
* Use priority parameter
* Unified parameter names
* Suppress unchecked type warning
* Removed inline function
* Suppress obsolete coroutine warnings
* Improve previous commit
* Fix unnecessary safe call warning
* Remove unused parameter
* Unreachable code
* toLowerCase where possible
* Changed parameter name
* Suppress several "unused" warnings
* Fixed fromHtml() deprecation
* Suppress intentionally unused parameter warning
* Remove redundant initializer
* Remove inline function
* Suppress intentionally used deprecated code
* Unreachable code
* Suppress obsolete coroutine warnings
* Suppress intentionally unused parameter
* Remove unused expression
* Supertype parameter name
* Warnings of GetBlockRangeFragment.kt
* Deprecated onActivityCreated
* Suppress obsolete coroutine/flow warnings
* Unnecessary null check
* Suppress intentionally unused parameter
* Suppress intentionally unused parameters
* Deprecated onActivityCreated
* Predetermined type
* ListUtxosFragment clean code
* Suppress intentionally unused parameter
* Lint checks warnings fix
* Add data db migration
* Enable treating Kotlin compiler warnings as errors
* Solve several darkside-test-lib tests warnings
* Solve several demo-app tests warnings
* Solve several sdk-lib tests warnings
* Ktlint check result fix
* Remove parentheses now that Synchronizer is not cast
* Remove wildcard imports for java.util
* Revert "Add data db migration"
* Revert "Fix missing db column index"
* Suppress missing indexes on data db entities

Co-authored-by: Carter Jernigan <git@carterjernigan.com>
2022-08-17 15:48:02 +02:00
Carter Jernigan 10d0652a8d
[#252] Replace third party publishing Gradle plugin
The third party plugin that we’ve used for publishing has introduced multiple breaking changes recently.

By migrating to more standard Gradle publishing APIs, the deployment process is more explicit for those unfamiliar with Gradle.  It also will simplify some upcoming changes to modularize this SDK project.
2022-08-16 08:53:23 -04:00
Honza Rychnovsky c721a5e24e
[#343] Store database files in no_backup folder
Co-authored-by: Carter Jernigan <git@carterjernigan.com>
2022-08-12 11:05:00 -04:00
Carter Jernigan f4940348fe
Improve readme documentation (#667)
Co-authored-by: Honza <rychnovsky.honza@gmail.com>
2022-08-12 06:57:27 -04:00
Carter Jernigan 2b469b53a6 [#661] Update checkpoints 2022-08-12 06:55:46 -04:00
dependabot[bot] 4db4ecc5a3 Bump actions/cache from 3.0.6 to 3.0.7 in /.github/actions/setup
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.6 to 3.0.7.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](f4278025ab...a7c34adf76)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-12 06:55:22 -04:00
Carter Jernigan bc0212f77c [#659] Detekt 1.21.0 2022-08-09 16:45:27 -04:00
Carter Jernigan 13d3b073d4 [#656] Gradle 7.5.1 2022-08-09 07:20:04 -04:00
dependabot[bot] 2da6696014 Bump actions/cache from 3.0.5 to 3.0.6 in /.github/actions/setup
Bumps [actions/cache](https://github.com/actions/cache) from 3.0.5 to 3.0.6.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](0865c47f36...f4278025ab)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-09 07:16:49 -04:00
Carter Jernigan 1cb63e590a [#641] bip-39 1.0.4 2022-08-05 08:11:58 -04:00
Carter Jernigan 2f1ae4b6f6 [#652] GRPC 1.48.1 2022-08-05 08:11:58 -04:00
Carter Jernigan 7050c73ea2 [#651] AGP 7.2.2 2022-08-05 08:11:58 -04:00
Carter Jernigan e01a906407
[#593] Refactor ZcashNetwork
Splits the ZcashNetwork and Lightwalletd server information, making it easier to configure different servers
2022-08-02 09:29:09 -04:00
Carter Jernigan 2362c60dd6 [#597] Run unit tests on CI 2022-08-02 07:28:55 -04:00
Carter Jernigan 9e3a1af23c Bump version to prepare for 1.9-beta01
This ensures that further commits to the main branch deploy snapshots under the 1.9 version
2022-07-29 11:00:53 -04:00
Carter Jernigan 421f932bd5 Update changelog for 1.8 release 2022-07-28 17:07:02 -04:00
Carter Jernigan ecba4884b2 [#642] gRPC 1.8.0 2022-07-28 17:06:47 -04:00
Carter Jernigan 8ec216dac6 [#643] Protoc .21.4 2022-07-28 17:06:47 -04:00
Carter Jernigan b93965973d [#644] JUnit 5.9.0 2022-07-28 17:06:47 -04:00
Carter Jernigan 75ba753340 [#640] Room 2.4.3 2022-07-28 17:06:47 -04:00
Carter Jernigan 1f35e37a5e [#628] Fix off-by-one download blocks
This should yield approximatly a 10% performance improvement, as it prevents downloading duplicate blocks.
2022-07-28 17:06:34 -04:00
Carter Jernigan 3535ba905e [#629] Stream blocks during download
This change leverages the gRPC streaming API along with the elimination of bulk inserts to SQLite to reduce the amount of memory required to write blocks.
2022-07-28 15:49:46 -04:00
Carter Jernigan 98e22f6029 [#625] Reduce block batch size to fix OOM 2022-07-26 11:25:09 -04:00
Carter Jernigan 8e3c4a636f [#610] Fix block download regression
This includes a few different fixes that prevented the demo app and other SDK consumers from working.

First, initialization of the demo app was fixed to use the sapling activation height rather than the current latest checkpoint.

Second, CompactBlockProcessor wasn’t downloading blocks.

Third, a few potential thread safety issues were resolved by making fields that are accessed by multiple threads volatile.
2022-07-26 08:46:53 -04:00
Carter Jernigan b53b09d40d [#622] Update checkpoints 2022-07-26 08:09:57 -04:00
Carter Jernigan 96eab807cb [#612] Make dependency locking configurable
This implementation is somewhat special from our other Gradle properties, because it does not get declared in the root gradle.properties.  The reason is that included builds are supposed to have their own properties e.g.

root_project/gradle.properties
root_project/build-conventions/gradle.properties

Instead of declaring the property in different places which might lead to confusion, this leaves the property undeclared, with the Gradle scripts assuming a default value of true.  The only time this is expected to be overridden is due to a workaround for an Android Studio bug.
2022-07-25 15:36:39 -04:00
Kris Nuttycombe a03a89707c
Clarify instructions for Android NDK installation. 2022-07-25 10:11:09 -06:00