Skip to content

Commit 331a99c

Browse files
authored
CORE-4714 Avro schema for uniqueness check request / response protocol (#358)
* Avro schema for uniqueness check request / responses * Make time window upper bound mandatory
1 parent 037b70b commit 331a99c

9 files changed

+175
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"type": "record",
3+
"name": "UniquenessCheckRequest",
4+
"namespace": "net.corda.data.uniqueness",
5+
"fields": [
6+
{
7+
"name": "txId",
8+
"type": "string"
9+
},
10+
{
11+
"name": "inputStates",
12+
"type": {
13+
"type": "array",
14+
"items": "string"
15+
}
16+
},
17+
{
18+
"name": "referenceStates",
19+
"type": {
20+
"type": "array",
21+
"items": "string"
22+
}
23+
},
24+
{
25+
"name": "numOutputStates",
26+
"type": "int"
27+
},
28+
{
29+
"name": "timeWindowLowerBound",
30+
"type": ["null", {
31+
"type": "long",
32+
"logicalType": "timestamp-millis"
33+
}]
34+
},
35+
{
36+
"name": "timeWindowUpperBound",
37+
"type": {
38+
"type": "long",
39+
"logicalType": "timestamp-millis"
40+
}
41+
}
42+
]
43+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"type": "record",
3+
"name": "UniquenessCheckResponse",
4+
"namespace": "net.corda.data.uniqueness",
5+
"fields": [
6+
{
7+
"name": "txId",
8+
"type": "string"
9+
},
10+
{
11+
"name": "result",
12+
"type": [
13+
"net.corda.data.uniqueness.UniquenessCheckResultSuccess",
14+
"net.corda.data.uniqueness.UniquenessCheckResultInputStateConflict",
15+
"net.corda.data.uniqueness.UniquenessCheckResultInputStateUnknown",
16+
"net.corda.data.uniqueness.UniquenessCheckResultReferenceStateConflict",
17+
"net.corda.data.uniqueness.UniquenessCheckResultReferenceStateUnknown",
18+
"net.corda.data.uniqueness.UniquenessCheckResultTimeWindowOutOfBounds",
19+
"net.corda.data.uniqueness.UniquenessCheckResultMalformedRequest"
20+
]
21+
}
22+
]
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"type": "record",
3+
"name": "UniquenessCheckResultInputStateConflict",
4+
"namespace": "net.corda.data.uniqueness",
5+
"fields": [
6+
{
7+
"name": "conflictingStates",
8+
"type": {
9+
"type": "array",
10+
"items": "string"
11+
}
12+
}
13+
]
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"type": "record",
3+
"name": "UniquenessCheckResultInputStateUnknown",
4+
"namespace": "net.corda.data.uniqueness",
5+
"fields": [
6+
{
7+
"name": "unknownStates",
8+
"type": {
9+
"type": "array",
10+
"items": "string"
11+
}
12+
}
13+
]
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"type": "record",
3+
"name": "UniquenessCheckResultMalformedRequest",
4+
"namespace": "net.corda.data.uniqueness",
5+
"fields": [
6+
{
7+
"name": "errorText",
8+
"type": "string"
9+
}
10+
]
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"type": "record",
3+
"name": "UniquenessCheckResultReferenceStateConflict",
4+
"namespace": "net.corda.data.uniqueness",
5+
"fields": [
6+
{
7+
"name": "conflictingStates",
8+
"type": {
9+
"type": "array",
10+
"items": "string"
11+
}
12+
}
13+
]
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"type": "record",
3+
"name": "UniquenessCheckResultReferenceStateUnknown",
4+
"namespace": "net.corda.data.uniqueness",
5+
"fields": [
6+
{
7+
"name": "unknownStates",
8+
"type": {
9+
"type": "array",
10+
"items": "string"
11+
}
12+
}
13+
]
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"type": "record",
3+
"name": "UniquenessCheckResultSuccess",
4+
"namespace": "net.corda.data.uniqueness",
5+
"fields": [
6+
{
7+
"name": "commitTimestamp",
8+
"type": {
9+
"type": "long",
10+
"logicalType": "timestamp-millis"
11+
}
12+
}
13+
]
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"type": "record",
3+
"name": "UniquenessCheckResultTimeWindowOutOfBounds",
4+
"namespace": "net.corda.data.uniqueness",
5+
"fields": [
6+
{
7+
"name": "evaluationTimestamp",
8+
"type": {
9+
"type": "long",
10+
"logicalType": "timestamp-millis"
11+
}
12+
},
13+
{
14+
"name": "timeWindowLowerBound",
15+
"type": ["null", {
16+
"type": "long",
17+
"logicalType": "timestamp-millis"
18+
}]
19+
},
20+
{
21+
"name": "timeWindowUpperBound",
22+
"type": {
23+
"type": "long",
24+
"logicalType": "timestamp-millis"
25+
}
26+
}
27+
]
28+
}

0 commit comments

Comments
 (0)