SHA256
CORE/CONTENT test5593 и адаптация UI
This commit is contained in:
@@ -21,22 +21,20 @@ const context = {
|
||||
int8Byte: value => Uint8Array.of(value),
|
||||
concatBytes: (...parts) => Uint8Array.from(parts.flatMap(part => Array.from(part))),
|
||||
Uint8Array,
|
||||
HEADER_LICENSE_FIELD_CC0: 'license:CC0-1.0',
|
||||
};
|
||||
const makeHeaderBodyBytes = vm.runInNewContext(`function makeHeaderBodyBytes(${makeBytesFunction}\nmakeHeaderBodyBytes`, context);
|
||||
|
||||
test('HEADER v2 places literal license:CC0-1.0 before the initial key', () => {
|
||||
test('CORE HEADER v1 preserves registration login and initial key without CC0', () => {
|
||||
const key = Uint8Array.from({ length: 32 }, (_, n) => n + 1);
|
||||
const result = makeHeaderBodyBytes({ login: 'Alice@shine', initialBlockchainKey32: key });
|
||||
const login = new TextEncoder().encode('Alice@shine');
|
||||
assert.equal(new TextDecoder().decode(result.slice(0,5)), 'SHiNE');
|
||||
assert.equal(result[5], login.length);
|
||||
assert.deepEqual(Array.from(result.slice(6, 6+login.length)), Array.from(login));
|
||||
assert.equal(new TextDecoder().decode(result.slice(6+login.length, 6+login.length+15)), 'license:CC0-1.0');
|
||||
assert.deepEqual(Array.from(result.slice(6+login.length+15)), Array.from(key));
|
||||
assert.equal(result.length, 5 + 1 + login.length + 15 + 32);
|
||||
assert.match(auth, /msgSubType: MSG_SUBTYPE_TECH_HEADER,\s*msgVersion: HEADER_VERSION_CC0/);
|
||||
assert.match(auth, /export const HEADER_VERSION_CC0 = 2/);
|
||||
assert.deepEqual(Array.from(result.slice(6+login.length)), Array.from(key));
|
||||
assert.equal(result.length, 5 + 1 + login.length + 32);
|
||||
assert.match(auth, /msgSubType: MSG_SUBTYPE_TECH_HEADER,\s*msgVersion: HEADER_CONTENT_VERSION/);
|
||||
assert.match(auth, /export const HEADER_CONTENT_VERSION = 1/);
|
||||
});
|
||||
|
||||
test('free and paid registration both require accepted documents before any registration operation', { skip: !hasRegistrationTerms }, () => {
|
||||
|
||||
Reference in New Issue
Block a user