Пример #1
0
def prepare_schema_for_state(txn):
    origin = get_from(txn)
    schema_name = get_txn_schema_name(txn)
    schema_version = get_txn_schema_version(txn)
    value = {SCHEMA_ATTR_NAMES: get_txn_schema_attr_names(txn)}
    path = make_state_path_for_schema(origin, schema_name, schema_version)
    seq_no = get_seq_no(txn)
    txn_time = get_txn_time(txn)
    value_bytes = encode_state_value(value, seq_no, txn_time)
    return path, value_bytes
Пример #2
0
def test_get_txn_schema_name(write_schema_request):
    txn = reqToTxn(write_schema_request)
    assert 'Degree' == get_txn_schema_name(txn)