Skip to content
This repository has been archived by the owner on Jun 24, 2024. It is now read-only.

Commit

Permalink
revert compute_packet_commitment util method
Browse files Browse the repository at this point in the history
  • Loading branch information
rnbguy committed Nov 14, 2023
1 parent 581c50e commit dc76a96
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions mocks/src/relayer/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,20 +200,3 @@ where
CallMessage::Core(msg_recv_packet.to_any())
}
}

pub fn compute_packet_commitment(
packet_data: &[u8],
timeout_height: &TimeoutHeight,
timeout_timestamp: &Timestamp,
) -> PacketCommitment {
use sha2::Digest;

let mut hash_input = [0; 8 * 3 + 32];

hash_input[..8].copy_from_slice(&timeout_timestamp.nanoseconds().to_be_bytes());
hash_input[8..16].copy_from_slice(&timeout_height.commitment_revision_number().to_be_bytes());
hash_input[16..24].copy_from_slice(&timeout_height.commitment_revision_height().to_be_bytes());
hash_input[24..].copy_from_slice(&<[u8; 32]>::from(sha2::Sha256::digest(packet_data)));

sha2::Sha256::digest(hash_input).to_vec().into()
}

0 comments on commit dc76a96

Please sign in to comment.