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()
def test_validate_block_by_itself_invalid_coinbase_transaction(): coinstate = CoinState.empty() transactions = [ Transaction(inputs=[ Input( OutputReference(b'x' * 32, 1), SECP256k1Signature(b'y' * 64), ) ], outputs=[Output(1, example_public_key)]) ] summary = construct_minable_summary(coinstate, transactions, 1615209942, 39) evidence = construct_pow_evidence(coinstate, summary, 0, transactions) block = Block(BlockHeader(summary, evidence), transactions) with pytest.raises(ValidateTransactionError, match=".*thin air.*"): validate_block_by_itself(block, 1615209942)