UNPKG

@neo-one/node-protocol

Version:

NEO•ONE NEO node and consensus protocol.

33 lines (31 loc) 1.21 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.GetBlocksPayload = void 0; const client_common_1 = require("@neo-one/client-common"); const node_core_1 = require("@neo-one/node-core"); class GetBlocksPayload { constructor({ hashStart, hashStop = client_common_1.common.ZERO_UINT256 }) { this.serializeWire = client_common_1.createSerializeWire(this.serializeWireBase.bind(this)); this.hashStart = hashStart; this.hashStop = hashStop; } static deserializeWireBase({ reader }) { const hashStart = reader.readArray(() => reader.readUInt256()); const hashStop = reader.readUInt256(); return new this({ hashStart, hashStop }); } static deserializeWire(options) { return this.deserializeWireBase({ context: options.context, reader: new node_core_1.BinaryReader(options.buffer), }); } serializeWireBase(writer) { writer.writeArray(this.hashStart, (value) => { writer.writeUInt256(value); }); writer.writeUInt256(this.hashStop); } } exports.GetBlocksPayload = GetBlocksPayload; //# sourceMappingURL=GetBlocksPayload.js.map