pub fn sign_transfer_to_random(
        &self,
        test_accounts: &[AccountInfo],
        amount: BigUint,
    ) -> (FranklinTx, Option<PackedEthSignature>) {
        let to = {
            let mut to_idx = rand::thread_rng().gen_range(0, test_accounts.len() - 1);
            while test_accounts[to_idx].address == self.zk_acc.address {
                to_idx = rand::thread_rng().gen_range(0, test_accounts.len() - 1);
            }
            test_accounts[to_idx].address
        };
        let (tx, eth_signature) = self.zk_acc.sign_transfer(
            0, // ETH
            "ETH",
            amount,
            BigUint::from(0u32),
            &to,
            None,
            true,
        );
        (FranklinTx::Transfer(Box::new(tx)), Some(eth_signature))
    }
// Creates a signed transfer tx to a random receiver.
Creates a signed transfer tx to a random receiver.
Creates a signed transfer tx to a random receiver .
pub fn sign_transfer_to_random(
        &self,
        test_accounts: &[AccountInfo],
        amount: BigUint,
    ) -> (FranklinTx, Option<PackedEthSignature>) {
        let to = {
            let mut to_idx = rand::thread_rng().gen_range(0, test_accounts.len() - 1);
            while test_accounts[to_idx].address == self.zk_acc.address {
                to_idx = rand::thread_rng().gen_range(0, test_accounts.len() - 1);
            }
            test_accounts[to_idx].address
        };
        let (tx, eth_signature) = self.zk_acc.sign_transfer(
            0, // ETH
            "ETH",
            amount,
            BigUint::from(0u32),
            &to,
            None,
            true,
        );
        (FranklinTx::Transfer(Box::new(tx)), Some(eth_signature))
    }
pub fn sign_transfer_to_random ( & self , test_accounts : & [ AccountInfo ] , amount : BigUint , ) -> ( FranklinTx , Option < PackedEthSignature > ) { let to = { let mut to_idx = rand :: thread_rng ( ) . gen_range ( 0 , test_accounts . len ( ) - 1 ) ; while test_accounts [ to_idx ] . address == self . zk_acc . address { to_idx = rand :: thread_rng ( ) . gen_range ( 0 , test_accounts . len ( ) - 1 ) ; } test_accounts [ to_idx ] . address } ; let ( tx , eth_signature ) = self . zk_acc . sign_transfer ( 0 , // ETH " " , amount , BigUint :: from ( 0u32 ) , & to , None , true , ) ; ( FranklinTx :: Transfer ( Box :: new ( tx ) ) , Some ( eth_signature ) ) }
Creates a signed transfer tx to a random receiver.
Creates a signed transfer tx to a random receiver .
&self
test_accounts
&[AccountInfo]
amount
BigUint