def add_txns_to_audit(alh, count, ledger_id, txns_per_batch, view_no, initial_pp_seq_no, pp_time, digest=''): db_manager = alh.database_manager for i in range(count): add_txns(db_manager, ledger_id, txns_per_batch, pp_time) three_pc_batch = ThreePcBatch( ledger_id=ledger_id, inst_id=0, view_no=view_no, pp_seq_no=initial_pp_seq_no + i, pp_time=pp_time, state_root=db_manager.get_state(ledger_id).headHash, txn_root=db_manager.get_ledger(ledger_id).uncommitted_root_hash, primaries=DEFAULT_PRIMARIES, node_reg=DEFAULT_NODE_REG, valid_digests=[], pp_digest=digest) alh._add_to_ledger(three_pc_batch) alh.ledger.commitTxns(count)
def add_txns_to_audit(alh, count, ledger_id, txns_per_batch, view_no, initial_pp_seq_no, pp_time): db_manager = alh.database_manager for i in range(count): add_txns(db_manager, ledger_id, txns_per_batch, pp_time) three_pc_batch = ThreePcBatch( ledger_id=ledger_id, inst_id=0, view_no=view_no, pp_seq_no=initial_pp_seq_no + i, pp_time=pp_time, valid_txn_count=txns_per_batch, state_root=db_manager.get_state(ledger_id).headHash, txn_root=db_manager.get_ledger(ledger_id).uncommitted_root_hash) alh._add_to_ledger(three_pc_batch) alh.ledger.commitTxns(count)