Ejemplo n.º 1
0
def test_construct_minable_summary_no_transactions():
    summary = construct_minable_summary_genesis([
        construct_coinbase_transaction(0, [], immutables.Map(),
                                       b"Political statement goes here",
                                       example_public_key)
    ], 1231006505, 0)

    summary.serialize()
Ejemplo n.º 2
0
def _get_example_coinbase_transaction():
    height = 123
    non_coinbase_transactions = []
    unspent_transaction_outs = immutables.Map()
    miner_public_key = b'x' * 32
    random_data = b"No need to get all political here"
    return construct_coinbase_transaction(
        height, non_coinbase_transactions, unspent_transaction_outs, random_data, miner_public_key)
Ejemplo n.º 3
0
def test_construct_pow_evidence_genesis_block():
    coinstate = CoinState.empty()

    transactions = [
        construct_coinbase_transaction(0, [], immutables.Map(), b"Political statement goes here", example_public_key),
    ]

    summary = construct_minable_summary_genesis(transactions, 1231006505, 0)

    evidence = construct_pow_evidence(coinstate, summary, 0, transactions)
    evidence.serialize()
Ejemplo n.º 4
0
def test_construct_pow_evidence_non_genesis_block():
    coinstate = _read_chain_from_disk(5)

    transactions = [
        construct_coinbase_transaction(0, [], immutables.Map(),
                                       b"Political statement goes here",
                                       example_public_key),
    ]

    summary = construct_minable_summary(coinstate, transactions, 1231006505, 0)

    evidence = construct_pow_evidence(coinstate, summary,
                                      coinstate.head().height + 1,
                                      transactions)
    evidence.serialize()