Migrates EventStore from Android's SQLLite to KMP
Fixes testing of libsodium between java and android
This commit is contained in:
+3
-2
@@ -51,7 +51,7 @@ class LargeDBInsertBenchmark : BaseLargeCacheBenchmark() {
|
||||
benchmarkRule.measureRepeated {
|
||||
val db =
|
||||
runWithMeasurementDisabled {
|
||||
EventStore(context, null)
|
||||
EventStore(null)
|
||||
}
|
||||
firstThousandEvents.forEach { event ->
|
||||
try {
|
||||
@@ -81,7 +81,8 @@ class LargeDBInsertBenchmark : BaseLargeCacheBenchmark() {
|
||||
benchmarkRule.measureRepeated {
|
||||
val db =
|
||||
runWithMeasurementDisabled {
|
||||
val db = EventStore(context, null)
|
||||
val db =
|
||||
EventStore(null)
|
||||
toBeDeletedEvents.forEach { event ->
|
||||
try {
|
||||
db.insert(event)
|
||||
|
||||
+2
-2
@@ -49,14 +49,14 @@ class LargeDBQueryingBenchmark : BaseLargeCacheBenchmark() {
|
||||
val allEvents = getEventDB().distinctBy { it.id }.sortedBy { it.createdAt }
|
||||
}
|
||||
|
||||
lateinit var db: EventStore
|
||||
lateinit var db: com.vitorpamplona.quartz.nip01Core.store.sqlite.EventStore
|
||||
|
||||
@Before
|
||||
fun setup() {
|
||||
val context = ApplicationProvider.getApplicationContext<Context>()
|
||||
|
||||
context.deleteDatabase("allEvents.db")
|
||||
db = EventStore(context, "allEvents.db")
|
||||
db = EventStore("allEvents.db")
|
||||
allEvents.forEach { event ->
|
||||
try {
|
||||
db.insert(event)
|
||||
|
||||
Reference in New Issue
Block a user