From bb71da55e874813dce58a57bcefa8c9206b0dc0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= Date: Tue, 6 Feb 2024 09:39:42 +0000 Subject: [PATCH] regenerated DKG contract schema --- .../coconut-dkg/schema/nym-coconut-dkg.json | 516 ++++++++++++++---- contracts/coconut-dkg/schema/raw/execute.json | 72 ++- contracts/coconut-dkg/schema/raw/query.json | 102 +++- ...esponse_to_get_dealer_dealings_status.json | 74 +++ .../raw/response_to_get_dealing_chunk.json | 56 ++ .../response_to_get_dealing_chunk_status.json | 56 ++ .../raw/response_to_get_dealing_status.json | 47 +- .../response_to_get_dealings_metadata.json | 107 ++++ 8 files changed, 898 insertions(+), 132 deletions(-) create mode 100644 contracts/coconut-dkg/schema/raw/response_to_get_dealer_dealings_status.json create mode 100644 contracts/coconut-dkg/schema/raw/response_to_get_dealing_chunk.json create mode 100644 contracts/coconut-dkg/schema/raw/response_to_get_dealing_chunk_status.json create mode 100644 contracts/coconut-dkg/schema/raw/response_to_get_dealings_metadata.json diff --git a/contracts/coconut-dkg/schema/nym-coconut-dkg.json b/contracts/coconut-dkg/schema/nym-coconut-dkg.json index 48cc7943d2..65aee28825 100644 --- a/contracts/coconut-dkg/schema/nym-coconut-dkg.json +++ b/contracts/coconut-dkg/schema/nym-coconut-dkg.json @@ -140,17 +140,51 @@ { "type": "object", "required": [ - "commit_dealing" + "commit_dealings_metadata" ], "properties": { - "commit_dealing": { + "commit_dealings_metadata": { "type": "object", "required": [ - "dealing", + "chunks", + "dealing_index", "resharing" ], "properties": { - "dealing": { + "chunks": { + "type": "array", + "items": { + "$ref": "#/definitions/DealingChunkInfo" + } + }, + "dealing_index": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "resharing": { + "type": "boolean" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "commit_dealings_chunk" + ], + "properties": { + "commit_dealings_chunk": { + "type": "object", + "required": [ + "chunk", + "resharing" + ], + "properties": { + "chunk": { "$ref": "#/definitions/PartialContractDealing" }, "resharing": { @@ -201,7 +235,7 @@ ], "properties": { "owner": { - "$ref": "#/definitions/Addr" + "type": "string" }, "resharing": { "type": "boolean" @@ -240,10 +274,6 @@ } ], "definitions": { - "Addr": { - "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", - "type": "string" - }, "ContractSafeBytes": { "type": "array", "items": { @@ -252,17 +282,37 @@ "minimum": 0.0 } }, + "DealingChunkInfo": { + "type": "object", + "required": [ + "size" + ], + "properties": { + "size": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, "PartialContractDealing": { "type": "object", "required": [ + "chunk_index", "data", - "index" + "dealing_index" ], "properties": { + "chunk_index": { + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, "data": { "$ref": "#/definitions/ContractSafeBytes" }, - "index": { + "dealing_index": { "type": "integer", "format": "uint32", "minimum": 0.0 @@ -407,6 +457,66 @@ }, "additionalProperties": false }, + { + "type": "object", + "required": [ + "get_dealings_metadata" + ], + "properties": { + "get_dealings_metadata": { + "type": "object", + "required": [ + "dealer", + "dealing_index", + "epoch_id" + ], + "properties": { + "dealer": { + "type": "string" + }, + "dealing_index": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "epoch_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "get_dealer_dealings_status" + ], + "properties": { + "get_dealer_dealings_status": { + "type": "object", + "required": [ + "dealer", + "epoch_id" + ], + "properties": { + "dealer": { + "type": "string" + }, + "epoch_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, { "type": "object", "required": [ @@ -443,17 +553,23 @@ { "type": "object", "required": [ - "get_dealing" + "get_dealing_chunk_status" ], "properties": { - "get_dealing": { + "get_dealing_chunk_status": { "type": "object", "required": [ + "chunk_index", "dealer", "dealing_index", "epoch_id" ], "properties": { + "chunk_index": { + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, "dealer": { "type": "string" }, @@ -476,39 +592,35 @@ { "type": "object", "required": [ - "get_dealings" + "get_dealing_chunk" ], "properties": { - "get_dealings": { + "get_dealing_chunk": { "type": "object", "required": [ + "chunk_index", "dealer", + "dealing_index", "epoch_id" ], "properties": { + "chunk_index": { + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, "dealer": { "type": "string" }, + "dealing_index": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, "epoch_id": { "type": "integer", "format": "uint64", "minimum": 0.0 - }, - "limit": { - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0.0 - }, - "start_after": { - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0.0 } }, "additionalProperties": false @@ -909,6 +1021,80 @@ "format": "uint64", "minimum": 0.0 }, + "get_dealer_dealings_status": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "DealerDealingsStatusResponse", + "type": "object", + "required": [ + "all_dealings_fully_submitted", + "dealer", + "dealing_submission_status", + "epoch_id" + ], + "properties": { + "all_dealings_fully_submitted": { + "type": "boolean" + }, + "dealer": { + "$ref": "#/definitions/Addr" + }, + "dealing_submission_status": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/DealingStatus" + } + }, + "epoch_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "ChunkSubmissionStatus": { + "type": "object", + "properties": { + "submission_height": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + "DealingStatus": { + "type": "object", + "required": [ + "chunk_submission_status", + "fully_submitted", + "has_metadata" + ], + "properties": { + "chunk_submission_status": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ChunkSubmissionStatus" + } + }, + "fully_submitted": { + "type": "boolean" + }, + "has_metadata": { + "type": "boolean" + } + }, + "additionalProperties": false + } + } + }, "get_dealer_details": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "DealerDetailsResponse", @@ -977,20 +1163,18 @@ } } }, - "get_dealing": { + "get_dealing_chunk": { "$schema": "http://json-schema.org/draft-07/schema#", - "title": "DealingResponse", + "title": "DealingChunkResponse", "type": "object", "required": [ + "chunk_index", "dealer", "dealing_index", "epoch_id" ], "properties": { - "dealer": { - "$ref": "#/definitions/Addr" - }, - "dealing": { + "chunk": { "anyOf": [ { "$ref": "#/definitions/ContractSafeBytes" @@ -1000,6 +1184,14 @@ } ] }, + "chunk_index": { + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "dealer": { + "$ref": "#/definitions/Addr" + }, "dealing_index": { "type": "integer", "format": "uint32", @@ -1027,6 +1219,62 @@ } } }, + "get_dealing_chunk_status": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "DealingChunkStatusResponse", + "type": "object", + "required": [ + "chunk_index", + "dealer", + "dealing_index", + "epoch_id", + "status" + ], + "properties": { + "chunk_index": { + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "dealer": { + "$ref": "#/definitions/Addr" + }, + "dealing_index": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "epoch_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "status": { + "$ref": "#/definitions/ChunkSubmissionStatus" + } + }, + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "ChunkSubmissionStatus": { + "type": "object", + "properties": { + "submission_height": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + } + }, "get_dealing_status": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "DealingStatusResponse", @@ -1034,7 +1282,79 @@ "required": [ "dealer", "dealing_index", - "dealing_submitted", + "epoch_id", + "status" + ], + "properties": { + "dealer": { + "$ref": "#/definitions/Addr" + }, + "dealing_index": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "epoch_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "status": { + "$ref": "#/definitions/DealingStatus" + } + }, + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "ChunkSubmissionStatus": { + "type": "object", + "properties": { + "submission_height": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + "DealingStatus": { + "type": "object", + "required": [ + "chunk_submission_status", + "fully_submitted", + "has_metadata" + ], + "properties": { + "chunk_submission_status": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ChunkSubmissionStatus" + } + }, + "fully_submitted": { + "type": "boolean" + }, + "has_metadata": { + "type": "boolean" + } + }, + "additionalProperties": false + } + } + }, + "get_dealings_metadata": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "DealingMetadataResponse", + "type": "object", + "required": [ + "dealer", + "dealing_index", "epoch_id" ], "properties": { @@ -1046,55 +1366,20 @@ "format": "uint32", "minimum": 0.0 }, - "dealing_submitted": { - "type": "boolean" - }, - "epoch_id": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 - } - }, - "additionalProperties": false, - "definitions": { - "Addr": { - "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", - "type": "string" - } - } - }, - "get_dealings": { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "PagedDealingsResponse", - "type": "object", - "required": [ - "dealer", - "dealings", - "epoch_id" - ], - "properties": { - "dealer": { - "$ref": "#/definitions/Addr" - }, - "dealings": { - "type": "array", - "items": { - "$ref": "#/definitions/PartialContractDealing" - } - }, "epoch_id": { "type": "integer", "format": "uint64", "minimum": 0.0 }, - "start_next_after": { - "description": "Field indicating paging information for the following queries if the caller wishes to get further entries.", - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0.0 + "metadata": { + "anyOf": [ + { + "$ref": "#/definitions/DealingMetadata" + }, + { + "type": "null" + } + ] } }, "additionalProperties": false, @@ -1103,28 +1388,67 @@ "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", "type": "string" }, - "ContractSafeBytes": { - "type": "array", - "items": { - "type": "integer", - "format": "uint8", - "minimum": 0.0 - } + "ChunkSubmissionStatus": { + "type": "object", + "properties": { + "submission_height": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false }, - "PartialContractDealing": { + "DealingChunkInfo": { "type": "object", "required": [ - "data", - "index" + "size" ], "properties": { - "data": { - "$ref": "#/definitions/ContractSafeBytes" - }, - "index": { + "size": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + "DealingMetadata": { + "type": "object", + "required": [ + "dealing_index", + "submitted_chunks" + ], + "properties": { + "dealing_index": { "type": "integer", "format": "uint32", "minimum": 0.0 + }, + "submitted_chunks": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/SubmittedChunk" + } + } + }, + "additionalProperties": false + }, + "SubmittedChunk": { + "type": "object", + "required": [ + "info", + "status" + ], + "properties": { + "info": { + "$ref": "#/definitions/DealingChunkInfo" + }, + "status": { + "$ref": "#/definitions/ChunkSubmissionStatus" } }, "additionalProperties": false diff --git a/contracts/coconut-dkg/schema/raw/execute.json b/contracts/coconut-dkg/schema/raw/execute.json index fb2dfb02bd..d0e9ccdd1f 100644 --- a/contracts/coconut-dkg/schema/raw/execute.json +++ b/contracts/coconut-dkg/schema/raw/execute.json @@ -51,17 +51,51 @@ { "type": "object", "required": [ - "commit_dealing" + "commit_dealings_metadata" ], "properties": { - "commit_dealing": { + "commit_dealings_metadata": { "type": "object", "required": [ - "dealing", + "chunks", + "dealing_index", "resharing" ], "properties": { - "dealing": { + "chunks": { + "type": "array", + "items": { + "$ref": "#/definitions/DealingChunkInfo" + } + }, + "dealing_index": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "resharing": { + "type": "boolean" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "commit_dealings_chunk" + ], + "properties": { + "commit_dealings_chunk": { + "type": "object", + "required": [ + "chunk", + "resharing" + ], + "properties": { + "chunk": { "$ref": "#/definitions/PartialContractDealing" }, "resharing": { @@ -112,7 +146,7 @@ ], "properties": { "owner": { - "$ref": "#/definitions/Addr" + "type": "string" }, "resharing": { "type": "boolean" @@ -151,10 +185,6 @@ } ], "definitions": { - "Addr": { - "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", - "type": "string" - }, "ContractSafeBytes": { "type": "array", "items": { @@ -163,17 +193,37 @@ "minimum": 0.0 } }, + "DealingChunkInfo": { + "type": "object", + "required": [ + "size" + ], + "properties": { + "size": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, "PartialContractDealing": { "type": "object", "required": [ + "chunk_index", "data", - "index" + "dealing_index" ], "properties": { + "chunk_index": { + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, "data": { "$ref": "#/definitions/ContractSafeBytes" }, - "index": { + "dealing_index": { "type": "integer", "format": "uint32", "minimum": 0.0 diff --git a/contracts/coconut-dkg/schema/raw/query.json b/contracts/coconut-dkg/schema/raw/query.json index 026389c764..96f50233dd 100644 --- a/contracts/coconut-dkg/schema/raw/query.json +++ b/contracts/coconut-dkg/schema/raw/query.json @@ -133,6 +133,66 @@ }, "additionalProperties": false }, + { + "type": "object", + "required": [ + "get_dealings_metadata" + ], + "properties": { + "get_dealings_metadata": { + "type": "object", + "required": [ + "dealer", + "dealing_index", + "epoch_id" + ], + "properties": { + "dealer": { + "type": "string" + }, + "dealing_index": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "epoch_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "get_dealer_dealings_status" + ], + "properties": { + "get_dealer_dealings_status": { + "type": "object", + "required": [ + "dealer", + "epoch_id" + ], + "properties": { + "dealer": { + "type": "string" + }, + "epoch_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, { "type": "object", "required": [ @@ -169,17 +229,23 @@ { "type": "object", "required": [ - "get_dealing" + "get_dealing_chunk_status" ], "properties": { - "get_dealing": { + "get_dealing_chunk_status": { "type": "object", "required": [ + "chunk_index", "dealer", "dealing_index", "epoch_id" ], "properties": { + "chunk_index": { + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, "dealer": { "type": "string" }, @@ -202,39 +268,35 @@ { "type": "object", "required": [ - "get_dealings" + "get_dealing_chunk" ], "properties": { - "get_dealings": { + "get_dealing_chunk": { "type": "object", "required": [ + "chunk_index", "dealer", + "dealing_index", "epoch_id" ], "properties": { + "chunk_index": { + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, "dealer": { "type": "string" }, + "dealing_index": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, "epoch_id": { "type": "integer", "format": "uint64", "minimum": 0.0 - }, - "limit": { - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0.0 - }, - "start_after": { - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0.0 } }, "additionalProperties": false diff --git a/contracts/coconut-dkg/schema/raw/response_to_get_dealer_dealings_status.json b/contracts/coconut-dkg/schema/raw/response_to_get_dealer_dealings_status.json new file mode 100644 index 0000000000..0422d9506b --- /dev/null +++ b/contracts/coconut-dkg/schema/raw/response_to_get_dealer_dealings_status.json @@ -0,0 +1,74 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "DealerDealingsStatusResponse", + "type": "object", + "required": [ + "all_dealings_fully_submitted", + "dealer", + "dealing_submission_status", + "epoch_id" + ], + "properties": { + "all_dealings_fully_submitted": { + "type": "boolean" + }, + "dealer": { + "$ref": "#/definitions/Addr" + }, + "dealing_submission_status": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/DealingStatus" + } + }, + "epoch_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "ChunkSubmissionStatus": { + "type": "object", + "properties": { + "submission_height": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + "DealingStatus": { + "type": "object", + "required": [ + "chunk_submission_status", + "fully_submitted", + "has_metadata" + ], + "properties": { + "chunk_submission_status": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ChunkSubmissionStatus" + } + }, + "fully_submitted": { + "type": "boolean" + }, + "has_metadata": { + "type": "boolean" + } + }, + "additionalProperties": false + } + } +} diff --git a/contracts/coconut-dkg/schema/raw/response_to_get_dealing_chunk.json b/contracts/coconut-dkg/schema/raw/response_to_get_dealing_chunk.json new file mode 100644 index 0000000000..8006bf8845 --- /dev/null +++ b/contracts/coconut-dkg/schema/raw/response_to_get_dealing_chunk.json @@ -0,0 +1,56 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "DealingChunkResponse", + "type": "object", + "required": [ + "chunk_index", + "dealer", + "dealing_index", + "epoch_id" + ], + "properties": { + "chunk": { + "anyOf": [ + { + "$ref": "#/definitions/ContractSafeBytes" + }, + { + "type": "null" + } + ] + }, + "chunk_index": { + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "dealer": { + "$ref": "#/definitions/Addr" + }, + "dealing_index": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "epoch_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "ContractSafeBytes": { + "type": "array", + "items": { + "type": "integer", + "format": "uint8", + "minimum": 0.0 + } + } + } +} diff --git a/contracts/coconut-dkg/schema/raw/response_to_get_dealing_chunk_status.json b/contracts/coconut-dkg/schema/raw/response_to_get_dealing_chunk_status.json new file mode 100644 index 0000000000..a278e4622d --- /dev/null +++ b/contracts/coconut-dkg/schema/raw/response_to_get_dealing_chunk_status.json @@ -0,0 +1,56 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "DealingChunkStatusResponse", + "type": "object", + "required": [ + "chunk_index", + "dealer", + "dealing_index", + "epoch_id", + "status" + ], + "properties": { + "chunk_index": { + "type": "integer", + "format": "uint16", + "minimum": 0.0 + }, + "dealer": { + "$ref": "#/definitions/Addr" + }, + "dealing_index": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "epoch_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "status": { + "$ref": "#/definitions/ChunkSubmissionStatus" + } + }, + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "ChunkSubmissionStatus": { + "type": "object", + "properties": { + "submission_height": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + } +} diff --git a/contracts/coconut-dkg/schema/raw/response_to_get_dealing_status.json b/contracts/coconut-dkg/schema/raw/response_to_get_dealing_status.json index 376a668683..c3a428dd14 100644 --- a/contracts/coconut-dkg/schema/raw/response_to_get_dealing_status.json +++ b/contracts/coconut-dkg/schema/raw/response_to_get_dealing_status.json @@ -5,8 +5,8 @@ "required": [ "dealer", "dealing_index", - "dealing_submitted", - "epoch_id" + "epoch_id", + "status" ], "properties": { "dealer": { @@ -17,13 +17,13 @@ "format": "uint32", "minimum": 0.0 }, - "dealing_submitted": { - "type": "boolean" - }, "epoch_id": { "type": "integer", "format": "uint64", "minimum": 0.0 + }, + "status": { + "$ref": "#/definitions/DealingStatus" } }, "additionalProperties": false, @@ -31,6 +31,43 @@ "Addr": { "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", "type": "string" + }, + "ChunkSubmissionStatus": { + "type": "object", + "properties": { + "submission_height": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + "DealingStatus": { + "type": "object", + "required": [ + "chunk_submission_status", + "fully_submitted", + "has_metadata" + ], + "properties": { + "chunk_submission_status": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/ChunkSubmissionStatus" + } + }, + "fully_submitted": { + "type": "boolean" + }, + "has_metadata": { + "type": "boolean" + } + }, + "additionalProperties": false } } } diff --git a/contracts/coconut-dkg/schema/raw/response_to_get_dealings_metadata.json b/contracts/coconut-dkg/schema/raw/response_to_get_dealings_metadata.json new file mode 100644 index 0000000000..1d51549fb3 --- /dev/null +++ b/contracts/coconut-dkg/schema/raw/response_to_get_dealings_metadata.json @@ -0,0 +1,107 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "DealingMetadataResponse", + "type": "object", + "required": [ + "dealer", + "dealing_index", + "epoch_id" + ], + "properties": { + "dealer": { + "$ref": "#/definitions/Addr" + }, + "dealing_index": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "epoch_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "metadata": { + "anyOf": [ + { + "$ref": "#/definitions/DealingMetadata" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "ChunkSubmissionStatus": { + "type": "object", + "properties": { + "submission_height": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + "DealingChunkInfo": { + "type": "object", + "required": [ + "size" + ], + "properties": { + "size": { + "type": "integer", + "format": "uint", + "minimum": 0.0 + } + }, + "additionalProperties": false + }, + "DealingMetadata": { + "type": "object", + "required": [ + "dealing_index", + "submitted_chunks" + ], + "properties": { + "dealing_index": { + "type": "integer", + "format": "uint32", + "minimum": 0.0 + }, + "submitted_chunks": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/SubmittedChunk" + } + } + }, + "additionalProperties": false + }, + "SubmittedChunk": { + "type": "object", + "required": [ + "info", + "status" + ], + "properties": { + "info": { + "$ref": "#/definitions/DealingChunkInfo" + }, + "status": { + "$ref": "#/definitions/ChunkSubmissionStatus" + } + }, + "additionalProperties": false + } + } +}