Очень сильно переделать формат блоков

Внимание: версия ещё не проверена.
This commit is contained in:
AidarKC
2026-10-01 09:34:19 +03:00
parent 08c7fd7676
commit 3281da7f5c
65 changed files with 1863 additions and 2743 deletions
+16 -3
View File
@@ -1915,8 +1915,9 @@ var solanaWeb3=function(exports){"use strict";function getDefaultExportFromCjs(x
throw new Error(`HEADER: неожиданный tag ${tag}`);
}
const login = reader.readUtf8U8();
const initialBlockchainKeyHex = bytesToHex(reader.readBytes(32));
reader.ensureDone();
return { kind: 'header', login, tag };
return { kind: 'header', login, tag, initialBlockchainKeyHex };
}
function parseCreateChannelBody(bodyBytes) {
@@ -1950,6 +1951,8 @@ var solanaWeb3=function(exports){"use strict";function getDefaultExportFromCjs(x
const prevLineHashHex = bytesToHex(reader.readBytes(32));
const thisLineNumber = reader.readI32();
let targetBlockchainName = '';
let targetLogin = '';
let targetForkNumber = null;
let targetBlockNumber = null;
let targetBlockHashHex = '';
@@ -1957,7 +1960,9 @@ var solanaWeb3=function(exports){"use strict";function getDefaultExportFromCjs(x
targetBlockNumber = reader.readI32();
targetBlockHashHex = bytesToHex(reader.readBytes(32));
} else if (subType === BCH_SUBTYPE_TEXT_REPOST) {
targetBlockchainName = reader.readUtf8U8();
targetLogin = reader.readUtf8U8();
targetForkNumber = reader.readU16();
targetBlockchainName = targetForkNumber > 0 ? `${targetLogin}-${String(targetForkNumber).padStart(3, '0')}` : '';
targetBlockNumber = reader.readI32();
targetBlockHashHex = bytesToHex(reader.readBytes(32));
}
@@ -1972,6 +1977,8 @@ var solanaWeb3=function(exports){"use strict";function getDefaultExportFromCjs(x
prevLineHashHex,
thisLineNumber,
targetBlockchainName,
targetLogin,
targetForkNumber,
targetBlockNumber,
targetBlockHashHex,
message,
@@ -1981,8 +1988,12 @@ var solanaWeb3=function(exports){"use strict";function getDefaultExportFromCjs(x
function parseTextReplyBody(subType, bodyBytes) {
const reader = makeBigEndianReader(bodyBytes, 'TEXT_REPLY');
let targetBlockchainName = '';
let targetLogin = '';
let targetForkNumber = null;
if (subType === BCH_SUBTYPE_TEXT_REPLY) {
targetBlockchainName = reader.readUtf8U8();
targetLogin = reader.readUtf8U8();
targetForkNumber = reader.readU16();
targetBlockchainName = targetForkNumber > 0 ? `${targetLogin}-${String(targetForkNumber).padStart(3, '0')}` : '';
}
const targetBlockNumber = reader.readI32();
const targetBlockHashHex = bytesToHex(reader.readBytes(32));
@@ -1992,6 +2003,8 @@ var solanaWeb3=function(exports){"use strict";function getDefaultExportFromCjs(x
kind: 'text_reply',
subType,
targetBlockchainName,
targetLogin,
targetForkNumber,
targetBlockNumber,
targetBlockHashHex,
message,