From 3b39ec4b28c6ece841aebc5c2b5b0ec20ec28f7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= Date: Thu, 4 Jan 2024 14:21:19 +0000 Subject: [PATCH] schema --- .../coconut-dkg/schema/nym-coconut-dkg.json | 69 +++++++++++++++++++ contracts/coconut-dkg/schema/raw/query.json | 33 +++++++++ .../raw/response_to_get_dealing_status.json | 36 ++++++++++ 3 files changed, 138 insertions(+) create mode 100644 contracts/coconut-dkg/schema/raw/response_to_get_dealing_status.json diff --git a/contracts/coconut-dkg/schema/nym-coconut-dkg.json b/contracts/coconut-dkg/schema/nym-coconut-dkg.json index e2bf961954..3f18d5239c 100644 --- a/contracts/coconut-dkg/schema/nym-coconut-dkg.json +++ b/contracts/coconut-dkg/schema/nym-coconut-dkg.json @@ -390,6 +390,39 @@ }, "additionalProperties": false }, + { + "type": "object", + "required": [ + "get_dealing_status" + ], + "properties": { + "get_dealing_status": { + "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": [ @@ -901,6 +934,42 @@ } } }, + "get_dealing_status": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "DealingStatusResponse", + "type": "object", + "required": [ + "dealer", + "dealing_index", + "dealing_submitted", + "epoch_id" + ], + "properties": { + "dealer": { + "$ref": "#/definitions/Addr" + }, + "dealing_index": { + "type": "integer", + "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", diff --git a/contracts/coconut-dkg/schema/raw/query.json b/contracts/coconut-dkg/schema/raw/query.json index f42e7a980b..ddb6b4c63c 100644 --- a/contracts/coconut-dkg/schema/raw/query.json +++ b/contracts/coconut-dkg/schema/raw/query.json @@ -133,6 +133,39 @@ }, "additionalProperties": false }, + { + "type": "object", + "required": [ + "get_dealing_status" + ], + "properties": { + "get_dealing_status": { + "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": [ 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 new file mode 100644 index 0000000000..376a668683 --- /dev/null +++ b/contracts/coconut-dkg/schema/raw/response_to_get_dealing_status.json @@ -0,0 +1,36 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "DealingStatusResponse", + "type": "object", + "required": [ + "dealer", + "dealing_index", + "dealing_submitted", + "epoch_id" + ], + "properties": { + "dealer": { + "$ref": "#/definitions/Addr" + }, + "dealing_index": { + "type": "integer", + "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" + } + } +}