예제 #1
0
def checkSubmitted(looper, client, optype, txnsBefore):
    txnsAfter = []

    def checkTxnCountAdvanced():
        nonlocal txnsAfter
        txnsAfter = client.getTxnsByType(optype)
        logger.debug("old and new txns {} {}".format(txnsBefore, txnsAfter))
        assert len(txnsAfter) > len(txnsBefore)

    timeout = plenumWaits.expectedReqAckQuorumTime()
    looper.run(eventually(checkTxnCountAdvanced, retryWait=1, timeout=timeout))
    txnIdsBefore = [get_txn_id(txn) for txn in txnsBefore]
    txnIdsAfter = [get_txn_id(txn) for txn in txnsAfter]
    logger.debug("old and new txnids {} {}".format(txnIdsBefore, txnIdsAfter))
    return list(set(txnIdsAfter) - set(txnIdsBefore))
예제 #2
0
def checkSubmitted(looper, client, optype, txnsBefore):
    txnsAfter = []

    def checkTxnCountAdvanced():
        nonlocal txnsAfter
        txnsAfter = client.getTxnsByType(optype)
        logger.debug("old and new txns {} {}".format(txnsBefore, txnsAfter))
        assert len(txnsAfter) > len(txnsBefore)

    timeout = plenumWaits.expectedReqAckQuorumTime()
    looper.run(eventually(checkTxnCountAdvanced, retryWait=1,
                          timeout=timeout))
    txnIdsBefore = [get_txn_id(txn) for txn in txnsBefore]
    txnIdsAfter = [get_txn_id(txn) for txn in txnsAfter]
    logger.debug("old and new txnids {} {}".format(txnIdsBefore, txnIdsAfter))
    return list(set(txnIdsAfter) - set(txnIdsBefore))
예제 #3
0
def test_pool_genesis_txns(bootstrap, pool_genesis_file):
    serializer = JsonSerializer()
    with open(pool_genesis_file) as f:
        for line in store_utils.cleanLines(f.readlines()):
            txn = serializer.deserialize(line)
            assert get_seq_no(txn)
            assert get_txn_id(txn)
            assert get_payload_data(txn)
            assert get_type(txn) == NODE
            assert get_version(txn) == "1"
            assert get_payload_data(txn)[TARGET_NYM]
            data = get_payload_data(txn).get(DATA)
            assert data
            assert data[ALIAS]
            assert data[CLIENT_IP]
            assert data[CLIENT_PORT]
            assert data[NODE_IP]
            assert data[NODE_PORT]
            assert data[SERVICES] == [VALIDATOR]
            assert data[BLS_KEY]
def test_pool_genesis_txns(bootstrap, pool_genesis_file):
    serializer = JsonSerializer()
    with open(pool_genesis_file) as f:
        for line in store_utils.cleanLines(f.readlines()):
            txn = serializer.deserialize(line)
            assert get_seq_no(txn)
            assert get_txn_id(txn)
            assert get_payload_data(txn)
            assert get_type(txn) == NODE
            assert get_version(txn) == "1"
            assert get_protocol_version(txn) is None
            assert get_payload_data(txn)[TARGET_NYM]
            data = get_payload_data(txn).get(DATA)
            assert data
            assert data[ALIAS]
            assert data[CLIENT_IP]
            assert data[CLIENT_PORT]
            assert data[NODE_IP]
            assert data[NODE_PORT]
            assert data[SERVICES] == [VALIDATOR]
            assert data[BLS_KEY]
            assert data[BLS_KEY_PROOF]
def test_get_txn_id_none(txn):
    txn["txnMetadata"].pop("txnId", None)
    assert get_txn_id(txn) is None
def test_get_txn_id(txn):
    assert get_txn_id(txn) == "aaaaa"
def test_get_txn_id(txn):
    assert get_txn_id(txn) == "aaaaa"
def test_get_txn_id_none(txn):
    txn["txnMetadata"].pop("txnId", None)
    assert get_txn_id(txn) is None