def test_node(uuid):
    #for uuid in ['123', 'matt']:
    n = bl.Node(uuid)
    assert n.uuid == uuid
def matt_node():
    node = bl.Node('matt')
    return node
def test_genesis():
    node = block.Node('Ali')
    gb, hash = node.process_txns([])
    assert hash.startswith('0')
Beispiel #4
0
def test_hash():
    node = bl.Node('matt')
    gb, hash = node.process_txns([])
    print(f'Genesis block {gb.todict()}, \nHash {hash}')
    assert hash.startswith('0')
Beispiel #5
0
def test_bad_difficulty():
    node = bl.Node('matt')
    with pytest.raises(TypeError):
        gb, hash = node.process_txns([], difficulty='1')
Beispiel #6
0
def node():
    node = block.Node('matt')
    return node