diff --git a/common/cosmwasm-smart-contracts/coconut-dkg/src/types.rs b/common/cosmwasm-smart-contracts/coconut-dkg/src/types.rs index 43192e9622..f63fb39736 100644 --- a/common/cosmwasm-smart-contracts/coconut-dkg/src/types.rs +++ b/common/cosmwasm-smart-contracts/coconut-dkg/src/types.rs @@ -328,4 +328,8 @@ impl EpochState { pub fn is_dealing_exchange(&self) -> bool { matches!(self, EpochState::DealingExchange { .. }) } + + pub fn is_waiting_initialisation(&self) -> bool { + matches!(self, EpochState::WaitingInitialisation) + } } diff --git a/common/credentials/src/coconut/bandwidth/voucher.rs b/common/credentials/src/coconut/bandwidth/voucher.rs index acce944fae..b65b96491a 100644 --- a/common/credentials/src/coconut/bandwidth/voucher.rs +++ b/common/credentials/src/coconut/bandwidth/voucher.rs @@ -6,7 +6,7 @@ use crate::coconut::utils::scalar_serde_helper; use crate::error::Error; use nym_api_requests::coconut::BlindSignRequestBody; use nym_credentials_interface::{ - hash_to_scalar, Attribute, BlindSignRequest, BlindedSignature, PublicAttribute, + hash_to_scalar, Attribute, BlindSignRequest, BlindedSignature, CredentialType, PublicAttribute, }; use nym_crypto::asymmetric::{encryption, identity}; use nym_validator_client::nyxd::{Coin, Hash}; @@ -123,6 +123,10 @@ impl BandwidthVoucherIssuanceData { &self.value_prehashed } + pub fn typ() -> CredentialType { + CredentialType::Voucher + } + pub fn tx_hash(&self) -> Hash { self.deposit_tx_hash } diff --git a/common/nymcoconut/src/scheme/issuance.rs b/common/nymcoconut/src/scheme/issuance.rs index 1582a55e98..3779e377d6 100644 --- a/common/nymcoconut/src/scheme/issuance.rs +++ b/common/nymcoconut/src/scheme/issuance.rs @@ -157,6 +157,10 @@ impl BlindSignRequest { ) } + pub fn verify_commitment_hash(&self, public_attributes: &[&Attribute]) -> bool { + self.commitment_hash == compute_hash(self.commitment, public_attributes) + } + pub fn get_commitment_hash(&self) -> G1Projective { self.commitment_hash } diff --git a/common/nyxd-scraper/src/block_processor/mod.rs b/common/nyxd-scraper/src/block_processor/mod.rs index e6af88cdda..2b1748b633 100644 --- a/common/nyxd-scraper/src/block_processor/mod.rs +++ b/common/nyxd-scraper/src/block_processor/mod.rs @@ -249,7 +249,7 @@ impl BlockProcessor { match to_prune { v if v > 1000 => warn!("approximately {v} blocks worth of data will be pruned"), v if v > 100 => info!("approximately {v} blocks worth of data will be pruned"), - v if v == 0 => trace!("no blocks to prune"), + 0 => trace!("no blocks to prune"), v => debug!("approximately {v} blocks worth of data will be pruned"), }