Move the cryptographic hash to newly created pallas-crypto
This commit is contained in:
parent
9c4d41e711
commit
57d6791096
15 changed files with 309 additions and 71 deletions
|
|
@ -25,4 +25,4 @@ cryptoxide = "0.3.6"
|
|||
env_logger = "0.9.0"
|
||||
pallas-handshake = { version = "0.3.0", path = "../pallas-handshake/" }
|
||||
pallas-txsubmission = { version = "0.3.0", path = "../pallas-txsubmission/" }
|
||||
pallas-alonzo = { version = "0.3.0", path = "../pallas-alonzo/", features = ["crypto"] }
|
||||
pallas-alonzo = { version = "0.3.0", path = "../pallas-alonzo/" }
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ impl DecodePayload for Content {
|
|||
|
||||
impl BlockLike for Content {
|
||||
fn block_point(&self) -> Result<Point, Box<dyn std::error::Error>> {
|
||||
let hash = crypto::hash_block_header(&self.0.header)?;
|
||||
Ok(Point(self.0.header.header_body.slot, Vec::from(hash)))
|
||||
let hash = crypto::hash_block_header(&self.0.header);
|
||||
Ok(Point(self.0.header.header_body.slot, hash.to_vec()))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ impl DecodePayload for Content {
|
|||
|
||||
impl BlockLike for Content {
|
||||
fn block_point(&self) -> Result<Point, Box<dyn std::error::Error>> {
|
||||
let hash = crypto::hash_block_header(&self.1)?;
|
||||
Ok(Point(self.1.header_body.slot, Vec::from(hash)))
|
||||
let hash = crypto::hash_block_header(&self.1);
|
||||
Ok(Point(self.1.header_body.slot, hash.to_vec()))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue