lisk-framework
Version:
Lisk blockchain application platform
128 lines • 3.97 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.aggregateCommitSchema = exports.singleCommitsNetworkPacketSchema = exports.singleCommitSchema = exports.certificateSchema = exports.unsignedCertificateSchema = void 0;
const constants_1 = require("../../../modules/interoperability/constants");
const constants_2 = require("../../../modules/validators/constants");
exports.unsignedCertificateSchema = {
$id: '/consensus/unsignedCertificate',
type: 'object',
required: ['blockID', 'height', 'timestamp', 'stateRoot', 'validatorsHash'],
properties: {
blockID: {
dataType: 'bytes',
minLength: constants_1.HASH_LENGTH,
maxLength: constants_1.HASH_LENGTH,
fieldNumber: 1,
},
height: {
dataType: 'uint32',
fieldNumber: 2,
},
timestamp: {
dataType: 'uint32',
fieldNumber: 3,
},
stateRoot: {
dataType: 'bytes',
minLength: constants_1.HASH_LENGTH,
maxLength: constants_1.HASH_LENGTH,
fieldNumber: 4,
},
validatorsHash: {
dataType: 'bytes',
minLength: constants_1.HASH_LENGTH,
maxLength: constants_1.HASH_LENGTH,
fieldNumber: 5,
},
},
};
exports.certificateSchema = {
$id: '/consensus/certificate',
type: 'object',
required: [...exports.unsignedCertificateSchema.required, 'aggregationBits', 'signature'],
properties: {
...exports.unsignedCertificateSchema.properties,
timestamp: {
minimum: 1,
dataType: 'uint32',
fieldNumber: 3,
},
aggregationBits: {
dataType: 'bytes',
fieldNumber: 6,
maxLength: constants_1.MAX_LENGTH_AGGREGATION_BITS,
},
signature: {
dataType: 'bytes',
minLength: constants_1.BLS_SIGNATURE_LENGTH,
maxLength: constants_1.BLS_SIGNATURE_LENGTH,
fieldNumber: 7,
},
},
};
exports.singleCommitSchema = {
$id: '/consensus/singleCommit',
type: 'object',
required: ['blockID', 'height', 'validatorAddress', 'certificateSignature'],
properties: {
blockID: {
dataType: 'bytes',
fieldNumber: 1,
minLength: constants_1.HASH_LENGTH,
maxLength: constants_1.HASH_LENGTH,
},
height: {
dataType: 'uint32',
fieldNumber: 2,
},
validatorAddress: {
dataType: 'bytes',
minLength: constants_2.ADDRESS_LENGTH,
maxLength: constants_2.ADDRESS_LENGTH,
fieldNumber: 3,
format: 'lisk32',
},
certificateSignature: {
dataType: 'bytes',
fieldNumber: 4,
minLength: constants_1.BLS_SIGNATURE_LENGTH,
maxLength: constants_1.BLS_SIGNATURE_LENGTH,
},
},
};
exports.singleCommitsNetworkPacketSchema = {
$id: '/consensus/singleCommitsNetworkPacket',
type: 'object',
required: ['commits'],
properties: {
commits: {
type: 'array',
fieldNumber: 1,
items: {
dataType: 'bytes',
},
},
},
};
exports.aggregateCommitSchema = {
$id: '/consensus/aggregateCommit',
type: 'object',
required: ['height', 'aggregationBits', 'certificateSignature'],
properties: {
height: {
dataType: 'uint32',
fieldNumber: 1,
},
aggregationBits: {
dataType: 'bytes',
fieldNumber: 2,
},
certificateSignature: {
dataType: 'bytes',
minLength: constants_1.BLS_SIGNATURE_LENGTH,
maxLength: constants_1.BLS_SIGNATURE_LENGTH,
fieldNumber: 3,
},
},
};
//# sourceMappingURL=schema.js.map