Skip to content

Commit

Permalink
regenerated DKG contract schema
Browse files Browse the repository at this point in the history
  • Loading branch information
jstuczyn committed Feb 6, 2024
1 parent 494ed92 commit eb76260
Show file tree
Hide file tree
Showing 8 changed files with 868 additions and 102 deletions.
462 changes: 393 additions & 69 deletions contracts/coconut-dkg/schema/nym-coconut-dkg.json

Large diffs are not rendered by default.

72 changes: 61 additions & 11 deletions contracts/coconut-dkg/schema/raw/execute.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -112,7 +146,7 @@
],
"properties": {
"owner": {
"$ref": "#/definitions/Addr"
"type": "string"
},
"resharing": {
"type": "boolean"
Expand Down Expand Up @@ -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": {
Expand All @@ -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
Expand Down
96 changes: 79 additions & 17 deletions contracts/coconut-dkg/schema/raw/query.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@
{
"type": "object",
"required": [
"get_dealing_status"
"get_dealings_metadata"
],
"properties": {
"get_dealing_status": {
"get_dealings_metadata": {
"type": "object",
"required": [
"dealer",
Expand Down Expand Up @@ -169,10 +169,37 @@
{
"type": "object",
"required": [
"get_dealing"
"get_dealer_dealings_status"
],
"properties": {
"get_dealing": {
"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": [
"get_dealing_status"
],
"properties": {
"get_dealing_status": {
"type": "object",
"required": [
"dealer",
Expand Down Expand Up @@ -202,38 +229,73 @@
{
"type": "object",
"required": [
"get_dealings"
"get_dealing_chunk_status"
],
"properties": {
"get_dealings": {
"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"
},
"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_dealing_chunk"
],
"properties": {
"get_dealing_chunk": {
"type": "object",
"required": [
"chunk_index",
"dealer",
"dealing_index",
"epoch_id"
],
"properties": {
"chunk_index": {
"type": "integer",
"format": "uint16",
"minimum": 0.0
},
"limit": {
"type": [
"integer",
"null"
],
"dealer": {
"type": "string"
},
"dealing_index": {
"type": "integer",
"format": "uint32",
"minimum": 0.0
},
"start_after": {
"type": [
"integer",
"null"
],
"format": "uint32",
"epoch_id": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -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
}
}
}
Original file line number Diff line number Diff line change
@@ -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
}
}
}
}
Loading

0 comments on commit eb76260

Please sign in to comment.