Skip to content
Snippets Groups Projects
Commit 8b72d5b0 authored by Éloïs's avatar Éloïs
Browse files

[ref] dubp-block-doc: sign method not need ownership to signator

parent 119e8d0a
No related branches found
No related tags found
2 merge requests!232Elois/local validation,!221WIP: Resolve "Fail to revert block with transactions"
......@@ -90,7 +90,7 @@ pub trait BlockDocumentTrait {
/// Verify block hash
fn verify_hash(&self) -> Result<(), VerifyBlockHashError>;
/// Sign block
fn sign(&mut self, signator: SignatorEnum);
fn sign(&mut self, signator: &SignatorEnum);
}
impl BlockDocumentTrait for BlockDocument {
......@@ -209,7 +209,7 @@ impl BlockDocumentTrait for BlockDocument {
}
}
#[inline]
fn sign(&mut self, signator: SignatorEnum) {
fn sign(&mut self, signator: &SignatorEnum) {
match self {
BlockDocument::V10(block) => block.sign(signator),
}
......
......@@ -311,7 +311,7 @@ Transactions:{transactions}
i.reduce();
}
}
fn sign(&mut self, signator: SignatorEnum) {
fn sign(&mut self, signator: &SignatorEnum) {
self.signatures = vec![signator.sign(self.compute_will_signed_string().as_bytes())];
}
fn verify_inner_hash(&self) -> Result<(), VerifyBlockHashError> {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment