Обновить HEADER, теги CORE и конфигурацию основного сервера

This commit is contained in:
AidarKC
2026-12-04 00:12:50 +03:00
parent cc010a8eea
commit 3c91014469
40 changed files with 526 additions and 103 deletions
@@ -24,7 +24,7 @@ const context = {
};
const makeHeaderBodyBytes = vm.runInNewContext(`function makeHeaderBodyBytes(${makeBytesFunction}\nmakeHeaderBodyBytes`, context);
test('CORE/CONTENT HEADER 1.0 contains identity, arbitrary license and initial key', () => {
test('CORE/CONTENT HEADER 2 contains identity, arbitrary license and initial key', () => {
const key = Uint8Array.from({ length: 32 }, (_, n) => n + 1);
const result = makeHeaderBodyBytes({ login: 'Alice@shine', initialBlockchainKey32: key });
const login = new TextEncoder().encode('Alice@shine');
@@ -34,11 +34,12 @@ test('CORE/CONTENT HEADER 1.0 contains identity, arbitrary license and initial k
const identityOffset = 6 + login.length;
assert.equal(result[identityOffset], 1);
assert.deepEqual(Array.from(result.slice(identityOffset + 1, identityOffset + 3)), [0, 0]);
assert.equal(result[identityOffset + 3], 0);
assert.deepEqual(Array.from(result.slice(identityOffset + 4)), Array.from(key));
assert.equal(result.length, 5 + 1 + login.length + 1 + 2 + 1 + 32);
assert.deepEqual(Array.from(result.slice(identityOffset + 3, identityOffset + 5)), [0, 7]);
assert.equal(new TextDecoder().decode(result.slice(identityOffset + 5, identityOffset + 12)), 'CC0-1.0');
assert.deepEqual(Array.from(result.slice(identityOffset + 12)), Array.from(key));
assert.equal(result.length, 5 + 1 + login.length + 1 + 2 + 2 + 7 + 32);
assert.match(auth, /msgSubType: MSG_SUBTYPE_TECH_HEADER,\s*msgVersion: HEADER_VERSION/);
assert.match(auth, /export const HEADER_VERSION = 1/);
assert.match(auth, /export const HEADER_VERSION = 2/);
});
test('free and paid registration both require accepted documents before any registration operation', { skip: !hasRegistrationTerms }, () => {