Add test utilities for db Migration

This commit is contained in:
Francisco Gindre 2022-04-26 17:45:38 -03:00 committed by Kris Nuttycombe
parent a1bc2937d4
commit cd345f6ddc
1 changed files with 6 additions and 2 deletions

View File

@ -68,9 +68,13 @@ class TestDbBuilder {
static func prePopulatedDataDbURL() -> URL? {
Bundle.module.url(forResource: "test_data", withExtension: "db")
}
static func prePopulatedMainnetDataDbURL() -> URL? {
Bundle.module.url(forResource: "ZcashSdk_Data", withExtension: "db")
}
static func prepopulatedDataDbProvider() -> ConnectionProvider? {
guard let url = Bundle.module.url(forResource: "ZcashSdk_Data", withExtension: "db") else { return nil }
guard let url = prePopulatedMainnetDataDbURL() else { return nil }
let provider = SimpleConnectionProvider(path: url.absoluteString, readonly: true)
return provider