Skip to content

Commit

Permalink
removes unused import, updates method calls
Browse files Browse the repository at this point in the history
  • Loading branch information
arya2 committed Jul 17, 2023
1 parent d4896be commit deea124
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions zebra-chain/src/serialization/sha256d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl Writer {
/// Consume the Writer and produce the hash result.
pub fn finish(self) -> [u8; 32] {
let result1 = self.hash.finalize();
let result2 = Sha256::digest(&result1);
let result2 = Sha256::digest(result1);
let mut buffer = [0u8; 32];
buffer[0..32].copy_from_slice(&result2[0..32]);
buffer
Expand All @@ -39,7 +39,7 @@ pub struct Checksum(pub [u8; 4]);
impl<'a> From<&'a [u8]> for Checksum {
fn from(bytes: &'a [u8]) -> Self {
let hash1 = Sha256::digest(bytes);
let hash2 = Sha256::digest(&hash1);
let hash2 = Sha256::digest(hash1);
let mut checksum = [0u8; 4];
checksum[0..4].copy_from_slice(&hash2[0..4]);
Self(checksum)
Expand Down
1 change: 0 additions & 1 deletion zebra-chain/src/transparent/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use std::{fmt, io};

use ripemd::{Digest, Ripemd160};
use secp256k1::PublicKey;
use sha2::Digest as Sha256Digest;
use sha2::Sha256;

use crate::{
Expand Down

0 comments on commit deea124

Please sign in to comment.