Skip to content

Commit

Permalink
chore(dpp): fix features
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed Nov 14, 2024
1 parent ae22fb8 commit 6164e1b
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions packages/rs-dpp/src/signing.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
use crate::bls_signatures::{Bls12381G2Impl, Pairing};
#[cfg(feature = "message-signature-verification")]
use crate::consensus::signature::{
BasicBLSError, BasicECDSAError, SignatureError, SignatureShouldNotBePresentError,
};
use crate::identity::KeyType;
use crate::serialization::PlatformMessageSignable;
#[cfg(feature = "message-signature-verification")]
use crate::validation::SimpleConsensusValidationResult;
use crate::{
consensus::signature::{
BasicBLSError, BasicECDSAError, SignatureError, SignatureShouldNotBePresentError,
},
validation::SimpleConsensusValidationResult,
};
#[cfg(feature = "message-signing")]
use crate::{BlsModule, ProtocolError};
use dashcore::blsful::Signature;
use dashcore::{blsful as bls_signatures, signer};
use dashcore::signer;
#[cfg(feature = "bls-signatures")]
use {
crate::bls_signatures::{Bls12381G2Impl, Pairing},
dashcore::{blsful as bls_signatures, blsful::Signature},
};

impl PlatformMessageSignable for &[u8] {
#[cfg(feature = "message-signature-verification")]
Expand Down Expand Up @@ -67,7 +71,7 @@ impl PlatformMessageSignable for &[u8] {
.expect("G2 projective");
let signature = Signature::<Bls12381G2Impl>::Basic(g2);

if !signature.verify(&public_key, signable_data).is_ok() {
if signature.verify(&public_key, signable_data).is_err() {
SimpleConsensusValidationResult::new_with_error(
SignatureError::BasicBLSError(BasicBLSError::new(
"bls signature was incorrect".to_string(),
Expand Down

0 comments on commit 6164e1b

Please sign in to comment.