Exemplo n.º 1
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]
Exemplo n.º 3
0
def test_domain_genesis_txns(bootstrap, domain_genesis_file):
    serializer = JsonSerializer()
    with open(domain_genesis_file) as f:
        i = 0
        for line in store_utils.cleanLines(f.readlines()):
            txn = serializer.deserialize(line)
            assert get_seq_no(txn)
            assert get_payload_data(txn)
            assert get_type(txn) == NYM
            assert get_version(txn) == "1"
            assert get_payload_data(txn)[VERKEY]
            assert get_payload_data(txn)[TARGET_NYM]
            assert ALIAS not in get_payload_data(txn)

            # expect Trustees, then Stewards, then Clients
            if 0 <= i < TRUSTEE_COUNT:
                expected_role = TRUSTEE
            elif TRUSTEE_COUNT <= i < TRUSTEE_COUNT + NODE_COUNT:
                expected_role = STEWARD
            else:
                expected_role = None
            assert get_payload_data(txn).get(ROLE) == expected_role
            i += 1
def test_domain_genesis_txns(bootstrap, domain_genesis_file):
    serializer = JsonSerializer()
    with open(domain_genesis_file) as f:
        i = 0
        for line in store_utils.cleanLines(f.readlines()):
            txn = serializer.deserialize(line)
            assert get_seq_no(txn)
            assert get_payload_data(txn)
            assert get_type(txn) == NYM
            assert get_version(txn) == "1"
            assert get_protocol_version(txn) is None
            assert get_payload_data(txn)[VERKEY]
            assert get_payload_data(txn)[TARGET_NYM]
            assert ALIAS not in get_payload_data(txn)

            # expect Trustees, then Stewards, then Clients
            if 0 <= i < TRUSTEE_COUNT:
                expected_role = TRUSTEE
            elif TRUSTEE_COUNT <= i < TRUSTEE_COUNT + NODE_COUNT:
                expected_role = STEWARD
            else:
                expected_role = None
            assert get_payload_data(txn).get(ROLE) == expected_role
            i += 1
def test_get_txn_version(txn):
    assert get_version(txn) == "1"
def test_get_txn_version(txn):
    assert get_version(txn) == "1"