pub fn new_signed(
        account_id: AccountId,
        from: Address,
        to: Address,
        token: TokenId,
        amount: BigUint,
        fee: BigUint,
        nonce: Nonce,
        private_key: &PrivateKey<Engine>,
    ) -> Result<Self, failure::Error> {
        let mut tx = Self::new(account_id, from, to, token, amount, fee, nonce, None);
        tx.signature = TxSignature::sign_musig(private_key, &tx.get_bytes());
        if !tx.check_correctness() {
            bail!("Transfer is incorrect, check amounts");
        }
        Ok(tx)
    }
/// Creates signed transaction using private key, checks for correcteness
Creates signed transaction using private key, checks for correcteness
Creates signed transaction using private key checks for correcteness
pub fn new_signed(
        account_id: AccountId,
        from: Address,
        to: Address,
        token: TokenId,
        amount: BigUint,
        fee: BigUint,
        nonce: Nonce,
        private_key: &PrivateKey<Engine>,
    ) -> Result<Self, failure::Error> {
        let mut tx = Self::new(account_id, from, to, token, amount, fee, nonce, None);
        tx.signature = TxSignature::sign_musig(private_key, &tx.get_bytes());
        if !tx.check_correctness() {
            bail!("Transfer is incorrect, check amounts");
        }
        Ok(tx)
    }
pub fn new_signed ( account_id : AccountId , from : Address , to : Address , token : TokenId , amount : BigUint , fee : BigUint , nonce : Nonce , private_key : & PrivateKey < Engine > , ) -> Result < Self , failure :: Error > { let mut tx = Self :: new ( account_id , from , to , token , amount , fee , nonce , None ) ; tx . signature = TxSignature :: sign_musig ( private_key , & tx . get_bytes ( ) ) ; if ! tx . check_correctness ( ) { bail ! ( " " ) ; } Ok ( tx ) }
Creates signed transaction using private key, checks for correcteness
Creates signed transaction using private key checks for correcteness
account_id
AccountId
from
Address
to
Address
token
TokenId
amount
BigUint
fee
BigUint
nonce
Nonce
private_key
&PrivateKey<Engine>