From ec92801904183ac92a75d62288c20b86dc879509 Mon Sep 17 00:00:00 2001 From: Ramzi El-Yafi Date: Fri, 18 Dec 2020 09:59:12 +0000 Subject: [PATCH] Port of notary query API from ENT (#6837) --- .../net/corda/common/logging/Constants.kt | 2 +- detekt-baseline.xml | 1 + .../net/corda/nodeapi/notary/NotaryQueries.kt | 30 +++++++++++++++++++ 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 node-api/src/main/kotlin/net/corda/nodeapi/notary/NotaryQueries.kt diff --git a/common/logging/src/main/kotlin/net/corda/common/logging/Constants.kt b/common/logging/src/main/kotlin/net/corda/common/logging/Constants.kt index bd81d9d6eb..aa5d86d5d7 100644 --- a/common/logging/src/main/kotlin/net/corda/common/logging/Constants.kt +++ b/common/logging/src/main/kotlin/net/corda/common/logging/Constants.kt @@ -9,4 +9,4 @@ package net.corda.common.logging * (originally added to source control for ease of use) */ -internal const val CURRENT_MAJOR_RELEASE = "4.8-SNAPSHOT" +internal const val CURRENT_MAJOR_RELEASE = "4.8-SNAPSHOT" \ No newline at end of file diff --git a/detekt-baseline.xml b/detekt-baseline.xml index 4398ca38b0..d6fdc13c8c 100644 --- a/detekt-baseline.xml +++ b/detekt-baseline.xml @@ -1162,6 +1162,7 @@ MatchingDeclarationName:NamedCache.kt$net.corda.core.internal.NamedCache.kt MatchingDeclarationName:NetParams.kt$net.corda.netparams.NetParams.kt MatchingDeclarationName:NetworkParametersServiceInternal.kt$net.corda.core.internal.NetworkParametersServiceInternal.kt + MatchingDeclarationName:NotaryQueries.kt$net.corda.nodeapi.notary.NotaryQueries.kt MatchingDeclarationName:OGSwapPricingCcpExample.kt$net.corda.vega.analytics.example.OGSwapPricingCcpExample.kt MatchingDeclarationName:OGSwapPricingExample.kt$net.corda.vega.analytics.example.OGSwapPricingExample.kt MatchingDeclarationName:PlatformSecureRandom.kt$net.corda.core.crypto.internal.PlatformSecureRandom.kt diff --git a/node-api/src/main/kotlin/net/corda/nodeapi/notary/NotaryQueries.kt b/node-api/src/main/kotlin/net/corda/nodeapi/notary/NotaryQueries.kt new file mode 100644 index 0000000000..af97ba89c9 --- /dev/null +++ b/node-api/src/main/kotlin/net/corda/nodeapi/notary/NotaryQueries.kt @@ -0,0 +1,30 @@ +package net.corda.nodeapi.notary + +import net.corda.core.contracts.StateRef +import net.corda.core.internal.notary.NotaryService +import net.corda.core.serialization.CordaSerializable +import java.time.Instant + +/** + * Implementations of queries supported by notary services + */ +class SpentStateQuery { + @CordaSerializable + data class Request(val stateRef: StateRef, + val maxResults: Int, + val successOnly: Boolean, + val startTime: Instant?, + val endTime: Instant?, + val lastTxId: String?) : NotaryService.Query.Request + + @CordaSerializable + data class Result(val spendEvents: List, + val moreResults: Boolean): NotaryService.Query.Result + + @CordaSerializable + data class SpendEventDetails(val requestTimestamp: Instant, + val transactionId: String, + val result: String, + val requestingPartyName: String?, + val workerNodeX500Name: String?) +} \ No newline at end of file