1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/*
   Appellation: sig <module>
   Contributors: FL03 <jo3mccain@icloud.com>
   Description: ... Summary ...
*/
pub use self::{sign::*, signed::*, utils::*};

pub(crate) mod sign;
pub(crate) mod signed;

pub(crate) mod utils {
    use crate::transactions::Transaction;
    use scsys::prelude::ring::signature::{Ed25519KeyPair, Signature};

    /// Create digital signature of a transaction
    pub fn sign(t: &Transaction, key: &Ed25519KeyPair) -> Signature {
        let serialized: Vec<u8> = serde_json::to_vec(t).unwrap();
        key.sign(&serialized)
    }
}