UNPKG

@provenanceio/wallet-utils

Version:

Typescript Utilities for Provenance Blockchain Wallet

1,298 lines (1,061 loc) 39.5 kB
"use strict"; // source: tendermint/consensus/wal.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 || window || global || self || Function('return this')(); }.call(null); var gogoproto_gogo_pb = require('../../gogoproto/gogo_pb.js'); goog.object.extend(proto, gogoproto_gogo_pb); var tendermint_consensus_types_pb = require('../../tendermint/consensus/types_pb.js'); goog.object.extend(proto, tendermint_consensus_types_pb); var tendermint_types_events_pb = require('../../tendermint/types/events_pb.js'); goog.object.extend(proto, tendermint_types_events_pb); var google_protobuf_duration_pb = require('google-protobuf/google/protobuf/duration_pb.js'); goog.object.extend(proto, google_protobuf_duration_pb); var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js'); goog.object.extend(proto, google_protobuf_timestamp_pb); goog.exportSymbol('proto.tendermint.consensus.EndHeight', null, global); goog.exportSymbol('proto.tendermint.consensus.MsgInfo', null, global); goog.exportSymbol('proto.tendermint.consensus.TimedWALMessage', null, global); goog.exportSymbol('proto.tendermint.consensus.TimeoutInfo', null, global); goog.exportSymbol('proto.tendermint.consensus.WALMessage', null, global); goog.exportSymbol('proto.tendermint.consensus.WALMessage.SumCase', 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.tendermint.consensus.MsgInfo = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.tendermint.consensus.MsgInfo, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.tendermint.consensus.MsgInfo.displayName = 'proto.tendermint.consensus.MsgInfo'; } /** * 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.tendermint.consensus.TimeoutInfo = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.tendermint.consensus.TimeoutInfo, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.tendermint.consensus.TimeoutInfo.displayName = 'proto.tendermint.consensus.TimeoutInfo'; } /** * 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.tendermint.consensus.EndHeight = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.tendermint.consensus.EndHeight, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.tendermint.consensus.EndHeight.displayName = 'proto.tendermint.consensus.EndHeight'; } /** * 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.tendermint.consensus.WALMessage = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, proto.tendermint.consensus.WALMessage.oneofGroups_); }; goog.inherits(proto.tendermint.consensus.WALMessage, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.tendermint.consensus.WALMessage.displayName = 'proto.tendermint.consensus.WALMessage'; } /** * 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.tendermint.consensus.TimedWALMessage = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.tendermint.consensus.TimedWALMessage, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.tendermint.consensus.TimedWALMessage.displayName = 'proto.tendermint.consensus.TimedWALMessage'; } 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_<name>, 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.tendermint.consensus.MsgInfo.prototype.toObject = function (opt_includeInstance) { return proto.tendermint.consensus.MsgInfo.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.tendermint.consensus.MsgInfo} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.tendermint.consensus.MsgInfo.toObject = function (includeInstance, msg) { var f, obj = { msg: (f = msg.getMsg()) && tendermint_consensus_types_pb.Message.toObject(includeInstance, f), peerId: jspb.Message.getFieldWithDefault(msg, 2, "") }; if (includeInstance) { obj.$jspbMessageInstance = msg; } return obj; }; } /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. * @return {!proto.tendermint.consensus.MsgInfo} */ proto.tendermint.consensus.MsgInfo.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.tendermint.consensus.MsgInfo(); return proto.tendermint.consensus.MsgInfo.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.tendermint.consensus.MsgInfo} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.tendermint.consensus.MsgInfo} */ proto.tendermint.consensus.MsgInfo.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new tendermint_consensus_types_pb.Message(); reader.readMessage(value, tendermint_consensus_types_pb.Message.deserializeBinaryFromReader); msg.setMsg(value); break; case 2: var value = /** @type {string} */ reader.readString(); msg.setPeerId(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.tendermint.consensus.MsgInfo.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); proto.tendermint.consensus.MsgInfo.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.tendermint.consensus.MsgInfo} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.tendermint.consensus.MsgInfo.serializeBinaryToWriter = function (message, writer) { var f = undefined; f = message.getMsg(); if (f != null) { writer.writeMessage(1, f, tendermint_consensus_types_pb.Message.serializeBinaryToWriter); } f = message.getPeerId(); if (f.length > 0) { writer.writeString(2, f); } }; /** * optional Message msg = 1; * @return {?proto.tendermint.consensus.Message} */ proto.tendermint.consensus.MsgInfo.prototype.getMsg = function () { return ( /** @type{?proto.tendermint.consensus.Message} */ jspb.Message.getWrapperField(this, tendermint_consensus_types_pb.Message, 1) ); }; /** * @param {?proto.tendermint.consensus.Message|undefined} value * @return {!proto.tendermint.consensus.MsgInfo} returns this */ proto.tendermint.consensus.MsgInfo.prototype.setMsg = function (value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.tendermint.consensus.MsgInfo} returns this */ proto.tendermint.consensus.MsgInfo.prototype.clearMsg = function () { return this.setMsg(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.tendermint.consensus.MsgInfo.prototype.hasMsg = function () { return jspb.Message.getField(this, 1) != null; }; /** * optional string peer_id = 2; * @return {string} */ proto.tendermint.consensus.MsgInfo.prototype.getPeerId = function () { return ( /** @type {string} */ jspb.Message.getFieldWithDefault(this, 2, "") ); }; /** * @param {string} value * @return {!proto.tendermint.consensus.MsgInfo} returns this */ proto.tendermint.consensus.MsgInfo.prototype.setPeerId = function (value) { return jspb.Message.setProto3StringField(this, 2, 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_<name>, 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.tendermint.consensus.TimeoutInfo.prototype.toObject = function (opt_includeInstance) { return proto.tendermint.consensus.TimeoutInfo.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.tendermint.consensus.TimeoutInfo} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.tendermint.consensus.TimeoutInfo.toObject = function (includeInstance, msg) { var f, obj = { duration: (f = msg.getDuration()) && google_protobuf_duration_pb.Duration.toObject(includeInstance, f), height: jspb.Message.getFieldWithDefault(msg, 2, 0), round: jspb.Message.getFieldWithDefault(msg, 3, 0), step: 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.tendermint.consensus.TimeoutInfo} */ proto.tendermint.consensus.TimeoutInfo.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.tendermint.consensus.TimeoutInfo(); return proto.tendermint.consensus.TimeoutInfo.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.tendermint.consensus.TimeoutInfo} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.tendermint.consensus.TimeoutInfo} */ proto.tendermint.consensus.TimeoutInfo.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new google_protobuf_duration_pb.Duration(); reader.readMessage(value, google_protobuf_duration_pb.Duration.deserializeBinaryFromReader); msg.setDuration(value); break; case 2: var value = /** @type {number} */ reader.readInt64(); msg.setHeight(value); break; case 3: var value = /** @type {number} */ reader.readInt32(); msg.setRound(value); break; case 4: var value = /** @type {number} */ reader.readUint32(); msg.setStep(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.tendermint.consensus.TimeoutInfo.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); proto.tendermint.consensus.TimeoutInfo.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.tendermint.consensus.TimeoutInfo} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.tendermint.consensus.TimeoutInfo.serializeBinaryToWriter = function (message, writer) { var f = undefined; f = message.getDuration(); if (f != null) { writer.writeMessage(1, f, google_protobuf_duration_pb.Duration.serializeBinaryToWriter); } f = message.getHeight(); if (f !== 0) { writer.writeInt64(2, f); } f = message.getRound(); if (f !== 0) { writer.writeInt32(3, f); } f = message.getStep(); if (f !== 0) { writer.writeUint32(4, f); } }; /** * optional google.protobuf.Duration duration = 1; * @return {?proto.google.protobuf.Duration} */ proto.tendermint.consensus.TimeoutInfo.prototype.getDuration = function () { return ( /** @type{?proto.google.protobuf.Duration} */ jspb.Message.getWrapperField(this, google_protobuf_duration_pb.Duration, 1) ); }; /** * @param {?proto.google.protobuf.Duration|undefined} value * @return {!proto.tendermint.consensus.TimeoutInfo} returns this */ proto.tendermint.consensus.TimeoutInfo.prototype.setDuration = function (value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.tendermint.consensus.TimeoutInfo} returns this */ proto.tendermint.consensus.TimeoutInfo.prototype.clearDuration = function () { return this.setDuration(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.tendermint.consensus.TimeoutInfo.prototype.hasDuration = function () { return jspb.Message.getField(this, 1) != null; }; /** * optional int64 height = 2; * @return {number} */ proto.tendermint.consensus.TimeoutInfo.prototype.getHeight = function () { return ( /** @type {number} */ jspb.Message.getFieldWithDefault(this, 2, 0) ); }; /** * @param {number} value * @return {!proto.tendermint.consensus.TimeoutInfo} returns this */ proto.tendermint.consensus.TimeoutInfo.prototype.setHeight = function (value) { return jspb.Message.setProto3IntField(this, 2, value); }; /** * optional int32 round = 3; * @return {number} */ proto.tendermint.consensus.TimeoutInfo.prototype.getRound = function () { return ( /** @type {number} */ jspb.Message.getFieldWithDefault(this, 3, 0) ); }; /** * @param {number} value * @return {!proto.tendermint.consensus.TimeoutInfo} returns this */ proto.tendermint.consensus.TimeoutInfo.prototype.setRound = function (value) { return jspb.Message.setProto3IntField(this, 3, value); }; /** * optional uint32 step = 4; * @return {number} */ proto.tendermint.consensus.TimeoutInfo.prototype.getStep = function () { return ( /** @type {number} */ jspb.Message.getFieldWithDefault(this, 4, 0) ); }; /** * @param {number} value * @return {!proto.tendermint.consensus.TimeoutInfo} returns this */ proto.tendermint.consensus.TimeoutInfo.prototype.setStep = function (value) { return jspb.Message.setProto3IntField(this, 4, 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_<name>, 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.tendermint.consensus.EndHeight.prototype.toObject = function (opt_includeInstance) { return proto.tendermint.consensus.EndHeight.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.tendermint.consensus.EndHeight} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.tendermint.consensus.EndHeight.toObject = function (includeInstance, msg) { var f, obj = { height: jspb.Message.getFieldWithDefault(msg, 1, 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.tendermint.consensus.EndHeight} */ proto.tendermint.consensus.EndHeight.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.tendermint.consensus.EndHeight(); return proto.tendermint.consensus.EndHeight.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.tendermint.consensus.EndHeight} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.tendermint.consensus.EndHeight} */ proto.tendermint.consensus.EndHeight.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {number} */ reader.readInt64(); msg.setHeight(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.tendermint.consensus.EndHeight.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); proto.tendermint.consensus.EndHeight.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.tendermint.consensus.EndHeight} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.tendermint.consensus.EndHeight.serializeBinaryToWriter = function (message, writer) { var f = undefined; f = message.getHeight(); if (f !== 0) { writer.writeInt64(1, f); } }; /** * optional int64 height = 1; * @return {number} */ proto.tendermint.consensus.EndHeight.prototype.getHeight = function () { return ( /** @type {number} */ jspb.Message.getFieldWithDefault(this, 1, 0) ); }; /** * @param {number} value * @return {!proto.tendermint.consensus.EndHeight} returns this */ proto.tendermint.consensus.EndHeight.prototype.setHeight = function (value) { return jspb.Message.setProto3IntField(this, 1, 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<!Array<number>>} * @const */ proto.tendermint.consensus.WALMessage.oneofGroups_ = [[1, 2, 3, 4]]; /** * @enum {number} */ proto.tendermint.consensus.WALMessage.SumCase = { SUM_NOT_SET: 0, EVENT_DATA_ROUND_STATE: 1, MSG_INFO: 2, TIMEOUT_INFO: 3, END_HEIGHT: 4 }; /** * @return {proto.tendermint.consensus.WALMessage.SumCase} */ proto.tendermint.consensus.WALMessage.prototype.getSumCase = function () { return ( /** @type {proto.tendermint.consensus.WALMessage.SumCase} */ jspb.Message.computeOneofCase(this, proto.tendermint.consensus.WALMessage.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_<name>, 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.tendermint.consensus.WALMessage.prototype.toObject = function (opt_includeInstance) { return proto.tendermint.consensus.WALMessage.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.tendermint.consensus.WALMessage} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.tendermint.consensus.WALMessage.toObject = function (includeInstance, msg) { var f, obj = { eventDataRoundState: (f = msg.getEventDataRoundState()) && tendermint_types_events_pb.EventDataRoundState.toObject(includeInstance, f), msgInfo: (f = msg.getMsgInfo()) && proto.tendermint.consensus.MsgInfo.toObject(includeInstance, f), timeoutInfo: (f = msg.getTimeoutInfo()) && proto.tendermint.consensus.TimeoutInfo.toObject(includeInstance, f), endHeight: (f = msg.getEndHeight()) && proto.tendermint.consensus.EndHeight.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.tendermint.consensus.WALMessage} */ proto.tendermint.consensus.WALMessage.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.tendermint.consensus.WALMessage(); return proto.tendermint.consensus.WALMessage.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.tendermint.consensus.WALMessage} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.tendermint.consensus.WALMessage} */ proto.tendermint.consensus.WALMessage.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new tendermint_types_events_pb.EventDataRoundState(); reader.readMessage(value, tendermint_types_events_pb.EventDataRoundState.deserializeBinaryFromReader); msg.setEventDataRoundState(value); break; case 2: var value = new proto.tendermint.consensus.MsgInfo(); reader.readMessage(value, proto.tendermint.consensus.MsgInfo.deserializeBinaryFromReader); msg.setMsgInfo(value); break; case 3: var value = new proto.tendermint.consensus.TimeoutInfo(); reader.readMessage(value, proto.tendermint.consensus.TimeoutInfo.deserializeBinaryFromReader); msg.setTimeoutInfo(value); break; case 4: var value = new proto.tendermint.consensus.EndHeight(); reader.readMessage(value, proto.tendermint.consensus.EndHeight.deserializeBinaryFromReader); msg.setEndHeight(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.tendermint.consensus.WALMessage.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); proto.tendermint.consensus.WALMessage.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.tendermint.consensus.WALMessage} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.tendermint.consensus.WALMessage.serializeBinaryToWriter = function (message, writer) { var f = undefined; f = message.getEventDataRoundState(); if (f != null) { writer.writeMessage(1, f, tendermint_types_events_pb.EventDataRoundState.serializeBinaryToWriter); } f = message.getMsgInfo(); if (f != null) { writer.writeMessage(2, f, proto.tendermint.consensus.MsgInfo.serializeBinaryToWriter); } f = message.getTimeoutInfo(); if (f != null) { writer.writeMessage(3, f, proto.tendermint.consensus.TimeoutInfo.serializeBinaryToWriter); } f = message.getEndHeight(); if (f != null) { writer.writeMessage(4, f, proto.tendermint.consensus.EndHeight.serializeBinaryToWriter); } }; /** * optional tendermint.types.EventDataRoundState event_data_round_state = 1; * @return {?proto.tendermint.types.EventDataRoundState} */ proto.tendermint.consensus.WALMessage.prototype.getEventDataRoundState = function () { return ( /** @type{?proto.tendermint.types.EventDataRoundState} */ jspb.Message.getWrapperField(this, tendermint_types_events_pb.EventDataRoundState, 1) ); }; /** * @param {?proto.tendermint.types.EventDataRoundState|undefined} value * @return {!proto.tendermint.consensus.WALMessage} returns this */ proto.tendermint.consensus.WALMessage.prototype.setEventDataRoundState = function (value) { return jspb.Message.setOneofWrapperField(this, 1, proto.tendermint.consensus.WALMessage.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. * @return {!proto.tendermint.consensus.WALMessage} returns this */ proto.tendermint.consensus.WALMessage.prototype.clearEventDataRoundState = function () { return this.setEventDataRoundState(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.tendermint.consensus.WALMessage.prototype.hasEventDataRoundState = function () { return jspb.Message.getField(this, 1) != null; }; /** * optional MsgInfo msg_info = 2; * @return {?proto.tendermint.consensus.MsgInfo} */ proto.tendermint.consensus.WALMessage.prototype.getMsgInfo = function () { return ( /** @type{?proto.tendermint.consensus.MsgInfo} */ jspb.Message.getWrapperField(this, proto.tendermint.consensus.MsgInfo, 2) ); }; /** * @param {?proto.tendermint.consensus.MsgInfo|undefined} value * @return {!proto.tendermint.consensus.WALMessage} returns this */ proto.tendermint.consensus.WALMessage.prototype.setMsgInfo = function (value) { return jspb.Message.setOneofWrapperField(this, 2, proto.tendermint.consensus.WALMessage.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. * @return {!proto.tendermint.consensus.WALMessage} returns this */ proto.tendermint.consensus.WALMessage.prototype.clearMsgInfo = function () { return this.setMsgInfo(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.tendermint.consensus.WALMessage.prototype.hasMsgInfo = function () { return jspb.Message.getField(this, 2) != null; }; /** * optional TimeoutInfo timeout_info = 3; * @return {?proto.tendermint.consensus.TimeoutInfo} */ proto.tendermint.consensus.WALMessage.prototype.getTimeoutInfo = function () { return ( /** @type{?proto.tendermint.consensus.TimeoutInfo} */ jspb.Message.getWrapperField(this, proto.tendermint.consensus.TimeoutInfo, 3) ); }; /** * @param {?proto.tendermint.consensus.TimeoutInfo|undefined} value * @return {!proto.tendermint.consensus.WALMessage} returns this */ proto.tendermint.consensus.WALMessage.prototype.setTimeoutInfo = function (value) { return jspb.Message.setOneofWrapperField(this, 3, proto.tendermint.consensus.WALMessage.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. * @return {!proto.tendermint.consensus.WALMessage} returns this */ proto.tendermint.consensus.WALMessage.prototype.clearTimeoutInfo = function () { return this.setTimeoutInfo(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.tendermint.consensus.WALMessage.prototype.hasTimeoutInfo = function () { return jspb.Message.getField(this, 3) != null; }; /** * optional EndHeight end_height = 4; * @return {?proto.tendermint.consensus.EndHeight} */ proto.tendermint.consensus.WALMessage.prototype.getEndHeight = function () { return ( /** @type{?proto.tendermint.consensus.EndHeight} */ jspb.Message.getWrapperField(this, proto.tendermint.consensus.EndHeight, 4) ); }; /** * @param {?proto.tendermint.consensus.EndHeight|undefined} value * @return {!proto.tendermint.consensus.WALMessage} returns this */ proto.tendermint.consensus.WALMessage.prototype.setEndHeight = function (value) { return jspb.Message.setOneofWrapperField(this, 4, proto.tendermint.consensus.WALMessage.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. * @return {!proto.tendermint.consensus.WALMessage} returns this */ proto.tendermint.consensus.WALMessage.prototype.clearEndHeight = function () { return this.setEndHeight(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.tendermint.consensus.WALMessage.prototype.hasEndHeight = function () { return jspb.Message.getField(this, 4) != 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_<name>, 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.tendermint.consensus.TimedWALMessage.prototype.toObject = function (opt_includeInstance) { return proto.tendermint.consensus.TimedWALMessage.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.tendermint.consensus.TimedWALMessage} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.tendermint.consensus.TimedWALMessage.toObject = function (includeInstance, msg) { var f, obj = { time: (f = msg.getTime()) && google_protobuf_timestamp_pb.Timestamp.toObject(includeInstance, f), msg: (f = msg.getMsg()) && proto.tendermint.consensus.WALMessage.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.tendermint.consensus.TimedWALMessage} */ proto.tendermint.consensus.TimedWALMessage.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.tendermint.consensus.TimedWALMessage(); return proto.tendermint.consensus.TimedWALMessage.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.tendermint.consensus.TimedWALMessage} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.tendermint.consensus.TimedWALMessage} */ proto.tendermint.consensus.TimedWALMessage.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new google_protobuf_timestamp_pb.Timestamp(); reader.readMessage(value, google_protobuf_timestamp_pb.Timestamp.deserializeBinaryFromReader); msg.setTime(value); break; case 2: var value = new proto.tendermint.consensus.WALMessage(); reader.readMessage(value, proto.tendermint.consensus.WALMessage.deserializeBinaryFromReader); msg.setMsg(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.tendermint.consensus.TimedWALMessage.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); proto.tendermint.consensus.TimedWALMessage.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.tendermint.consensus.TimedWALMessage} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.tendermint.consensus.TimedWALMessage.serializeBinaryToWriter = function (message, writer) { var f = undefined; f = message.getTime(); if (f != null) { writer.writeMessage(1, f, google_protobuf_timestamp_pb.Timestamp.serializeBinaryToWriter); } f = message.getMsg(); if (f != null) { writer.writeMessage(2, f, proto.tendermint.consensus.WALMessage.serializeBinaryToWriter); } }; /** * optional google.protobuf.Timestamp time = 1; * @return {?proto.google.protobuf.Timestamp} */ proto.tendermint.consensus.TimedWALMessage.prototype.getTime = function () { return ( /** @type{?proto.google.protobuf.Timestamp} */ jspb.Message.getWrapperField(this, google_protobuf_timestamp_pb.Timestamp, 1) ); }; /** * @param {?proto.google.protobuf.Timestamp|undefined} value * @return {!proto.tendermint.consensus.TimedWALMessage} returns this */ proto.tendermint.consensus.TimedWALMessage.prototype.setTime = function (value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.tendermint.consensus.TimedWALMessage} returns this */ proto.tendermint.consensus.TimedWALMessage.prototype.clearTime = function () { return this.setTime(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.tendermint.consensus.TimedWALMessage.prototype.hasTime = function () { return jspb.Message.getField(this, 1) != null; }; /** * optional WALMessage msg = 2; * @return {?proto.tendermint.consensus.WALMessage} */ proto.tendermint.consensus.TimedWALMessage.prototype.getMsg = function () { return ( /** @type{?proto.tendermint.consensus.WALMessage} */ jspb.Message.getWrapperField(this, proto.tendermint.consensus.WALMessage, 2) ); }; /** * @param {?proto.tendermint.consensus.WALMessage|undefined} value * @return {!proto.tendermint.consensus.TimedWALMessage} returns this */ proto.tendermint.consensus.TimedWALMessage.prototype.setMsg = function (value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. * @return {!proto.tendermint.consensus.TimedWALMessage} returns this */ proto.tendermint.consensus.TimedWALMessage.prototype.clearMsg = function () { return this.setMsg(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.tendermint.consensus.TimedWALMessage.prototype.hasMsg = function () { return jspb.Message.getField(this, 2) != null; }; goog.object.extend(exports, proto.tendermint.consensus);