fn multi_transaction_block(oversized: bool) -> Block {
    // A dummy transaction
    let tx = Transaction::zcash_deserialize(&zebra_test::vectors::DUMMY_TX1[..]).unwrap();

    // A block header
    let header = block_header();

    // Serialize header
    let mut data_header = Vec::new();
    header
        .zcash_serialize(&mut data_header)
        .expect("Block header should serialize");

    // Calculate the number of transactions we need
    let mut max_transactions_in_block =
        (MAX_BLOCK_BYTES as usize - data_header.len()) / zebra_test::vectors::DUMMY_TX1[..].len();
    if oversized {
        max_transactions_in_block += 1;
    }

    // Create transactions to be just below or just above the limit
    let transactions = std::iter::repeat(Arc::new(tx))
        .take(max_transactions_in_block)
        .collect::<Vec<_>>();

    // Add the transactions into a block
    Block {
        header,
        transactions,
    }
}
// Implementation of block generation with multiple transactions
Implementation of block generation with multiple transactions
Implementation of block generation with multiple transactions
fn multi_transaction_block(oversized: bool) -> Block {
    // A dummy transaction
    let tx = Transaction::zcash_deserialize(&zebra_test::vectors::DUMMY_TX1[..]).unwrap();
    // A block header
    let header = block_header();
    // Serialize header
    let mut data_header = Vec::new();
    header
        .zcash_serialize(&mut data_header)
        .expect("Block header should serialize");
    // Calculate the number of transactions we need
    let mut max_transactions_in_block =
        (MAX_BLOCK_BYTES as usize - data_header.len()) / zebra_test::vectors::DUMMY_TX1[..].len();
    if oversized {
        max_transactions_in_block += 1;
    }
    // Create transactions to be just below or just above the limit
    let transactions = std::iter::repeat(Arc::new(tx))
        .take(max_transactions_in_block)
        .collect::<Vec<_>>();
    // Add the transactions into a block
    Block {
        header,
        transactions,
    }
}
fn multi_transaction_block ( oversized : bool ) -> Block { // A dummy transaction let tx = Transaction :: zcash_deserialize ( & zebra_test :: vectors :: DUMMY_TX1 [ .. ] ) . unwrap ( ) ; // A block header let header = block_header ( ) ; // Serialize header let mut data_header = Vec :: new ( ) ; header . zcash_serialize ( & mut data_header ) . expect ( " " ) ; // Calculate the number of transactions we need let mut max_transactions_in_block = ( MAX_BLOCK_BYTES as usize - data_header . len ( ) ) / zebra_test :: vectors :: DUMMY_TX1 [ .. ] . len ( ) ; if oversized { max_transactions_in_block += 1 ; } // Create transactions to be just below or just above the limit let transactions = std :: iter :: repeat ( Arc :: new ( tx ) ) . take ( max_transactions_in_block ) . collect :: < Vec < _ > > ( ) ; // Add the transactions into a block Block { header , transactions , } }
Implementation of block generation with multiple transactions
Implementation of block generation with multiple transactions
oversized
bool