UNPKG

@provenanceio/wallet-utils

Version:

Typescript Utilities for Provenance Blockchain Wallet

1,098 lines (908 loc) 32.2 kB
"use strict"; // source: tendermint/p2p/conn.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_crypto_keys_pb = require('../../tendermint/crypto/keys_pb.js'); goog.object.extend(proto, tendermint_crypto_keys_pb); goog.exportSymbol('proto.tendermint.p2p.AuthSigMessage', null, global); goog.exportSymbol('proto.tendermint.p2p.Packet', null, global); goog.exportSymbol('proto.tendermint.p2p.Packet.SumCase', null, global); goog.exportSymbol('proto.tendermint.p2p.PacketMsg', null, global); goog.exportSymbol('proto.tendermint.p2p.PacketPing', null, global); goog.exportSymbol('proto.tendermint.p2p.PacketPong', 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.p2p.PacketPing = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.tendermint.p2p.PacketPing, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.tendermint.p2p.PacketPing.displayName = 'proto.tendermint.p2p.PacketPing'; } /** * 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.p2p.PacketPong = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.tendermint.p2p.PacketPong, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.tendermint.p2p.PacketPong.displayName = 'proto.tendermint.p2p.PacketPong'; } /** * 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.p2p.PacketMsg = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.tendermint.p2p.PacketMsg, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.tendermint.p2p.PacketMsg.displayName = 'proto.tendermint.p2p.PacketMsg'; } /** * 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.p2p.Packet = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, proto.tendermint.p2p.Packet.oneofGroups_); }; goog.inherits(proto.tendermint.p2p.Packet, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.tendermint.p2p.Packet.displayName = 'proto.tendermint.p2p.Packet'; } /** * 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.p2p.AuthSigMessage = function (opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; goog.inherits(proto.tendermint.p2p.AuthSigMessage, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.tendermint.p2p.AuthSigMessage.displayName = 'proto.tendermint.p2p.AuthSigMessage'; } 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.p2p.PacketPing.prototype.toObject = function (opt_includeInstance) { return proto.tendermint.p2p.PacketPing.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.p2p.PacketPing} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.tendermint.p2p.PacketPing.toObject = function (includeInstance, msg) { var f, obj = {}; 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.p2p.PacketPing} */ proto.tendermint.p2p.PacketPing.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.tendermint.p2p.PacketPing(); return proto.tendermint.p2p.PacketPing.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.tendermint.p2p.PacketPing} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.tendermint.p2p.PacketPing} */ proto.tendermint.p2p.PacketPing.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.tendermint.p2p.PacketPing.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); proto.tendermint.p2p.PacketPing.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.p2p.PacketPing} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.tendermint.p2p.PacketPing.serializeBinaryToWriter = function (message, writer) { var f = undefined; }; 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.p2p.PacketPong.prototype.toObject = function (opt_includeInstance) { return proto.tendermint.p2p.PacketPong.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.p2p.PacketPong} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.tendermint.p2p.PacketPong.toObject = function (includeInstance, msg) { var f, obj = {}; 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.p2p.PacketPong} */ proto.tendermint.p2p.PacketPong.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.tendermint.p2p.PacketPong(); return proto.tendermint.p2p.PacketPong.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.tendermint.p2p.PacketPong} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.tendermint.p2p.PacketPong} */ proto.tendermint.p2p.PacketPong.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.tendermint.p2p.PacketPong.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); proto.tendermint.p2p.PacketPong.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.p2p.PacketPong} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.tendermint.p2p.PacketPong.serializeBinaryToWriter = function (message, writer) { var f = undefined; }; 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.p2p.PacketMsg.prototype.toObject = function (opt_includeInstance) { return proto.tendermint.p2p.PacketMsg.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.p2p.PacketMsg} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.tendermint.p2p.PacketMsg.toObject = function (includeInstance, msg) { var f, obj = { channelId: jspb.Message.getFieldWithDefault(msg, 1, 0), eof: jspb.Message.getBooleanFieldWithDefault(msg, 2, false), data: msg.getData_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.tendermint.p2p.PacketMsg} */ proto.tendermint.p2p.PacketMsg.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.tendermint.p2p.PacketMsg(); return proto.tendermint.p2p.PacketMsg.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.tendermint.p2p.PacketMsg} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.tendermint.p2p.PacketMsg} */ proto.tendermint.p2p.PacketMsg.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = /** @type {number} */ reader.readInt32(); msg.setChannelId(value); break; case 2: var value = /** @type {boolean} */ reader.readBool(); msg.setEof(value); break; case 3: var value = /** @type {!Uint8Array} */ reader.readBytes(); msg.setData(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.tendermint.p2p.PacketMsg.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); proto.tendermint.p2p.PacketMsg.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.p2p.PacketMsg} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.tendermint.p2p.PacketMsg.serializeBinaryToWriter = function (message, writer) { var f = undefined; f = message.getChannelId(); if (f !== 0) { writer.writeInt32(1, f); } f = message.getEof(); if (f) { writer.writeBool(2, f); } f = message.getData_asU8(); if (f.length > 0) { writer.writeBytes(3, f); } }; /** * optional int32 channel_id = 1; * @return {number} */ proto.tendermint.p2p.PacketMsg.prototype.getChannelId = function () { return ( /** @type {number} */ jspb.Message.getFieldWithDefault(this, 1, 0) ); }; /** * @param {number} value * @return {!proto.tendermint.p2p.PacketMsg} returns this */ proto.tendermint.p2p.PacketMsg.prototype.setChannelId = function (value) { return jspb.Message.setProto3IntField(this, 1, value); }; /** * optional bool eof = 2; * @return {boolean} */ proto.tendermint.p2p.PacketMsg.prototype.getEof = function () { return ( /** @type {boolean} */ jspb.Message.getBooleanFieldWithDefault(this, 2, false) ); }; /** * @param {boolean} value * @return {!proto.tendermint.p2p.PacketMsg} returns this */ proto.tendermint.p2p.PacketMsg.prototype.setEof = function (value) { return jspb.Message.setProto3BooleanField(this, 2, value); }; /** * optional bytes data = 3; * @return {!(string|Uint8Array)} */ proto.tendermint.p2p.PacketMsg.prototype.getData = function () { return ( /** @type {!(string|Uint8Array)} */ jspb.Message.getFieldWithDefault(this, 3, "") ); }; /** * optional bytes data = 3; * This is a type-conversion wrapper around `getData()` * @return {string} */ proto.tendermint.p2p.PacketMsg.prototype.getData_asB64 = function () { return ( /** @type {string} */ jspb.Message.bytesAsB64(this.getData()) ); }; /** * optional bytes data = 3; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getData()` * @return {!Uint8Array} */ proto.tendermint.p2p.PacketMsg.prototype.getData_asU8 = function () { return ( /** @type {!Uint8Array} */ jspb.Message.bytesAsU8(this.getData()) ); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.tendermint.p2p.PacketMsg} returns this */ proto.tendermint.p2p.PacketMsg.prototype.setData = function (value) { return jspb.Message.setProto3BytesField(this, 3, 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.p2p.Packet.oneofGroups_ = [[1, 2, 3]]; /** * @enum {number} */ proto.tendermint.p2p.Packet.SumCase = { SUM_NOT_SET: 0, PACKET_PING: 1, PACKET_PONG: 2, PACKET_MSG: 3 }; /** * @return {proto.tendermint.p2p.Packet.SumCase} */ proto.tendermint.p2p.Packet.prototype.getSumCase = function () { return ( /** @type {proto.tendermint.p2p.Packet.SumCase} */ jspb.Message.computeOneofCase(this, proto.tendermint.p2p.Packet.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.p2p.Packet.prototype.toObject = function (opt_includeInstance) { return proto.tendermint.p2p.Packet.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.p2p.Packet} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.tendermint.p2p.Packet.toObject = function (includeInstance, msg) { var f, obj = { packetPing: (f = msg.getPacketPing()) && proto.tendermint.p2p.PacketPing.toObject(includeInstance, f), packetPong: (f = msg.getPacketPong()) && proto.tendermint.p2p.PacketPong.toObject(includeInstance, f), packetMsg: (f = msg.getPacketMsg()) && proto.tendermint.p2p.PacketMsg.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.p2p.Packet} */ proto.tendermint.p2p.Packet.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.tendermint.p2p.Packet(); return proto.tendermint.p2p.Packet.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.tendermint.p2p.Packet} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.tendermint.p2p.Packet} */ proto.tendermint.p2p.Packet.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new proto.tendermint.p2p.PacketPing(); reader.readMessage(value, proto.tendermint.p2p.PacketPing.deserializeBinaryFromReader); msg.setPacketPing(value); break; case 2: var value = new proto.tendermint.p2p.PacketPong(); reader.readMessage(value, proto.tendermint.p2p.PacketPong.deserializeBinaryFromReader); msg.setPacketPong(value); break; case 3: var value = new proto.tendermint.p2p.PacketMsg(); reader.readMessage(value, proto.tendermint.p2p.PacketMsg.deserializeBinaryFromReader); msg.setPacketMsg(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.tendermint.p2p.Packet.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); proto.tendermint.p2p.Packet.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.p2p.Packet} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.tendermint.p2p.Packet.serializeBinaryToWriter = function (message, writer) { var f = undefined; f = message.getPacketPing(); if (f != null) { writer.writeMessage(1, f, proto.tendermint.p2p.PacketPing.serializeBinaryToWriter); } f = message.getPacketPong(); if (f != null) { writer.writeMessage(2, f, proto.tendermint.p2p.PacketPong.serializeBinaryToWriter); } f = message.getPacketMsg(); if (f != null) { writer.writeMessage(3, f, proto.tendermint.p2p.PacketMsg.serializeBinaryToWriter); } }; /** * optional PacketPing packet_ping = 1; * @return {?proto.tendermint.p2p.PacketPing} */ proto.tendermint.p2p.Packet.prototype.getPacketPing = function () { return ( /** @type{?proto.tendermint.p2p.PacketPing} */ jspb.Message.getWrapperField(this, proto.tendermint.p2p.PacketPing, 1) ); }; /** * @param {?proto.tendermint.p2p.PacketPing|undefined} value * @return {!proto.tendermint.p2p.Packet} returns this */ proto.tendermint.p2p.Packet.prototype.setPacketPing = function (value) { return jspb.Message.setOneofWrapperField(this, 1, proto.tendermint.p2p.Packet.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. * @return {!proto.tendermint.p2p.Packet} returns this */ proto.tendermint.p2p.Packet.prototype.clearPacketPing = function () { return this.setPacketPing(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.tendermint.p2p.Packet.prototype.hasPacketPing = function () { return jspb.Message.getField(this, 1) != null; }; /** * optional PacketPong packet_pong = 2; * @return {?proto.tendermint.p2p.PacketPong} */ proto.tendermint.p2p.Packet.prototype.getPacketPong = function () { return ( /** @type{?proto.tendermint.p2p.PacketPong} */ jspb.Message.getWrapperField(this, proto.tendermint.p2p.PacketPong, 2) ); }; /** * @param {?proto.tendermint.p2p.PacketPong|undefined} value * @return {!proto.tendermint.p2p.Packet} returns this */ proto.tendermint.p2p.Packet.prototype.setPacketPong = function (value) { return jspb.Message.setOneofWrapperField(this, 2, proto.tendermint.p2p.Packet.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. * @return {!proto.tendermint.p2p.Packet} returns this */ proto.tendermint.p2p.Packet.prototype.clearPacketPong = function () { return this.setPacketPong(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.tendermint.p2p.Packet.prototype.hasPacketPong = function () { return jspb.Message.getField(this, 2) != null; }; /** * optional PacketMsg packet_msg = 3; * @return {?proto.tendermint.p2p.PacketMsg} */ proto.tendermint.p2p.Packet.prototype.getPacketMsg = function () { return ( /** @type{?proto.tendermint.p2p.PacketMsg} */ jspb.Message.getWrapperField(this, proto.tendermint.p2p.PacketMsg, 3) ); }; /** * @param {?proto.tendermint.p2p.PacketMsg|undefined} value * @return {!proto.tendermint.p2p.Packet} returns this */ proto.tendermint.p2p.Packet.prototype.setPacketMsg = function (value) { return jspb.Message.setOneofWrapperField(this, 3, proto.tendermint.p2p.Packet.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. * @return {!proto.tendermint.p2p.Packet} returns this */ proto.tendermint.p2p.Packet.prototype.clearPacketMsg = function () { return this.setPacketMsg(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.tendermint.p2p.Packet.prototype.hasPacketMsg = function () { return jspb.Message.getField(this, 3) != 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.p2p.AuthSigMessage.prototype.toObject = function (opt_includeInstance) { return proto.tendermint.p2p.AuthSigMessage.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.p2p.AuthSigMessage} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.tendermint.p2p.AuthSigMessage.toObject = function (includeInstance, msg) { var f, obj = { pubKey: (f = msg.getPubKey()) && tendermint_crypto_keys_pb.PublicKey.toObject(includeInstance, f), sig: msg.getSig_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.tendermint.p2p.AuthSigMessage} */ proto.tendermint.p2p.AuthSigMessage.deserializeBinary = function (bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.tendermint.p2p.AuthSigMessage(); return proto.tendermint.p2p.AuthSigMessage.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.tendermint.p2p.AuthSigMessage} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.tendermint.p2p.AuthSigMessage} */ proto.tendermint.p2p.AuthSigMessage.deserializeBinaryFromReader = function (msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { case 1: var value = new tendermint_crypto_keys_pb.PublicKey(); reader.readMessage(value, tendermint_crypto_keys_pb.PublicKey.deserializeBinaryFromReader); msg.setPubKey(value); break; case 2: var value = /** @type {!Uint8Array} */ reader.readBytes(); msg.setSig(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.tendermint.p2p.AuthSigMessage.prototype.serializeBinary = function () { var writer = new jspb.BinaryWriter(); proto.tendermint.p2p.AuthSigMessage.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.p2p.AuthSigMessage} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.tendermint.p2p.AuthSigMessage.serializeBinaryToWriter = function (message, writer) { var f = undefined; f = message.getPubKey(); if (f != null) { writer.writeMessage(1, f, tendermint_crypto_keys_pb.PublicKey.serializeBinaryToWriter); } f = message.getSig_asU8(); if (f.length > 0) { writer.writeBytes(2, f); } }; /** * optional tendermint.crypto.PublicKey pub_key = 1; * @return {?proto.tendermint.crypto.PublicKey} */ proto.tendermint.p2p.AuthSigMessage.prototype.getPubKey = function () { return ( /** @type{?proto.tendermint.crypto.PublicKey} */ jspb.Message.getWrapperField(this, tendermint_crypto_keys_pb.PublicKey, 1) ); }; /** * @param {?proto.tendermint.crypto.PublicKey|undefined} value * @return {!proto.tendermint.p2p.AuthSigMessage} returns this */ proto.tendermint.p2p.AuthSigMessage.prototype.setPubKey = function (value) { return jspb.Message.setWrapperField(this, 1, value); }; /** * Clears the message field making it undefined. * @return {!proto.tendermint.p2p.AuthSigMessage} returns this */ proto.tendermint.p2p.AuthSigMessage.prototype.clearPubKey = function () { return this.setPubKey(undefined); }; /** * Returns whether this field is set. * @return {boolean} */ proto.tendermint.p2p.AuthSigMessage.prototype.hasPubKey = function () { return jspb.Message.getField(this, 1) != null; }; /** * optional bytes sig = 2; * @return {!(string|Uint8Array)} */ proto.tendermint.p2p.AuthSigMessage.prototype.getSig = function () { return ( /** @type {!(string|Uint8Array)} */ jspb.Message.getFieldWithDefault(this, 2, "") ); }; /** * optional bytes sig = 2; * This is a type-conversion wrapper around `getSig()` * @return {string} */ proto.tendermint.p2p.AuthSigMessage.prototype.getSig_asB64 = function () { return ( /** @type {string} */ jspb.Message.bytesAsB64(this.getSig()) ); }; /** * optional bytes sig = 2; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array * This is a type-conversion wrapper around `getSig()` * @return {!Uint8Array} */ proto.tendermint.p2p.AuthSigMessage.prototype.getSig_asU8 = function () { return ( /** @type {!Uint8Array} */ jspb.Message.bytesAsU8(this.getSig()) ); }; /** * @param {!(string|Uint8Array)} value * @return {!proto.tendermint.p2p.AuthSigMessage} returns this */ proto.tendermint.p2p.AuthSigMessage.prototype.setSig = function (value) { return jspb.Message.setProto3BytesField(this, 2, value); }; goog.object.extend(exports, proto.tendermint.p2p);