SHA256
Очень сильно переделать формат блоков
Внимание: версия ещё не проверена.
This commit is contained in:
@@ -1922,8 +1922,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) {
|
||||
@@ -1957,6 +1958,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 = '';
|
||||
|
||||
@@ -1964,7 +1967,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));
|
||||
}
|
||||
@@ -1979,6 +1984,8 @@ var solanaWeb3=function(exports){"use strict";function getDefaultExportFromCjs(x
|
||||
prevLineHashHex,
|
||||
thisLineNumber,
|
||||
targetBlockchainName,
|
||||
targetLogin,
|
||||
targetForkNumber,
|
||||
targetBlockNumber,
|
||||
targetBlockHashHex,
|
||||
message,
|
||||
@@ -1988,8 +1995,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));
|
||||
@@ -1999,6 +2010,8 @@ var solanaWeb3=function(exports){"use strict";function getDefaultExportFromCjs(x
|
||||
kind: 'text_reply',
|
||||
subType,
|
||||
targetBlockchainName,
|
||||
targetLogin,
|
||||
targetForkNumber,
|
||||
targetBlockNumber,
|
||||
targetBlockHashHex,
|
||||
message,
|
||||
|
||||
Reference in New Issue
Block a user