diff --git a/lib/modules/blockchain/blockchain/src/dubp/check/local.rs b/lib/modules/blockchain/blockchain/src/dubp/check/local.rs index 6205fa614f3de5d97f347ea6fbe4c7903dedc73c..8a587db5f12797fa1a57c5a8d7ffde09a7de455c 100644 --- a/lib/modules/blockchain/blockchain/src/dubp/check/local.rs +++ b/lib/modules/blockchain/blockchain/src/dubp/check/local.rs @@ -26,7 +26,7 @@ use self::tx_doc::TransactionDocumentError; use dubp_block_doc::block::v10::BlockDocumentV10; use dubp_block_doc::{block::BlockDocumentTrait, BlockDocument}; use dubp_common_doc::errors::DocumentSigsErr; -use dubp_common_doc::traits::Document; +//use dubp_common_doc::traits::Document; use dubp_common_doc::BlockNumber; use dubp_currency_params::CurrencyParameters; @@ -45,13 +45,13 @@ pub enum LocalVerifyBlockError { /// Signature error _BlockSignatureError(DocumentSigsErr), /// Identity signature error - IdentitySignatureError(DocumentSigsErr), + _IdentitySignatureError(DocumentSigsErr), /// Joiner signature error - JoinerSignatureError(DocumentSigsErr), + _JoinerSignatureError(DocumentSigsErr), /// Active signature error - ActiveSignatureError(DocumentSigsErr), + _ActiveSignatureError(DocumentSigsErr), /// Leaver signature error - LeaverSignatureError(DocumentSigsErr), + _LeaverSignatureError(DocumentSigsErr), /// Missing issuer MissingIssuer, /// Too many issuers (> 1) @@ -123,10 +123,10 @@ pub fn verify_local_validity_block_v10( // As it has been checked that block.issuers.len() == 1 and as // block.issuers.len() == block.signatures.len() is check in block.verify_signatures() // there is no need to check that block.signatures.len() == 1 - // check bloc sig tmp disabled because #183 + // Temporary disabled due to #183 /*block .verify_signatures() - .map_err(LocalVerifyBlockError::BlockSignatureError)?;*/ + .map_err(LocalVerifyBlockError::BlockSignatureError)?; for identity in &block.identities { identity .verify_signatures() @@ -146,7 +146,7 @@ pub fn verify_local_validity_block_v10( leaver .verify_signatures() .map_err(LocalVerifyBlockError::LeaverSignatureError)?; - } + }*/ // Check transactions for tx in &block.transactions { diff --git a/lib/modules/blockchain/blockchain/src/dubp/check/local/tx_doc.rs b/lib/modules/blockchain/blockchain/src/dubp/check/local/tx_doc.rs index 9f0dd8f94dc819dfa9ddb45c86272a7913ee3fd1..faadb20b2724bf9875c900e303782fea3c05d255 100644 --- a/lib/modules/blockchain/blockchain/src/dubp/check/local/tx_doc.rs +++ b/lib/modules/blockchain/blockchain/src/dubp/check/local/tx_doc.rs @@ -17,7 +17,7 @@ use dubp_common_doc::errors::DocumentSigsErr; use dubp_common_doc::traits::text::CompactTextDocument; -use dubp_common_doc::traits::Document; +//use dubp_common_doc::traits::Document; use dubp_user_docs::documents::transaction::TransactionDocument; use durs_common_tools::traits::bool_ext::BoolExt; @@ -32,7 +32,7 @@ pub enum TransactionDocumentError { /// There is no input MissingInput, /// Signature error - TxSignatureError(DocumentSigsErr), + _TxSignatureError(DocumentSigsErr), } /// Local verification of a Tx Document @@ -46,23 +46,15 @@ pub fn local_verify_tx_doc(tx_doc: &TransactionDocument) -> Result<(), Transacti // A transaction must have at least 1 input (tx_doc.get_inputs().is_empty().not()).or_err(TransactionDocumentError::MissingInput)?; - // A transaction cannot have `SIG(INDEX)` unlocks with `INDEX >= ` issuers count. - // Question : règle à pas vérifier - /*if y.get_unlocks().len() >= y.issuers().len() { - return Err(TransactionDocumentError(SignatureIssuerError)); - }*/ - - // Signatures count must be the same as issuers count - // It's alreeady checked by `tx_doc.verify_signatures()` - //////////////////////////////////////////////////////////////////////////////////// // A transaction **must** have signatures matching its content **for each issuer** // Signatures are ordered by issuer // Signatures are made over the transaction's content, signatures excepted //////////////////////////////////////////////////////////////////////////////////// - tx_doc - .verify_signatures() - .map_err(TransactionDocumentError::TxSignatureError)?; + // Temporary disabled due to #183 + /*tx_doc + .verify_signatures() + .map_err(TransactionDocumentError::TxSignatureError)?;*/ Ok(()) } @@ -195,7 +187,7 @@ mod tests { assert_eq!(expected, actual); } - #[test] + /*#[test] fn test_tx_invalid_sig() { let blockstamp = blockstamp(); let issuers = issuers(); @@ -212,5 +204,5 @@ mod tests { )); let actual = local_verify_tx_doc(&tx); assert_eq!(expected, actual); - } + }*/ }