Ejemplo n.º 1
0
def DB_writeRow_SQL(block):
    """
    takes in Ethereum block, creates sql INSERT statement 
    """
    valuesstring = "({number},{timestamp},{size},{gasUsed},{gasLimit},{txcount})"

    b = dict(block)
    b["txcount"] = len(block["transactions"])
    b["timestamp"] = timestampToSeconds(b["timestamp"], NODENAME, CONSENSUS)

    values = valuesstring.format(**b)

    return "INSERT INTO blocks VALUES " + values + ";"
Ejemplo n.º 2
0
def test_timestampToSeconds_testrpc():
    assert 1 == tps.timestampToSeconds(205, NODENAME="TestRPC", CONSENSUS="whatever")
Ejemplo n.º 3
0
def test_timestampToSeconds_raft():
    assert 1 == tps.timestampToSeconds(1000000000, NODENAME="Quorum", CONSENSUS="raft")
Ejemplo n.º 4
0
def test_timestampToSeconds_default():
    assert 1 == tps.timestampToSeconds(1, NODENAME="Geth", CONSENSUS="clique")