diff --git a/packages/libra-web-net/__grpc_web_generated__/admission_control_grpc_web_pb.d.ts b/packages/libra-web-net/__grpc_web_generated__/admission_control_grpc_web_pb.d.ts index ca113b9..e0b3968 100644 --- a/packages/libra-web-net/__grpc_web_generated__/admission_control_grpc_web_pb.d.ts +++ b/packages/libra-web-net/__grpc_web_generated__/admission_control_grpc_web_pb.d.ts @@ -1,11 +1,9 @@ import * as grpcWeb from 'grpc-web'; import * as get_with_proof_pb from './get_with_proof_pb'; +import * as mempool_status_pb from './mempool_status_pb'; import * as transaction_pb from './transaction_pb'; -import * as proof_pb from './proof_pb'; -import * as ledger_info_pb from './ledger_info_pb'; import * as vm_errors_pb from './vm_errors_pb'; -import * as mempool_status_pb from './mempool_status_pb'; import { SubmitTransactionRequest, diff --git a/packages/libra-web-net/__grpc_web_generated__/admission_control_grpc_web_pb.js b/packages/libra-web-net/__grpc_web_generated__/admission_control_grpc_web_pb.js index 9878cc9..27c2a86 100644 --- a/packages/libra-web-net/__grpc_web_generated__/admission_control_grpc_web_pb.js +++ b/packages/libra-web-net/__grpc_web_generated__/admission_control_grpc_web_pb.js @@ -14,15 +14,11 @@ grpc.web = require('grpc-web'); var get_with_proof_pb = require('./get_with_proof_pb.js') -var transaction_pb = require('./transaction_pb.js') - -var proof_pb = require('./proof_pb.js') +var mempool_status_pb = require('./mempool_status_pb.js') -var ledger_info_pb = require('./ledger_info_pb.js') +var transaction_pb = require('./transaction_pb.js') var vm_errors_pb = require('./vm_errors_pb.js') - -var mempool_status_pb = require('./mempool_status_pb.js') const proto = {}; proto.admission_control = require('./admission_control_pb.js'); diff --git a/packages/libra-web-net/__grpc_web_generated__/admission_control_pb.d.ts b/packages/libra-web-net/__grpc_web_generated__/admission_control_pb.d.ts index 6c92fa2..7c8ae3d 100644 --- a/packages/libra-web-net/__grpc_web_generated__/admission_control_pb.d.ts +++ b/packages/libra-web-net/__grpc_web_generated__/admission_control_pb.d.ts @@ -1,11 +1,9 @@ import * as jspb from "google-protobuf" import * as get_with_proof_pb from './get_with_proof_pb'; +import * as mempool_status_pb from './mempool_status_pb'; import * as transaction_pb from './transaction_pb'; -import * as proof_pb from './proof_pb'; -import * as ledger_info_pb from './ledger_info_pb'; import * as vm_errors_pb from './vm_errors_pb'; -import * as mempool_status_pb from './mempool_status_pb'; export class SubmitTransactionRequest extends jspb.Message { getSignedTxn(): transaction_pb.SignedTransaction | undefined; @@ -27,6 +25,28 @@ export namespace SubmitTransactionRequest { } } +export class AdmissionControlStatus extends jspb.Message { + getCode(): AdmissionControlStatusCode; + setCode(value: AdmissionControlStatusCode): void; + + getMessage(): string; + setMessage(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AdmissionControlStatus.AsObject; + static toObject(includeInstance: boolean, msg: AdmissionControlStatus): AdmissionControlStatus.AsObject; + static serializeBinaryToWriter(message: AdmissionControlStatus, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AdmissionControlStatus; + static deserializeBinaryFromReader(message: AdmissionControlStatus, reader: jspb.BinaryReader): AdmissionControlStatus; +} + +export namespace AdmissionControlStatus { + export type AsObject = { + code: AdmissionControlStatusCode, + message: string, + } +} + export class SubmitTransactionResponse extends jspb.Message { getVmStatus(): vm_errors_pb.VMStatus | undefined; setVmStatus(value?: vm_errors_pb.VMStatus): void; @@ -34,12 +54,16 @@ export class SubmitTransactionResponse extends jspb.Message { clearVmStatus(): void; hasVmStatus(): boolean; - getAcStatus(): AdmissionControlStatus; - setAcStatus(value: AdmissionControlStatus): void; + getAcStatus(): AdmissionControlStatus | undefined; + setAcStatus(value?: AdmissionControlStatus): void; + hasAcStatus(): boolean; + clearAcStatus(): void; hasAcStatus(): boolean; - getMempoolStatus(): mempool_status_pb.MempoolAddTransactionStatus; - setMempoolStatus(value: mempool_status_pb.MempoolAddTransactionStatus): void; + getMempoolStatus(): mempool_status_pb.MempoolAddTransactionStatus | undefined; + setMempoolStatus(value?: mempool_status_pb.MempoolAddTransactionStatus): void; + hasMempoolStatus(): boolean; + clearMempoolStatus(): void; hasMempoolStatus(): boolean; getValidatorId(): Uint8Array | string; @@ -60,8 +84,8 @@ export class SubmitTransactionResponse extends jspb.Message { export namespace SubmitTransactionResponse { export type AsObject = { vmStatus?: vm_errors_pb.VMStatus.AsObject, - acStatus: AdmissionControlStatus, - mempoolStatus: mempool_status_pb.MempoolAddTransactionStatus, + acStatus?: AdmissionControlStatus.AsObject, + mempoolStatus?: mempool_status_pb.MempoolAddTransactionStatus.AsObject, validatorId: Uint8Array | string, } @@ -73,7 +97,7 @@ export namespace SubmitTransactionResponse { } } -export enum AdmissionControlStatus { +export enum AdmissionControlStatusCode { Accepted = 0, Blacklisted = 1, Rejected = 2, diff --git a/packages/libra-web-net/__grpc_web_generated__/admission_control_pb.js b/packages/libra-web-net/__grpc_web_generated__/admission_control_pb.js index d3c5e5c..009bcd5 100644 --- a/packages/libra-web-net/__grpc_web_generated__/admission_control_pb.js +++ b/packages/libra-web-net/__grpc_web_generated__/admission_control_pb.js @@ -13,17 +13,14 @@ var global = Function('return this')(); var get_with_proof_pb = require('./get_with_proof_pb.js'); goog.object.extend(proto, get_with_proof_pb); +var mempool_status_pb = require('./mempool_status_pb.js'); +goog.object.extend(proto, mempool_status_pb); var transaction_pb = require('./transaction_pb.js'); goog.object.extend(proto, transaction_pb); -var proof_pb = require('./proof_pb.js'); -goog.object.extend(proto, proof_pb); -var ledger_info_pb = require('./ledger_info_pb.js'); -goog.object.extend(proto, ledger_info_pb); var vm_errors_pb = require('./vm_errors_pb.js'); goog.object.extend(proto, vm_errors_pb); -var mempool_status_pb = require('./mempool_status_pb.js'); -goog.object.extend(proto, mempool_status_pb); goog.exportSymbol('proto.admission_control.AdmissionControlStatus', null, global); +goog.exportSymbol('proto.admission_control.AdmissionControlStatusCode', null, global); goog.exportSymbol('proto.admission_control.SubmitTransactionRequest', null, global); goog.exportSymbol('proto.admission_control.SubmitTransactionResponse', null, global); /** @@ -47,6 +44,27 @@ if (goog.DEBUG && !COMPILED) { */ proto.admission_control.SubmitTransactionRequest.displayName = 'proto.admission_control.SubmitTransactionRequest'; } +/** + * 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.admission_control.AdmissionControlStatus = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.admission_control.AdmissionControlStatus, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.admission_control.AdmissionControlStatus.displayName = 'proto.admission_control.AdmissionControlStatus'; +} /** * Generated by JsPbCodeGenerator. * @param {Array=} opt_data Optional initial data array, typically from a @@ -214,6 +232,158 @@ proto.admission_control.SubmitTransactionRequest.prototype.hasSignedTxn = functi + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.admission_control.AdmissionControlStatus.prototype.toObject = function(opt_includeInstance) { + return proto.admission_control.AdmissionControlStatus.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.admission_control.AdmissionControlStatus} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.admission_control.AdmissionControlStatus.toObject = function(includeInstance, msg) { + var f, obj = { + code: jspb.Message.getFieldWithDefault(msg, 1, 0), + message: 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.admission_control.AdmissionControlStatus} + */ +proto.admission_control.AdmissionControlStatus.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.admission_control.AdmissionControlStatus; + return proto.admission_control.AdmissionControlStatus.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.admission_control.AdmissionControlStatus} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.admission_control.AdmissionControlStatus} + */ +proto.admission_control.AdmissionControlStatus.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.admission_control.AdmissionControlStatusCode} */ (reader.readEnum()); + msg.setCode(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setMessage(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.admission_control.AdmissionControlStatus.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.admission_control.AdmissionControlStatus.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.admission_control.AdmissionControlStatus} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.admission_control.AdmissionControlStatus.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getCode(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getMessage(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional AdmissionControlStatusCode code = 1; + * @return {!proto.admission_control.AdmissionControlStatusCode} + */ +proto.admission_control.AdmissionControlStatus.prototype.getCode = function() { + return /** @type {!proto.admission_control.AdmissionControlStatusCode} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {!proto.admission_control.AdmissionControlStatusCode} value */ +proto.admission_control.AdmissionControlStatus.prototype.setCode = function(value) { + jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional string message = 2; + * @return {string} + */ +proto.admission_control.AdmissionControlStatus.prototype.getMessage = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.admission_control.AdmissionControlStatus.prototype.setMessage = function(value) { + jspb.Message.setProto3StringField(this, 2, 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 @@ -271,8 +441,8 @@ proto.admission_control.SubmitTransactionResponse.prototype.toObject = function( proto.admission_control.SubmitTransactionResponse.toObject = function(includeInstance, msg) { var f, obj = { vmStatus: (f = msg.getVmStatus()) && vm_errors_pb.VMStatus.toObject(includeInstance, f), - acStatus: jspb.Message.getFieldWithDefault(msg, 2, 0), - mempoolStatus: jspb.Message.getFieldWithDefault(msg, 3, 0), + acStatus: (f = msg.getAcStatus()) && proto.admission_control.AdmissionControlStatus.toObject(includeInstance, f), + mempoolStatus: (f = msg.getMempoolStatus()) && mempool_status_pb.MempoolAddTransactionStatus.toObject(includeInstance, f), validatorId: msg.getValidatorId_asB64() }; @@ -316,11 +486,13 @@ proto.admission_control.SubmitTransactionResponse.deserializeBinaryFromReader = msg.setVmStatus(value); break; case 2: - var value = /** @type {!proto.admission_control.AdmissionControlStatus} */ (reader.readEnum()); + var value = new proto.admission_control.AdmissionControlStatus; + reader.readMessage(value,proto.admission_control.AdmissionControlStatus.deserializeBinaryFromReader); msg.setAcStatus(value); break; case 3: - var value = /** @type {!proto.mempool.MempoolAddTransactionStatus} */ (reader.readEnum()); + var value = new mempool_status_pb.MempoolAddTransactionStatus; + reader.readMessage(value,mempool_status_pb.MempoolAddTransactionStatus.deserializeBinaryFromReader); msg.setMempoolStatus(value); break; case 4: @@ -364,18 +536,20 @@ proto.admission_control.SubmitTransactionResponse.serializeBinaryToWriter = func vm_errors_pb.VMStatus.serializeBinaryToWriter ); } - f = /** @type {!proto.admission_control.AdmissionControlStatus} */ (jspb.Message.getField(message, 2)); + f = message.getAcStatus(); if (f != null) { - writer.writeEnum( + writer.writeMessage( 2, - f + f, + proto.admission_control.AdmissionControlStatus.serializeBinaryToWriter ); } - f = /** @type {!proto.mempool.MempoolAddTransactionStatus} */ (jspb.Message.getField(message, 3)); + f = message.getMempoolStatus(); if (f != null) { - writer.writeEnum( + writer.writeMessage( 3, - f + f, + mempool_status_pb.MempoolAddTransactionStatus.serializeBinaryToWriter ); } f = message.getValidatorId_asU8(); @@ -423,24 +597,25 @@ proto.admission_control.SubmitTransactionResponse.prototype.hasVmStatus = functi /** * optional AdmissionControlStatus ac_status = 2; - * @return {!proto.admission_control.AdmissionControlStatus} + * @return {?proto.admission_control.AdmissionControlStatus} */ proto.admission_control.SubmitTransactionResponse.prototype.getAcStatus = function() { - return /** @type {!proto.admission_control.AdmissionControlStatus} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); + return /** @type{?proto.admission_control.AdmissionControlStatus} */ ( + jspb.Message.getWrapperField(this, proto.admission_control.AdmissionControlStatus, 2)); }; -/** @param {!proto.admission_control.AdmissionControlStatus} value */ +/** @param {?proto.admission_control.AdmissionControlStatus|undefined} value */ proto.admission_control.SubmitTransactionResponse.prototype.setAcStatus = function(value) { - jspb.Message.setOneofField(this, 2, proto.admission_control.SubmitTransactionResponse.oneofGroups_[0], value); + jspb.Message.setOneofWrapperField(this, 2, proto.admission_control.SubmitTransactionResponse.oneofGroups_[0], value); }; /** - * Clears the field making it undefined. + * Clears the message field making it undefined. */ proto.admission_control.SubmitTransactionResponse.prototype.clearAcStatus = function() { - jspb.Message.setOneofField(this, 2, proto.admission_control.SubmitTransactionResponse.oneofGroups_[0], undefined); + this.setAcStatus(undefined); }; @@ -455,24 +630,25 @@ proto.admission_control.SubmitTransactionResponse.prototype.hasAcStatus = functi /** * optional mempool.MempoolAddTransactionStatus mempool_status = 3; - * @return {!proto.mempool.MempoolAddTransactionStatus} + * @return {?proto.mempool.MempoolAddTransactionStatus} */ proto.admission_control.SubmitTransactionResponse.prototype.getMempoolStatus = function() { - return /** @type {!proto.mempool.MempoolAddTransactionStatus} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); + return /** @type{?proto.mempool.MempoolAddTransactionStatus} */ ( + jspb.Message.getWrapperField(this, mempool_status_pb.MempoolAddTransactionStatus, 3)); }; -/** @param {!proto.mempool.MempoolAddTransactionStatus} value */ +/** @param {?proto.mempool.MempoolAddTransactionStatus|undefined} value */ proto.admission_control.SubmitTransactionResponse.prototype.setMempoolStatus = function(value) { - jspb.Message.setOneofField(this, 3, proto.admission_control.SubmitTransactionResponse.oneofGroups_[0], value); + jspb.Message.setOneofWrapperField(this, 3, proto.admission_control.SubmitTransactionResponse.oneofGroups_[0], value); }; /** - * Clears the field making it undefined. + * Clears the message field making it undefined. */ proto.admission_control.SubmitTransactionResponse.prototype.clearMempoolStatus = function() { - jspb.Message.setOneofField(this, 3, proto.admission_control.SubmitTransactionResponse.oneofGroups_[0], undefined); + this.setMempoolStatus(undefined); }; @@ -527,7 +703,7 @@ proto.admission_control.SubmitTransactionResponse.prototype.setValidatorId = fun /** * @enum {number} */ -proto.admission_control.AdmissionControlStatus = { +proto.admission_control.AdmissionControlStatusCode = { ACCEPTED: 0, BLACKLISTED: 1, REJECTED: 2 diff --git a/packages/libra-web-net/__grpc_web_generated__/language_storage_pb.d.ts b/packages/libra-web-net/__grpc_web_generated__/language_storage_pb.d.ts new file mode 100644 index 0000000..7abe972 --- /dev/null +++ b/packages/libra-web-net/__grpc_web_generated__/language_storage_pb.d.ts @@ -0,0 +1,26 @@ +import * as jspb from "google-protobuf" + +export class ModuleId extends jspb.Message { + getAddress(): Uint8Array | string; + getAddress_asU8(): Uint8Array; + getAddress_asB64(): string; + setAddress(value: Uint8Array | string): void; + + getName(): string; + setName(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ModuleId.AsObject; + static toObject(includeInstance: boolean, msg: ModuleId): ModuleId.AsObject; + static serializeBinaryToWriter(message: ModuleId, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ModuleId; + static deserializeBinaryFromReader(message: ModuleId, reader: jspb.BinaryReader): ModuleId; +} + +export namespace ModuleId { + export type AsObject = { + address: Uint8Array | string, + name: string, + } +} + diff --git a/packages/libra-web-net/__grpc_web_generated__/language_storage_pb.js b/packages/libra-web-net/__grpc_web_generated__/language_storage_pb.js new file mode 100644 index 0000000..1a2aa7e --- /dev/null +++ b/packages/libra-web-net/__grpc_web_generated__/language_storage_pb.js @@ -0,0 +1,212 @@ +/** + * @fileoverview + * @enhanceable + * @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! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +goog.exportSymbol('proto.types.ModuleId', 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.types.ModuleId = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.types.ModuleId, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.types.ModuleId.displayName = 'proto.types.ModuleId'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.types.ModuleId.prototype.toObject = function(opt_includeInstance) { + return proto.types.ModuleId.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.types.ModuleId} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.ModuleId.toObject = function(includeInstance, msg) { + var f, obj = { + address: msg.getAddress_asB64(), + name: 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.types.ModuleId} + */ +proto.types.ModuleId.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.types.ModuleId; + return proto.types.ModuleId.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.types.ModuleId} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.types.ModuleId} + */ +proto.types.ModuleId.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.setAddress(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setName(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.types.ModuleId.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.types.ModuleId.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.types.ModuleId} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.ModuleId.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getName(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional bytes address = 1; + * @return {string} + */ +proto.types.ModuleId.prototype.getAddress = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes address = 1; + * This is a type-conversion wrapper around `getAddress()` + * @return {string} + */ +proto.types.ModuleId.prototype.getAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAddress())); +}; + + +/** + * optional bytes address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAddress()` + * @return {!Uint8Array} + */ +proto.types.ModuleId.prototype.getAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.types.ModuleId.prototype.setAddress = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional string name = 2; + * @return {string} + */ +proto.types.ModuleId.prototype.getName = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.types.ModuleId.prototype.setName = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + +goog.object.extend(exports, proto.types); diff --git a/packages/libra-web-net/__grpc_web_generated__/mempool_grpc_web_pb.d.ts b/packages/libra-web-net/__grpc_web_generated__/mempool_grpc_web_pb.d.ts new file mode 100644 index 0000000..3760db6 --- /dev/null +++ b/packages/libra-web-net/__grpc_web_generated__/mempool_grpc_web_pb.d.ts @@ -0,0 +1,77 @@ +import * as grpcWeb from 'grpc-web'; + +import * as transaction_pb from './transaction_pb'; +import * as mempool_status_pb from './mempool_status_pb'; + +import { + AddTransactionWithValidationRequest, + AddTransactionWithValidationResponse, + CommitTransactionsRequest, + CommitTransactionsResponse, + GetBlockRequest, + GetBlockResponse, + HealthCheckRequest, + HealthCheckResponse} from './mempool_pb'; + +export class MempoolClient { + constructor (hostname: string, + credentials: null | { [index: string]: string; }, + options: null | { [index: string]: string; }); + + addTransactionWithValidation( + request: AddTransactionWithValidationRequest, + metadata: grpcWeb.Metadata | undefined, + callback: (err: grpcWeb.Error, + response: AddTransactionWithValidationResponse) => void + ): grpcWeb.ClientReadableStream; + + getBlock( + request: GetBlockRequest, + metadata: grpcWeb.Metadata | undefined, + callback: (err: grpcWeb.Error, + response: GetBlockResponse) => void + ): grpcWeb.ClientReadableStream; + + commitTransactions( + request: CommitTransactionsRequest, + metadata: grpcWeb.Metadata | undefined, + callback: (err: grpcWeb.Error, + response: CommitTransactionsResponse) => void + ): grpcWeb.ClientReadableStream; + + healthCheck( + request: HealthCheckRequest, + metadata: grpcWeb.Metadata | undefined, + callback: (err: grpcWeb.Error, + response: HealthCheckResponse) => void + ): grpcWeb.ClientReadableStream; + +} + +export class MempoolPromiseClient { + constructor (hostname: string, + credentials: null | { [index: string]: string; }, + options: null | { [index: string]: string; }); + + addTransactionWithValidation( + request: AddTransactionWithValidationRequest, + metadata?: grpcWeb.Metadata + ): Promise; + + getBlock( + request: GetBlockRequest, + metadata?: grpcWeb.Metadata + ): Promise; + + commitTransactions( + request: CommitTransactionsRequest, + metadata?: grpcWeb.Metadata + ): Promise; + + healthCheck( + request: HealthCheckRequest, + metadata?: grpcWeb.Metadata + ): Promise; + +} + diff --git a/packages/libra-web-net/__grpc_web_generated__/mempool_grpc_web_pb.js b/packages/libra-web-net/__grpc_web_generated__/mempool_grpc_web_pb.js new file mode 100644 index 0000000..d869170 --- /dev/null +++ b/packages/libra-web-net/__grpc_web_generated__/mempool_grpc_web_pb.js @@ -0,0 +1,314 @@ +/** + * @fileoverview gRPC-Web generated client stub for mempool + * @enhanceable + * @public + */ + +// GENERATED CODE -- DO NOT EDIT! + + + +const grpc = {}; +grpc.web = require('grpc-web'); + + +var transaction_pb = require('./transaction_pb.js') + +var mempool_status_pb = require('./mempool_status_pb.js') +const proto = {}; +proto.mempool = require('./mempool_pb.js'); + +/** + * @param {string} hostname + * @param {?Object} credentials + * @param {?Object} options + * @constructor + * @struct + * @final + */ +proto.mempool.MempoolClient = + function(hostname, credentials, options) { + if (!options) options = {}; + options['format'] = 'text'; + + /** + * @private @const {!grpc.web.GrpcWebClientBase} The client + */ + this.client_ = new grpc.web.GrpcWebClientBase(options); + + /** + * @private @const {string} The hostname + */ + this.hostname_ = hostname; + + /** + * @private @const {?Object} The credentials to be used to connect + * to the server + */ + this.credentials_ = credentials; + + /** + * @private @const {?Object} Options for the client + */ + this.options_ = options; +}; + + +/** + * @param {string} hostname + * @param {?Object} credentials + * @param {?Object} options + * @constructor + * @struct + * @final + */ +proto.mempool.MempoolPromiseClient = + function(hostname, credentials, options) { + if (!options) options = {}; + options['format'] = 'text'; + + /** + * @private @const {!grpc.web.GrpcWebClientBase} The client + */ + this.client_ = new grpc.web.GrpcWebClientBase(options); + + /** + * @private @const {string} The hostname + */ + this.hostname_ = hostname; + + /** + * @private @const {?Object} The credentials to be used to connect + * to the server + */ + this.credentials_ = credentials; + + /** + * @private @const {?Object} Options for the client + */ + this.options_ = options; +}; + + +/** + * @const + * @type {!grpc.web.AbstractClientBase.MethodInfo< + * !proto.mempool.AddTransactionWithValidationRequest, + * !proto.mempool.AddTransactionWithValidationResponse>} + */ +const methodInfo_Mempool_AddTransactionWithValidation = new grpc.web.AbstractClientBase.MethodInfo( + proto.mempool.AddTransactionWithValidationResponse, + /** @param {!proto.mempool.AddTransactionWithValidationRequest} request */ + function(request) { + return request.serializeBinary(); + }, + proto.mempool.AddTransactionWithValidationResponse.deserializeBinary +); + + +/** + * @param {!proto.mempool.AddTransactionWithValidationRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.Error, ?proto.mempool.AddTransactionWithValidationResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.mempool.MempoolClient.prototype.addTransactionWithValidation = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/mempool.Mempool/AddTransactionWithValidation', + request, + metadata || {}, + methodInfo_Mempool_AddTransactionWithValidation, + callback); +}; + + +/** + * @param {!proto.mempool.AddTransactionWithValidationRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @return {!Promise} + * A native promise that resolves to the response + */ +proto.mempool.MempoolPromiseClient.prototype.addTransactionWithValidation = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/mempool.Mempool/AddTransactionWithValidation', + request, + metadata || {}, + methodInfo_Mempool_AddTransactionWithValidation); +}; + + +/** + * @const + * @type {!grpc.web.AbstractClientBase.MethodInfo< + * !proto.mempool.GetBlockRequest, + * !proto.mempool.GetBlockResponse>} + */ +const methodInfo_Mempool_GetBlock = new grpc.web.AbstractClientBase.MethodInfo( + proto.mempool.GetBlockResponse, + /** @param {!proto.mempool.GetBlockRequest} request */ + function(request) { + return request.serializeBinary(); + }, + proto.mempool.GetBlockResponse.deserializeBinary +); + + +/** + * @param {!proto.mempool.GetBlockRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.Error, ?proto.mempool.GetBlockResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.mempool.MempoolClient.prototype.getBlock = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/mempool.Mempool/GetBlock', + request, + metadata || {}, + methodInfo_Mempool_GetBlock, + callback); +}; + + +/** + * @param {!proto.mempool.GetBlockRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @return {!Promise} + * A native promise that resolves to the response + */ +proto.mempool.MempoolPromiseClient.prototype.getBlock = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/mempool.Mempool/GetBlock', + request, + metadata || {}, + methodInfo_Mempool_GetBlock); +}; + + +/** + * @const + * @type {!grpc.web.AbstractClientBase.MethodInfo< + * !proto.mempool.CommitTransactionsRequest, + * !proto.mempool.CommitTransactionsResponse>} + */ +const methodInfo_Mempool_CommitTransactions = new grpc.web.AbstractClientBase.MethodInfo( + proto.mempool.CommitTransactionsResponse, + /** @param {!proto.mempool.CommitTransactionsRequest} request */ + function(request) { + return request.serializeBinary(); + }, + proto.mempool.CommitTransactionsResponse.deserializeBinary +); + + +/** + * @param {!proto.mempool.CommitTransactionsRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.Error, ?proto.mempool.CommitTransactionsResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.mempool.MempoolClient.prototype.commitTransactions = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/mempool.Mempool/CommitTransactions', + request, + metadata || {}, + methodInfo_Mempool_CommitTransactions, + callback); +}; + + +/** + * @param {!proto.mempool.CommitTransactionsRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @return {!Promise} + * A native promise that resolves to the response + */ +proto.mempool.MempoolPromiseClient.prototype.commitTransactions = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/mempool.Mempool/CommitTransactions', + request, + metadata || {}, + methodInfo_Mempool_CommitTransactions); +}; + + +/** + * @const + * @type {!grpc.web.AbstractClientBase.MethodInfo< + * !proto.mempool.HealthCheckRequest, + * !proto.mempool.HealthCheckResponse>} + */ +const methodInfo_Mempool_HealthCheck = new grpc.web.AbstractClientBase.MethodInfo( + proto.mempool.HealthCheckResponse, + /** @param {!proto.mempool.HealthCheckRequest} request */ + function(request) { + return request.serializeBinary(); + }, + proto.mempool.HealthCheckResponse.deserializeBinary +); + + +/** + * @param {!proto.mempool.HealthCheckRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @param {function(?grpc.web.Error, ?proto.mempool.HealthCheckResponse)} + * callback The callback function(error, response) + * @return {!grpc.web.ClientReadableStream|undefined} + * The XHR Node Readable Stream + */ +proto.mempool.MempoolClient.prototype.healthCheck = + function(request, metadata, callback) { + return this.client_.rpcCall(this.hostname_ + + '/mempool.Mempool/HealthCheck', + request, + metadata || {}, + methodInfo_Mempool_HealthCheck, + callback); +}; + + +/** + * @param {!proto.mempool.HealthCheckRequest} request The + * request proto + * @param {?Object} metadata User defined + * call metadata + * @return {!Promise} + * A native promise that resolves to the response + */ +proto.mempool.MempoolPromiseClient.prototype.healthCheck = + function(request, metadata) { + return this.client_.unaryCall(this.hostname_ + + '/mempool.Mempool/HealthCheck', + request, + metadata || {}, + methodInfo_Mempool_HealthCheck); +}; + + +module.exports = proto.mempool; + diff --git a/packages/libra-web-net/__grpc_web_generated__/mempool_pb.d.ts b/packages/libra-web-net/__grpc_web_generated__/mempool_pb.d.ts new file mode 100644 index 0000000..97e7340 --- /dev/null +++ b/packages/libra-web-net/__grpc_web_generated__/mempool_pb.d.ts @@ -0,0 +1,227 @@ +import * as jspb from "google-protobuf" + +import * as transaction_pb from './transaction_pb'; +import * as mempool_status_pb from './mempool_status_pb'; + +export class AddTransactionWithValidationRequest extends jspb.Message { + getSignedTxn(): transaction_pb.SignedTransaction | undefined; + setSignedTxn(value?: transaction_pb.SignedTransaction): void; + hasSignedTxn(): boolean; + clearSignedTxn(): void; + + getMaxGasCost(): number; + setMaxGasCost(value: number): void; + + getLatestSequenceNumber(): number; + setLatestSequenceNumber(value: number): void; + + getAccountBalance(): number; + setAccountBalance(value: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AddTransactionWithValidationRequest.AsObject; + static toObject(includeInstance: boolean, msg: AddTransactionWithValidationRequest): AddTransactionWithValidationRequest.AsObject; + static serializeBinaryToWriter(message: AddTransactionWithValidationRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AddTransactionWithValidationRequest; + static deserializeBinaryFromReader(message: AddTransactionWithValidationRequest, reader: jspb.BinaryReader): AddTransactionWithValidationRequest; +} + +export namespace AddTransactionWithValidationRequest { + export type AsObject = { + signedTxn?: transaction_pb.SignedTransaction.AsObject, + maxGasCost: number, + latestSequenceNumber: number, + accountBalance: number, + } +} + +export class AddTransactionWithValidationResponse extends jspb.Message { + getCurrentVersion(): number; + setCurrentVersion(value: number): void; + + getStatus(): mempool_status_pb.MempoolAddTransactionStatus | undefined; + setStatus(value?: mempool_status_pb.MempoolAddTransactionStatus): void; + hasStatus(): boolean; + clearStatus(): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AddTransactionWithValidationResponse.AsObject; + static toObject(includeInstance: boolean, msg: AddTransactionWithValidationResponse): AddTransactionWithValidationResponse.AsObject; + static serializeBinaryToWriter(message: AddTransactionWithValidationResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AddTransactionWithValidationResponse; + static deserializeBinaryFromReader(message: AddTransactionWithValidationResponse, reader: jspb.BinaryReader): AddTransactionWithValidationResponse; +} + +export namespace AddTransactionWithValidationResponse { + export type AsObject = { + currentVersion: number, + status?: mempool_status_pb.MempoolAddTransactionStatus.AsObject, + } +} + +export class GetBlockRequest extends jspb.Message { + getMaxBlockSize(): number; + setMaxBlockSize(value: number): void; + + getTransactionsList(): Array; + setTransactionsList(value: Array): void; + clearTransactionsList(): void; + addTransactions(value?: TransactionExclusion, index?: number): TransactionExclusion; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetBlockRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetBlockRequest): GetBlockRequest.AsObject; + static serializeBinaryToWriter(message: GetBlockRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetBlockRequest; + static deserializeBinaryFromReader(message: GetBlockRequest, reader: jspb.BinaryReader): GetBlockRequest; +} + +export namespace GetBlockRequest { + export type AsObject = { + maxBlockSize: number, + transactionsList: Array, + } +} + +export class GetBlockResponse extends jspb.Message { + getBlock(): transaction_pb.SignedTransactionsBlock | undefined; + setBlock(value?: transaction_pb.SignedTransactionsBlock): void; + hasBlock(): boolean; + clearBlock(): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetBlockResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetBlockResponse): GetBlockResponse.AsObject; + static serializeBinaryToWriter(message: GetBlockResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetBlockResponse; + static deserializeBinaryFromReader(message: GetBlockResponse, reader: jspb.BinaryReader): GetBlockResponse; +} + +export namespace GetBlockResponse { + export type AsObject = { + block?: transaction_pb.SignedTransactionsBlock.AsObject, + } +} + +export class TransactionExclusion extends jspb.Message { + getSender(): Uint8Array | string; + getSender_asU8(): Uint8Array; + getSender_asB64(): string; + setSender(value: Uint8Array | string): void; + + getSequenceNumber(): number; + setSequenceNumber(value: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): TransactionExclusion.AsObject; + static toObject(includeInstance: boolean, msg: TransactionExclusion): TransactionExclusion.AsObject; + static serializeBinaryToWriter(message: TransactionExclusion, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): TransactionExclusion; + static deserializeBinaryFromReader(message: TransactionExclusion, reader: jspb.BinaryReader): TransactionExclusion; +} + +export namespace TransactionExclusion { + export type AsObject = { + sender: Uint8Array | string, + sequenceNumber: number, + } +} + +export class CommitTransactionsRequest extends jspb.Message { + getTransactionsList(): Array; + setTransactionsList(value: Array): void; + clearTransactionsList(): void; + addTransactions(value?: CommittedTransaction, index?: number): CommittedTransaction; + + getBlockTimestampUsecs(): number; + setBlockTimestampUsecs(value: number): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): CommitTransactionsRequest.AsObject; + static toObject(includeInstance: boolean, msg: CommitTransactionsRequest): CommitTransactionsRequest.AsObject; + static serializeBinaryToWriter(message: CommitTransactionsRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): CommitTransactionsRequest; + static deserializeBinaryFromReader(message: CommitTransactionsRequest, reader: jspb.BinaryReader): CommitTransactionsRequest; +} + +export namespace CommitTransactionsRequest { + export type AsObject = { + transactionsList: Array, + blockTimestampUsecs: number, + } +} + +export class CommitTransactionsResponse extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): CommitTransactionsResponse.AsObject; + static toObject(includeInstance: boolean, msg: CommitTransactionsResponse): CommitTransactionsResponse.AsObject; + static serializeBinaryToWriter(message: CommitTransactionsResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): CommitTransactionsResponse; + static deserializeBinaryFromReader(message: CommitTransactionsResponse, reader: jspb.BinaryReader): CommitTransactionsResponse; +} + +export namespace CommitTransactionsResponse { + export type AsObject = { + } +} + +export class CommittedTransaction extends jspb.Message { + getSender(): Uint8Array | string; + getSender_asU8(): Uint8Array; + getSender_asB64(): string; + setSender(value: Uint8Array | string): void; + + getSequenceNumber(): number; + setSequenceNumber(value: number): void; + + getIsRejected(): boolean; + setIsRejected(value: boolean): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): CommittedTransaction.AsObject; + static toObject(includeInstance: boolean, msg: CommittedTransaction): CommittedTransaction.AsObject; + static serializeBinaryToWriter(message: CommittedTransaction, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): CommittedTransaction; + static deserializeBinaryFromReader(message: CommittedTransaction, reader: jspb.BinaryReader): CommittedTransaction; +} + +export namespace CommittedTransaction { + export type AsObject = { + sender: Uint8Array | string, + sequenceNumber: number, + isRejected: boolean, + } +} + +export class HealthCheckRequest extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): HealthCheckRequest.AsObject; + static toObject(includeInstance: boolean, msg: HealthCheckRequest): HealthCheckRequest.AsObject; + static serializeBinaryToWriter(message: HealthCheckRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): HealthCheckRequest; + static deserializeBinaryFromReader(message: HealthCheckRequest, reader: jspb.BinaryReader): HealthCheckRequest; +} + +export namespace HealthCheckRequest { + export type AsObject = { + } +} + +export class HealthCheckResponse extends jspb.Message { + getIsHealthy(): boolean; + setIsHealthy(value: boolean): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): HealthCheckResponse.AsObject; + static toObject(includeInstance: boolean, msg: HealthCheckResponse): HealthCheckResponse.AsObject; + static serializeBinaryToWriter(message: HealthCheckResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): HealthCheckResponse; + static deserializeBinaryFromReader(message: HealthCheckResponse, reader: jspb.BinaryReader): HealthCheckResponse; +} + +export namespace HealthCheckResponse { + export type AsObject = { + isHealthy: boolean, + } +} + diff --git a/packages/libra-web-net/__grpc_web_generated__/mempool_pb.js b/packages/libra-web-net/__grpc_web_generated__/mempool_pb.js new file mode 100644 index 0000000..b0380b5 --- /dev/null +++ b/packages/libra-web-net/__grpc_web_generated__/mempool_pb.js @@ -0,0 +1,1849 @@ +/** + * @fileoverview + * @enhanceable + * @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! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +var transaction_pb = require('./transaction_pb.js'); +goog.object.extend(proto, transaction_pb); +var mempool_status_pb = require('./mempool_status_pb.js'); +goog.object.extend(proto, mempool_status_pb); +goog.exportSymbol('proto.mempool.AddTransactionWithValidationRequest', null, global); +goog.exportSymbol('proto.mempool.AddTransactionWithValidationResponse', null, global); +goog.exportSymbol('proto.mempool.CommitTransactionsRequest', null, global); +goog.exportSymbol('proto.mempool.CommitTransactionsResponse', null, global); +goog.exportSymbol('proto.mempool.CommittedTransaction', null, global); +goog.exportSymbol('proto.mempool.GetBlockRequest', null, global); +goog.exportSymbol('proto.mempool.GetBlockResponse', null, global); +goog.exportSymbol('proto.mempool.HealthCheckRequest', null, global); +goog.exportSymbol('proto.mempool.HealthCheckResponse', null, global); +goog.exportSymbol('proto.mempool.TransactionExclusion', 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.mempool.AddTransactionWithValidationRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.mempool.AddTransactionWithValidationRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.mempool.AddTransactionWithValidationRequest.displayName = 'proto.mempool.AddTransactionWithValidationRequest'; +} +/** + * 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.mempool.AddTransactionWithValidationResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.mempool.AddTransactionWithValidationResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.mempool.AddTransactionWithValidationResponse.displayName = 'proto.mempool.AddTransactionWithValidationResponse'; +} +/** + * 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.mempool.GetBlockRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.mempool.GetBlockRequest.repeatedFields_, null); +}; +goog.inherits(proto.mempool.GetBlockRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.mempool.GetBlockRequest.displayName = 'proto.mempool.GetBlockRequest'; +} +/** + * 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.mempool.GetBlockResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.mempool.GetBlockResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.mempool.GetBlockResponse.displayName = 'proto.mempool.GetBlockResponse'; +} +/** + * 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.mempool.TransactionExclusion = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.mempool.TransactionExclusion, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.mempool.TransactionExclusion.displayName = 'proto.mempool.TransactionExclusion'; +} +/** + * 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.mempool.CommitTransactionsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.mempool.CommitTransactionsRequest.repeatedFields_, null); +}; +goog.inherits(proto.mempool.CommitTransactionsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.mempool.CommitTransactionsRequest.displayName = 'proto.mempool.CommitTransactionsRequest'; +} +/** + * 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.mempool.CommitTransactionsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.mempool.CommitTransactionsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.mempool.CommitTransactionsResponse.displayName = 'proto.mempool.CommitTransactionsResponse'; +} +/** + * 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.mempool.CommittedTransaction = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.mempool.CommittedTransaction, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.mempool.CommittedTransaction.displayName = 'proto.mempool.CommittedTransaction'; +} +/** + * 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.mempool.HealthCheckRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.mempool.HealthCheckRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.mempool.HealthCheckRequest.displayName = 'proto.mempool.HealthCheckRequest'; +} +/** + * 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.mempool.HealthCheckResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.mempool.HealthCheckResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.mempool.HealthCheckResponse.displayName = 'proto.mempool.HealthCheckResponse'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.mempool.AddTransactionWithValidationRequest.prototype.toObject = function(opt_includeInstance) { + return proto.mempool.AddTransactionWithValidationRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.mempool.AddTransactionWithValidationRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.mempool.AddTransactionWithValidationRequest.toObject = function(includeInstance, msg) { + var f, obj = { + signedTxn: (f = msg.getSignedTxn()) && transaction_pb.SignedTransaction.toObject(includeInstance, f), + maxGasCost: jspb.Message.getFieldWithDefault(msg, 2, 0), + latestSequenceNumber: jspb.Message.getFieldWithDefault(msg, 3, 0), + accountBalance: 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.mempool.AddTransactionWithValidationRequest} + */ +proto.mempool.AddTransactionWithValidationRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.mempool.AddTransactionWithValidationRequest; + return proto.mempool.AddTransactionWithValidationRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.mempool.AddTransactionWithValidationRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.mempool.AddTransactionWithValidationRequest} + */ +proto.mempool.AddTransactionWithValidationRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new transaction_pb.SignedTransaction; + reader.readMessage(value,transaction_pb.SignedTransaction.deserializeBinaryFromReader); + msg.setSignedTxn(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint64()); + msg.setMaxGasCost(value); + break; + case 3: + var value = /** @type {number} */ (reader.readUint64()); + msg.setLatestSequenceNumber(value); + break; + case 4: + var value = /** @type {number} */ (reader.readUint64()); + msg.setAccountBalance(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.mempool.AddTransactionWithValidationRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.mempool.AddTransactionWithValidationRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.mempool.AddTransactionWithValidationRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.mempool.AddTransactionWithValidationRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSignedTxn(); + if (f != null) { + writer.writeMessage( + 1, + f, + transaction_pb.SignedTransaction.serializeBinaryToWriter + ); + } + f = message.getMaxGasCost(); + if (f !== 0) { + writer.writeUint64( + 2, + f + ); + } + f = message.getLatestSequenceNumber(); + if (f !== 0) { + writer.writeUint64( + 3, + f + ); + } + f = message.getAccountBalance(); + if (f !== 0) { + writer.writeUint64( + 4, + f + ); + } +}; + + +/** + * optional types.SignedTransaction signed_txn = 1; + * @return {?proto.types.SignedTransaction} + */ +proto.mempool.AddTransactionWithValidationRequest.prototype.getSignedTxn = function() { + return /** @type{?proto.types.SignedTransaction} */ ( + jspb.Message.getWrapperField(this, transaction_pb.SignedTransaction, 1)); +}; + + +/** @param {?proto.types.SignedTransaction|undefined} value */ +proto.mempool.AddTransactionWithValidationRequest.prototype.setSignedTxn = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.mempool.AddTransactionWithValidationRequest.prototype.clearSignedTxn = function() { + this.setSignedTxn(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.mempool.AddTransactionWithValidationRequest.prototype.hasSignedTxn = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional uint64 max_gas_cost = 2; + * @return {number} + */ +proto.mempool.AddTransactionWithValidationRequest.prototype.getMaxGasCost = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.mempool.AddTransactionWithValidationRequest.prototype.setMaxGasCost = function(value) { + jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional uint64 latest_sequence_number = 3; + * @return {number} + */ +proto.mempool.AddTransactionWithValidationRequest.prototype.getLatestSequenceNumber = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** @param {number} value */ +proto.mempool.AddTransactionWithValidationRequest.prototype.setLatestSequenceNumber = function(value) { + jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional uint64 account_balance = 4; + * @return {number} + */ +proto.mempool.AddTransactionWithValidationRequest.prototype.getAccountBalance = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** @param {number} value */ +proto.mempool.AddTransactionWithValidationRequest.prototype.setAccountBalance = function(value) { + jspb.Message.setProto3IntField(this, 4, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.mempool.AddTransactionWithValidationResponse.prototype.toObject = function(opt_includeInstance) { + return proto.mempool.AddTransactionWithValidationResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.mempool.AddTransactionWithValidationResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.mempool.AddTransactionWithValidationResponse.toObject = function(includeInstance, msg) { + var f, obj = { + currentVersion: jspb.Message.getFieldWithDefault(msg, 1, 0), + status: (f = msg.getStatus()) && mempool_status_pb.MempoolAddTransactionStatus.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.mempool.AddTransactionWithValidationResponse} + */ +proto.mempool.AddTransactionWithValidationResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.mempool.AddTransactionWithValidationResponse; + return proto.mempool.AddTransactionWithValidationResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.mempool.AddTransactionWithValidationResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.mempool.AddTransactionWithValidationResponse} + */ +proto.mempool.AddTransactionWithValidationResponse.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.setCurrentVersion(value); + break; + case 2: + var value = new mempool_status_pb.MempoolAddTransactionStatus; + reader.readMessage(value,mempool_status_pb.MempoolAddTransactionStatus.deserializeBinaryFromReader); + msg.setStatus(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.mempool.AddTransactionWithValidationResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.mempool.AddTransactionWithValidationResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.mempool.AddTransactionWithValidationResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.mempool.AddTransactionWithValidationResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getCurrentVersion(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } + f = message.getStatus(); + if (f != null) { + writer.writeMessage( + 2, + f, + mempool_status_pb.MempoolAddTransactionStatus.serializeBinaryToWriter + ); + } +}; + + +/** + * optional uint64 current_version = 1; + * @return {number} + */ +proto.mempool.AddTransactionWithValidationResponse.prototype.getCurrentVersion = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.mempool.AddTransactionWithValidationResponse.prototype.setCurrentVersion = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional MempoolAddTransactionStatus status = 2; + * @return {?proto.mempool.MempoolAddTransactionStatus} + */ +proto.mempool.AddTransactionWithValidationResponse.prototype.getStatus = function() { + return /** @type{?proto.mempool.MempoolAddTransactionStatus} */ ( + jspb.Message.getWrapperField(this, mempool_status_pb.MempoolAddTransactionStatus, 2)); +}; + + +/** @param {?proto.mempool.MempoolAddTransactionStatus|undefined} value */ +proto.mempool.AddTransactionWithValidationResponse.prototype.setStatus = function(value) { + jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.mempool.AddTransactionWithValidationResponse.prototype.clearStatus = function() { + this.setStatus(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.mempool.AddTransactionWithValidationResponse.prototype.hasStatus = function() { + return jspb.Message.getField(this, 2) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.mempool.GetBlockRequest.repeatedFields_ = [2]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.mempool.GetBlockRequest.prototype.toObject = function(opt_includeInstance) { + return proto.mempool.GetBlockRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.mempool.GetBlockRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.mempool.GetBlockRequest.toObject = function(includeInstance, msg) { + var f, obj = { + maxBlockSize: jspb.Message.getFieldWithDefault(msg, 1, 0), + transactionsList: jspb.Message.toObjectList(msg.getTransactionsList(), + proto.mempool.TransactionExclusion.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.mempool.GetBlockRequest} + */ +proto.mempool.GetBlockRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.mempool.GetBlockRequest; + return proto.mempool.GetBlockRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.mempool.GetBlockRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.mempool.GetBlockRequest} + */ +proto.mempool.GetBlockRequest.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.setMaxBlockSize(value); + break; + case 2: + var value = new proto.mempool.TransactionExclusion; + reader.readMessage(value,proto.mempool.TransactionExclusion.deserializeBinaryFromReader); + msg.addTransactions(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.mempool.GetBlockRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.mempool.GetBlockRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.mempool.GetBlockRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.mempool.GetBlockRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getMaxBlockSize(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } + f = message.getTransactionsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 2, + f, + proto.mempool.TransactionExclusion.serializeBinaryToWriter + ); + } +}; + + +/** + * optional uint64 max_block_size = 1; + * @return {number} + */ +proto.mempool.GetBlockRequest.prototype.getMaxBlockSize = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {number} value */ +proto.mempool.GetBlockRequest.prototype.setMaxBlockSize = function(value) { + jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * repeated TransactionExclusion transactions = 2; + * @return {!Array} + */ +proto.mempool.GetBlockRequest.prototype.getTransactionsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.mempool.TransactionExclusion, 2)); +}; + + +/** @param {!Array} value */ +proto.mempool.GetBlockRequest.prototype.setTransactionsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 2, value); +}; + + +/** + * @param {!proto.mempool.TransactionExclusion=} opt_value + * @param {number=} opt_index + * @return {!proto.mempool.TransactionExclusion} + */ +proto.mempool.GetBlockRequest.prototype.addTransactions = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, proto.mempool.TransactionExclusion, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.mempool.GetBlockRequest.prototype.clearTransactionsList = function() { + this.setTransactionsList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.mempool.GetBlockResponse.prototype.toObject = function(opt_includeInstance) { + return proto.mempool.GetBlockResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.mempool.GetBlockResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.mempool.GetBlockResponse.toObject = function(includeInstance, msg) { + var f, obj = { + block: (f = msg.getBlock()) && transaction_pb.SignedTransactionsBlock.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.mempool.GetBlockResponse} + */ +proto.mempool.GetBlockResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.mempool.GetBlockResponse; + return proto.mempool.GetBlockResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.mempool.GetBlockResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.mempool.GetBlockResponse} + */ +proto.mempool.GetBlockResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new transaction_pb.SignedTransactionsBlock; + reader.readMessage(value,transaction_pb.SignedTransactionsBlock.deserializeBinaryFromReader); + msg.setBlock(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.mempool.GetBlockResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.mempool.GetBlockResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.mempool.GetBlockResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.mempool.GetBlockResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getBlock(); + if (f != null) { + writer.writeMessage( + 1, + f, + transaction_pb.SignedTransactionsBlock.serializeBinaryToWriter + ); + } +}; + + +/** + * optional types.SignedTransactionsBlock block = 1; + * @return {?proto.types.SignedTransactionsBlock} + */ +proto.mempool.GetBlockResponse.prototype.getBlock = function() { + return /** @type{?proto.types.SignedTransactionsBlock} */ ( + jspb.Message.getWrapperField(this, transaction_pb.SignedTransactionsBlock, 1)); +}; + + +/** @param {?proto.types.SignedTransactionsBlock|undefined} value */ +proto.mempool.GetBlockResponse.prototype.setBlock = function(value) { + jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.mempool.GetBlockResponse.prototype.clearBlock = function() { + this.setBlock(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.mempool.GetBlockResponse.prototype.hasBlock = function() { + return jspb.Message.getField(this, 1) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.mempool.TransactionExclusion.prototype.toObject = function(opt_includeInstance) { + return proto.mempool.TransactionExclusion.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.mempool.TransactionExclusion} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.mempool.TransactionExclusion.toObject = function(includeInstance, msg) { + var f, obj = { + sender: msg.getSender_asB64(), + sequenceNumber: jspb.Message.getFieldWithDefault(msg, 2, 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.mempool.TransactionExclusion} + */ +proto.mempool.TransactionExclusion.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.mempool.TransactionExclusion; + return proto.mempool.TransactionExclusion.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.mempool.TransactionExclusion} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.mempool.TransactionExclusion} + */ +proto.mempool.TransactionExclusion.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.setSender(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint64()); + msg.setSequenceNumber(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.mempool.TransactionExclusion.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.mempool.TransactionExclusion.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.mempool.TransactionExclusion} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.mempool.TransactionExclusion.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSender_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getSequenceNumber(); + if (f !== 0) { + writer.writeUint64( + 2, + f + ); + } +}; + + +/** + * optional bytes sender = 1; + * @return {string} + */ +proto.mempool.TransactionExclusion.prototype.getSender = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes sender = 1; + * This is a type-conversion wrapper around `getSender()` + * @return {string} + */ +proto.mempool.TransactionExclusion.prototype.getSender_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getSender())); +}; + + +/** + * optional bytes sender = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getSender()` + * @return {!Uint8Array} + */ +proto.mempool.TransactionExclusion.prototype.getSender_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getSender())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.mempool.TransactionExclusion.prototype.setSender = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional uint64 sequence_number = 2; + * @return {number} + */ +proto.mempool.TransactionExclusion.prototype.getSequenceNumber = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.mempool.TransactionExclusion.prototype.setSequenceNumber = function(value) { + jspb.Message.setProto3IntField(this, 2, value); +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.mempool.CommitTransactionsRequest.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.mempool.CommitTransactionsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.mempool.CommitTransactionsRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.mempool.CommitTransactionsRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.mempool.CommitTransactionsRequest.toObject = function(includeInstance, msg) { + var f, obj = { + transactionsList: jspb.Message.toObjectList(msg.getTransactionsList(), + proto.mempool.CommittedTransaction.toObject, includeInstance), + blockTimestampUsecs: jspb.Message.getFieldWithDefault(msg, 2, 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.mempool.CommitTransactionsRequest} + */ +proto.mempool.CommitTransactionsRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.mempool.CommitTransactionsRequest; + return proto.mempool.CommitTransactionsRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.mempool.CommitTransactionsRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.mempool.CommitTransactionsRequest} + */ +proto.mempool.CommitTransactionsRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.mempool.CommittedTransaction; + reader.readMessage(value,proto.mempool.CommittedTransaction.deserializeBinaryFromReader); + msg.addTransactions(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint64()); + msg.setBlockTimestampUsecs(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.mempool.CommitTransactionsRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.mempool.CommitTransactionsRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.mempool.CommitTransactionsRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.mempool.CommitTransactionsRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getTransactionsList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.mempool.CommittedTransaction.serializeBinaryToWriter + ); + } + f = message.getBlockTimestampUsecs(); + if (f !== 0) { + writer.writeUint64( + 2, + f + ); + } +}; + + +/** + * repeated CommittedTransaction transactions = 1; + * @return {!Array} + */ +proto.mempool.CommitTransactionsRequest.prototype.getTransactionsList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.mempool.CommittedTransaction, 1)); +}; + + +/** @param {!Array} value */ +proto.mempool.CommitTransactionsRequest.prototype.setTransactionsList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.mempool.CommittedTransaction=} opt_value + * @param {number=} opt_index + * @return {!proto.mempool.CommittedTransaction} + */ +proto.mempool.CommitTransactionsRequest.prototype.addTransactions = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.mempool.CommittedTransaction, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.mempool.CommitTransactionsRequest.prototype.clearTransactionsList = function() { + this.setTransactionsList([]); +}; + + +/** + * optional uint64 block_timestamp_usecs = 2; + * @return {number} + */ +proto.mempool.CommitTransactionsRequest.prototype.getBlockTimestampUsecs = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.mempool.CommitTransactionsRequest.prototype.setBlockTimestampUsecs = function(value) { + jspb.Message.setProto3IntField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.mempool.CommitTransactionsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.mempool.CommitTransactionsResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.mempool.CommitTransactionsResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.mempool.CommitTransactionsResponse.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.mempool.CommitTransactionsResponse} + */ +proto.mempool.CommitTransactionsResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.mempool.CommitTransactionsResponse; + return proto.mempool.CommitTransactionsResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.mempool.CommitTransactionsResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.mempool.CommitTransactionsResponse} + */ +proto.mempool.CommitTransactionsResponse.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.mempool.CommitTransactionsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.mempool.CommitTransactionsResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.mempool.CommitTransactionsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.mempool.CommitTransactionsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.mempool.CommittedTransaction.prototype.toObject = function(opt_includeInstance) { + return proto.mempool.CommittedTransaction.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.mempool.CommittedTransaction} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.mempool.CommittedTransaction.toObject = function(includeInstance, msg) { + var f, obj = { + sender: msg.getSender_asB64(), + sequenceNumber: jspb.Message.getFieldWithDefault(msg, 2, 0), + isRejected: jspb.Message.getFieldWithDefault(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.mempool.CommittedTransaction} + */ +proto.mempool.CommittedTransaction.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.mempool.CommittedTransaction; + return proto.mempool.CommittedTransaction.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.mempool.CommittedTransaction} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.mempool.CommittedTransaction} + */ +proto.mempool.CommittedTransaction.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.setSender(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint64()); + msg.setSequenceNumber(value); + break; + case 3: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsRejected(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.mempool.CommittedTransaction.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.mempool.CommittedTransaction.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.mempool.CommittedTransaction} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.mempool.CommittedTransaction.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSender_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getSequenceNumber(); + if (f !== 0) { + writer.writeUint64( + 2, + f + ); + } + f = message.getIsRejected(); + if (f) { + writer.writeBool( + 3, + f + ); + } +}; + + +/** + * optional bytes sender = 1; + * @return {string} + */ +proto.mempool.CommittedTransaction.prototype.getSender = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes sender = 1; + * This is a type-conversion wrapper around `getSender()` + * @return {string} + */ +proto.mempool.CommittedTransaction.prototype.getSender_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getSender())); +}; + + +/** + * optional bytes sender = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getSender()` + * @return {!Uint8Array} + */ +proto.mempool.CommittedTransaction.prototype.getSender_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getSender())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.mempool.CommittedTransaction.prototype.setSender = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional uint64 sequence_number = 2; + * @return {number} + */ +proto.mempool.CommittedTransaction.prototype.getSequenceNumber = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** @param {number} value */ +proto.mempool.CommittedTransaction.prototype.setSequenceNumber = function(value) { + jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional bool is_rejected = 3; + * Note that Boolean fields may be set to 0/1 when serialized from a Java server. + * You should avoid comparisons like {@code val === true/false} in those cases. + * @return {boolean} + */ +proto.mempool.CommittedTransaction.prototype.getIsRejected = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 3, false)); +}; + + +/** @param {boolean} value */ +proto.mempool.CommittedTransaction.prototype.setIsRejected = function(value) { + jspb.Message.setProto3BooleanField(this, 3, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.mempool.HealthCheckRequest.prototype.toObject = function(opt_includeInstance) { + return proto.mempool.HealthCheckRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.mempool.HealthCheckRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.mempool.HealthCheckRequest.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.mempool.HealthCheckRequest} + */ +proto.mempool.HealthCheckRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.mempool.HealthCheckRequest; + return proto.mempool.HealthCheckRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.mempool.HealthCheckRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.mempool.HealthCheckRequest} + */ +proto.mempool.HealthCheckRequest.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.mempool.HealthCheckRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.mempool.HealthCheckRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.mempool.HealthCheckRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.mempool.HealthCheckRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.mempool.HealthCheckResponse.prototype.toObject = function(opt_includeInstance) { + return proto.mempool.HealthCheckResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.mempool.HealthCheckResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.mempool.HealthCheckResponse.toObject = function(includeInstance, msg) { + var f, obj = { + isHealthy: jspb.Message.getFieldWithDefault(msg, 1, 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.mempool.HealthCheckResponse} + */ +proto.mempool.HealthCheckResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.mempool.HealthCheckResponse; + return proto.mempool.HealthCheckResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.mempool.HealthCheckResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.mempool.HealthCheckResponse} + */ +proto.mempool.HealthCheckResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setIsHealthy(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.mempool.HealthCheckResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.mempool.HealthCheckResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.mempool.HealthCheckResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.mempool.HealthCheckResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getIsHealthy(); + if (f) { + writer.writeBool( + 1, + f + ); + } +}; + + +/** + * optional bool is_healthy = 1; + * Note that Boolean fields may be set to 0/1 when serialized from a Java server. + * You should avoid comparisons like {@code val === true/false} in those cases. + * @return {boolean} + */ +proto.mempool.HealthCheckResponse.prototype.getIsHealthy = function() { + return /** @type {boolean} */ (jspb.Message.getFieldWithDefault(this, 1, false)); +}; + + +/** @param {boolean} value */ +proto.mempool.HealthCheckResponse.prototype.setIsHealthy = function(value) { + jspb.Message.setProto3BooleanField(this, 1, value); +}; + + +goog.object.extend(exports, proto.mempool); diff --git a/packages/libra-web-net/__grpc_web_generated__/mempool_status_pb.d.ts b/packages/libra-web-net/__grpc_web_generated__/mempool_status_pb.d.ts index 821edcf..f6fea63 100644 --- a/packages/libra-web-net/__grpc_web_generated__/mempool_status_pb.d.ts +++ b/packages/libra-web-net/__grpc_web_generated__/mempool_status_pb.d.ts @@ -1,6 +1,28 @@ import * as jspb from "google-protobuf" -export enum MempoolAddTransactionStatus { +export class MempoolAddTransactionStatus extends jspb.Message { + getCode(): MempoolAddTransactionStatusCode; + setCode(value: MempoolAddTransactionStatusCode): void; + + getMessage(): string; + setMessage(value: string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): MempoolAddTransactionStatus.AsObject; + static toObject(includeInstance: boolean, msg: MempoolAddTransactionStatus): MempoolAddTransactionStatus.AsObject; + static serializeBinaryToWriter(message: MempoolAddTransactionStatus, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): MempoolAddTransactionStatus; + static deserializeBinaryFromReader(message: MempoolAddTransactionStatus, reader: jspb.BinaryReader): MempoolAddTransactionStatus; +} + +export namespace MempoolAddTransactionStatus { + export type AsObject = { + code: MempoolAddTransactionStatusCode, + message: string, + } +} + +export enum MempoolAddTransactionStatusCode { Valid = 0, InsufficientBalance = 1, InvalidSeqNumber = 2, diff --git a/packages/libra-web-net/__grpc_web_generated__/mempool_status_pb.js b/packages/libra-web-net/__grpc_web_generated__/mempool_status_pb.js index 21dc61e..d1063ac 100644 --- a/packages/libra-web-net/__grpc_web_generated__/mempool_status_pb.js +++ b/packages/libra-web-net/__grpc_web_generated__/mempool_status_pb.js @@ -12,10 +12,184 @@ var goog = jspb; var global = Function('return this')(); goog.exportSymbol('proto.mempool.MempoolAddTransactionStatus', null, global); +goog.exportSymbol('proto.mempool.MempoolAddTransactionStatusCode', 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.mempool.MempoolAddTransactionStatus = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.mempool.MempoolAddTransactionStatus, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.mempool.MempoolAddTransactionStatus.displayName = 'proto.mempool.MempoolAddTransactionStatus'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.mempool.MempoolAddTransactionStatus.prototype.toObject = function(opt_includeInstance) { + return proto.mempool.MempoolAddTransactionStatus.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.mempool.MempoolAddTransactionStatus} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.mempool.MempoolAddTransactionStatus.toObject = function(includeInstance, msg) { + var f, obj = { + code: jspb.Message.getFieldWithDefault(msg, 1, 0), + message: 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.mempool.MempoolAddTransactionStatus} + */ +proto.mempool.MempoolAddTransactionStatus.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.mempool.MempoolAddTransactionStatus; + return proto.mempool.MempoolAddTransactionStatus.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.mempool.MempoolAddTransactionStatus} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.mempool.MempoolAddTransactionStatus} + */ +proto.mempool.MempoolAddTransactionStatus.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!proto.mempool.MempoolAddTransactionStatusCode} */ (reader.readEnum()); + msg.setCode(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setMessage(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.mempool.MempoolAddTransactionStatus.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.mempool.MempoolAddTransactionStatus.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.mempool.MempoolAddTransactionStatus} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.mempool.MempoolAddTransactionStatus.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getCode(); + if (f !== 0.0) { + writer.writeEnum( + 1, + f + ); + } + f = message.getMessage(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } +}; + + +/** + * optional MempoolAddTransactionStatusCode code = 1; + * @return {!proto.mempool.MempoolAddTransactionStatusCode} + */ +proto.mempool.MempoolAddTransactionStatus.prototype.getCode = function() { + return /** @type {!proto.mempool.MempoolAddTransactionStatusCode} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** @param {!proto.mempool.MempoolAddTransactionStatusCode} value */ +proto.mempool.MempoolAddTransactionStatus.prototype.setCode = function(value) { + jspb.Message.setProto3EnumField(this, 1, value); +}; + + +/** + * optional string message = 2; + * @return {string} + */ +proto.mempool.MempoolAddTransactionStatus.prototype.getMessage = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** @param {string} value */ +proto.mempool.MempoolAddTransactionStatus.prototype.setMessage = function(value) { + jspb.Message.setProto3StringField(this, 2, value); +}; + + /** * @enum {number} */ -proto.mempool.MempoolAddTransactionStatus = { +proto.mempool.MempoolAddTransactionStatusCode = { VALID: 0, INSUFFICIENTBALANCE: 1, INVALIDSEQNUMBER: 2, diff --git a/packages/libra-web-net/__grpc_web_generated__/validator_public_keys_pb.d.ts b/packages/libra-web-net/__grpc_web_generated__/validator_public_keys_pb.d.ts new file mode 100644 index 0000000..4717a11 --- /dev/null +++ b/packages/libra-web-net/__grpc_web_generated__/validator_public_keys_pb.d.ts @@ -0,0 +1,40 @@ +import * as jspb from "google-protobuf" + +export class ValidatorPublicKeys extends jspb.Message { + getAccountAddress(): Uint8Array | string; + getAccountAddress_asU8(): Uint8Array; + getAccountAddress_asB64(): string; + setAccountAddress(value: Uint8Array | string): void; + + getConsensusPublicKey(): Uint8Array | string; + getConsensusPublicKey_asU8(): Uint8Array; + getConsensusPublicKey_asB64(): string; + setConsensusPublicKey(value: Uint8Array | string): void; + + getNetworkSigningPublicKey(): Uint8Array | string; + getNetworkSigningPublicKey_asU8(): Uint8Array; + getNetworkSigningPublicKey_asB64(): string; + setNetworkSigningPublicKey(value: Uint8Array | string): void; + + getNetworkIdentityPublicKey(): Uint8Array | string; + getNetworkIdentityPublicKey_asU8(): Uint8Array; + getNetworkIdentityPublicKey_asB64(): string; + setNetworkIdentityPublicKey(value: Uint8Array | string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ValidatorPublicKeys.AsObject; + static toObject(includeInstance: boolean, msg: ValidatorPublicKeys): ValidatorPublicKeys.AsObject; + static serializeBinaryToWriter(message: ValidatorPublicKeys, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ValidatorPublicKeys; + static deserializeBinaryFromReader(message: ValidatorPublicKeys, reader: jspb.BinaryReader): ValidatorPublicKeys; +} + +export namespace ValidatorPublicKeys { + export type AsObject = { + accountAddress: Uint8Array | string, + consensusPublicKey: Uint8Array | string, + networkSigningPublicKey: Uint8Array | string, + networkIdentityPublicKey: Uint8Array | string, + } +} + diff --git a/packages/libra-web-net/__grpc_web_generated__/validator_public_keys_pb.js b/packages/libra-web-net/__grpc_web_generated__/validator_public_keys_pb.js new file mode 100644 index 0000000..8d24831 --- /dev/null +++ b/packages/libra-web-net/__grpc_web_generated__/validator_public_keys_pb.js @@ -0,0 +1,338 @@ +/** + * @fileoverview + * @enhanceable + * @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! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +goog.exportSymbol('proto.types.ValidatorPublicKeys', 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.types.ValidatorPublicKeys = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.types.ValidatorPublicKeys, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.types.ValidatorPublicKeys.displayName = 'proto.types.ValidatorPublicKeys'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.types.ValidatorPublicKeys.prototype.toObject = function(opt_includeInstance) { + return proto.types.ValidatorPublicKeys.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.types.ValidatorPublicKeys} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.ValidatorPublicKeys.toObject = function(includeInstance, msg) { + var f, obj = { + accountAddress: msg.getAccountAddress_asB64(), + consensusPublicKey: msg.getConsensusPublicKey_asB64(), + networkSigningPublicKey: msg.getNetworkSigningPublicKey_asB64(), + networkIdentityPublicKey: msg.getNetworkIdentityPublicKey_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.types.ValidatorPublicKeys} + */ +proto.types.ValidatorPublicKeys.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.types.ValidatorPublicKeys; + return proto.types.ValidatorPublicKeys.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.types.ValidatorPublicKeys} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.types.ValidatorPublicKeys} + */ +proto.types.ValidatorPublicKeys.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.setAccountAddress(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setConsensusPublicKey(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setNetworkSigningPublicKey(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setNetworkIdentityPublicKey(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.types.ValidatorPublicKeys.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.types.ValidatorPublicKeys.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.types.ValidatorPublicKeys} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.ValidatorPublicKeys.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAccountAddress_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getConsensusPublicKey_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getNetworkSigningPublicKey_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getNetworkIdentityPublicKey_asU8(); + if (f.length > 0) { + writer.writeBytes( + 4, + f + ); + } +}; + + +/** + * optional bytes account_address = 1; + * @return {string} + */ +proto.types.ValidatorPublicKeys.prototype.getAccountAddress = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes account_address = 1; + * This is a type-conversion wrapper around `getAccountAddress()` + * @return {string} + */ +proto.types.ValidatorPublicKeys.prototype.getAccountAddress_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getAccountAddress())); +}; + + +/** + * optional bytes account_address = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getAccountAddress()` + * @return {!Uint8Array} + */ +proto.types.ValidatorPublicKeys.prototype.getAccountAddress_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getAccountAddress())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.types.ValidatorPublicKeys.prototype.setAccountAddress = function(value) { + jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes consensus_public_key = 2; + * @return {string} + */ +proto.types.ValidatorPublicKeys.prototype.getConsensusPublicKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes consensus_public_key = 2; + * This is a type-conversion wrapper around `getConsensusPublicKey()` + * @return {string} + */ +proto.types.ValidatorPublicKeys.prototype.getConsensusPublicKey_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getConsensusPublicKey())); +}; + + +/** + * optional bytes consensus_public_key = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getConsensusPublicKey()` + * @return {!Uint8Array} + */ +proto.types.ValidatorPublicKeys.prototype.getConsensusPublicKey_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getConsensusPublicKey())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.types.ValidatorPublicKeys.prototype.setConsensusPublicKey = function(value) { + jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * optional bytes network_signing_public_key = 3; + * @return {string} + */ +proto.types.ValidatorPublicKeys.prototype.getNetworkSigningPublicKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes network_signing_public_key = 3; + * This is a type-conversion wrapper around `getNetworkSigningPublicKey()` + * @return {string} + */ +proto.types.ValidatorPublicKeys.prototype.getNetworkSigningPublicKey_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getNetworkSigningPublicKey())); +}; + + +/** + * optional bytes network_signing_public_key = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getNetworkSigningPublicKey()` + * @return {!Uint8Array} + */ +proto.types.ValidatorPublicKeys.prototype.getNetworkSigningPublicKey_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getNetworkSigningPublicKey())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.types.ValidatorPublicKeys.prototype.setNetworkSigningPublicKey = function(value) { + jspb.Message.setProto3BytesField(this, 3, value); +}; + + +/** + * optional bytes network_identity_public_key = 4; + * @return {string} + */ +proto.types.ValidatorPublicKeys.prototype.getNetworkIdentityPublicKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; + + +/** + * optional bytes network_identity_public_key = 4; + * This is a type-conversion wrapper around `getNetworkIdentityPublicKey()` + * @return {string} + */ +proto.types.ValidatorPublicKeys.prototype.getNetworkIdentityPublicKey_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getNetworkIdentityPublicKey())); +}; + + +/** + * optional bytes network_identity_public_key = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getNetworkIdentityPublicKey()` + * @return {!Uint8Array} + */ +proto.types.ValidatorPublicKeys.prototype.getNetworkIdentityPublicKey_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getNetworkIdentityPublicKey())); +}; + + +/** @param {!(string|Uint8Array)} value */ +proto.types.ValidatorPublicKeys.prototype.setNetworkIdentityPublicKey = function(value) { + jspb.Message.setProto3BytesField(this, 4, value); +}; + + +goog.object.extend(exports, proto.types); diff --git a/packages/libra-web-net/__grpc_web_generated__/validator_set_pb.d.ts b/packages/libra-web-net/__grpc_web_generated__/validator_set_pb.d.ts new file mode 100644 index 0000000..d5d11a4 --- /dev/null +++ b/packages/libra-web-net/__grpc_web_generated__/validator_set_pb.d.ts @@ -0,0 +1,24 @@ +import * as jspb from "google-protobuf" + +import * as validator_public_keys_pb from './validator_public_keys_pb'; + +export class ValidatorSet extends jspb.Message { + getValidatorPublicKeysList(): Array; + setValidatorPublicKeysList(value: Array): void; + clearValidatorPublicKeysList(): void; + addValidatorPublicKeys(value?: validator_public_keys_pb.ValidatorPublicKeys, index?: number): validator_public_keys_pb.ValidatorPublicKeys; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): ValidatorSet.AsObject; + static toObject(includeInstance: boolean, msg: ValidatorSet): ValidatorSet.AsObject; + static serializeBinaryToWriter(message: ValidatorSet, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): ValidatorSet; + static deserializeBinaryFromReader(message: ValidatorSet, reader: jspb.BinaryReader): ValidatorSet; +} + +export namespace ValidatorSet { + export type AsObject = { + validatorPublicKeysList: Array, + } +} + diff --git a/packages/libra-web-net/__grpc_web_generated__/validator_set_pb.js b/packages/libra-web-net/__grpc_web_generated__/validator_set_pb.js new file mode 100644 index 0000000..29565dd --- /dev/null +++ b/packages/libra-web-net/__grpc_web_generated__/validator_set_pb.js @@ -0,0 +1,192 @@ +/** + * @fileoverview + * @enhanceable + * @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! + +var jspb = require('google-protobuf'); +var goog = jspb; +var global = Function('return this')(); + +var validator_public_keys_pb = require('./validator_public_keys_pb.js'); +goog.object.extend(proto, validator_public_keys_pb); +goog.exportSymbol('proto.types.ValidatorSet', 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.types.ValidatorSet = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.types.ValidatorSet.repeatedFields_, null); +}; +goog.inherits(proto.types.ValidatorSet, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.types.ValidatorSet.displayName = 'proto.types.ValidatorSet'; +} + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.types.ValidatorSet.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto suitable for use in Soy templates. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * com.google.apps.jspb.JsClassTemplate.JS_RESERVED_WORDS. + * @param {boolean=} opt_includeInstance Whether to include the JSPB instance + * for transitional soy proto support: http://goto/soy-param-migration + * @return {!Object} + */ +proto.types.ValidatorSet.prototype.toObject = function(opt_includeInstance) { + return proto.types.ValidatorSet.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Whether to include the JSPB + * instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.types.ValidatorSet} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.ValidatorSet.toObject = function(includeInstance, msg) { + var f, obj = { + validatorPublicKeysList: jspb.Message.toObjectList(msg.getValidatorPublicKeysList(), + validator_public_keys_pb.ValidatorPublicKeys.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.types.ValidatorSet} + */ +proto.types.ValidatorSet.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.types.ValidatorSet; + return proto.types.ValidatorSet.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.types.ValidatorSet} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.types.ValidatorSet} + */ +proto.types.ValidatorSet.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new validator_public_keys_pb.ValidatorPublicKeys; + reader.readMessage(value,validator_public_keys_pb.ValidatorPublicKeys.deserializeBinaryFromReader); + msg.addValidatorPublicKeys(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.types.ValidatorSet.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.types.ValidatorSet.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.types.ValidatorSet} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.types.ValidatorSet.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValidatorPublicKeysList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + validator_public_keys_pb.ValidatorPublicKeys.serializeBinaryToWriter + ); + } +}; + + +/** + * repeated ValidatorPublicKeys validator_public_keys = 1; + * @return {!Array} + */ +proto.types.ValidatorSet.prototype.getValidatorPublicKeysList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, validator_public_keys_pb.ValidatorPublicKeys, 1)); +}; + + +/** @param {!Array} value */ +proto.types.ValidatorSet.prototype.setValidatorPublicKeysList = function(value) { + jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.types.ValidatorPublicKeys=} opt_value + * @param {number=} opt_index + * @return {!proto.types.ValidatorPublicKeys} + */ +proto.types.ValidatorSet.prototype.addValidatorPublicKeys = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.types.ValidatorPublicKeys, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + */ +proto.types.ValidatorSet.prototype.clearValidatorPublicKeysList = function() { + this.setValidatorPublicKeysList([]); +}; + + +goog.object.extend(exports, proto.types); diff --git a/packages/libra-web-net/__grpc_web_generated__/vm_errors_pb.d.ts b/packages/libra-web-net/__grpc_web_generated__/vm_errors_pb.d.ts index e475caf..e674f60 100644 --- a/packages/libra-web-net/__grpc_web_generated__/vm_errors_pb.d.ts +++ b/packages/libra-web-net/__grpc_web_generated__/vm_errors_pb.d.ts @@ -1,5 +1,7 @@ import * as jspb from "google-protobuf" +import * as language_storage_pb from './language_storage_pb'; + export class VMValidationStatus extends jspb.Message { getCode(): VMValidationStatusCode; setCode(value: VMValidationStatusCode): void; @@ -55,6 +57,11 @@ export class VMVerificationStatus extends jspb.Message { getMessage(): string; setMessage(value: string): void; + getDependencyId(): language_storage_pb.ModuleId | undefined; + setDependencyId(value?: language_storage_pb.ModuleId): void; + hasDependencyId(): boolean; + clearDependencyId(): void; + serializeBinary(): Uint8Array; toObject(includeInstance?: boolean): VMVerificationStatus.AsObject; static toObject(includeInstance: boolean, msg: VMVerificationStatus): VMVerificationStatus.AsObject; @@ -69,11 +76,13 @@ export namespace VMVerificationStatus { moduleIdx: number, errorKind: VMVerificationErrorKind, message: string, + dependencyId?: language_storage_pb.ModuleId.AsObject, } export enum StatusKind { SCRIPT = 0, MODULE = 1, + DEPENDENCY = 2, } } diff --git a/packages/libra-web-net/__grpc_web_generated__/vm_errors_pb.js b/packages/libra-web-net/__grpc_web_generated__/vm_errors_pb.js index 8f19b10..9544f6d 100644 --- a/packages/libra-web-net/__grpc_web_generated__/vm_errors_pb.js +++ b/packages/libra-web-net/__grpc_web_generated__/vm_errors_pb.js @@ -11,6 +11,8 @@ var jspb = require('google-protobuf'); var goog = jspb; var global = Function('return this')(); +var language_storage_pb = require('./language_storage_pb.js'); +goog.object.extend(proto, language_storage_pb); goog.exportSymbol('proto.types.ArithmeticError', null, global); goog.exportSymbol('proto.types.ArithmeticError.ArithmeticErrorType', null, global); goog.exportSymbol('proto.types.AssertionFailure', null, global); @@ -534,7 +536,8 @@ proto.types.VMVerificationStatus.toObject = function(includeInstance, msg) { statusKind: jspb.Message.getFieldWithDefault(msg, 1, 0), moduleIdx: jspb.Message.getFieldWithDefault(msg, 2, 0), errorKind: jspb.Message.getFieldWithDefault(msg, 3, 0), - message: jspb.Message.getFieldWithDefault(msg, 4, "") + message: jspb.Message.getFieldWithDefault(msg, 4, ""), + dependencyId: (f = msg.getDependencyId()) && language_storage_pb.ModuleId.toObject(includeInstance, f) }; if (includeInstance) { @@ -587,6 +590,11 @@ proto.types.VMVerificationStatus.deserializeBinaryFromReader = function(msg, rea var value = /** @type {string} */ (reader.readString()); msg.setMessage(value); break; + case 5: + var value = new language_storage_pb.ModuleId; + reader.readMessage(value,language_storage_pb.ModuleId.deserializeBinaryFromReader); + msg.setDependencyId(value); + break; default: reader.skipField(); break; @@ -644,6 +652,14 @@ proto.types.VMVerificationStatus.serializeBinaryToWriter = function(message, wri f ); } + f = message.getDependencyId(); + if (f != null) { + writer.writeMessage( + 5, + f, + language_storage_pb.ModuleId.serializeBinaryToWriter + ); + } }; @@ -652,7 +668,8 @@ proto.types.VMVerificationStatus.serializeBinaryToWriter = function(message, wri */ proto.types.VMVerificationStatus.StatusKind = { SCRIPT: 0, - MODULE: 1 + MODULE: 1, + DEPENDENCY: 2 }; /** @@ -715,6 +732,39 @@ proto.types.VMVerificationStatus.prototype.setMessage = function(value) { }; +/** + * optional ModuleId dependency_id = 5; + * @return {?proto.types.ModuleId} + */ +proto.types.VMVerificationStatus.prototype.getDependencyId = function() { + return /** @type{?proto.types.ModuleId} */ ( + jspb.Message.getWrapperField(this, language_storage_pb.ModuleId, 5)); +}; + + +/** @param {?proto.types.ModuleId|undefined} value */ +proto.types.VMVerificationStatus.prototype.setDependencyId = function(value) { + jspb.Message.setWrapperField(this, 5, value); +}; + + +/** + * Clears the message field making it undefined. + */ +proto.types.VMVerificationStatus.prototype.clearDependencyId = function() { + this.setDependencyId(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.types.VMVerificationStatus.prototype.hasDependencyId = function() { + return jspb.Message.getField(this, 5) != null; +}; + + diff --git a/proto/admission_control.proto b/proto/admission_control.proto index c1c4358..86a00ba 100644 --- a/proto/admission_control.proto +++ b/proto/admission_control.proto @@ -6,11 +6,9 @@ syntax = "proto3"; package admission_control; import "get_with_proof.proto"; +import "mempool_status.proto"; import "transaction.proto"; -import "proof.proto"; -import "ledger_info.proto"; import "vm_errors.proto"; -import "mempool_status.proto"; // ----------------------------------------------------------------------------- // ---------------- Submit transaction @@ -21,11 +19,20 @@ message SubmitTransactionRequest { types.SignedTransaction signed_txn = 1; } +// AC response status containing code and optionally an error message. +message AdmissionControlStatus { + AdmissionControlStatusCode code = 1; + string message = 2; +} + // Additional statuses that are possible from admission control in addition // to VM statuses. -enum AdmissionControlStatus { +enum AdmissionControlStatusCode { + // Validator accepted the transaction. Accepted = 0; + // The sender is blacklisted. Blacklisted = 1; + // The transaction is rejected, e.g. due to incorrect signature. Rejected = 2; } diff --git a/proto/language_storage.proto b/proto/language_storage.proto new file mode 100644 index 0000000..c31a182 --- /dev/null +++ b/proto/language_storage.proto @@ -0,0 +1,12 @@ +// Copyright (c) The Libra Core Contributors +// SPDX-License-Identifier: Apache-2.0 + +syntax = "proto3"; + +package types; + +/// The unique identifier for a module on the chain. +message ModuleId { + bytes address = 1; + string name = 2; +} diff --git a/proto/mempool.proto b/proto/mempool.proto new file mode 100644 index 0000000..6c23ff8 --- /dev/null +++ b/proto/mempool.proto @@ -0,0 +1,105 @@ +// Copyright (c) The Libra Core Contributors +// SPDX-License-Identifier: Apache-2.0 + +syntax = "proto3"; + +package mempool; + +import "transaction.proto"; +import "mempool_status.proto"; + +// ----------------------------------------------------------------------------- +// ---------------- Mempool Service Definition +// ----------------------------------------------------------------------------- +service Mempool { + // Adds a new transaction to the mempool with validation against existing + // transactions in the mempool. Note that this function performs additional + // validation that AC is unable to perform. (because AC knows only about a + // single transaction, but mempool potentially knows about multiple pending + // transactions) + rpc AddTransactionWithValidation(AddTransactionWithValidationRequest) + returns (AddTransactionWithValidationResponse) {} + + // Fetch ordered block of transactions + rpc GetBlock(GetBlockRequest) returns (GetBlockResponse) {} + + // Remove committed transactions from Mempool + rpc CommitTransactions(CommitTransactionsRequest) + returns (CommitTransactionsResponse) {} + + // Check the health of mempool + rpc HealthCheck(HealthCheckRequest) + returns (HealthCheckResponse) {} +} + +// ----------------------------------------------------------------------------- +// ---------------- AddTransactionWithValidation +// ----------------------------------------------------------------------------- + +message AddTransactionWithValidationRequest { + // Transaction from a wallet + types.SignedTransaction signed_txn = 1; + // Max amount of gas required to execute the transaction + // Without running the program, it is very difficult to determine this number, + // so we use the max gas specified by the signed transaction. + // This field is still included separately from the signed transaction so that + // if we have a better methodology in the future, we can more accurately + // specify the max gas. + uint64 max_gas_cost = 2; + // Latest sequence number of the involved account from state db. + uint64 latest_sequence_number = 3; + // Latest account balance of the involved account from state db. + uint64 account_balance = 4; +} + +message AddTransactionWithValidationResponse { + // The ledger version at the time of the transaction submitted. The submitted + // transaction will have version bigger than this 'current_version' + uint64 current_version = 1; + // The result of the transaction submission + MempoolAddTransactionStatus status = 2; +} + +// ----------------------------------------------------------------------------- +// ---------------- GetBlock +// ----------------------------------------------------------------------------- +message GetBlockRequest { + uint64 max_block_size = 1; + repeated TransactionExclusion transactions = 2; +} + +message GetBlockResponse { types.SignedTransactionsBlock block = 1; } + +message TransactionExclusion { + bytes sender = 1; + uint64 sequence_number = 2; +} + +// ----------------------------------------------------------------------------- +// ---------------- CommitTransactions +// ----------------------------------------------------------------------------- +message CommitTransactionsRequest { + repeated CommittedTransaction transactions = 1; + // agreed monotonic timestamp microseconds since the epoch for a committed block + // used by Mempool to GC expired transactions + uint64 block_timestamp_usecs = 2; +} + +message CommitTransactionsResponse {} + +message CommittedTransaction { + bytes sender = 1; + uint64 sequence_number = 2; + bool is_rejected = 3; +} + +// ----------------------------------------------------------------------------- +// ---------------- HealthCheck +// ----------------------------------------------------------------------------- +message HealthCheckRequest { +} + +message HealthCheckResponse { + // Indicate whether Mempool is in healthy condition. + bool is_healthy = 1; +} diff --git a/proto/mempool_status.proto b/proto/mempool_status.proto index 0405039..8070aa5 100644 --- a/proto/mempool_status.proto +++ b/proto/mempool_status.proto @@ -5,7 +5,7 @@ syntax = "proto3"; package mempool; -enum MempoolAddTransactionStatus { +enum MempoolAddTransactionStatusCode { // Transaction was sent to Mempool Valid = 0; // The sender does not have enough balance for the transaction. @@ -19,3 +19,8 @@ enum MempoolAddTransactionStatus { // Invalid update. Only gas price increase is allowed InvalidUpdate = 5; } + +message MempoolAddTransactionStatus { + MempoolAddTransactionStatusCode code = 1; + string message = 2; +} diff --git a/proto/transaction.proto b/proto/transaction.proto index 026f493..ac3c5f1 100644 --- a/proto/transaction.proto +++ b/proto/transaction.proto @@ -28,7 +28,7 @@ message RawTransaction { // Maximal total gas specified by wallet to spend for this transaction. uint64 max_gas_amount = 5; // The price to be paid for each unit of gas. - uint64 gas_unit_price = 6; + uint64 gas_unit_price = 6; // Expiration time for this transaction. If storage is queried and // the time returned is greater than or equal to this time and this // transaction has not been included, you can be certain that it will diff --git a/proto/validator_public_keys.proto b/proto/validator_public_keys.proto new file mode 100644 index 0000000..efcfcad --- /dev/null +++ b/proto/validator_public_keys.proto @@ -0,0 +1,18 @@ +// Copyright (c) The Libra Core Contributors +// SPDX-License-Identifier: Apache-2.0 + +syntax = "proto3"; + +package types; + +// Protobuf definition for the Rust struct ValidatorPublicKeys +message ValidatorPublicKeys { + // Validator account address + bytes account_address = 1; + // Consensus public key + bytes consensus_public_key = 2; + // Network signing publick key + bytes network_signing_public_key = 3; + /// Network identity publick key + bytes network_identity_public_key = 4; +} diff --git a/proto/validator_set.proto b/proto/validator_set.proto new file mode 100644 index 0000000..2bec2a6 --- /dev/null +++ b/proto/validator_set.proto @@ -0,0 +1,13 @@ +// Copyright (c) The Libra Core Contributors +// SPDX-License-Identifier: Apache-2.0 + +syntax = "proto3"; + +package types; + +import "validator_public_keys.proto"; + +// Protobuf definition for the Rust struct ValidatorSet. +message ValidatorSet { + repeated ValidatorPublicKeys validator_public_keys = 1; +} diff --git a/proto/vm_errors.proto b/proto/vm_errors.proto index b29d32e..767d80b 100644 --- a/proto/vm_errors.proto +++ b/proto/vm_errors.proto @@ -5,6 +5,8 @@ syntax = "proto3"; package types; +import "language_storage.proto"; + // The statuses and errors produced by the VM can be categorized into a // couple different types: // 1. Validation Statuses: all the errors that can (/should) be @@ -83,12 +85,15 @@ message VMVerificationStatus { enum StatusKind { SCRIPT = 0; MODULE = 1; + DEPENDENCY = 2; } StatusKind status_kind = 1; - // For StatusKind::SCRIPT this is ignored. + // For StatusKind::SCRIPT and DEPENDENCY this is ignored. uint32 module_idx = 2; VMVerificationErrorKind error_kind = 3; string message = 4; + // For StatusKind::SCRIPT and MODULE this is ignored. + ModuleId dependency_id = 5; } // When a code module/script is published it is verified. These are the