This is an initial step before moving the Rust backend into a separate Gradle module
- Use primitive values for the Rust backend interface. This will allow the backend to be moved into a new Gradle module in the future, without needing to access the model objects of the SDK
- Add extension functions to the Backend to replace the existing usage of more strongly typed objects. The extension functions can continue to live in the sdk-lib even after refactoring the Rust backend
- Add new decorator that can eventually replace using the Rust backend within the SDK
* Switch to FsBlockDb for caching CompactBlocks
* Add RustBackend.getLatestHeight() method
* Raise MSRV to 1.60
* Migrate to latest Rust crate API
* Add RustBackend.findBlockMetadata() method
* Add RustBackend.rewindBlockMetadataToHeight() method
* [#765] implementation of FileCompactBlockRepository
* writing block metadata to database
* split write function into smaller easier to test blocks
* testing for FileCompactBlockRepository
* fixed rewinding
* fixed tests
* fixed FileCompactBlockRepositoryTest and SynchronizerFactoryTest
* code review fixes
* updated proto files
* override all functions in FakeRustBackend
* code review fixes
* Fix function body formatting
* Improve clear function clarity
* Use length of string const
* Delete single file instead of directory
* Improve function clarity
* Refactor outputs counting
- Found a typo in intermediary model class JniBlockMeta parameter change of which does not impact encoding from rust to kotlin according to rust layer implementation.
* Check blocks mkdir result
* Remove unnecessary detekt warning suppression
* Refactor buffer size check
* Improve visibility annotations
* Make file finalise obvious and self documenting
* Remove prevHash logging
* Move instantiation to the object itself
* Enrich fixture with default values
* Extend eror message
* Rename benchmark blocks range fixture
* Fix rebase changes
* Improve FileCompactBlockRepositoryTest
- "De-integrated" the test suite - it now works with fixture blocks
- Created needed fixtures for a clear mocked blocks providing
- Enhanced getting of FileCompactBlockRepository in FileCompactBlockRepositoryTest to clarify that it works with mock components
* Fix ktlintFormat findings
* Bump actions/cache from 3.2.4 to 3.2.5 in /.github/actions/setup (#927)
Bumps [actions/cache](https://github.com/actions/cache) from 3.2.4 to 3.2.5.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](627f0f41f6...6998d139dd)
---
updated-dependencies:
- dependency-name: actions/cache
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Fix incorrect dir checking
* More robust min/max checking
* Rewinding to more robust middle value
* Strengthen blocks counts after rewind
* Add check of temp finalized file
* Refactor DatabaseCoordinatorTest
* Rename cache files root directory
- To have the same unified variable name across our repositories - fsBlockDbRoot
* Refactor FileCompactBlockRepositoryTest
- To have these tests more clear
- Fixed FakeRustBackend instantiation bug
* Revert back JniBlockMeta param name
* Delete legacy Cache db files
- Deleted from both the older and the newer legacy locations
- All related db files deleted - rollback files included
- The deletion is run once we try to access the new store blocks on disk root directory
- The deletion check does not throw any exception in case of failure, we just log it in console and try it on the next time
- Related new test added too
* Test refactoring
- Made few changes to improve clarity of provided tests and fixtures
- Prepared few new "failure path" tests
- Enhanced existing tests
* Manual test case
* Simplify error printing
- As we had some commented out code there
* Reset manual tests steps numbering
* [#924] Remove alias from WalletCoordinator
Also make Compose UI the default. The old UI is deprecated but is still used by the benchmarking tests
* Bump benchmark version
* Protect JniBlockMetadata agains minification
* Enable debuggable while benchmarking
* Enhance benchmark screen waiting
* Fix cache db files deletion
- With this construct we delete all blocks blob metadata files, as well as their sqlite file
* Add new benchmark results
* Remove benchmark operations receiver fix
- As it's not needed after the latest profiler dependency update
* Bump gradle/wrapper-validation-action from 1.0.5 to 1.0.6 (#928)
Bumps [gradle/wrapper-validation-action](https://github.com/gradle/wrapper-validation-action) from 1.0.5 to 1.0.6.
- [Release notes](https://github.com/gradle/wrapper-validation-action/releases)
- [Commits](55e685c48d...8d49e559aa)
---
updated-dependencies:
- dependency-name: gradle/wrapper-validation-action
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Bump actions/cache from 3.2.5 to 3.2.6 in /.github/actions/setup (#929)
Bumps [actions/cache](https://github.com/actions/cache) from 3.2.5 to 3.2.6.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](6998d139dd...69d9d449ac)
---
updated-dependencies:
- dependency-name: actions/cache
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Update DatabaseCoordinator.kt
Move if/else out from log message body
* Update Switch cache to store blocks on disk.md
Reset documentation bullets numbering
* Hide internal constants from public package
* Update manual test user with new UI requirement
* Comment out cargo.toml test values
* Inline fixture blocks metadata with its creation
* Switch to FsBlockDb for caching CompactBlocks
* Add RustBackend.getLatestHeight() method
* Raise MSRV to 1.60
* Migrate to latest Rust crate API
* Add RustBackend.findBlockMetadata() method
* Add RustBackend.rewindBlockMetadataToHeight() method
* Update cargo.lock
* Switch to FsBlockDb for caching CompactBlocks
* Migrate to latest Rust crate API
* [#765] implementation of FileCompactBlockRepository
* writing block metadata to database
* split write function into smaller easier to test blocks
* testing for FileCompactBlockRepository
* fixed rewinding
* fixed tests
* fixed FileCompactBlockRepositoryTest and SynchronizerFactoryTest
* code review fixes
* updated proto files
* override all functions in FakeRustBackend
* code review fixes
* Fix function body formatting
* Improve clear function clarity
* Use length of string const
* Delete single file instead of directory
* Improve function clarity
* Refactor outputs counting
- Found a typo in intermediary model class JniBlockMeta parameter change of which does not impact encoding from rust to kotlin according to rust layer implementation.
* Check blocks mkdir result
* Remove unnecessary detekt warning suppression
* Refactor buffer size check
* Improve visibility annotations
* Make file finalise obvious and self documenting
* Remove prevHash logging
* Move instantiation to the object itself
* Enrich fixture with default values
* Extend eror message
* Rename benchmark blocks range fixture
* Fix rebase changes
* Improve FileCompactBlockRepositoryTest
- "De-integrated" the test suite - it now works with fixture blocks
- Created needed fixtures for a clear mocked blocks providing
- Enhanced getting of FileCompactBlockRepository in FileCompactBlockRepositoryTest to clarify that it works with mock components
* Fix ktlintFormat findings
* Fix incorrect dir checking
* More robust min/max checking
* Rewinding to more robust middle value
* Strengthen blocks counts after rewind
* Add check of temp finalized file
* Refactor DatabaseCoordinatorTest
* Rename cache files root directory
- To have the same unified variable name across our repositories - fsBlockDbRoot
* Refactor FileCompactBlockRepositoryTest
- To have these tests more clear
- Fixed FakeRustBackend instantiation bug
* Revert back JniBlockMeta param name
* Delete legacy Cache db files
- Deleted from both the older and the newer legacy locations
- All related db files deleted - rollback files included
- The deletion is run once we try to access the new store blocks on disk root directory
- The deletion check does not throw any exception in case of failure, we just log it in console and try it on the next time
- Related new test added too
* Test refactoring
- Made few changes to improve clarity of provided tests and fixtures
- Prepared few new "failure path" tests
- Enhanced existing tests
* Manual test case
* Simplify error printing
- As we had some commented out code there
* Reset manual tests steps numbering
* Bump benchmark version
* Protect JniBlockMetadata agains minification
* Enable debuggable while benchmarking
* Enhance benchmark screen waiting
* Fix cache db files deletion
- With this construct we delete all blocks blob metadata files, as well as their sqlite file
* Add new benchmark results
* Remove benchmark operations receiver fix
- As it's not needed after the latest profiler dependency update
* Update DatabaseCoordinator.kt
Move if/else out from log message body
* Update Switch cache to store blocks on disk.md
Reset documentation bullets numbering
* Hide internal constants from public package
* Update manual test user with new UI requirement
* Comment out cargo.toml test values
* Inline fixture blocks metadata with its creation
* Update cargo.lock
* Update Cargo.lock
* Check and document JniBlockMeta params ranges
* Add assert for gradle property
* Use UInt internally
uint
* Change array API to list
* Fix for using correct SDK Synchronizer alias
- Only the older Demo-app UI was impacted.
- Thus also our benchmarking was impacted.
* Apply documentation suggestions from code review
Co-authored-by: Kris Nuttycombe <kris@electriccoin.co>
* Final manual test instructions update
* Fixture block hash deterministically generated from block height
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Jack Grigg <jack@electriccoin.co>
Co-authored-by: Jack Grigg <jack@z.cash>
Co-authored-by: Honza <rychnovsky.honza@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Carter Jernigan <git@carterjernigan.com>
Co-authored-by: Kris Nuttycombe <kris@electriccoin.co>
This ensures that errors are logged and tracing events are generated,
but prevents debug logging in release mode. Eventually this will be
made configurable based on the SDK build type, but for now we impose
the same limits on debug builds.
Previously if `initLogs()` was called more than once, the application
would crash. `NativeLibraryLoader` already implements a singleton for
loading the Rust library, so we now hook into that for initialization.
We now always initialize the Rust logging system, along with the tracing
event hooks and anything else we add in future.
The SDK now exposes UAs primarily, with additional methods for obtaining
corresponding Sapling and transparent addresses for legacy compatibility.
The `Account` DAO is also fixed to use the migrated `accounts` table format.
The demo app now shows the current UA and the legacy Sapling and transparent
addresses.
Closeszcash/zcash-android-wallet-sdk#677.
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.
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.
- Replace int with type safe BlockHeight(Long) object
- Fix down casting bug, as BlockHeight is uint32 but Java only supports int32 or int64
- Rename WalletBirthday to Checkpoint and hide from the public API
`decrypt_and_store_transaction` internally serialized transactions, but
the previous commit only added parsing support. Fortunately we already
have the transaction bytes, so to handle this in the short term we can
just pass them through.
Once we have migrated the SDK to latest `zcash/librustzcash` the API
will return to its previous form.
Move SDK from the root gradle project to its own Gradle module
Move the demo app to be a peer of the SDK
This will simplify integration with CI on Bitrise.