pub fn verify(t: &Transaction, public_key: &<Ed25519KeyPair as KeyPair>::PublicKey, signature: &Signature) -> bool {
    let mut bytes = t.Input.clone();
    bytes.push_str(t.Output.as_str());
    let peer_pub_key = UnparsedPublicKey::new(&signature::ED25519,public_key.as_ref());
    let result = peer_pub_key.verify(bytes.as_bytes(),signature.as_ref());
    result.is_ok()
}
/// 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 mut bytes = t.Input.clone();
    bytes.push_str(t.Output.as_str());
    let peer_pub_key = UnparsedPublicKey::new(&signature::ED25519,public_key.as_ref());
    let result = peer_pub_key.verify(bytes.as_bytes(),signature.as_ref());
    result.is_ok()
}
pub fn verify ( t : & Transaction , public_key : & < Ed25519KeyPair as KeyPair > :: PublicKey , signature : & Signature ) -> bool { let mut bytes = t . Input . clone ( ) ; bytes . push_str ( t . Output . as_str ( ) ) ; let peer_pub_key = UnparsedPublicKey :: new ( & signature :: ED25519 , public_key . as_ref ( ) ) ; let result = peer_pub_key . verify ( bytes . as_bytes ( ) , signature . as_ref ( ) ) ; result . is_ok ( ) }
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
t
&Transaction
public_key
&<Ed25519KeyPair as KeyPair>::PublicKey
signature
&Signature