From b960dc8aaf238dd5cd0ecc1f275852206074b40d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= Date: Thu, 15 Feb 2024 14:49:47 +0000 Subject: [PATCH] removed 'SurpassedThreshold' message --- .../contract_traits/dkg_signing_client.rs | 12 +-- .../coconut-dkg/src/msg.rs | 2 - .../coconut-dkg/schema/nym-coconut-dkg.json | 82 ++++++++++++++++--- contracts/coconut-dkg/schema/raw/execute.json | 13 --- contracts/coconut-dkg/schema/raw/query.json | 29 +++++++ .../response_to_get_registered_dealer.json | 40 +++++++++ contracts/coconut-dkg/src/contract.rs | 1 - 7 files changed, 140 insertions(+), 39 deletions(-) create mode 100644 contracts/coconut-dkg/schema/raw/response_to_get_registered_dealer.json diff --git a/common/client-libs/validator-client/src/nyxd/contract_traits/dkg_signing_client.rs b/common/client-libs/validator-client/src/nyxd/contract_traits/dkg_signing_client.rs index a1249070cc..e347c86b0f 100644 --- a/common/client-libs/validator-client/src/nyxd/contract_traits/dkg_signing_client.rs +++ b/common/client-libs/validator-client/src/nyxd/contract_traits/dkg_signing_client.rs @@ -39,13 +39,6 @@ pub trait DkgSigningClient { .await } - async fn surpass_threshold(&self, fee: Option) -> Result { - let req = DkgExecuteMsg::SurpassedThreshold {}; - - self.execute_dkg_contract(fee, req, "surpass DKG threshold".to_string(), vec![]) - .await - } - async fn register_dealer( &self, bte_key: EncodedBTEPublicKeyWithProof, @@ -191,8 +184,8 @@ mod tests { } => client .submit_dealing_metadata(dealing_index, chunks, resharing, None) .ignore(), - DkgExecuteMsg::CommitDealingsChunk { chunk, resharing } => { - client.submit_dealing_chunk(chunk, resharing, None).ignore() + DkgExecuteMsg::CommitDealingsChunk { chunk } => { + client.submit_dealing_chunk(chunk, None).ignore() } DkgExecuteMsg::CommitVerificationKeyShare { share, resharing } => client .submit_verification_key_share(share, resharing, None) @@ -200,7 +193,6 @@ mod tests { DkgExecuteMsg::VerifyVerificationKeyShare { owner, resharing } => client .verify_verification_key_share(&owner.parse().unwrap(), resharing, None) .ignore(), - DkgExecuteMsg::SurpassedThreshold {} => client.surpass_threshold(None).ignore(), DkgExecuteMsg::AdvanceEpochState {} => client.advance_dkg_epoch_state(None).ignore(), }; } diff --git a/common/cosmwasm-smart-contracts/coconut-dkg/src/msg.rs b/common/cosmwasm-smart-contracts/coconut-dkg/src/msg.rs index 02274926e9..8874bce5cb 100644 --- a/common/cosmwasm-smart-contracts/coconut-dkg/src/msg.rs +++ b/common/cosmwasm-smart-contracts/coconut-dkg/src/msg.rs @@ -68,8 +68,6 @@ pub enum ExecuteMsg { resharing: bool, }, - SurpassedThreshold {}, - AdvanceEpochState {}, TriggerReset {}, diff --git a/contracts/coconut-dkg/schema/nym-coconut-dkg.json b/contracts/coconut-dkg/schema/nym-coconut-dkg.json index e6fca1f892..3f64c4f100 100644 --- a/contracts/coconut-dkg/schema/nym-coconut-dkg.json +++ b/contracts/coconut-dkg/schema/nym-coconut-dkg.json @@ -242,19 +242,6 @@ }, "additionalProperties": false }, - { - "type": "object", - "required": [ - "surpassed_threshold" - ], - "properties": { - "surpassed_threshold": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - }, { "type": "object", "required": [ @@ -387,6 +374,35 @@ }, "additionalProperties": false }, + { + "type": "object", + "required": [ + "get_registered_dealer" + ], + "properties": { + "get_registered_dealer": { + "type": "object", + "required": [ + "dealer_address" + ], + "properties": { + "dealer_address": { + "type": "string" + }, + "epoch_id": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, { "type": "object", "required": [ @@ -1594,6 +1610,46 @@ } } }, + "get_registered_dealer": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "RegisteredDealerDetails", + "type": "object", + "properties": { + "details": { + "anyOf": [ + { + "$ref": "#/definitions/DealerRegistrationDetails" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "DealerRegistrationDetails": { + "type": "object", + "required": [ + "announce_address", + "bte_public_key_with_proof", + "ed25519_identity" + ], + "properties": { + "announce_address": { + "type": "string" + }, + "bte_public_key_with_proof": { + "type": "string" + }, + "ed25519_identity": { + "type": "string" + } + }, + "additionalProperties": false + } + } + }, "get_state": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "State", diff --git a/contracts/coconut-dkg/schema/raw/execute.json b/contracts/coconut-dkg/schema/raw/execute.json index b1395d8c2e..34547d0026 100644 --- a/contracts/coconut-dkg/schema/raw/execute.json +++ b/contracts/coconut-dkg/schema/raw/execute.json @@ -153,19 +153,6 @@ }, "additionalProperties": false }, - { - "type": "object", - "required": [ - "surpassed_threshold" - ], - "properties": { - "surpassed_threshold": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - }, { "type": "object", "required": [ diff --git a/contracts/coconut-dkg/schema/raw/query.json b/contracts/coconut-dkg/schema/raw/query.json index d55ad0769c..714003786d 100644 --- a/contracts/coconut-dkg/schema/raw/query.json +++ b/contracts/coconut-dkg/schema/raw/query.json @@ -41,6 +41,35 @@ }, "additionalProperties": false }, + { + "type": "object", + "required": [ + "get_registered_dealer" + ], + "properties": { + "get_registered_dealer": { + "type": "object", + "required": [ + "dealer_address" + ], + "properties": { + "dealer_address": { + "type": "string" + }, + "epoch_id": { + "type": [ + "integer", + "null" + ], + "format": "uint64", + "minimum": 0.0 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, { "type": "object", "required": [ diff --git a/contracts/coconut-dkg/schema/raw/response_to_get_registered_dealer.json b/contracts/coconut-dkg/schema/raw/response_to_get_registered_dealer.json new file mode 100644 index 0000000000..8a70bb3ce4 --- /dev/null +++ b/contracts/coconut-dkg/schema/raw/response_to_get_registered_dealer.json @@ -0,0 +1,40 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "RegisteredDealerDetails", + "type": "object", + "properties": { + "details": { + "anyOf": [ + { + "$ref": "#/definitions/DealerRegistrationDetails" + }, + { + "type": "null" + } + ] + } + }, + "additionalProperties": false, + "definitions": { + "DealerRegistrationDetails": { + "type": "object", + "required": [ + "announce_address", + "bte_public_key_with_proof", + "ed25519_identity" + ], + "properties": { + "announce_address": { + "type": "string" + }, + "bte_public_key_with_proof": { + "type": "string" + }, + "ed25519_identity": { + "type": "string" + } + }, + "additionalProperties": false + } + } +} diff --git a/contracts/coconut-dkg/src/contract.rs b/contracts/coconut-dkg/src/contract.rs index 01a3d38303..b1926206c6 100644 --- a/contracts/coconut-dkg/src/contract.rs +++ b/contracts/coconut-dkg/src/contract.rs @@ -116,7 +116,6 @@ pub fn execute( ExecuteMsg::VerifyVerificationKeyShare { owner, resharing } => { try_verify_verification_key_share(deps, info, owner, resharing) } - ExecuteMsg::SurpassedThreshold {} => todo!(), ExecuteMsg::AdvanceEpochState {} => try_advance_epoch_state(deps, env), ExecuteMsg::TriggerReset {} => try_trigger_reset(deps, env, info), ExecuteMsg::TriggerResharing {} => try_trigger_resharing(deps, env, info),