pub fn sign(t: &Transaction, key: &Ed25519KeyPair) -> Signature {
    let m = bincode::serialize(&t).unwrap();
    let txid = digest::digest(&digest::SHA256, digest::digest(&digest::SHA256, m.as_ref()).as_ref());
    let sig = key.sign(txid.as_ref());
    return sig;
}
/// Create digital signature of a transaction
Create digital signature of a transaction
Create digital signature of a transaction
pub fn sign(t: &Transaction, key: &Ed25519KeyPair) -> Signature {
    let m = bincode::serialize(&t).unwrap();
    let txid = digest::digest(&digest::SHA256, digest::digest(&digest::SHA256, m.as_ref()).as_ref());
    let sig = key.sign(txid.as_ref());
    return sig;
}
pub fn sign ( t : & Transaction , key : & Ed25519KeyPair ) -> Signature { let m = bincode :: serialize ( & t ) . unwrap ( ) ; let txid = digest :: digest ( & digest :: SHA256 , digest :: digest ( & digest :: SHA256 , m . as_ref ( ) ) . as_ref ( ) ) ; let sig = key . sign ( txid . as_ref ( ) ) ; return sig ; }
Create digital signature of a transaction
Create digital signature of a transaction
t
&Transaction
key
&Ed25519KeyPair