Moving the EmptyOTS resolver to Quartz for test cases

This commit is contained in:
Vitor Pamplona
2025-10-17 14:29:46 -04:00
parent 563e985a2b
commit 990cca3d64
5 changed files with 32 additions and 40 deletions

View File

@@ -20,6 +20,18 @@
*/
package com.vitorpamplona.quartz.nip03Timestamp
import com.vitorpamplona.quartz.nip03Timestamp.ots.EmptyBitcoinExplorer
import com.vitorpamplona.quartz.nip03Timestamp.ots.EmptyRemoteCalendar
interface OtsResolverBuilder {
fun build(): OtsResolver
}
val EmptyOtsResolverBuilder =
object : OtsResolverBuilder {
override fun build(): OtsResolver =
OtsResolver(
explorer = EmptyBitcoinExplorer,
calendar = EmptyRemoteCalendar,
)
}

View File

@@ -39,3 +39,9 @@ interface BitcoinExplorer {
*/
suspend fun blockHash(height: Int): String
}
object EmptyBitcoinExplorer : BitcoinExplorer {
override suspend fun block(hash: String) = TODO("Not yet implemented")
override suspend fun blockHash(height: Int) = TODO("Not yet implemented")
}

View File

@@ -55,3 +55,15 @@ interface RemoteCalendar {
commitment: ByteArray,
): Timestamp
}
object EmptyRemoteCalendar : RemoteCalendar {
override suspend fun submit(
url: String,
digest: ByteArray,
) = TODO("Not yet implemented")
override suspend fun getTimestamp(
url: String,
commitment: ByteArray,
) = TODO("Not yet implemented")
}