UNPKG

@routerprotocol/chain-api

Version:

Router Chain API Query client with generated gRPC bindings.

265 lines (229 loc) 9.22 kB
// source: routerprotocol/routerchain/attestation/valset.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 routerprotocol_routerchain_attestation_bridge_validator_pb = require('../../../routerprotocol/routerchain/attestation/bridge_validator_pb.js'); goog.object.extend(proto, routerprotocol_routerchain_attestation_bridge_validator_pb); var gogoproto_gogo_pb = require('../../../gogoproto/gogo_pb.js'); goog.object.extend(proto, gogoproto_gogo_pb); goog.exportSymbol('proto.routerprotocol.routerchain.attestation.Valset', 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.routerprotocol.routerchain.attestation.Valset = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, proto.routerprotocol.routerchain.attestation.Valset.repeatedFields_, null); }; goog.inherits(proto.routerprotocol.routerchain.attestation.Valset, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ proto.routerprotocol.routerchain.attestation.Valset.displayName = 'proto.routerprotocol.routerchain.attestation.Valset'; } /** * List of repeated fields within this message type. * @private {!Array<number>} * @const */ proto.routerprotocol.routerchain.attestation.Valset.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_<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.routerprotocol.routerchain.attestation.Valset.prototype.toObject = function(opt_includeInstance) { return proto.routerprotocol.routerchain.attestation.Valset.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.routerprotocol.routerchain.attestation.Valset} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.routerprotocol.routerchain.attestation.Valset.toObject = function(includeInstance, msg) { var f, obj = { nonce: jspb.Message.getFieldWithDefault(msg, 1, 0), membersList: jspb.Message.toObjectList(msg.getMembersList(), routerprotocol_routerchain_attestation_bridge_validator_pb.BridgeValidator.toObject, includeInstance), height: 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.routerprotocol.routerchain.attestation.Valset} */ proto.routerprotocol.routerchain.attestation.Valset.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); var msg = new proto.routerprotocol.routerchain.attestation.Valset; return proto.routerprotocol.routerchain.attestation.Valset.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. * @param {!proto.routerprotocol.routerchain.attestation.Valset} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. * @return {!proto.routerprotocol.routerchain.attestation.Valset} */ proto.routerprotocol.routerchain.attestation.Valset.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.setNonce(value); break; case 2: var value = new routerprotocol_routerchain_attestation_bridge_validator_pb.BridgeValidator; reader.readMessage(value,routerprotocol_routerchain_attestation_bridge_validator_pb.BridgeValidator.deserializeBinaryFromReader); msg.addMembers(value); break; case 3: var value = /** @type {number} */ (reader.readUint64()); msg.setHeight(value); break; default: reader.skipField(); break; } } return msg; }; /** * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ proto.routerprotocol.routerchain.attestation.Valset.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); proto.routerprotocol.routerchain.attestation.Valset.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. * @param {!proto.routerprotocol.routerchain.attestation.Valset} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ proto.routerprotocol.routerchain.attestation.Valset.serializeBinaryToWriter = function(message, writer) { var f = undefined; f = message.getNonce(); if (f !== 0) { writer.writeUint64( 1, f ); } f = message.getMembersList(); if (f.length > 0) { writer.writeRepeatedMessage( 2, f, routerprotocol_routerchain_attestation_bridge_validator_pb.BridgeValidator.serializeBinaryToWriter ); } f = message.getHeight(); if (f !== 0) { writer.writeUint64( 3, f ); } }; /** * optional uint64 nonce = 1; * @return {number} */ proto.routerprotocol.routerchain.attestation.Valset.prototype.getNonce = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); }; /** * @param {number} value * @return {!proto.routerprotocol.routerchain.attestation.Valset} returns this */ proto.routerprotocol.routerchain.attestation.Valset.prototype.setNonce = function(value) { return jspb.Message.setProto3IntField(this, 1, value); }; /** * repeated BridgeValidator members = 2; * @return {!Array<!proto.routerprotocol.routerchain.attestation.BridgeValidator>} */ proto.routerprotocol.routerchain.attestation.Valset.prototype.getMembersList = function() { return /** @type{!Array<!proto.routerprotocol.routerchain.attestation.BridgeValidator>} */ ( jspb.Message.getRepeatedWrapperField(this, routerprotocol_routerchain_attestation_bridge_validator_pb.BridgeValidator, 2)); }; /** * @param {!Array<!proto.routerprotocol.routerchain.attestation.BridgeValidator>} value * @return {!proto.routerprotocol.routerchain.attestation.Valset} returns this */ proto.routerprotocol.routerchain.attestation.Valset.prototype.setMembersList = function(value) { return jspb.Message.setRepeatedWrapperField(this, 2, value); }; /** * @param {!proto.routerprotocol.routerchain.attestation.BridgeValidator=} opt_value * @param {number=} opt_index * @return {!proto.routerprotocol.routerchain.attestation.BridgeValidator} */ proto.routerprotocol.routerchain.attestation.Valset.prototype.addMembers = function(opt_value, opt_index) { return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.routerprotocol.routerchain.attestation.BridgeValidator, opt_index); }; /** * Clears the list making it empty but non-null. * @return {!proto.routerprotocol.routerchain.attestation.Valset} returns this */ proto.routerprotocol.routerchain.attestation.Valset.prototype.clearMembersList = function() { return this.setMembersList([]); }; /** * optional uint64 height = 3; * @return {number} */ proto.routerprotocol.routerchain.attestation.Valset.prototype.getHeight = function() { return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); }; /** * @param {number} value * @return {!proto.routerprotocol.routerchain.attestation.Valset} returns this */ proto.routerprotocol.routerchain.attestation.Valset.prototype.setHeight = function(value) { return jspb.Message.setProto3IntField(this, 3, value); }; goog.object.extend(exports, proto.routerprotocol.routerchain.attestation);