zcash-android-wallet-sdk/sdk-lib/src/androidTest/java/cash/z/ecc/android/sdk/db/DatabaseCoordinatorTest.kt

332 lines
12 KiB
Kotlin
Raw Normal View History

package cash.z.ecc.android.sdk.db
import androidx.test.core.app.ApplicationProvider
import androidx.test.filters.SmallTest
import cash.z.ecc.android.sdk.internal.db.DatabaseCoordinator
import cash.z.ecc.android.sdk.model.ZcashNetwork
import cash.z.ecc.android.sdk.test.getAppContext
[#765] Store blocks on disk instead of in SQLite * 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](https://github.com/actions/cache/compare/627f0f41f6904a5b1efbaed9f96d9eb58e92e920...6998d139ddd3e68c71e9e398d8e40b71a2f39812) --- 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](https://github.com/gradle/wrapper-validation-action/compare/55e685c48d84285a5b0418cd094606e199cca3b6...8d49e559aae34d3e0eb16cde532684bc9702762b) --- 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](https://github.com/actions/cache/compare/6998d139ddd3e68c71e9e398d8e40b71a2f39812...69d9d449aced6a2ede0bc19182fadc3a0a42d2b0) --- 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>
2023-03-08 07:04:04 -08:00
import cash.z.ecc.fixture.DatabaseCacheFilesRootFixture
import cash.z.ecc.fixture.DatabaseNameFixture
import cash.z.ecc.fixture.DatabasePathFixture
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.test.runTest
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
import java.io.File
class DatabaseCoordinatorTest {
private val dbCoordinator = DatabaseCoordinator.getInstance(getAppContext())
@Before
fun clear_test_files() {
val databaseDir = DatabasePathFixture.new(baseFolderPath = DatabasePathFixture.DATABASE_DIR_PATH)
val noBackupDir = DatabasePathFixture.new(baseFolderPath = DatabasePathFixture.NO_BACKUP_DIR_PATH)
File(databaseDir).deleteRecursively()
File(noBackupDir).deleteRecursively()
}
@Test
@SmallTest
@OptIn(ExperimentalCoroutinesApi::class)
[#765] Store blocks on disk instead of in SQLite * 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](https://github.com/actions/cache/compare/627f0f41f6904a5b1efbaed9f96d9eb58e92e920...6998d139ddd3e68c71e9e398d8e40b71a2f39812) --- 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](https://github.com/gradle/wrapper-validation-action/compare/55e685c48d84285a5b0418cd094606e199cca3b6...8d49e559aae34d3e0eb16cde532684bc9702762b) --- 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](https://github.com/actions/cache/compare/6998d139ddd3e68c71e9e398d8e40b71a2f39812...69d9d449aced6a2ede0bc19182fadc3a0a42d2b0) --- 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>
2023-03-08 07:04:04 -08:00
fun database_cache_root_directory_creation_test() = runTest {
val parentDirectory = File(DatabasePathFixture.new())
val destinationDirectory = DatabaseCacheFilesRootFixture.newCacheRoot()
val expectedDirectoryPath = File(parentDirectory, destinationDirectory).path
[#765] Store blocks on disk instead of in SQLite * 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](https://github.com/actions/cache/compare/627f0f41f6904a5b1efbaed9f96d9eb58e92e920...6998d139ddd3e68c71e9e398d8e40b71a2f39812) --- 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](https://github.com/gradle/wrapper-validation-action/compare/55e685c48d84285a5b0418cd094606e199cca3b6...8d49e559aae34d3e0eb16cde532684bc9702762b) --- 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](https://github.com/actions/cache/compare/6998d139ddd3e68c71e9e398d8e40b71a2f39812...69d9d449aced6a2ede0bc19182fadc3a0a42d2b0) --- 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>
2023-03-08 07:04:04 -08:00
dbCoordinator.fsBlockDbRoot(
DatabaseNameFixture.TEST_DB_NETWORK,
DatabaseNameFixture.TEST_DB_ALIAS
).also { resultFile ->
[#765] Store blocks on disk instead of in SQLite * 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](https://github.com/actions/cache/compare/627f0f41f6904a5b1efbaed9f96d9eb58e92e920...6998d139ddd3e68c71e9e398d8e40b71a2f39812) --- 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](https://github.com/gradle/wrapper-validation-action/compare/55e685c48d84285a5b0418cd094606e199cca3b6...8d49e559aae34d3e0eb16cde532684bc9702762b) --- 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](https://github.com/actions/cache/compare/6998d139ddd3e68c71e9e398d8e40b71a2f39812...69d9d449aced6a2ede0bc19182fadc3a0a42d2b0) --- 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>
2023-03-08 07:04:04 -08:00
assertEquals(expectedDirectoryPath, resultFile.absolutePath)
}
}
@Test
@SmallTest
@OptIn(ExperimentalCoroutinesApi::class)
fun database_data_file_creation_test() = runTest {
val directory = File(DatabasePathFixture.new())
val fileName = DatabaseNameFixture.newDb(name = DatabaseCoordinator.DB_DATA_NAME)
val expectedFilePath = File(directory, fileName).path
dbCoordinator.dataDbFile(
DatabaseNameFixture.TEST_DB_NETWORK,
DatabaseNameFixture.TEST_DB_ALIAS
).also { resultFile ->
assertEquals(expectedFilePath, resultFile.absolutePath)
}
}
@Test
@SmallTest
@OptIn(ExperimentalCoroutinesApi::class)
fun database_transactions_file_creation_test() = runTest {
val directory = File(DatabasePathFixture.new())
val fileName = DatabaseNameFixture.newDb(name = DatabaseCoordinator.DB_PENDING_TRANSACTIONS_NAME)
val expectedFilePath = File(directory, fileName).path
dbCoordinator.pendingTransactionsDbFile(
DatabaseNameFixture.TEST_DB_NETWORK,
DatabaseNameFixture.TEST_DB_ALIAS
).also { resultFile ->
assertEquals(expectedFilePath, resultFile.absolutePath)
}
}
@Test
@SmallTest
@OptIn(ExperimentalCoroutinesApi::class)
[#765] Store blocks on disk instead of in SQLite * 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](https://github.com/actions/cache/compare/627f0f41f6904a5b1efbaed9f96d9eb58e92e920...6998d139ddd3e68c71e9e398d8e40b71a2f39812) --- 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](https://github.com/gradle/wrapper-validation-action/compare/55e685c48d84285a5b0418cd094606e199cca3b6...8d49e559aae34d3e0eb16cde532684bc9702762b) --- 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](https://github.com/actions/cache/compare/6998d139ddd3e68c71e9e398d8e40b71a2f39812...69d9d449aced6a2ede0bc19182fadc3a0a42d2b0) --- 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>
2023-03-08 07:04:04 -08:00
fun data_database_files_move_test() = runTest {
val parentFile = File(
DatabasePathFixture.new(
baseFolderPath = DatabasePathFixture.DATABASE_DIR_PATH,
internalPath = ""
)
)
val originalDbFile = getEmptyFile(
parent = parentFile,
fileName = DatabaseNameFixture.newDb(
[#765] Store blocks on disk instead of in SQLite * 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](https://github.com/actions/cache/compare/627f0f41f6904a5b1efbaed9f96d9eb58e92e920...6998d139ddd3e68c71e9e398d8e40b71a2f39812) --- 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](https://github.com/gradle/wrapper-validation-action/compare/55e685c48d84285a5b0418cd094606e199cca3b6...8d49e559aae34d3e0eb16cde532684bc9702762b) --- 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](https://github.com/actions/cache/compare/6998d139ddd3e68c71e9e398d8e40b71a2f39812...69d9d449aced6a2ede0bc19182fadc3a0a42d2b0) --- 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>
2023-03-08 07:04:04 -08:00
name = DatabaseCoordinator.DB_DATA_NAME_LEGACY,
alias = DatabaseCoordinator.ALIAS_LEGACY
)
)
val originalDbJournalFile = getEmptyFile(
parent = parentFile,
fileName = DatabaseNameFixture.newDbJournal(
[#765] Store blocks on disk instead of in SQLite * 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](https://github.com/actions/cache/compare/627f0f41f6904a5b1efbaed9f96d9eb58e92e920...6998d139ddd3e68c71e9e398d8e40b71a2f39812) --- 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](https://github.com/gradle/wrapper-validation-action/compare/55e685c48d84285a5b0418cd094606e199cca3b6...8d49e559aae34d3e0eb16cde532684bc9702762b) --- 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](https://github.com/actions/cache/compare/6998d139ddd3e68c71e9e398d8e40b71a2f39812...69d9d449aced6a2ede0bc19182fadc3a0a42d2b0) --- 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>
2023-03-08 07:04:04 -08:00
name = DatabaseCoordinator.DB_DATA_NAME_LEGACY,
alias = DatabaseCoordinator.ALIAS_LEGACY
)
)
val originalDbWalFile = getEmptyFile(
parent = parentFile,
fileName = DatabaseNameFixture.newDbWal(
[#765] Store blocks on disk instead of in SQLite * 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](https://github.com/actions/cache/compare/627f0f41f6904a5b1efbaed9f96d9eb58e92e920...6998d139ddd3e68c71e9e398d8e40b71a2f39812) --- 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](https://github.com/gradle/wrapper-validation-action/compare/55e685c48d84285a5b0418cd094606e199cca3b6...8d49e559aae34d3e0eb16cde532684bc9702762b) --- 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](https://github.com/actions/cache/compare/6998d139ddd3e68c71e9e398d8e40b71a2f39812...69d9d449aced6a2ede0bc19182fadc3a0a42d2b0) --- 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>
2023-03-08 07:04:04 -08:00
name = DatabaseCoordinator.DB_DATA_NAME_LEGACY,
alias = DatabaseCoordinator.ALIAS_LEGACY
)
)
val expectedDbFile = File(
DatabasePathFixture.new(),
[#765] Store blocks on disk instead of in SQLite * 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](https://github.com/actions/cache/compare/627f0f41f6904a5b1efbaed9f96d9eb58e92e920...6998d139ddd3e68c71e9e398d8e40b71a2f39812) --- 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](https://github.com/gradle/wrapper-validation-action/compare/55e685c48d84285a5b0418cd094606e199cca3b6...8d49e559aae34d3e0eb16cde532684bc9702762b) --- 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](https://github.com/actions/cache/compare/6998d139ddd3e68c71e9e398d8e40b71a2f39812...69d9d449aced6a2ede0bc19182fadc3a0a42d2b0) --- 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>
2023-03-08 07:04:04 -08:00
DatabaseNameFixture.newDb(name = DatabaseCoordinator.DB_DATA_NAME)
)
val expectedDbJournalFile = File(
DatabasePathFixture.new(),
[#765] Store blocks on disk instead of in SQLite * 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](https://github.com/actions/cache/compare/627f0f41f6904a5b1efbaed9f96d9eb58e92e920...6998d139ddd3e68c71e9e398d8e40b71a2f39812) --- 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](https://github.com/gradle/wrapper-validation-action/compare/55e685c48d84285a5b0418cd094606e199cca3b6...8d49e559aae34d3e0eb16cde532684bc9702762b) --- 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](https://github.com/actions/cache/compare/6998d139ddd3e68c71e9e398d8e40b71a2f39812...69d9d449aced6a2ede0bc19182fadc3a0a42d2b0) --- 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>
2023-03-08 07:04:04 -08:00
DatabaseNameFixture.newDbJournal(name = DatabaseCoordinator.DB_DATA_NAME)
)
val expectedDbWalFile = File(
DatabasePathFixture.new(),
[#765] Store blocks on disk instead of in SQLite * 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](https://github.com/actions/cache/compare/627f0f41f6904a5b1efbaed9f96d9eb58e92e920...6998d139ddd3e68c71e9e398d8e40b71a2f39812) --- 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](https://github.com/gradle/wrapper-validation-action/compare/55e685c48d84285a5b0418cd094606e199cca3b6...8d49e559aae34d3e0eb16cde532684bc9702762b) --- 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](https://github.com/actions/cache/compare/6998d139ddd3e68c71e9e398d8e40b71a2f39812...69d9d449aced6a2ede0bc19182fadc3a0a42d2b0) --- 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>
2023-03-08 07:04:04 -08:00
DatabaseNameFixture.newDbWal(name = DatabaseCoordinator.DB_DATA_NAME)
)
assertTrue(originalDbFile.exists())
assertTrue(originalDbJournalFile.exists())
assertTrue(originalDbWalFile.exists())
assertFalse(expectedDbFile.exists())
assertFalse(expectedDbJournalFile.exists())
assertFalse(expectedDbWalFile.exists())
[#765] Store blocks on disk instead of in SQLite * 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](https://github.com/actions/cache/compare/627f0f41f6904a5b1efbaed9f96d9eb58e92e920...6998d139ddd3e68c71e9e398d8e40b71a2f39812) --- 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](https://github.com/gradle/wrapper-validation-action/compare/55e685c48d84285a5b0418cd094606e199cca3b6...8d49e559aae34d3e0eb16cde532684bc9702762b) --- 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](https://github.com/actions/cache/compare/6998d139ddd3e68c71e9e398d8e40b71a2f39812...69d9d449aced6a2ede0bc19182fadc3a0a42d2b0) --- 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>
2023-03-08 07:04:04 -08:00
dbCoordinator.dataDbFile(
DatabaseNameFixture.TEST_DB_NETWORK,
DatabaseNameFixture.TEST_DB_ALIAS
).also { resultFile ->
assertTrue(resultFile.exists())
assertEquals(expectedDbFile.absolutePath, resultFile.absolutePath)
assertTrue(expectedDbFile.exists())
assertTrue(expectedDbJournalFile.exists())
assertTrue(expectedDbWalFile.exists())
assertFalse(originalDbFile.exists())
assertFalse(originalDbJournalFile.exists())
assertFalse(originalDbWalFile.exists())
}
}
private fun getEmptyFile(parent: File, fileName: String): File {
return File(parent, fileName).apply {
assertTrue(parentFile != null)
parentFile!!.mkdirs()
assertTrue(parentFile!!.exists())
createNewFile()
assertTrue(exists())
}
}
@Test
@SmallTest
@OptIn(ExperimentalCoroutinesApi::class)
[#765] Store blocks on disk instead of in SQLite * 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](https://github.com/actions/cache/compare/627f0f41f6904a5b1efbaed9f96d9eb58e92e920...6998d139ddd3e68c71e9e398d8e40b71a2f39812) --- 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](https://github.com/gradle/wrapper-validation-action/compare/55e685c48d84285a5b0418cd094606e199cca3b6...8d49e559aae34d3e0eb16cde532684bc9702762b) --- 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](https://github.com/actions/cache/compare/6998d139ddd3e68c71e9e398d8e40b71a2f39812...69d9d449aced6a2ede0bc19182fadc3a0a42d2b0) --- 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>
2023-03-08 07:04:04 -08:00
fun delete_data_database_files_test() = runTest {
val parentFile = File(
DatabasePathFixture.new(
baseFolderPath = DatabasePathFixture.NO_BACKUP_DIR_PATH,
internalPath = DatabasePathFixture.INTERNAL_DATABASE_PATH
)
)
val dbFile = getEmptyFile(
parent = parentFile,
[#765] Store blocks on disk instead of in SQLite * 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](https://github.com/actions/cache/compare/627f0f41f6904a5b1efbaed9f96d9eb58e92e920...6998d139ddd3e68c71e9e398d8e40b71a2f39812) --- 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](https://github.com/gradle/wrapper-validation-action/compare/55e685c48d84285a5b0418cd094606e199cca3b6...8d49e559aae34d3e0eb16cde532684bc9702762b) --- 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](https://github.com/actions/cache/compare/6998d139ddd3e68c71e9e398d8e40b71a2f39812...69d9d449aced6a2ede0bc19182fadc3a0a42d2b0) --- 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>
2023-03-08 07:04:04 -08:00
fileName = DatabaseNameFixture.newDb(name = DatabaseCoordinator.DB_DATA_NAME)
)
val dbJournalFile = getEmptyFile(
parent = parentFile,
[#765] Store blocks on disk instead of in SQLite * 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](https://github.com/actions/cache/compare/627f0f41f6904a5b1efbaed9f96d9eb58e92e920...6998d139ddd3e68c71e9e398d8e40b71a2f39812) --- 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](https://github.com/gradle/wrapper-validation-action/compare/55e685c48d84285a5b0418cd094606e199cca3b6...8d49e559aae34d3e0eb16cde532684bc9702762b) --- 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](https://github.com/actions/cache/compare/6998d139ddd3e68c71e9e398d8e40b71a2f39812...69d9d449aced6a2ede0bc19182fadc3a0a42d2b0) --- 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>
2023-03-08 07:04:04 -08:00
fileName = DatabaseNameFixture.newDbJournal(name = DatabaseCoordinator.DB_DATA_NAME)
)
val dbWalFile = getEmptyFile(
parent = parentFile,
[#765] Store blocks on disk instead of in SQLite * 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](https://github.com/actions/cache/compare/627f0f41f6904a5b1efbaed9f96d9eb58e92e920...6998d139ddd3e68c71e9e398d8e40b71a2f39812) --- 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](https://github.com/gradle/wrapper-validation-action/compare/55e685c48d84285a5b0418cd094606e199cca3b6...8d49e559aae34d3e0eb16cde532684bc9702762b) --- 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](https://github.com/actions/cache/compare/6998d139ddd3e68c71e9e398d8e40b71a2f39812...69d9d449aced6a2ede0bc19182fadc3a0a42d2b0) --- 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>
2023-03-08 07:04:04 -08:00
fileName = DatabaseNameFixture.newDbWal(name = DatabaseCoordinator.DB_DATA_NAME)
)
assertTrue(dbFile.exists())
assertTrue(dbJournalFile.exists())
assertTrue(dbWalFile.exists())
dbCoordinator.deleteDatabases(DatabaseNameFixture.TEST_DB_NETWORK, DatabaseNameFixture.TEST_DB_ALIAS).also {
assertFalse(dbFile.exists())
assertFalse(dbJournalFile.exists())
assertFalse(dbWalFile.exists())
}
}
[#765] Store blocks on disk instead of in SQLite * 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](https://github.com/actions/cache/compare/627f0f41f6904a5b1efbaed9f96d9eb58e92e920...6998d139ddd3e68c71e9e398d8e40b71a2f39812) --- 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](https://github.com/gradle/wrapper-validation-action/compare/55e685c48d84285a5b0418cd094606e199cca3b6...8d49e559aae34d3e0eb16cde532684bc9702762b) --- 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](https://github.com/actions/cache/compare/6998d139ddd3e68c71e9e398d8e40b71a2f39812...69d9d449aced6a2ede0bc19182fadc3a0a42d2b0) --- 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>
2023-03-08 07:04:04 -08:00
/**
* Note that this situation is just hypothetical, as the legacy database files should be placed only on one of
* the legacy locations, not both, but it is alright to test it together.
*/
@Test
@SmallTest
@OptIn(ExperimentalCoroutinesApi::class)
fun delete_all_legacy_database_files_test() = runTest {
// create older location legacy files
val olderLegacyParentFile = File(
DatabasePathFixture.new(
baseFolderPath = DatabasePathFixture.DATABASE_DIR_PATH,
internalPath = ""
)
)
val olderLegacyDbFile = getEmptyFile(
parent = olderLegacyParentFile,
fileName = DatabaseNameFixture.newDb(
name = DatabaseCoordinator.DB_CACHE_OLDER_NAME_LEGACY,
network = DatabaseNameFixture.TEST_DB_NETWORK.networkName,
alias = DatabaseCoordinator.ALIAS_LEGACY
)
)
val olderLegacyDbJournalFile = getEmptyFile(
parent = olderLegacyParentFile,
fileName = DatabaseNameFixture.newDbJournal(
name = DatabaseCoordinator.DB_CACHE_OLDER_NAME_LEGACY,
network = DatabaseNameFixture.TEST_DB_NETWORK.networkName,
alias = DatabaseCoordinator.ALIAS_LEGACY
)
)
val olderLegacyDbWalFile = getEmptyFile(
parent = olderLegacyParentFile,
fileName = DatabaseNameFixture.newDbWal(
name = DatabaseCoordinator.DB_CACHE_OLDER_NAME_LEGACY,
network = DatabaseNameFixture.TEST_DB_NETWORK.networkName,
alias = DatabaseCoordinator.ALIAS_LEGACY
)
)
// create newer location legacy files
val newerLegacyParentFile = File(
DatabasePathFixture.new(
baseFolderPath = DatabasePathFixture.NO_BACKUP_DIR_PATH,
internalPath = DatabasePathFixture.INTERNAL_DATABASE_PATH
)
)
val newerLegacyDbFile = getEmptyFile(
parent = newerLegacyParentFile,
fileName = DatabaseNameFixture.newDb(
name = DatabaseCoordinator.DB_CACHE_NEWER_NAME_LEGACY,
network = DatabaseNameFixture.TEST_DB_NETWORK.networkName,
alias = DatabaseNameFixture.TEST_DB_ALIAS
)
)
val newerLegacyDbJournalFile = getEmptyFile(
parent = newerLegacyParentFile,
fileName = DatabaseNameFixture.newDbJournal(
name = DatabaseCoordinator.DB_CACHE_NEWER_NAME_LEGACY,
network = DatabaseNameFixture.TEST_DB_NETWORK.networkName,
alias = DatabaseNameFixture.TEST_DB_ALIAS
)
)
val newerLegacyDbWalFile = getEmptyFile(
parent = newerLegacyParentFile,
fileName = DatabaseNameFixture.newDbWal(
name = DatabaseCoordinator.DB_CACHE_NEWER_NAME_LEGACY,
network = DatabaseNameFixture.TEST_DB_NETWORK.networkName,
alias = DatabaseNameFixture.TEST_DB_ALIAS
)
)
// check all files in place
assertTrue(olderLegacyDbFile.exists())
assertTrue(olderLegacyDbJournalFile.exists())
assertTrue(olderLegacyDbWalFile.exists())
[#765] Store blocks on disk instead of in SQLite * 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](https://github.com/actions/cache/compare/627f0f41f6904a5b1efbaed9f96d9eb58e92e920...6998d139ddd3e68c71e9e398d8e40b71a2f39812) --- 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](https://github.com/gradle/wrapper-validation-action/compare/55e685c48d84285a5b0418cd094606e199cca3b6...8d49e559aae34d3e0eb16cde532684bc9702762b) --- 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](https://github.com/actions/cache/compare/6998d139ddd3e68c71e9e398d8e40b71a2f39812...69d9d449aced6a2ede0bc19182fadc3a0a42d2b0) --- 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>
2023-03-08 07:04:04 -08:00
assertTrue(newerLegacyDbFile.exists())
assertTrue(newerLegacyDbJournalFile.exists())
assertTrue(newerLegacyDbWalFile.exists())
[#765] Store blocks on disk instead of in SQLite * 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](https://github.com/actions/cache/compare/627f0f41f6904a5b1efbaed9f96d9eb58e92e920...6998d139ddd3e68c71e9e398d8e40b71a2f39812) --- 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](https://github.com/gradle/wrapper-validation-action/compare/55e685c48d84285a5b0418cd094606e199cca3b6...8d49e559aae34d3e0eb16cde532684bc9702762b) --- 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](https://github.com/actions/cache/compare/6998d139ddd3e68c71e9e398d8e40b71a2f39812...69d9d449aced6a2ede0bc19182fadc3a0a42d2b0) --- 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>
2023-03-08 07:04:04 -08:00
// once we access the latest file system blocks storage root directory, all the legacy database files should
// be removed
dbCoordinator.fsBlockDbRoot(
network = DatabaseNameFixture.TEST_DB_NETWORK,
alias = DatabaseNameFixture.TEST_DB_ALIAS
).also {
assertFalse(olderLegacyDbFile.exists())
assertFalse(olderLegacyDbJournalFile.exists())
assertFalse(olderLegacyDbWalFile.exists())
[#765] Store blocks on disk instead of in SQLite * 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](https://github.com/actions/cache/compare/627f0f41f6904a5b1efbaed9f96d9eb58e92e920...6998d139ddd3e68c71e9e398d8e40b71a2f39812) --- 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](https://github.com/gradle/wrapper-validation-action/compare/55e685c48d84285a5b0418cd094606e199cca3b6...8d49e559aae34d3e0eb16cde532684bc9702762b) --- 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](https://github.com/actions/cache/compare/6998d139ddd3e68c71e9e398d8e40b71a2f39812...69d9d449aced6a2ede0bc19182fadc3a0a42d2b0) --- 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>
2023-03-08 07:04:04 -08:00
assertFalse(newerLegacyDbFile.exists())
assertFalse(newerLegacyDbJournalFile.exists())
assertFalse(newerLegacyDbWalFile.exists())
[#765] Store blocks on disk instead of in SQLite * 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](https://github.com/actions/cache/compare/627f0f41f6904a5b1efbaed9f96d9eb58e92e920...6998d139ddd3e68c71e9e398d8e40b71a2f39812) --- 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](https://github.com/gradle/wrapper-validation-action/compare/55e685c48d84285a5b0418cd094606e199cca3b6...8d49e559aae34d3e0eb16cde532684bc9702762b) --- 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](https://github.com/actions/cache/compare/6998d139ddd3e68c71e9e398d8e40b71a2f39812...69d9d449aced6a2ede0bc19182fadc3a0a42d2b0) --- 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>
2023-03-08 07:04:04 -08:00
}
}
@OptIn(ExperimentalCoroutinesApi::class)
@Test
@SmallTest
fun data_db_path() = runTest {
val coordinator = DatabaseCoordinator.getInstance(ApplicationProvider.getApplicationContext())
val dataDbFile = coordinator.dataDbFile(ZcashNetwork.Testnet, "TestWallet")
assertTrue(
"Invalid DataDB file",
dataDbFile.absolutePath.endsWith(
"no_backup/co.electricoin.zcash/TestWallet_testnet_${DatabaseCoordinator.DB_DATA_NAME}"
)
)
}
@OptIn(ExperimentalCoroutinesApi::class)
@Test
@SmallTest
fun cache_path() = runTest {
val coordinator = DatabaseCoordinator.getInstance(ApplicationProvider.getApplicationContext())
val cache = coordinator.fsBlockDbRoot(ZcashNetwork.Testnet, "TestWallet")
assertTrue(
"Invalid CacheDB file",
cache.absolutePath.endsWith(
"no_backup/co.electricoin.zcash/TestWallet_testnet_${DatabaseCoordinator.DB_FS_BLOCK_DB_ROOT_NAME}"
)
)
}
}