pub fn verify(t: &Transaction, public_key: &<Ed25519KeyPair as KeyPair>::PublicKey, signature: &Signature) -> bool {
    let m = bincode::serialize(&t).unwrap();
    let txid = digest::digest(&digest::SHA256, digest::digest(&digest::SHA256, m.as_ref()).as_ref());
    let public_key_ = signature::UnparsedPublicKey::new(&signature::ED25519, public_key.as_ref());
    let ret = public_key_.verify(txid.as_ref(), signature.as_ref()).is_ok();
    return ret;
}
/// Verify digital signature of a transaction, using public key instead of secret key
Verify digital signature of a transaction, using public key instead of secret key
Verify digital signature of a transaction using public key instead of secret key
pub fn verify(t: &Transaction, public_key: &<Ed25519KeyPair as KeyPair>::PublicKey, signature: &Signature) -> bool {
    let m = bincode::serialize(&t).unwrap();
    let txid = digest::digest(&digest::SHA256, digest::digest(&digest::SHA256, m.as_ref()).as_ref());
    let public_key_ = signature::UnparsedPublicKey::new(&signature::ED25519, public_key.as_ref());
    let ret = public_key_.verify(txid.as_ref(), signature.as_ref()).is_ok();
    return ret;
}
pub fn verify ( t : & Transaction , public_key : & < Ed25519KeyPair as KeyPair > :: PublicKey , signature : & Signature ) -> bool { let m = bincode :: serialize ( & t ) . unwrap ( ) ; let txid = digest :: digest ( & digest :: SHA256 , digest :: digest ( & digest :: SHA256 , m . as_ref ( ) ) . as_ref ( ) ) ; let public_key_ = signature :: UnparsedPublicKey :: new ( & signature :: ED25519 , public_key . as_ref ( ) ) ; let ret = public_key_ . verify ( txid . as_ref ( ) , signature . as_ref ( ) ) . is_ok ( ) ; return ret ; }
Verify digital signature of a transaction, using public key instead of secret key
Verify digital signature of a transaction using public key instead of secret key
t
&Transaction
public_key
&<Ed25519KeyPair as KeyPair>::PublicKey
signature
&Signature