function check_record_version(user, id) {
    let payload = JSON.parse(user.collection("clients").wbo(id).payload);

    let rec = new CryptoWrapper();
    rec.id = id;
    rec.collection = "clients";
    rec.ciphertext = payload.ciphertext;
    rec.hmac = payload.hmac;
    rec.IV = payload.IV;

    let cleartext = rec.decrypt(Service.collectionKeys.keyForCollection("clients"));

    _("Payload is " + JSON.stringify(cleartext));
    do_check_eq(Services.appinfo.version, cleartext.version);
    do_check_eq(2, cleartext.protocols.length);
    do_check_eq("1.1", cleartext.protocols[0]);
    do_check_eq("1.5", cleartext.protocols[1]);
}
/**
 * Unpack the record with this ID, and verify that it has the same version that
 * we should be putting into records.
 */
Unpack the record with this ID, and verify that it has the same version that
we should be putting into records.
Unpack the record with this ID and verify that it has the same version that we should be putting into records .
function check_record_version(user, id) {
    let payload = JSON.parse(user.collection("clients").wbo(id).payload);
    let rec = new CryptoWrapper();
    rec.id = id;
    rec.collection = "clients";
    rec.ciphertext = payload.ciphertext;
    rec.hmac = payload.hmac;
    rec.IV = payload.IV;
    let cleartext = rec.decrypt(Service.collectionKeys.keyForCollection("clients"));
    _("Payload is " + JSON.stringify(cleartext));
    do_check_eq(Services.appinfo.version, cleartext.version);
    do_check_eq(2, cleartext.protocols.length);
    do_check_eq("1.1", cleartext.protocols[0]);
    do_check_eq("1.5", cleartext.protocols[1]);
}
function check_record_version ( user , id ) { let payload = JSON . parse ( user . collection ( "clients" ) . wbo ( id ) . payload ) ; let rec = new CryptoWrapper ( ) ; rec . id = id ; rec . collection = "clients" ; rec . ciphertext = payload . ciphertext ; rec . hmac = payload . hmac ; rec . IV = payload . IV ; let cleartext = rec . decrypt ( Service . collectionKeys . keyForCollection ( "clients" ) ) ; _ ( "Payload is " + JSON . stringify ( cleartext ) ) ; do_check_eq ( Services . appinfo . version , cleartext . version ) ; do_check_eq ( 2 , cleartext . protocols . length ) ; do_check_eq ( "1.1" , cleartext . protocols [ 0 ] ) ; do_check_eq ( "1.5" , cleartext . protocols [ 1 ] ) ; }
Unpack the record with this ID, and verify that it has the same version that
 we should be putting into records.
Unpack the record with this ID and verify that it has the same version that we should be putting into records .