UNPKG

lisk-framework

Version:

Lisk blockchain application platform

16 lines 1.26 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.buildLegacyBracketDBKey = exports.buildBlockHeightDbKey = exports.buildTxsBlockIDDbKey = exports.buildBlockIDDbKey = exports.buildTxIDDbKey = void 0; const lisk_cryptography_1 = require("@liskhq/lisk-cryptography"); const constants_1 = require("./constants"); const buildTxIDDbKey = (id) => Buffer.from(`${constants_1.DB_KEY_TRANSACTIONS_ID}:${id.toString('binary')}`); exports.buildTxIDDbKey = buildTxIDDbKey; const buildBlockIDDbKey = (id) => Buffer.from(`${constants_1.DB_KEY_BLOCKS_ID}:${id.toString('binary')}`); exports.buildBlockIDDbKey = buildBlockIDDbKey; const buildTxsBlockIDDbKey = (id) => Buffer.from(`${constants_1.DB_KEY_TRANSACTIONS_BLOCK_ID}:${id.toString('binary')}`); exports.buildTxsBlockIDDbKey = buildTxsBlockIDDbKey; const buildBlockHeightDbKey = (height) => Buffer.from(`${constants_1.DB_KEY_BLOCKS_HEIGHT}:${lisk_cryptography_1.utils.intToBuffer(height, 4).toString('binary')}`); exports.buildBlockHeightDbKey = buildBlockHeightDbKey; const buildLegacyBracketDBKey = (snapshotBlockID) => Buffer.concat([constants_1.DB_KEY_LEGACY_BRACKET, snapshotBlockID]); exports.buildLegacyBracketDBKey = buildLegacyBracketDBKey; //# sourceMappingURL=utils.js.map