use tendermint::{crypto::signature, PublicKey, Signature};
use crate::{common::crypto::hash::Hash, consensus::tendermint::TENDERMINT_CONTEXT};
#[derive(Copy, Clone, Debug, Default, PartialEq, Eq)]
pub struct DomSepVerifier;
impl signature::Verifier for DomSepVerifier {
fn verify(
pubkey: PublicKey,
msg: &[u8],
signature: &Signature,
) -> Result<(), signature::Error> {
let msg = Hash::digest_bytes_list(&[TENDERMINT_CONTEXT, msg]);
tendermint::crypto::default::signature::Verifier::verify(pubkey, msg.as_ref(), signature)
}
}