// source: consensus/chainedbft/chainedbft.proto /** * @fileoverview * @enhanceable * @suppress {missingRequire} reports error on implicit type usages. * @suppress {messageConventions} JS Compiler reports an error if a variable or * field starts with 'MSG_' and isn't a translatable message. * @public */ // GENERATED CODE -- DO NOT EDIT! /* eslint-disable */ // @ts-nocheck var jspb = require('google-protobuf'); var goog = jspb; var global = Function('return this')(); var common_block_pb = require('../../common/block_pb.js'); goog.object.extend(proto, common_block_pb); var common_request_pb = require('../../common/request_pb.js'); goog.object.extend(proto, common_request_pb); goog.exportSymbol('proto.chainedbft.BlockFetchMsg', null, global); goog.exportSymbol('proto.chainedbft.BlockFetchRespMsg', null, global); goog.exportSymbol('proto.chainedbft.BlockFetchStatus', null, global); goog.exportSymbol('proto.chainedbft.BlockPair', null, global); goog.exportSymbol('proto.chainedbft.BuildProposal', null, global); goog.exportSymbol('proto.chainedbft.ConsStateType', null, global); goog.exportSymbol('proto.chainedbft.ConsensusInfo', null, global); goog.exportSymbol('proto.chainedbft.ConsensusMsg', null, global); goog.exportSymbol('proto.chainedbft.ConsensusPayload', null, global); goog.exportSymbol('proto.chainedbft.ConsensusPayload.DataCase', null, global); goog.exportSymbol('proto.chainedbft.MessageType', null, global); goog.exportSymbol('proto.chainedbft.ProposalData', null, global); goog.exportSymbol('proto.chainedbft.ProposalMsg', null, global); goog.exportSymbol('proto.chainedbft.QuorumCert', null, global); goog.exportSymbol('proto.chainedbft.SyncInfo', null, global); goog.exportSymbol('proto.chainedbft.VoteData', null, global); goog.exportSymbol('proto.chainedbft.VoteMsg', null, global); goog.exportSymbol('proto.chainedbft.WalEntry', null, global); /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.chainedbft.QuorumCert = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.chainedbft.QuorumCert.repeatedFields_, null); }; goog.inherits(proto.chainedbft.QuorumCert, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.chainedbft.QuorumCert.displayName = 'proto.chainedbft.QuorumCert'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.chainedbft.ConsensusInfo = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.chainedbft.ConsensusInfo, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.chainedbft.ConsensusInfo.displayName = 'proto.chainedbft.ConsensusInfo'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.chainedbft.SyncInfo = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.chainedbft.SyncInfo, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.chainedbft.SyncInfo.displayName = 'proto.chainedbft.SyncInfo'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.chainedbft.ProposalData = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.chainedbft.ProposalData, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.chainedbft.ProposalData.displayName = 'proto.chainedbft.ProposalData'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.chainedbft.ProposalMsg = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.chainedbft.ProposalMsg, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.chainedbft.ProposalMsg.displayName = 'proto.chainedbft.ProposalMsg'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.chainedbft.VoteData = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.chainedbft.VoteData, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.chainedbft.VoteData.displayName = 'proto.chainedbft.VoteData'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.chainedbft.VoteMsg = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.chainedbft.VoteMsg, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.chainedbft.VoteMsg.displayName = 'proto.chainedbft.VoteMsg'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.chainedbft.BlockFetchMsg = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.chainedbft.BlockFetchMsg, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.chainedbft.BlockFetchMsg.displayName = 'proto.chainedbft.BlockFetchMsg'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.chainedbft.BlockPair = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.chainedbft.BlockPair, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.chainedbft.BlockPair.displayName = 'proto.chainedbft.BlockPair'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.chainedbft.BlockFetchRespMsg = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.chainedbft.BlockFetchRespMsg.repeatedFields_, null); }; goog.inherits(proto.chainedbft.BlockFetchRespMsg, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.chainedbft.BlockFetchRespMsg.displayName = 'proto.chainedbft.BlockFetchRespMsg'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.chainedbft.ConsensusPayload = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, proto.chainedbft.ConsensusPayload.oneofGroups_); }; goog.inherits(proto.chainedbft.ConsensusPayload, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.chainedbft.ConsensusPayload.displayName = 'proto.chainedbft.ConsensusPayload'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.chainedbft.ConsensusMsg = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.chainedbft.ConsensusMsg, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.chainedbft.ConsensusMsg.displayName = 'proto.chainedbft.ConsensusMsg'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.chainedbft.BuildProposal = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.chainedbft.BuildProposal, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.chainedbft.BuildProposal.displayName = 'proto.chainedbft.BuildProposal'; } /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a * server response, or constructed directly in Javascript. The array is used * in place and becomes part of the constructed object. It is not cloned. * If no data is provided, the constructed object will be empty, but still * valid. * @extends {jspb.Message} * @constructor */ proto.chainedbft.WalEntry = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.chainedbft.WalEntry, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.chainedbft.WalEntry.displayName = 'proto.chainedbft.WalEntry'; } /** * List of repeated fields within this message type. * @private {!Array} * @const */ proto.chainedbft.QuorumCert.repeatedFields_ = [6]; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.chainedbft.QuorumCert.prototype.toObject = function(opt_includeInstance) { return proto.chainedbft.QuorumCert.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.chainedbft.QuorumCert} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.QuorumCert.toObject = function(includeInstance, msg) { var f, obj = { blockid: msg.getBlockid_asB64(), height: jspb.Message.getFieldWithDefault(msg, 2, 0), level: jspb.Message.getFieldWithDefault(msg, 3, 0), newview: jspb.Message.getBooleanFieldWithDefault(msg, 4, false), epochid: jspb.Message.getFieldWithDefault(msg, 5, 0), votesList: jspb.Message.toObjectList(msg.getVotesList(), proto.chainedbft.VoteData.toObject, includeInstance) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.chainedbft.QuorumCert} */ proto.chainedbft.QuorumCert.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.chainedbft.QuorumCert; return proto.chainedbft.QuorumCert.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.chainedbft.QuorumCert} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.chainedbft.QuorumCert} */ proto.chainedbft.QuorumCert.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setBlockid(value); break; case 2: var value = /** @type {number} */ (reader.readUint64()); msg.setHeight(value); break; case 3: var value = /** @type {number} */ (reader.readUint64()); msg.setLevel(value); break; case 4: var value = /** @type {boolean} */ (reader.readBool()); msg.setNewview(value); break; case 5: var value = /** @type {number} */ (reader.readUint64()); msg.setEpochid(value); break; case 6: var value = new proto.chainedbft.VoteData; reader.readMessage(value,proto.chainedbft.VoteData.deserializeBinaryFromReader); msg.addVotes(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.chainedbft.QuorumCert.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.chainedbft.QuorumCert.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.chainedbft.QuorumCert} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.QuorumCert.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getBlockid_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getHeight(); if (f !== 0) { writer.writeUint64( 2, f ); } f = message.getLevel(); if (f !== 0) { writer.writeUint64( 3, f ); } f = message.getNewview(); if (f) { writer.writeBool( 4, f ); } f = message.getEpochid(); if (f !== 0) { writer.writeUint64( 5, f ); } f = message.getVotesList(); if (f.length > 0) { writer.writeRepeatedMessage( 6, f, proto.chainedbft.VoteData.serializeBinaryToWriter ); } }; /** * optional bytes BlockID = 1; * @return {!(string|Uint8Array)} */ proto.chainedbft.QuorumCert.prototype.getBlockid = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes BlockID = 1; * This is a type-conversion wrapper around `getBlockid()` * @return {string} */ proto.chainedbft.QuorumCert.prototype.getBlockid_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getBlockid())); }; /** * optional bytes BlockID = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getBlockid()` * @return {!Uint8Array} */ proto.chainedbft.QuorumCert.prototype.getBlockid_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getBlockid())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.chainedbft.QuorumCert} returns this */ proto.chainedbft.QuorumCert.prototype.setBlockid = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional uint64 Height = 2; * @return {number} */ proto.chainedbft.QuorumCert.prototype.getHeight = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** * @param {number} value * @return {!proto.chainedbft.QuorumCert} returns this */ proto.chainedbft.QuorumCert.prototype.setHeight = function(value) { return jspb.Message.setProto3IntField(this, 2, value); }; /** * optional uint64 Level = 3; * @return {number} */ proto.chainedbft.QuorumCert.prototype.getLevel = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** * @param {number} value * @return {!proto.chainedbft.QuorumCert} returns this */ proto.chainedbft.QuorumCert.prototype.setLevel = function(value) { return jspb.Message.setProto3IntField(this, 3, value); }; /** * optional bool NewView = 4; * @return {boolean} */ proto.chainedbft.QuorumCert.prototype.getNewview = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 4, false)); }; /** * @param {boolean} value * @return {!proto.chainedbft.QuorumCert} returns this */ proto.chainedbft.QuorumCert.prototype.setNewview = function(value) { return jspb.Message.setProto3BooleanField(this, 4, value); }; /** * optional uint64 EpochId = 5; * @return {number} */ proto.chainedbft.QuorumCert.prototype.getEpochid = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); }; /** * @param {number} value * @return {!proto.chainedbft.QuorumCert} returns this */ proto.chainedbft.QuorumCert.prototype.setEpochid = function(value) { return jspb.Message.setProto3IntField(this, 5, value); }; /** * repeated VoteData Votes = 6; * @return {!Array} */ proto.chainedbft.QuorumCert.prototype.getVotesList = function() { return /** @type{!Array} */ ( jspb.Message.getRepeatedWrapperField(this, proto.chainedbft.VoteData, 6)); }; /** * @param {!Array} value * @return {!proto.chainedbft.QuorumCert} returns this */ proto.chainedbft.QuorumCert.prototype.setVotesList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 6, value); }; /** * @param {!proto.chainedbft.VoteData=} opt_value * @param {number=} opt_index * @return {!proto.chainedbft.VoteData} */ proto.chainedbft.QuorumCert.prototype.addVotes = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 6, opt_value, proto.chainedbft.VoteData, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.chainedbft.QuorumCert} returns this */ proto.chainedbft.QuorumCert.prototype.clearVotesList = function() { return this.setVotesList([]); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.chainedbft.ConsensusInfo.prototype.toObject = function(opt_includeInstance) { return proto.chainedbft.ConsensusInfo.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.chainedbft.ConsensusInfo} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.ConsensusInfo.toObject = function(includeInstance, msg) { var f, obj = { qc: (f = msg.getQc()) && proto.chainedbft.QuorumCert.toObject(includeInstance, f) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.chainedbft.ConsensusInfo} */ proto.chainedbft.ConsensusInfo.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.chainedbft.ConsensusInfo; return proto.chainedbft.ConsensusInfo.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.chainedbft.ConsensusInfo} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.chainedbft.ConsensusInfo} */ proto.chainedbft.ConsensusInfo.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new proto.chainedbft.QuorumCert; reader.readMessage(value,proto.chainedbft.QuorumCert.deserializeBinaryFromReader); msg.setQc(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.chainedbft.ConsensusInfo.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.chainedbft.ConsensusInfo.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.chainedbft.ConsensusInfo} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.ConsensusInfo.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getQc(); if (f != null) { writer.writeMessage( 1, f, proto.chainedbft.QuorumCert.serializeBinaryToWriter ); } }; /** * optional QuorumCert QC = 1; * @return {?proto.chainedbft.QuorumCert} */ proto.chainedbft.ConsensusInfo.prototype.getQc = function() { return /** @type{?proto.chainedbft.QuorumCert} */ ( jspb.Message.getWrapperField(this, proto.chainedbft.QuorumCert, 1)); }; /** * @param {?proto.chainedbft.QuorumCert|undefined} value * @return {!proto.chainedbft.ConsensusInfo} returns this */ proto.chainedbft.ConsensusInfo.prototype.setQc = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.chainedbft.ConsensusInfo} returns this */ proto.chainedbft.ConsensusInfo.prototype.clearQc = function() { return this.setQc(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.chainedbft.ConsensusInfo.prototype.hasQc = function() { return jspb.Message.getField(this, 1) != null; }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.chainedbft.SyncInfo.prototype.toObject = function(opt_includeInstance) { return proto.chainedbft.SyncInfo.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.chainedbft.SyncInfo} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.SyncInfo.toObject = function(includeInstance, msg) { var f, obj = { highestqc: (f = msg.getHighestqc()) && proto.chainedbft.QuorumCert.toObject(includeInstance, f), highesttc: (f = msg.getHighesttc()) && proto.chainedbft.QuorumCert.toObject(includeInstance, f), highesttclevel: jspb.Message.getFieldWithDefault(msg, 3, 0) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.chainedbft.SyncInfo} */ proto.chainedbft.SyncInfo.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.chainedbft.SyncInfo; return proto.chainedbft.SyncInfo.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.chainedbft.SyncInfo} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.chainedbft.SyncInfo} */ proto.chainedbft.SyncInfo.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new proto.chainedbft.QuorumCert; reader.readMessage(value,proto.chainedbft.QuorumCert.deserializeBinaryFromReader); msg.setHighestqc(value); break; case 2: var value = new proto.chainedbft.QuorumCert; reader.readMessage(value,proto.chainedbft.QuorumCert.deserializeBinaryFromReader); msg.setHighesttc(value); break; case 3: var value = /** @type {number} */ (reader.readUint64()); msg.setHighesttclevel(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.chainedbft.SyncInfo.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.chainedbft.SyncInfo.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.chainedbft.SyncInfo} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.SyncInfo.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getHighestqc(); if (f != null) { writer.writeMessage( 1, f, proto.chainedbft.QuorumCert.serializeBinaryToWriter ); } f = message.getHighesttc(); if (f != null) { writer.writeMessage( 2, f, proto.chainedbft.QuorumCert.serializeBinaryToWriter ); } f = message.getHighesttclevel(); if (f !== 0) { writer.writeUint64( 3, f ); } }; /** * optional QuorumCert HighestQC = 1; * @return {?proto.chainedbft.QuorumCert} */ proto.chainedbft.SyncInfo.prototype.getHighestqc = function() { return /** @type{?proto.chainedbft.QuorumCert} */ ( jspb.Message.getWrapperField(this, proto.chainedbft.QuorumCert, 1)); }; /** * @param {?proto.chainedbft.QuorumCert|undefined} value * @return {!proto.chainedbft.SyncInfo} returns this */ proto.chainedbft.SyncInfo.prototype.setHighestqc = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.chainedbft.SyncInfo} returns this */ proto.chainedbft.SyncInfo.prototype.clearHighestqc = function() { return this.setHighestqc(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.chainedbft.SyncInfo.prototype.hasHighestqc = function() { return jspb.Message.getField(this, 1) != null; }; /** * optional QuorumCert HighestTC = 2; * @return {?proto.chainedbft.QuorumCert} */ proto.chainedbft.SyncInfo.prototype.getHighesttc = function() { return /** @type{?proto.chainedbft.QuorumCert} */ ( jspb.Message.getWrapperField(this, proto.chainedbft.QuorumCert, 2)); }; /** * @param {?proto.chainedbft.QuorumCert|undefined} value * @return {!proto.chainedbft.SyncInfo} returns this */ proto.chainedbft.SyncInfo.prototype.setHighesttc = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.chainedbft.SyncInfo} returns this */ proto.chainedbft.SyncInfo.prototype.clearHighesttc = function() { return this.setHighesttc(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.chainedbft.SyncInfo.prototype.hasHighesttc = function() { return jspb.Message.getField(this, 2) != null; }; /** * optional uint64 HighestTCLevel = 3; * @return {number} */ proto.chainedbft.SyncInfo.prototype.getHighesttclevel = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** * @param {number} value * @return {!proto.chainedbft.SyncInfo} returns this */ proto.chainedbft.SyncInfo.prototype.setHighesttclevel = function(value) { return jspb.Message.setProto3IntField(this, 3, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.chainedbft.ProposalData.prototype.toObject = function(opt_includeInstance) { return proto.chainedbft.ProposalData.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.chainedbft.ProposalData} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.ProposalData.toObject = function(includeInstance, msg) { var f, obj = { block: (f = msg.getBlock()) && common_block_pb.Block.toObject(includeInstance, f), height: jspb.Message.getFieldWithDefault(msg, 2, 0), level: jspb.Message.getFieldWithDefault(msg, 3, 0), proposer: msg.getProposer_asB64(), proposeridx: jspb.Message.getFieldWithDefault(msg, 5, 0), epochid: jspb.Message.getFieldWithDefault(msg, 6, 0), justifyqc: (f = msg.getJustifyqc()) && proto.chainedbft.QuorumCert.toObject(includeInstance, f) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.chainedbft.ProposalData} */ proto.chainedbft.ProposalData.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.chainedbft.ProposalData; return proto.chainedbft.ProposalData.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.chainedbft.ProposalData} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.chainedbft.ProposalData} */ proto.chainedbft.ProposalData.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new common_block_pb.Block; reader.readMessage(value,common_block_pb.Block.deserializeBinaryFromReader); msg.setBlock(value); break; case 2: var value = /** @type {number} */ (reader.readUint64()); msg.setHeight(value); break; case 3: var value = /** @type {number} */ (reader.readUint64()); msg.setLevel(value); break; case 4: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setProposer(value); break; case 5: var value = /** @type {number} */ (reader.readUint64()); msg.setProposeridx(value); break; case 6: var value = /** @type {number} */ (reader.readUint64()); msg.setEpochid(value); break; case 7: var value = new proto.chainedbft.QuorumCert; reader.readMessage(value,proto.chainedbft.QuorumCert.deserializeBinaryFromReader); msg.setJustifyqc(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.chainedbft.ProposalData.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.chainedbft.ProposalData.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.chainedbft.ProposalData} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.ProposalData.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getBlock(); if (f != null) { writer.writeMessage( 1, f, common_block_pb.Block.serializeBinaryToWriter ); } f = message.getHeight(); if (f !== 0) { writer.writeUint64( 2, f ); } f = message.getLevel(); if (f !== 0) { writer.writeUint64( 3, f ); } f = message.getProposer_asU8(); if (f.length > 0) { writer.writeBytes( 4, f ); } f = message.getProposeridx(); if (f !== 0) { writer.writeUint64( 5, f ); } f = message.getEpochid(); if (f !== 0) { writer.writeUint64( 6, f ); } f = message.getJustifyqc(); if (f != null) { writer.writeMessage( 7, f, proto.chainedbft.QuorumCert.serializeBinaryToWriter ); } }; /** * optional common.Block Block = 1; * @return {?proto.common.Block} */ proto.chainedbft.ProposalData.prototype.getBlock = function() { return /** @type{?proto.common.Block} */ ( jspb.Message.getWrapperField(this, common_block_pb.Block, 1)); }; /** * @param {?proto.common.Block|undefined} value * @return {!proto.chainedbft.ProposalData} returns this */ proto.chainedbft.ProposalData.prototype.setBlock = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.chainedbft.ProposalData} returns this */ proto.chainedbft.ProposalData.prototype.clearBlock = function() { return this.setBlock(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.chainedbft.ProposalData.prototype.hasBlock = function() { return jspb.Message.getField(this, 1) != null; }; /** * optional uint64 Height = 2; * @return {number} */ proto.chainedbft.ProposalData.prototype.getHeight = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** * @param {number} value * @return {!proto.chainedbft.ProposalData} returns this */ proto.chainedbft.ProposalData.prototype.setHeight = function(value) { return jspb.Message.setProto3IntField(this, 2, value); }; /** * optional uint64 Level = 3; * @return {number} */ proto.chainedbft.ProposalData.prototype.getLevel = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** * @param {number} value * @return {!proto.chainedbft.ProposalData} returns this */ proto.chainedbft.ProposalData.prototype.setLevel = function(value) { return jspb.Message.setProto3IntField(this, 3, value); }; /** * optional bytes Proposer = 4; * @return {!(string|Uint8Array)} */ proto.chainedbft.ProposalData.prototype.getProposer = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; /** * optional bytes Proposer = 4; * This is a type-conversion wrapper around `getProposer()` * @return {string} */ proto.chainedbft.ProposalData.prototype.getProposer_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getProposer())); }; /** * optional bytes Proposer = 4; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getProposer()` * @return {!Uint8Array} */ proto.chainedbft.ProposalData.prototype.getProposer_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getProposer())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.chainedbft.ProposalData} returns this */ proto.chainedbft.ProposalData.prototype.setProposer = function(value) { return jspb.Message.setProto3BytesField(this, 4, value); }; /** * optional uint64 ProposerIdx = 5; * @return {number} */ proto.chainedbft.ProposalData.prototype.getProposeridx = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); }; /** * @param {number} value * @return {!proto.chainedbft.ProposalData} returns this */ proto.chainedbft.ProposalData.prototype.setProposeridx = function(value) { return jspb.Message.setProto3IntField(this, 5, value); }; /** * optional uint64 EpochId = 6; * @return {number} */ proto.chainedbft.ProposalData.prototype.getEpochid = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 6, 0)); }; /** * @param {number} value * @return {!proto.chainedbft.ProposalData} returns this */ proto.chainedbft.ProposalData.prototype.setEpochid = function(value) { return jspb.Message.setProto3IntField(this, 6, value); }; /** * optional QuorumCert JustifyQC = 7; * @return {?proto.chainedbft.QuorumCert} */ proto.chainedbft.ProposalData.prototype.getJustifyqc = function() { return /** @type{?proto.chainedbft.QuorumCert} */ ( jspb.Message.getWrapperField(this, proto.chainedbft.QuorumCert, 7)); }; /** * @param {?proto.chainedbft.QuorumCert|undefined} value * @return {!proto.chainedbft.ProposalData} returns this */ proto.chainedbft.ProposalData.prototype.setJustifyqc = function(value) { return jspb.Message.setWrapperField(this, 7, value); }; /** * Clears the message field making it undefined. * @return {!proto.chainedbft.ProposalData} returns this */ proto.chainedbft.ProposalData.prototype.clearJustifyqc = function() { return this.setJustifyqc(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.chainedbft.ProposalData.prototype.hasJustifyqc = function() { return jspb.Message.getField(this, 7) != null; }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.chainedbft.ProposalMsg.prototype.toObject = function(opt_includeInstance) { return proto.chainedbft.ProposalMsg.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.chainedbft.ProposalMsg} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.ProposalMsg.toObject = function(includeInstance, msg) { var f, obj = { proposaldata: (f = msg.getProposaldata()) && proto.chainedbft.ProposalData.toObject(includeInstance, f), syncinfo: (f = msg.getSyncinfo()) && proto.chainedbft.SyncInfo.toObject(includeInstance, f) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.chainedbft.ProposalMsg} */ proto.chainedbft.ProposalMsg.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.chainedbft.ProposalMsg; return proto.chainedbft.ProposalMsg.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.chainedbft.ProposalMsg} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.chainedbft.ProposalMsg} */ proto.chainedbft.ProposalMsg.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new proto.chainedbft.ProposalData; reader.readMessage(value,proto.chainedbft.ProposalData.deserializeBinaryFromReader); msg.setProposaldata(value); break; case 2: var value = new proto.chainedbft.SyncInfo; reader.readMessage(value,proto.chainedbft.SyncInfo.deserializeBinaryFromReader); msg.setSyncinfo(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.chainedbft.ProposalMsg.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.chainedbft.ProposalMsg.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.chainedbft.ProposalMsg} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.ProposalMsg.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getProposaldata(); if (f != null) { writer.writeMessage( 1, f, proto.chainedbft.ProposalData.serializeBinaryToWriter ); } f = message.getSyncinfo(); if (f != null) { writer.writeMessage( 2, f, proto.chainedbft.SyncInfo.serializeBinaryToWriter ); } }; /** * optional ProposalData ProposalData = 1; * @return {?proto.chainedbft.ProposalData} */ proto.chainedbft.ProposalMsg.prototype.getProposaldata = function() { return /** @type{?proto.chainedbft.ProposalData} */ ( jspb.Message.getWrapperField(this, proto.chainedbft.ProposalData, 1)); }; /** * @param {?proto.chainedbft.ProposalData|undefined} value * @return {!proto.chainedbft.ProposalMsg} returns this */ proto.chainedbft.ProposalMsg.prototype.setProposaldata = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.chainedbft.ProposalMsg} returns this */ proto.chainedbft.ProposalMsg.prototype.clearProposaldata = function() { return this.setProposaldata(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.chainedbft.ProposalMsg.prototype.hasProposaldata = function() { return jspb.Message.getField(this, 1) != null; }; /** * optional SyncInfo SyncInfo = 2; * @return {?proto.chainedbft.SyncInfo} */ proto.chainedbft.ProposalMsg.prototype.getSyncinfo = function() { return /** @type{?proto.chainedbft.SyncInfo} */ ( jspb.Message.getWrapperField(this, proto.chainedbft.SyncInfo, 2)); }; /** * @param {?proto.chainedbft.SyncInfo|undefined} value * @return {!proto.chainedbft.ProposalMsg} returns this */ proto.chainedbft.ProposalMsg.prototype.setSyncinfo = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.chainedbft.ProposalMsg} returns this */ proto.chainedbft.ProposalMsg.prototype.clearSyncinfo = function() { return this.setSyncinfo(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.chainedbft.ProposalMsg.prototype.hasSyncinfo = function() { return jspb.Message.getField(this, 2) != null; }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.chainedbft.VoteData.prototype.toObject = function(opt_includeInstance) { return proto.chainedbft.VoteData.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.chainedbft.VoteData} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.VoteData.toObject = function(includeInstance, msg) { var f, obj = { blockid: msg.getBlockid_asB64(), height: jspb.Message.getFieldWithDefault(msg, 2, 0), level: jspb.Message.getFieldWithDefault(msg, 3, 0), author: msg.getAuthor_asB64(), authoridx: jspb.Message.getFieldWithDefault(msg, 5, 0), newview: jspb.Message.getBooleanFieldWithDefault(msg, 6, false), epochid: jspb.Message.getFieldWithDefault(msg, 7, 0), signature: (f = msg.getSignature()) && common_request_pb.EndorsementEntry.toObject(includeInstance, f) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.chainedbft.VoteData} */ proto.chainedbft.VoteData.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.chainedbft.VoteData; return proto.chainedbft.VoteData.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.chainedbft.VoteData} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.chainedbft.VoteData} */ proto.chainedbft.VoteData.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setBlockid(value); break; case 2: var value = /** @type {number} */ (reader.readUint64()); msg.setHeight(value); break; case 3: var value = /** @type {number} */ (reader.readUint64()); msg.setLevel(value); break; case 4: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setAuthor(value); break; case 5: var value = /** @type {number} */ (reader.readUint64()); msg.setAuthoridx(value); break; case 6: var value = /** @type {boolean} */ (reader.readBool()); msg.setNewview(value); break; case 7: var value = /** @type {number} */ (reader.readUint64()); msg.setEpochid(value); break; case 8: var value = new common_request_pb.EndorsementEntry; reader.readMessage(value,common_request_pb.EndorsementEntry.deserializeBinaryFromReader); msg.setSignature(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.chainedbft.VoteData.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.chainedbft.VoteData.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.chainedbft.VoteData} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.VoteData.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getBlockid_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getHeight(); if (f !== 0) { writer.writeUint64( 2, f ); } f = message.getLevel(); if (f !== 0) { writer.writeUint64( 3, f ); } f = message.getAuthor_asU8(); if (f.length > 0) { writer.writeBytes( 4, f ); } f = message.getAuthoridx(); if (f !== 0) { writer.writeUint64( 5, f ); } f = message.getNewview(); if (f) { writer.writeBool( 6, f ); } f = message.getEpochid(); if (f !== 0) { writer.writeUint64( 7, f ); } f = message.getSignature(); if (f != null) { writer.writeMessage( 8, f, common_request_pb.EndorsementEntry.serializeBinaryToWriter ); } }; /** * optional bytes BlockID = 1; * @return {!(string|Uint8Array)} */ proto.chainedbft.VoteData.prototype.getBlockid = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes BlockID = 1; * This is a type-conversion wrapper around `getBlockid()` * @return {string} */ proto.chainedbft.VoteData.prototype.getBlockid_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getBlockid())); }; /** * optional bytes BlockID = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getBlockid()` * @return {!Uint8Array} */ proto.chainedbft.VoteData.prototype.getBlockid_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getBlockid())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.chainedbft.VoteData} returns this */ proto.chainedbft.VoteData.prototype.setBlockid = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional uint64 Height = 2; * @return {number} */ proto.chainedbft.VoteData.prototype.getHeight = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** * @param {number} value * @return {!proto.chainedbft.VoteData} returns this */ proto.chainedbft.VoteData.prototype.setHeight = function(value) { return jspb.Message.setProto3IntField(this, 2, value); }; /** * optional uint64 Level = 3; * @return {number} */ proto.chainedbft.VoteData.prototype.getLevel = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** * @param {number} value * @return {!proto.chainedbft.VoteData} returns this */ proto.chainedbft.VoteData.prototype.setLevel = function(value) { return jspb.Message.setProto3IntField(this, 3, value); }; /** * optional bytes Author = 4; * @return {!(string|Uint8Array)} */ proto.chainedbft.VoteData.prototype.getAuthor = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 4, "")); }; /** * optional bytes Author = 4; * This is a type-conversion wrapper around `getAuthor()` * @return {string} */ proto.chainedbft.VoteData.prototype.getAuthor_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getAuthor())); }; /** * optional bytes Author = 4; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getAuthor()` * @return {!Uint8Array} */ proto.chainedbft.VoteData.prototype.getAuthor_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getAuthor())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.chainedbft.VoteData} returns this */ proto.chainedbft.VoteData.prototype.setAuthor = function(value) { return jspb.Message.setProto3BytesField(this, 4, value); }; /** * optional uint64 AuthorIdx = 5; * @return {number} */ proto.chainedbft.VoteData.prototype.getAuthoridx = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); }; /** * @param {number} value * @return {!proto.chainedbft.VoteData} returns this */ proto.chainedbft.VoteData.prototype.setAuthoridx = function(value) { return jspb.Message.setProto3IntField(this, 5, value); }; /** * optional bool NewView = 6; * @return {boolean} */ proto.chainedbft.VoteData.prototype.getNewview = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 6, false)); }; /** * @param {boolean} value * @return {!proto.chainedbft.VoteData} returns this */ proto.chainedbft.VoteData.prototype.setNewview = function(value) { return jspb.Message.setProto3BooleanField(this, 6, value); }; /** * optional uint64 EpochId = 7; * @return {number} */ proto.chainedbft.VoteData.prototype.getEpochid = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 7, 0)); }; /** * @param {number} value * @return {!proto.chainedbft.VoteData} returns this */ proto.chainedbft.VoteData.prototype.setEpochid = function(value) { return jspb.Message.setProto3IntField(this, 7, value); }; /** * optional common.EndorsementEntry Signature = 8; * @return {?proto.common.EndorsementEntry} */ proto.chainedbft.VoteData.prototype.getSignature = function() { return /** @type{?proto.common.EndorsementEntry} */ ( jspb.Message.getWrapperField(this, common_request_pb.EndorsementEntry, 8)); }; /** * @param {?proto.common.EndorsementEntry|undefined} value * @return {!proto.chainedbft.VoteData} returns this */ proto.chainedbft.VoteData.prototype.setSignature = function(value) { return jspb.Message.setWrapperField(this, 8, value); }; /** * Clears the message field making it undefined. * @return {!proto.chainedbft.VoteData} returns this */ proto.chainedbft.VoteData.prototype.clearSignature = function() { return this.setSignature(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.chainedbft.VoteData.prototype.hasSignature = function() { return jspb.Message.getField(this, 8) != null; }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.chainedbft.VoteMsg.prototype.toObject = function(opt_includeInstance) { return proto.chainedbft.VoteMsg.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.chainedbft.VoteMsg} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.VoteMsg.toObject = function(includeInstance, msg) { var f, obj = { votedata: (f = msg.getVotedata()) && proto.chainedbft.VoteData.toObject(includeInstance, f), syncinfo: (f = msg.getSyncinfo()) && proto.chainedbft.SyncInfo.toObject(includeInstance, f) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.chainedbft.VoteMsg} */ proto.chainedbft.VoteMsg.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.chainedbft.VoteMsg; return proto.chainedbft.VoteMsg.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.chainedbft.VoteMsg} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.chainedbft.VoteMsg} */ proto.chainedbft.VoteMsg.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new proto.chainedbft.VoteData; reader.readMessage(value,proto.chainedbft.VoteData.deserializeBinaryFromReader); msg.setVotedata(value); break; case 2: var value = new proto.chainedbft.SyncInfo; reader.readMessage(value,proto.chainedbft.SyncInfo.deserializeBinaryFromReader); msg.setSyncinfo(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.chainedbft.VoteMsg.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.chainedbft.VoteMsg.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.chainedbft.VoteMsg} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.VoteMsg.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getVotedata(); if (f != null) { writer.writeMessage( 1, f, proto.chainedbft.VoteData.serializeBinaryToWriter ); } f = message.getSyncinfo(); if (f != null) { writer.writeMessage( 2, f, proto.chainedbft.SyncInfo.serializeBinaryToWriter ); } }; /** * optional VoteData VoteData = 1; * @return {?proto.chainedbft.VoteData} */ proto.chainedbft.VoteMsg.prototype.getVotedata = function() { return /** @type{?proto.chainedbft.VoteData} */ ( jspb.Message.getWrapperField(this, proto.chainedbft.VoteData, 1)); }; /** * @param {?proto.chainedbft.VoteData|undefined} value * @return {!proto.chainedbft.VoteMsg} returns this */ proto.chainedbft.VoteMsg.prototype.setVotedata = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.chainedbft.VoteMsg} returns this */ proto.chainedbft.VoteMsg.prototype.clearVotedata = function() { return this.setVotedata(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.chainedbft.VoteMsg.prototype.hasVotedata = function() { return jspb.Message.getField(this, 1) != null; }; /** * optional SyncInfo SyncInfo = 2; * @return {?proto.chainedbft.SyncInfo} */ proto.chainedbft.VoteMsg.prototype.getSyncinfo = function() { return /** @type{?proto.chainedbft.SyncInfo} */ ( jspb.Message.getWrapperField(this, proto.chainedbft.SyncInfo, 2)); }; /** * @param {?proto.chainedbft.SyncInfo|undefined} value * @return {!proto.chainedbft.VoteMsg} returns this */ proto.chainedbft.VoteMsg.prototype.setSyncinfo = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.chainedbft.VoteMsg} returns this */ proto.chainedbft.VoteMsg.prototype.clearSyncinfo = function() { return this.setSyncinfo(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.chainedbft.VoteMsg.prototype.hasSyncinfo = function() { return jspb.Message.getField(this, 2) != null; }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.chainedbft.BlockFetchMsg.prototype.toObject = function(opt_includeInstance) { return proto.chainedbft.BlockFetchMsg.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.chainedbft.BlockFetchMsg} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.BlockFetchMsg.toObject = function(includeInstance, msg) { var f, obj = { blockid: msg.getBlockid_asB64(), height: jspb.Message.getFieldWithDefault(msg, 2, 0), numblocks: jspb.Message.getFieldWithDefault(msg, 3, 0), authoridx: jspb.Message.getFieldWithDefault(msg, 4, 0), reqid: jspb.Message.getFieldWithDefault(msg, 5, 0), commitblock: msg.getCommitblock_asB64(), lockedblock: msg.getLockedblock_asB64() }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.chainedbft.BlockFetchMsg} */ proto.chainedbft.BlockFetchMsg.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.chainedbft.BlockFetchMsg; return proto.chainedbft.BlockFetchMsg.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.chainedbft.BlockFetchMsg} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.chainedbft.BlockFetchMsg} */ proto.chainedbft.BlockFetchMsg.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setBlockid(value); break; case 2: var value = /** @type {number} */ (reader.readUint64()); msg.setHeight(value); break; case 3: var value = /** @type {number} */ (reader.readUint64()); msg.setNumblocks(value); break; case 4: var value = /** @type {number} */ (reader.readUint64()); msg.setAuthoridx(value); break; case 5: var value = /** @type {number} */ (reader.readUint64()); msg.setReqid(value); break; case 6: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setCommitblock(value); break; case 7: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setLockedblock(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.chainedbft.BlockFetchMsg.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.chainedbft.BlockFetchMsg.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.chainedbft.BlockFetchMsg} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.BlockFetchMsg.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getBlockid_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } f = message.getHeight(); if (f !== 0) { writer.writeUint64( 2, f ); } f = message.getNumblocks(); if (f !== 0) { writer.writeUint64( 3, f ); } f = message.getAuthoridx(); if (f !== 0) { writer.writeUint64( 4, f ); } f = message.getReqid(); if (f !== 0) { writer.writeUint64( 5, f ); } f = message.getCommitblock_asU8(); if (f.length > 0) { writer.writeBytes( 6, f ); } f = message.getLockedblock_asU8(); if (f.length > 0) { writer.writeBytes( 7, f ); } }; /** * optional bytes BlockID = 1; * @return {!(string|Uint8Array)} */ proto.chainedbft.BlockFetchMsg.prototype.getBlockid = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** * optional bytes BlockID = 1; * This is a type-conversion wrapper around `getBlockid()` * @return {string} */ proto.chainedbft.BlockFetchMsg.prototype.getBlockid_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getBlockid())); }; /** * optional bytes BlockID = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getBlockid()` * @return {!Uint8Array} */ proto.chainedbft.BlockFetchMsg.prototype.getBlockid_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getBlockid())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.chainedbft.BlockFetchMsg} returns this */ proto.chainedbft.BlockFetchMsg.prototype.setBlockid = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** * optional uint64 Height = 2; * @return {number} */ proto.chainedbft.BlockFetchMsg.prototype.getHeight = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** * @param {number} value * @return {!proto.chainedbft.BlockFetchMsg} returns this */ proto.chainedbft.BlockFetchMsg.prototype.setHeight = function(value) { return jspb.Message.setProto3IntField(this, 2, value); }; /** * optional uint64 NumBlocks = 3; * @return {number} */ proto.chainedbft.BlockFetchMsg.prototype.getNumblocks = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** * @param {number} value * @return {!proto.chainedbft.BlockFetchMsg} returns this */ proto.chainedbft.BlockFetchMsg.prototype.setNumblocks = function(value) { return jspb.Message.setProto3IntField(this, 3, value); }; /** * optional uint64 AuthorIdx = 4; * @return {number} */ proto.chainedbft.BlockFetchMsg.prototype.getAuthoridx = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); }; /** * @param {number} value * @return {!proto.chainedbft.BlockFetchMsg} returns this */ proto.chainedbft.BlockFetchMsg.prototype.setAuthoridx = function(value) { return jspb.Message.setProto3IntField(this, 4, value); }; /** * optional uint64 ReqID = 5; * @return {number} */ proto.chainedbft.BlockFetchMsg.prototype.getReqid = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); }; /** * @param {number} value * @return {!proto.chainedbft.BlockFetchMsg} returns this */ proto.chainedbft.BlockFetchMsg.prototype.setReqid = function(value) { return jspb.Message.setProto3IntField(this, 5, value); }; /** * optional bytes CommitBlock = 6; * @return {!(string|Uint8Array)} */ proto.chainedbft.BlockFetchMsg.prototype.getCommitblock = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 6, "")); }; /** * optional bytes CommitBlock = 6; * This is a type-conversion wrapper around `getCommitblock()` * @return {string} */ proto.chainedbft.BlockFetchMsg.prototype.getCommitblock_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getCommitblock())); }; /** * optional bytes CommitBlock = 6; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getCommitblock()` * @return {!Uint8Array} */ proto.chainedbft.BlockFetchMsg.prototype.getCommitblock_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getCommitblock())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.chainedbft.BlockFetchMsg} returns this */ proto.chainedbft.BlockFetchMsg.prototype.setCommitblock = function(value) { return jspb.Message.setProto3BytesField(this, 6, value); }; /** * optional bytes LockedBLock = 7; * @return {!(string|Uint8Array)} */ proto.chainedbft.BlockFetchMsg.prototype.getLockedblock = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 7, "")); }; /** * optional bytes LockedBLock = 7; * This is a type-conversion wrapper around `getLockedblock()` * @return {string} */ proto.chainedbft.BlockFetchMsg.prototype.getLockedblock_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getLockedblock())); }; /** * optional bytes LockedBLock = 7; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getLockedblock()` * @return {!Uint8Array} */ proto.chainedbft.BlockFetchMsg.prototype.getLockedblock_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getLockedblock())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.chainedbft.BlockFetchMsg} returns this */ proto.chainedbft.BlockFetchMsg.prototype.setLockedblock = function(value) { return jspb.Message.setProto3BytesField(this, 7, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.chainedbft.BlockPair.prototype.toObject = function(opt_includeInstance) { return proto.chainedbft.BlockPair.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.chainedbft.BlockPair} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.BlockPair.toObject = function(includeInstance, msg) { var f, obj = { block: (f = msg.getBlock()) && common_block_pb.Block.toObject(includeInstance, f), qc: (f = msg.getQc()) && proto.chainedbft.QuorumCert.toObject(includeInstance, f) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.chainedbft.BlockPair} */ proto.chainedbft.BlockPair.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.chainedbft.BlockPair; return proto.chainedbft.BlockPair.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.chainedbft.BlockPair} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.chainedbft.BlockPair} */ proto.chainedbft.BlockPair.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new common_block_pb.Block; reader.readMessage(value,common_block_pb.Block.deserializeBinaryFromReader); msg.setBlock(value); break; case 2: var value = new proto.chainedbft.QuorumCert; reader.readMessage(value,proto.chainedbft.QuorumCert.deserializeBinaryFromReader); msg.setQc(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.chainedbft.BlockPair.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.chainedbft.BlockPair.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.chainedbft.BlockPair} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.BlockPair.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getBlock(); if (f != null) { writer.writeMessage( 1, f, common_block_pb.Block.serializeBinaryToWriter ); } f = message.getQc(); if (f != null) { writer.writeMessage( 2, f, proto.chainedbft.QuorumCert.serializeBinaryToWriter ); } }; /** * optional common.Block Block = 1; * @return {?proto.common.Block} */ proto.chainedbft.BlockPair.prototype.getBlock = function() { return /** @type{?proto.common.Block} */ ( jspb.Message.getWrapperField(this, common_block_pb.Block, 1)); }; /** * @param {?proto.common.Block|undefined} value * @return {!proto.chainedbft.BlockPair} returns this */ proto.chainedbft.BlockPair.prototype.setBlock = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.chainedbft.BlockPair} returns this */ proto.chainedbft.BlockPair.prototype.clearBlock = function() { return this.setBlock(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.chainedbft.BlockPair.prototype.hasBlock = function() { return jspb.Message.getField(this, 1) != null; }; /** * optional QuorumCert QC = 2; * @return {?proto.chainedbft.QuorumCert} */ proto.chainedbft.BlockPair.prototype.getQc = function() { return /** @type{?proto.chainedbft.QuorumCert} */ ( jspb.Message.getWrapperField(this, proto.chainedbft.QuorumCert, 2)); }; /** * @param {?proto.chainedbft.QuorumCert|undefined} value * @return {!proto.chainedbft.BlockPair} returns this */ proto.chainedbft.BlockPair.prototype.setQc = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.chainedbft.BlockPair} returns this */ proto.chainedbft.BlockPair.prototype.clearQc = function() { return this.setQc(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.chainedbft.BlockPair.prototype.hasQc = function() { return jspb.Message.getField(this, 2) != null; }; /** * List of repeated fields within this message type. * @private {!Array} * @const */ proto.chainedbft.BlockFetchRespMsg.repeatedFields_ = [2]; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.chainedbft.BlockFetchRespMsg.prototype.toObject = function(opt_includeInstance) { return proto.chainedbft.BlockFetchRespMsg.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.chainedbft.BlockFetchRespMsg} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.BlockFetchRespMsg.toObject = function(includeInstance, msg) { var f, obj = { status: jspb.Message.getFieldWithDefault(msg, 1, 0), blocksList: jspb.Message.toObjectList(msg.getBlocksList(), proto.chainedbft.BlockPair.toObject, includeInstance), authoridx: jspb.Message.getFieldWithDefault(msg, 3, 0), respid: jspb.Message.getFieldWithDefault(msg, 4, 0) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.chainedbft.BlockFetchRespMsg} */ proto.chainedbft.BlockFetchRespMsg.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.chainedbft.BlockFetchRespMsg; return proto.chainedbft.BlockFetchRespMsg.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.chainedbft.BlockFetchRespMsg} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.chainedbft.BlockFetchRespMsg} */ proto.chainedbft.BlockFetchRespMsg.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!proto.chainedbft.BlockFetchStatus} */ (reader.readEnum()); msg.setStatus(value); break; case 2: var value = new proto.chainedbft.BlockPair; reader.readMessage(value,proto.chainedbft.BlockPair.deserializeBinaryFromReader); msg.addBlocks(value); break; case 3: var value = /** @type {number} */ (reader.readUint64()); msg.setAuthoridx(value); break; case 4: var value = /** @type {number} */ (reader.readUint64()); msg.setRespid(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.chainedbft.BlockFetchRespMsg.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.chainedbft.BlockFetchRespMsg.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.chainedbft.BlockFetchRespMsg} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.BlockFetchRespMsg.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getStatus(); if (f !== 0.0) { writer.writeEnum( 1, f ); } f = message.getBlocksList(); if (f.length > 0) { writer.writeRepeatedMessage( 2, f, proto.chainedbft.BlockPair.serializeBinaryToWriter ); } f = message.getAuthoridx(); if (f !== 0) { writer.writeUint64( 3, f ); } f = message.getRespid(); if (f !== 0) { writer.writeUint64( 4, f ); } }; /** * optional BlockFetchStatus Status = 1; * @return {!proto.chainedbft.BlockFetchStatus} */ proto.chainedbft.BlockFetchRespMsg.prototype.getStatus = function() { return /** @type {!proto.chainedbft.BlockFetchStatus} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** * @param {!proto.chainedbft.BlockFetchStatus} value * @return {!proto.chainedbft.BlockFetchRespMsg} returns this */ proto.chainedbft.BlockFetchRespMsg.prototype.setStatus = function(value) { return jspb.Message.setProto3EnumField(this, 1, value); }; /** * repeated BlockPair Blocks = 2; * @return {!Array} */ proto.chainedbft.BlockFetchRespMsg.prototype.getBlocksList = function() { return /** @type{!Array} */ ( jspb.Message.getRepeatedWrapperField(this, proto.chainedbft.BlockPair, 2)); }; /** * @param {!Array} value * @return {!proto.chainedbft.BlockFetchRespMsg} returns this */ proto.chainedbft.BlockFetchRespMsg.prototype.setBlocksList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 2, value); }; /** * @param {!proto.chainedbft.BlockPair=} opt_value * @param {number=} opt_index * @return {!proto.chainedbft.BlockPair} */ proto.chainedbft.BlockFetchRespMsg.prototype.addBlocks = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.chainedbft.BlockPair, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.chainedbft.BlockFetchRespMsg} returns this */ proto.chainedbft.BlockFetchRespMsg.prototype.clearBlocksList = function() { return this.setBlocksList([]); }; /** * optional uint64 AuthorIdx = 3; * @return {number} */ proto.chainedbft.BlockFetchRespMsg.prototype.getAuthoridx = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** * @param {number} value * @return {!proto.chainedbft.BlockFetchRespMsg} returns this */ proto.chainedbft.BlockFetchRespMsg.prototype.setAuthoridx = function(value) { return jspb.Message.setProto3IntField(this, 3, value); }; /** * optional uint64 RespID = 4; * @return {number} */ proto.chainedbft.BlockFetchRespMsg.prototype.getRespid = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); }; /** * @param {number} value * @return {!proto.chainedbft.BlockFetchRespMsg} returns this */ proto.chainedbft.BlockFetchRespMsg.prototype.setRespid = function(value) { return jspb.Message.setProto3IntField(this, 4, value); }; /** * Oneof group definitions for this message. Each group defines the field * numbers belonging to that group. When of these fields' value is set, all * other fields in the group are cleared. During deserialization, if multiple * fields are encountered for a group, only the last value seen will be kept. * @private {!Array>} * @const */ proto.chainedbft.ConsensusPayload.oneofGroups_ = [[2,3,4,5]]; /** * @enum {number} */ proto.chainedbft.ConsensusPayload.DataCase = { DATA_NOT_SET: 0, PROPOSALMSG: 2, VOTEMSG: 3, BLOCKFETCHMSG: 4, BLOCKFETCHRESPMSG: 5 }; /** * @return {proto.chainedbft.ConsensusPayload.DataCase} */ proto.chainedbft.ConsensusPayload.prototype.getDataCase = function() { return /** @type {proto.chainedbft.ConsensusPayload.DataCase} */(jspb.Message.computeOneofCase(this, proto.chainedbft.ConsensusPayload.oneofGroups_[0])); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.chainedbft.ConsensusPayload.prototype.toObject = function(opt_includeInstance) { return proto.chainedbft.ConsensusPayload.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.chainedbft.ConsensusPayload} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.ConsensusPayload.toObject = function(includeInstance, msg) { var f, obj = { type: jspb.Message.getFieldWithDefault(msg, 1, 0), proposalmsg: (f = msg.getProposalmsg()) && proto.chainedbft.ProposalMsg.toObject(includeInstance, f), votemsg: (f = msg.getVotemsg()) && proto.chainedbft.VoteMsg.toObject(includeInstance, f), blockfetchmsg: (f = msg.getBlockfetchmsg()) && proto.chainedbft.BlockFetchMsg.toObject(includeInstance, f), blockfetchrespmsg: (f = msg.getBlockfetchrespmsg()) && proto.chainedbft.BlockFetchRespMsg.toObject(includeInstance, f) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.chainedbft.ConsensusPayload} */ proto.chainedbft.ConsensusPayload.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.chainedbft.ConsensusPayload; return proto.chainedbft.ConsensusPayload.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.chainedbft.ConsensusPayload} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.chainedbft.ConsensusPayload} */ proto.chainedbft.ConsensusPayload.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {!proto.chainedbft.MessageType} */ (reader.readEnum()); msg.setType(value); break; case 2: var value = new proto.chainedbft.ProposalMsg; reader.readMessage(value,proto.chainedbft.ProposalMsg.deserializeBinaryFromReader); msg.setProposalmsg(value); break; case 3: var value = new proto.chainedbft.VoteMsg; reader.readMessage(value,proto.chainedbft.VoteMsg.deserializeBinaryFromReader); msg.setVotemsg(value); break; case 4: var value = new proto.chainedbft.BlockFetchMsg; reader.readMessage(value,proto.chainedbft.BlockFetchMsg.deserializeBinaryFromReader); msg.setBlockfetchmsg(value); break; case 5: var value = new proto.chainedbft.BlockFetchRespMsg; reader.readMessage(value,proto.chainedbft.BlockFetchRespMsg.deserializeBinaryFromReader); msg.setBlockfetchrespmsg(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.chainedbft.ConsensusPayload.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.chainedbft.ConsensusPayload.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.chainedbft.ConsensusPayload} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.ConsensusPayload.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getType(); if (f !== 0.0) { writer.writeEnum( 1, f ); } f = message.getProposalmsg(); if (f != null) { writer.writeMessage( 2, f, proto.chainedbft.ProposalMsg.serializeBinaryToWriter ); } f = message.getVotemsg(); if (f != null) { writer.writeMessage( 3, f, proto.chainedbft.VoteMsg.serializeBinaryToWriter ); } f = message.getBlockfetchmsg(); if (f != null) { writer.writeMessage( 4, f, proto.chainedbft.BlockFetchMsg.serializeBinaryToWriter ); } f = message.getBlockfetchrespmsg(); if (f != null) { writer.writeMessage( 5, f, proto.chainedbft.BlockFetchRespMsg.serializeBinaryToWriter ); } }; /** * optional MessageType Type = 1; * @return {!proto.chainedbft.MessageType} */ proto.chainedbft.ConsensusPayload.prototype.getType = function() { return /** @type {!proto.chainedbft.MessageType} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** * @param {!proto.chainedbft.MessageType} value * @return {!proto.chainedbft.ConsensusPayload} returns this */ proto.chainedbft.ConsensusPayload.prototype.setType = function(value) { return jspb.Message.setProto3EnumField(this, 1, value); }; /** * optional ProposalMsg ProposalMsg = 2; * @return {?proto.chainedbft.ProposalMsg} */ proto.chainedbft.ConsensusPayload.prototype.getProposalmsg = function() { return /** @type{?proto.chainedbft.ProposalMsg} */ ( jspb.Message.getWrapperField(this, proto.chainedbft.ProposalMsg, 2)); }; /** * @param {?proto.chainedbft.ProposalMsg|undefined} value * @return {!proto.chainedbft.ConsensusPayload} returns this */ proto.chainedbft.ConsensusPayload.prototype.setProposalmsg = function(value) { return jspb.Message.setOneofWrapperField(this, 2, proto.chainedbft.ConsensusPayload.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. * @return {!proto.chainedbft.ConsensusPayload} returns this */ proto.chainedbft.ConsensusPayload.prototype.clearProposalmsg = function() { return this.setProposalmsg(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.chainedbft.ConsensusPayload.prototype.hasProposalmsg = function() { return jspb.Message.getField(this, 2) != null; }; /** * optional VoteMsg VoteMsg = 3; * @return {?proto.chainedbft.VoteMsg} */ proto.chainedbft.ConsensusPayload.prototype.getVotemsg = function() { return /** @type{?proto.chainedbft.VoteMsg} */ ( jspb.Message.getWrapperField(this, proto.chainedbft.VoteMsg, 3)); }; /** * @param {?proto.chainedbft.VoteMsg|undefined} value * @return {!proto.chainedbft.ConsensusPayload} returns this */ proto.chainedbft.ConsensusPayload.prototype.setVotemsg = function(value) { return jspb.Message.setOneofWrapperField(this, 3, proto.chainedbft.ConsensusPayload.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. * @return {!proto.chainedbft.ConsensusPayload} returns this */ proto.chainedbft.ConsensusPayload.prototype.clearVotemsg = function() { return this.setVotemsg(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.chainedbft.ConsensusPayload.prototype.hasVotemsg = function() { return jspb.Message.getField(this, 3) != null; }; /** * optional BlockFetchMsg BlockFetchMsg = 4; * @return {?proto.chainedbft.BlockFetchMsg} */ proto.chainedbft.ConsensusPayload.prototype.getBlockfetchmsg = function() { return /** @type{?proto.chainedbft.BlockFetchMsg} */ ( jspb.Message.getWrapperField(this, proto.chainedbft.BlockFetchMsg, 4)); }; /** * @param {?proto.chainedbft.BlockFetchMsg|undefined} value * @return {!proto.chainedbft.ConsensusPayload} returns this */ proto.chainedbft.ConsensusPayload.prototype.setBlockfetchmsg = function(value) { return jspb.Message.setOneofWrapperField(this, 4, proto.chainedbft.ConsensusPayload.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. * @return {!proto.chainedbft.ConsensusPayload} returns this */ proto.chainedbft.ConsensusPayload.prototype.clearBlockfetchmsg = function() { return this.setBlockfetchmsg(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.chainedbft.ConsensusPayload.prototype.hasBlockfetchmsg = function() { return jspb.Message.getField(this, 4) != null; }; /** * optional BlockFetchRespMsg BlockFetchRespMsg = 5; * @return {?proto.chainedbft.BlockFetchRespMsg} */ proto.chainedbft.ConsensusPayload.prototype.getBlockfetchrespmsg = function() { return /** @type{?proto.chainedbft.BlockFetchRespMsg} */ ( jspb.Message.getWrapperField(this, proto.chainedbft.BlockFetchRespMsg, 5)); }; /** * @param {?proto.chainedbft.BlockFetchRespMsg|undefined} value * @return {!proto.chainedbft.ConsensusPayload} returns this */ proto.chainedbft.ConsensusPayload.prototype.setBlockfetchrespmsg = function(value) { return jspb.Message.setOneofWrapperField(this, 5, proto.chainedbft.ConsensusPayload.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. * @return {!proto.chainedbft.ConsensusPayload} returns this */ proto.chainedbft.ConsensusPayload.prototype.clearBlockfetchrespmsg = function() { return this.setBlockfetchrespmsg(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.chainedbft.ConsensusPayload.prototype.hasBlockfetchrespmsg = function() { return jspb.Message.getField(this, 5) != null; }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.chainedbft.ConsensusMsg.prototype.toObject = function(opt_includeInstance) { return proto.chainedbft.ConsensusMsg.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.chainedbft.ConsensusMsg} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.ConsensusMsg.toObject = function(includeInstance, msg) { var f, obj = { payload: (f = msg.getPayload()) && proto.chainedbft.ConsensusPayload.toObject(includeInstance, f), signentry: (f = msg.getSignentry()) && common_request_pb.EndorsementEntry.toObject(includeInstance, f) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.chainedbft.ConsensusMsg} */ proto.chainedbft.ConsensusMsg.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.chainedbft.ConsensusMsg; return proto.chainedbft.ConsensusMsg.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.chainedbft.ConsensusMsg} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.chainedbft.ConsensusMsg} */ proto.chainedbft.ConsensusMsg.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new proto.chainedbft.ConsensusPayload; reader.readMessage(value,proto.chainedbft.ConsensusPayload.deserializeBinaryFromReader); msg.setPayload(value); break; case 2: var value = new common_request_pb.EndorsementEntry; reader.readMessage(value,common_request_pb.EndorsementEntry.deserializeBinaryFromReader); msg.setSignentry(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.chainedbft.ConsensusMsg.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.chainedbft.ConsensusMsg.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.chainedbft.ConsensusMsg} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.ConsensusMsg.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getPayload(); if (f != null) { writer.writeMessage( 1, f, proto.chainedbft.ConsensusPayload.serializeBinaryToWriter ); } f = message.getSignentry(); if (f != null) { writer.writeMessage( 2, f, common_request_pb.EndorsementEntry.serializeBinaryToWriter ); } }; /** * optional ConsensusPayload payload = 1; * @return {?proto.chainedbft.ConsensusPayload} */ proto.chainedbft.ConsensusMsg.prototype.getPayload = function() { return /** @type{?proto.chainedbft.ConsensusPayload} */ ( jspb.Message.getWrapperField(this, proto.chainedbft.ConsensusPayload, 1)); }; /** * @param {?proto.chainedbft.ConsensusPayload|undefined} value * @return {!proto.chainedbft.ConsensusMsg} returns this */ proto.chainedbft.ConsensusMsg.prototype.setPayload = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.chainedbft.ConsensusMsg} returns this */ proto.chainedbft.ConsensusMsg.prototype.clearPayload = function() { return this.setPayload(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.chainedbft.ConsensusMsg.prototype.hasPayload = function() { return jspb.Message.getField(this, 1) != null; }; /** * optional common.EndorsementEntry SignEntry = 2; * @return {?proto.common.EndorsementEntry} */ proto.chainedbft.ConsensusMsg.prototype.getSignentry = function() { return /** @type{?proto.common.EndorsementEntry} */ ( jspb.Message.getWrapperField(this, common_request_pb.EndorsementEntry, 2)); }; /** * @param {?proto.common.EndorsementEntry|undefined} value * @return {!proto.chainedbft.ConsensusMsg} returns this */ proto.chainedbft.ConsensusMsg.prototype.setSignentry = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.chainedbft.ConsensusMsg} returns this */ proto.chainedbft.ConsensusMsg.prototype.clearSignentry = function() { return this.setSignentry(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.chainedbft.ConsensusMsg.prototype.hasSignentry = function() { return jspb.Message.getField(this, 2) != null; }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.chainedbft.BuildProposal.prototype.toObject = function(opt_includeInstance) { return proto.chainedbft.BuildProposal.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.chainedbft.BuildProposal} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.BuildProposal.toObject = function(includeInstance, msg) { var f, obj = { height: jspb.Message.getFieldWithDefault(msg, 1, 0), prehash: msg.getPrehash_asB64(), isproposer: jspb.Message.getBooleanFieldWithDefault(msg, 3, false) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.chainedbft.BuildProposal} */ proto.chainedbft.BuildProposal.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.chainedbft.BuildProposal; return proto.chainedbft.BuildProposal.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.chainedbft.BuildProposal} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.chainedbft.BuildProposal} */ proto.chainedbft.BuildProposal.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {number} */ (reader.readUint64()); msg.setHeight(value); break; case 2: var value = /** @type {!Uint8Array} */ (reader.readBytes()); msg.setPrehash(value); break; case 3: var value = /** @type {boolean} */ (reader.readBool()); msg.setIsproposer(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.chainedbft.BuildProposal.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.chainedbft.BuildProposal.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.chainedbft.BuildProposal} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.BuildProposal.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getHeight(); if (f !== 0) { writer.writeUint64( 1, f ); } f = message.getPrehash_asU8(); if (f.length > 0) { writer.writeBytes( 2, f ); } f = message.getIsproposer(); if (f) { writer.writeBool( 3, f ); } }; /** * optional uint64 Height = 1; * @return {number} */ proto.chainedbft.BuildProposal.prototype.getHeight = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** * @param {number} value * @return {!proto.chainedbft.BuildProposal} returns this */ proto.chainedbft.BuildProposal.prototype.setHeight = function(value) { return jspb.Message.setProto3IntField(this, 1, value); }; /** * optional bytes PreHash = 2; * @return {!(string|Uint8Array)} */ proto.chainedbft.BuildProposal.prototype.getPrehash = function() { return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** * optional bytes PreHash = 2; * This is a type-conversion wrapper around `getPrehash()` * @return {string} */ proto.chainedbft.BuildProposal.prototype.getPrehash_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( this.getPrehash())); }; /** * optional bytes PreHash = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getPrehash()` * @return {!Uint8Array} */ proto.chainedbft.BuildProposal.prototype.getPrehash_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( this.getPrehash())); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.chainedbft.BuildProposal} returns this */ proto.chainedbft.BuildProposal.prototype.setPrehash = function(value) { return jspb.Message.setProto3BytesField(this, 2, value); }; /** * optional bool IsProposer = 3; * @return {boolean} */ proto.chainedbft.BuildProposal.prototype.getIsproposer = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false)); }; /** * @param {boolean} value * @return {!proto.chainedbft.BuildProposal} returns this */ proto.chainedbft.BuildProposal.prototype.setIsproposer = function(value) { return jspb.Message.setProto3BooleanField(this, 3, value); }; if (jspb.Message.GENERATE_TO_OBJECT) { /** * Creates an object representation of this proto. * Field names that are reserved in JavaScript and will be renamed to pb_name. * Optional fields that are not set will be set to undefined. * To access a reserved field use, foo.pb_, eg, foo.pb_default. * For the list of reserved names please see: * net/proto2/compiler/js/internal/generator.cc#kKeyword. * @param {boolean=} opt_includeInstance Deprecated. whether to include the * JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @return {!Object} */ proto.chainedbft.WalEntry.prototype.toObject = function(opt_includeInstance) { return proto.chainedbft.WalEntry.toObject(opt_includeInstance, this); }; /** * Static version of the {@see toObject} method. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration * @param {!proto.chainedbft.WalEntry} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.WalEntry.toObject = function(includeInstance, msg) { var f, obj = { msg: (f = msg.getMsg()) && proto.chainedbft.ConsensusMsg.toObject(includeInstance, f), msgtype: jspb.Message.getFieldWithDefault(msg, 2, 0), lastsnapshotindex: jspb.Message.getFieldWithDefault(msg, 3, 0) }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.chainedbft.WalEntry} */ proto.chainedbft.WalEntry.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.chainedbft.WalEntry; return proto.chainedbft.WalEntry.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.chainedbft.WalEntry} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.chainedbft.WalEntry} */ proto.chainedbft.WalEntry.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new proto.chainedbft.ConsensusMsg; reader.readMessage(value,proto.chainedbft.ConsensusMsg.deserializeBinaryFromReader); msg.setMsg(value); break; case 2: var value = /** @type {!proto.chainedbft.MessageType} */ (reader.readEnum()); msg.setMsgtype(value); break; case 3: var value = /** @type {number} */ (reader.readUint64()); msg.setLastsnapshotindex(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.chainedbft.WalEntry.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.chainedbft.WalEntry.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.chainedbft.WalEntry} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.chainedbft.WalEntry.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getMsg(); if (f != null) { writer.writeMessage( 1, f, proto.chainedbft.ConsensusMsg.serializeBinaryToWriter ); } f = message.getMsgtype(); if (f !== 0.0) { writer.writeEnum( 2, f ); } f = message.getLastsnapshotindex(); if (f !== 0) { writer.writeUint64( 3, f ); } }; /** * optional ConsensusMsg Msg = 1; * @return {?proto.chainedbft.ConsensusMsg} */ proto.chainedbft.WalEntry.prototype.getMsg = function() { return /** @type{?proto.chainedbft.ConsensusMsg} */ ( jspb.Message.getWrapperField(this, proto.chainedbft.ConsensusMsg, 1)); }; /** * @param {?proto.chainedbft.ConsensusMsg|undefined} value * @return {!proto.chainedbft.WalEntry} returns this */ proto.chainedbft.WalEntry.prototype.setMsg = function(value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.chainedbft.WalEntry} returns this */ proto.chainedbft.WalEntry.prototype.clearMsg = function() { return this.setMsg(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.chainedbft.WalEntry.prototype.hasMsg = function() { return jspb.Message.getField(this, 1) != null; }; /** * optional MessageType MsgType = 2; * @return {!proto.chainedbft.MessageType} */ proto.chainedbft.WalEntry.prototype.getMsgtype = function() { return /** @type {!proto.chainedbft.MessageType} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); }; /** * @param {!proto.chainedbft.MessageType} value * @return {!proto.chainedbft.WalEntry} returns this */ proto.chainedbft.WalEntry.prototype.setMsgtype = function(value) { return jspb.Message.setProto3EnumField(this, 2, value); }; /** * optional uint64 LastSnapshotIndex = 3; * @return {number} */ proto.chainedbft.WalEntry.prototype.getLastsnapshotindex = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** * @param {number} value * @return {!proto.chainedbft.WalEntry} returns this */ proto.chainedbft.WalEntry.prototype.setLastsnapshotindex = function(value) { return jspb.Message.setProto3IntField(this, 3, value); }; /** * @enum {number} */ proto.chainedbft.BlockFetchStatus = { SUCCEEDED: 0, IDNOTFOUND: 1, NOTENOUGHBLOCKS: 2 }; /** * @enum {number} */ proto.chainedbft.ConsStateType = { NEWHEIGHT: 0, NEWLEVEL: 1, PROPOSE: 2, VOTE: 3, PACEMAKER: 4 }; /** * @enum {number} */ proto.chainedbft.MessageType = { PROPOSALMESSAGE: 0, VOTEMESSAGE: 1, BLOCKFETCHMESSAGE: 2, BLOCKFETCHRESPMESSAGE: 3 }; goog.object.extend(exports, proto.chainedbft);