Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Dunitrust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
nodes
rust
Dunitrust
Commits
427f93bd
Commit
427f93bd
authored
5 years ago
by
Éloïs
Browse files
Options
Downloads
Patches
Plain Diff
[fix] bc: temporary skip check user docs sig due to #183
parent
998337e4
No related branches found
No related tags found
1 merge request
!235
Elois/engine
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/modules/blockchain/blockchain/src/dubp/check/local.rs
+8
-8
8 additions, 8 deletions
lib/modules/blockchain/blockchain/src/dubp/check/local.rs
lib/modules/blockchain/blockchain/src/dubp/check/local/tx_doc.rs
+8
-16
8 additions, 16 deletions
...ules/blockchain/blockchain/src/dubp/check/local/tx_doc.rs
with
16 additions
and
24 deletions
lib/modules/blockchain/blockchain/src/dubp/check/local.rs
+
8
−
8
View file @
427f93bd
...
@@ -26,7 +26,7 @@ use self::tx_doc::TransactionDocumentError;
...
@@ -26,7 +26,7 @@ use self::tx_doc::TransactionDocumentError;
use
dubp_block_doc
::
block
::
v10
::
BlockDocumentV10
;
use
dubp_block_doc
::
block
::
v10
::
BlockDocumentV10
;
use
dubp_block_doc
::{
block
::
BlockDocumentTrait
,
BlockDocument
};
use
dubp_block_doc
::{
block
::
BlockDocumentTrait
,
BlockDocument
};
use
dubp_common_doc
::
errors
::
DocumentSigsErr
;
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_common_doc
::
BlockNumber
;
use
dubp_currency_params
::
CurrencyParameters
;
use
dubp_currency_params
::
CurrencyParameters
;
...
@@ -45,13 +45,13 @@ pub enum LocalVerifyBlockError {
...
@@ -45,13 +45,13 @@ pub enum LocalVerifyBlockError {
/// Signature error
/// Signature error
_BlockSignatureError
(
DocumentSigsErr
),
_BlockSignatureError
(
DocumentSigsErr
),
/// Identity signature error
/// Identity signature error
IdentitySignatureError
(
DocumentSigsErr
),
_
IdentitySignatureError
(
DocumentSigsErr
),
/// Joiner signature error
/// Joiner signature error
JoinerSignatureError
(
DocumentSigsErr
),
_
JoinerSignatureError
(
DocumentSigsErr
),
/// Active signature error
/// Active signature error
ActiveSignatureError
(
DocumentSigsErr
),
_
ActiveSignatureError
(
DocumentSigsErr
),
/// Leaver signature error
/// Leaver signature error
LeaverSignatureError
(
DocumentSigsErr
),
_
LeaverSignatureError
(
DocumentSigsErr
),
/// Missing issuer
/// Missing issuer
MissingIssuer
,
MissingIssuer
,
/// Too many issuers (> 1)
/// Too many issuers (> 1)
...
@@ -123,10 +123,10 @@ pub fn verify_local_validity_block_v10(
...
@@ -123,10 +123,10 @@ pub fn verify_local_validity_block_v10(
// As it has been checked that block.issuers.len() == 1 and as
// As it has been checked that block.issuers.len() == 1 and as
// block.issuers.len() == block.signatures.len() is check in block.verify_signatures()
// block.issuers.len() == block.signatures.len() is check in block.verify_signatures()
// there is no need to check that block.signatures.len() == 1
// there is no need to check that block.signatures.len() == 1
//
check bloc sig tmp
disabled
because
#183
//
Temporary
disabled
due to
#183
/*block
/*block
.verify_signatures()
.verify_signatures()
.map_err(LocalVerifyBlockError::BlockSignatureError)?;
*/
.map_err(LocalVerifyBlockError::BlockSignatureError)?;
for identity in &block.identities {
for identity in &block.identities {
identity
identity
.verify_signatures()
.verify_signatures()
...
@@ -146,7 +146,7 @@ pub fn verify_local_validity_block_v10(
...
@@ -146,7 +146,7 @@ pub fn verify_local_validity_block_v10(
leaver
leaver
.verify_signatures()
.verify_signatures()
.map_err(LocalVerifyBlockError::LeaverSignatureError)?;
.map_err(LocalVerifyBlockError::LeaverSignatureError)?;
}
}
*/
// Check transactions
// Check transactions
for
tx
in
&
block
.transactions
{
for
tx
in
&
block
.transactions
{
...
...
This diff is collapsed.
Click to expand it.
lib/modules/blockchain/blockchain/src/dubp/check/local/tx_doc.rs
+
8
−
16
View file @
427f93bd
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
use
dubp_common_doc
::
errors
::
DocumentSigsErr
;
use
dubp_common_doc
::
errors
::
DocumentSigsErr
;
use
dubp_common_doc
::
traits
::
text
::
CompactTextDocument
;
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
dubp_user_docs
::
documents
::
transaction
::
TransactionDocument
;
use
durs_common_tools
::
traits
::
bool_ext
::
BoolExt
;
use
durs_common_tools
::
traits
::
bool_ext
::
BoolExt
;
...
@@ -32,7 +32,7 @@ pub enum TransactionDocumentError {
...
@@ -32,7 +32,7 @@ pub enum TransactionDocumentError {
/// There is no input
/// There is no input
MissingInput
,
MissingInput
,
/// Signature error
/// Signature error
TxSignatureError
(
DocumentSigsErr
),
_
TxSignatureError
(
DocumentSigsErr
),
}
}
/// Local verification of a Tx Document
/// Local verification of a Tx Document
...
@@ -46,23 +46,15 @@ pub fn local_verify_tx_doc(tx_doc: &TransactionDocument) -> Result<(), Transacti
...
@@ -46,23 +46,15 @@ pub fn local_verify_tx_doc(tx_doc: &TransactionDocument) -> Result<(), Transacti
// A transaction must have at least 1 input
// A transaction must have at least 1 input
(
tx_doc
.get_inputs
()
.is_empty
()
.not
())
.or_err
(
TransactionDocumentError
::
MissingInput
)
?
;
(
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**
// A transaction **must** have signatures matching its content **for each issuer**
// Signatures are ordered by issuer
// Signatures are ordered by issuer
// Signatures are made over the transaction's content, signatures excepted
// Signatures are made over the transaction's content, signatures excepted
////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////
tx_doc
// Temporary disabled due to #183
/*tx_doc
.verify_signatures()
.verify_signatures()
.map_err
(
TransactionDocumentError
::
TxSignatureError
)
?
;
.map_err(TransactionDocumentError::TxSignatureError)?;
*/
Ok
(())
Ok
(())
}
}
...
@@ -195,7 +187,7 @@ mod tests {
...
@@ -195,7 +187,7 @@ mod tests {
assert_eq!
(
expected
,
actual
);
assert_eq!
(
expected
,
actual
);
}
}
#[test]
/*
#[test]
fn test_tx_invalid_sig() {
fn test_tx_invalid_sig() {
let blockstamp = blockstamp();
let blockstamp = blockstamp();
let issuers = issuers();
let issuers = issuers();
...
@@ -212,5 +204,5 @@ mod tests {
...
@@ -212,5 +204,5 @@ mod tests {
));
));
let actual = local_verify_tx_doc(&tx);
let actual = local_verify_tx_doc(&tx);
assert_eq!(expected, actual);
assert_eq!(expected, actual);
}
}
*/
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment