bifcore-sdk-nodejs-bop-test
Version:
bifcore sdk nodejs
1,556 lines (1,323 loc) • 112 kB
JavaScript
/* eslint-disable */
/**
* @fileoverview
* @enhanceable
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
var jspb = require('google-protobuf');
var goog = jspb;
var global = Function('return this')();
var common_pb = require('./common_pb.js');
goog.exportSymbol('proto.protocol.FeeConfig', null, global);
goog.exportSymbol('proto.protocol.FeeConfig.Type', null, global);
goog.exportSymbol('proto.protocol.Pbft', null, global);
goog.exportSymbol('proto.protocol.PbftCommit', null, global);
goog.exportSymbol('proto.protocol.PbftEnv', null, global);
goog.exportSymbol('proto.protocol.PbftMessageType', null, global);
goog.exportSymbol('proto.protocol.PbftNewView', null, global);
goog.exportSymbol('proto.protocol.PbftPrePrepare', null, global);
goog.exportSymbol('proto.protocol.PbftPrepare', null, global);
goog.exportSymbol('proto.protocol.PbftPreparedSet', null, global);
goog.exportSymbol('proto.protocol.PbftProof', null, global);
goog.exportSymbol('proto.protocol.PbftValueType', null, global);
goog.exportSymbol('proto.protocol.PbftViewChange', null, global);
goog.exportSymbol('proto.protocol.PbftViewChangeWithRawValue', null, global);
goog.exportSymbol('proto.protocol.Validator', null, global);
goog.exportSymbol('proto.protocol.ValidatorSet', null, global);
goog.exportSymbol('proto.protocol.ValidatorSetV3', 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.protocol.PbftPrePrepare = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.protocol.PbftPrePrepare, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.protocol.PbftPrePrepare.displayName = 'proto.protocol.PbftPrePrepare';
}
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_<name>, 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.protocol.PbftPrePrepare.prototype.toObject = function (opt_includeInstance) {
return proto.protocol.PbftPrePrepare.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.protocol.PbftPrePrepare} msg The msg instance to transform.
* @return {!Object}
*/
proto.protocol.PbftPrePrepare.toObject = function (includeInstance, msg) {
var f, obj = {
viewNumber: msg.getViewNumber(),
sequence: msg.getSequence(),
replicaId: msg.getReplicaId(),
value: msg.getValue_asB64(),
valueDigest: msg.getValueDigest_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.protocol.PbftPrePrepare}
*/
proto.protocol.PbftPrePrepare.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.protocol.PbftPrePrepare;
return proto.protocol.PbftPrePrepare.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.protocol.PbftPrePrepare} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.protocol.PbftPrePrepare}
*/
proto.protocol.PbftPrePrepare.deserializeBinaryFromReader = function (msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {number} */ (reader.readInt64());
msg.setViewNumber(value);
break;
case 2:
var value = /** @type {number} */ (reader.readInt64());
msg.setSequence(value);
break;
case 3:
var value = /** @type {number} */ (reader.readInt64());
msg.setReplicaId(value);
break;
case 4:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setValue(value);
break;
case 5:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setValueDigest(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Class method variant: serializes the given message to binary data
* (in protobuf wire format), writing to the given BinaryWriter.
* @param {!proto.protocol.PbftPrePrepare} message
* @param {!jspb.BinaryWriter} writer
*/
proto.protocol.PbftPrePrepare.serializeBinaryToWriter = function (message, writer) {
message.serializeBinaryToWriter(writer);
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.protocol.PbftPrePrepare.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
this.serializeBinaryToWriter(writer);
return writer.getResultBuffer();
};
/**
* Serializes the message to binary data (in protobuf wire format),
* writing to the given BinaryWriter.
* @param {!jspb.BinaryWriter} writer
*/
proto.protocol.PbftPrePrepare.prototype.serializeBinaryToWriter = function (writer) {
var f = undefined;
f = this.getViewNumber();
if (f !== 0) {
writer.writeInt64(
1,
f
);
}
f = this.getSequence();
if (f !== 0) {
writer.writeInt64(
2,
f
);
}
f = this.getReplicaId();
if (f !== 0) {
writer.writeInt64(
3,
f
);
}
f = this.getValue_asU8();
if (f.length > 0) {
writer.writeBytes(
4,
f
);
}
f = this.getValueDigest_asU8();
if (f.length > 0) {
writer.writeBytes(
5,
f
);
}
};
/**
* Creates a deep clone of this proto. No data is shared with the original.
* @return {!proto.protocol.PbftPrePrepare} The clone.
*/
proto.protocol.PbftPrePrepare.prototype.cloneMessage = function () {
return /** @type {!proto.protocol.PbftPrePrepare} */ (jspb.Message.cloneMessage(this));
};
/**
* optional int64 view_number = 1;
* @return {number}
*/
proto.protocol.PbftPrePrepare.prototype.getViewNumber = function () {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 1, 0));
};
/** @param {number} value */
proto.protocol.PbftPrePrepare.prototype.setViewNumber = function (value) {
jspb.Message.setField(this, 1, value);
};
/**
* optional int64 sequence = 2;
* @return {number}
*/
proto.protocol.PbftPrePrepare.prototype.getSequence = function () {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 2, 0));
};
/** @param {number} value */
proto.protocol.PbftPrePrepare.prototype.setSequence = function (value) {
jspb.Message.setField(this, 2, value);
};
/**
* optional int64 replica_id = 3;
* @return {number}
*/
proto.protocol.PbftPrePrepare.prototype.getReplicaId = function () {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 3, 0));
};
/** @param {number} value */
proto.protocol.PbftPrePrepare.prototype.setReplicaId = function (value) {
jspb.Message.setField(this, 3, value);
};
/**
* optional bytes value = 4;
* @return {!(string|Uint8Array)}
*/
proto.protocol.PbftPrePrepare.prototype.getValue = function () {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldProto3(this, 4, ""));
};
/**
* optional bytes value = 4;
* This is a type-conversion wrapper around `getValue()`
* @return {string}
*/
proto.protocol.PbftPrePrepare.prototype.getValue_asB64 = function () {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getValue()));
};
/**
* optional bytes value = 4;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getValue()`
* @return {!Uint8Array}
*/
proto.protocol.PbftPrePrepare.prototype.getValue_asU8 = function () {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getValue()));
};
/** @param {!(string|Uint8Array)} value */
proto.protocol.PbftPrePrepare.prototype.setValue = function (value) {
jspb.Message.setField(this, 4, value);
};
/**
* optional bytes value_digest = 5;
* @return {!(string|Uint8Array)}
*/
proto.protocol.PbftPrePrepare.prototype.getValueDigest = function () {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldProto3(this, 5, ""));
};
/**
* optional bytes value_digest = 5;
* This is a type-conversion wrapper around `getValueDigest()`
* @return {string}
*/
proto.protocol.PbftPrePrepare.prototype.getValueDigest_asB64 = function () {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getValueDigest()));
};
/**
* optional bytes value_digest = 5;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getValueDigest()`
* @return {!Uint8Array}
*/
proto.protocol.PbftPrePrepare.prototype.getValueDigest_asU8 = function () {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getValueDigest()));
};
/** @param {!(string|Uint8Array)} value */
proto.protocol.PbftPrePrepare.prototype.setValueDigest = function (value) {
jspb.Message.setField(this, 5, value);
};
/**
* 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.protocol.PbftPrepare = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.protocol.PbftPrepare, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.protocol.PbftPrepare.displayName = 'proto.protocol.PbftPrepare';
}
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_<name>, 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.protocol.PbftPrepare.prototype.toObject = function (opt_includeInstance) {
return proto.protocol.PbftPrepare.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.protocol.PbftPrepare} msg The msg instance to transform.
* @return {!Object}
*/
proto.protocol.PbftPrepare.toObject = function (includeInstance, msg) {
var f, obj = {
viewNumber: msg.getViewNumber(),
sequence: msg.getSequence(),
replicaId: msg.getReplicaId(),
valueDigest: msg.getValueDigest_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.protocol.PbftPrepare}
*/
proto.protocol.PbftPrepare.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.protocol.PbftPrepare;
return proto.protocol.PbftPrepare.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.protocol.PbftPrepare} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.protocol.PbftPrepare}
*/
proto.protocol.PbftPrepare.deserializeBinaryFromReader = function (msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {number} */ (reader.readInt64());
msg.setViewNumber(value);
break;
case 2:
var value = /** @type {number} */ (reader.readInt64());
msg.setSequence(value);
break;
case 3:
var value = /** @type {number} */ (reader.readInt64());
msg.setReplicaId(value);
break;
case 4:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setValueDigest(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Class method variant: serializes the given message to binary data
* (in protobuf wire format), writing to the given BinaryWriter.
* @param {!proto.protocol.PbftPrepare} message
* @param {!jspb.BinaryWriter} writer
*/
proto.protocol.PbftPrepare.serializeBinaryToWriter = function (message, writer) {
message.serializeBinaryToWriter(writer);
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.protocol.PbftPrepare.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
this.serializeBinaryToWriter(writer);
return writer.getResultBuffer();
};
/**
* Serializes the message to binary data (in protobuf wire format),
* writing to the given BinaryWriter.
* @param {!jspb.BinaryWriter} writer
*/
proto.protocol.PbftPrepare.prototype.serializeBinaryToWriter = function (writer) {
var f = undefined;
f = this.getViewNumber();
if (f !== 0) {
writer.writeInt64(
1,
f
);
}
f = this.getSequence();
if (f !== 0) {
writer.writeInt64(
2,
f
);
}
f = this.getReplicaId();
if (f !== 0) {
writer.writeInt64(
3,
f
);
}
f = this.getValueDigest_asU8();
if (f.length > 0) {
writer.writeBytes(
4,
f
);
}
};
/**
* Creates a deep clone of this proto. No data is shared with the original.
* @return {!proto.protocol.PbftPrepare} The clone.
*/
proto.protocol.PbftPrepare.prototype.cloneMessage = function () {
return /** @type {!proto.protocol.PbftPrepare} */ (jspb.Message.cloneMessage(this));
};
/**
* optional int64 view_number = 1;
* @return {number}
*/
proto.protocol.PbftPrepare.prototype.getViewNumber = function () {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 1, 0));
};
/** @param {number} value */
proto.protocol.PbftPrepare.prototype.setViewNumber = function (value) {
jspb.Message.setField(this, 1, value);
};
/**
* optional int64 sequence = 2;
* @return {number}
*/
proto.protocol.PbftPrepare.prototype.getSequence = function () {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 2, 0));
};
/** @param {number} value */
proto.protocol.PbftPrepare.prototype.setSequence = function (value) {
jspb.Message.setField(this, 2, value);
};
/**
* optional int64 replica_id = 3;
* @return {number}
*/
proto.protocol.PbftPrepare.prototype.getReplicaId = function () {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 3, 0));
};
/** @param {number} value */
proto.protocol.PbftPrepare.prototype.setReplicaId = function (value) {
jspb.Message.setField(this, 3, value);
};
/**
* optional bytes value_digest = 4;
* @return {!(string|Uint8Array)}
*/
proto.protocol.PbftPrepare.prototype.getValueDigest = function () {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldProto3(this, 4, ""));
};
/**
* optional bytes value_digest = 4;
* This is a type-conversion wrapper around `getValueDigest()`
* @return {string}
*/
proto.protocol.PbftPrepare.prototype.getValueDigest_asB64 = function () {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getValueDigest()));
};
/**
* optional bytes value_digest = 4;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getValueDigest()`
* @return {!Uint8Array}
*/
proto.protocol.PbftPrepare.prototype.getValueDigest_asU8 = function () {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getValueDigest()));
};
/** @param {!(string|Uint8Array)} value */
proto.protocol.PbftPrepare.prototype.setValueDigest = function (value) {
jspb.Message.setField(this, 4, value);
};
/**
* 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.protocol.PbftCommit = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.protocol.PbftCommit, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.protocol.PbftCommit.displayName = 'proto.protocol.PbftCommit';
}
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_<name>, 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.protocol.PbftCommit.prototype.toObject = function (opt_includeInstance) {
return proto.protocol.PbftCommit.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.protocol.PbftCommit} msg The msg instance to transform.
* @return {!Object}
*/
proto.protocol.PbftCommit.toObject = function (includeInstance, msg) {
var f, obj = {
viewNumber: msg.getViewNumber(),
sequence: msg.getSequence(),
replicaId: msg.getReplicaId(),
valueDigest: msg.getValueDigest_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.protocol.PbftCommit}
*/
proto.protocol.PbftCommit.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.protocol.PbftCommit;
return proto.protocol.PbftCommit.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.protocol.PbftCommit} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.protocol.PbftCommit}
*/
proto.protocol.PbftCommit.deserializeBinaryFromReader = function (msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {number} */ (reader.readInt64());
msg.setViewNumber(value);
break;
case 2:
var value = /** @type {number} */ (reader.readInt64());
msg.setSequence(value);
break;
case 3:
var value = /** @type {number} */ (reader.readInt64());
msg.setReplicaId(value);
break;
case 4:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setValueDigest(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Class method variant: serializes the given message to binary data
* (in protobuf wire format), writing to the given BinaryWriter.
* @param {!proto.protocol.PbftCommit} message
* @param {!jspb.BinaryWriter} writer
*/
proto.protocol.PbftCommit.serializeBinaryToWriter = function (message, writer) {
message.serializeBinaryToWriter(writer);
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.protocol.PbftCommit.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
this.serializeBinaryToWriter(writer);
return writer.getResultBuffer();
};
/**
* Serializes the message to binary data (in protobuf wire format),
* writing to the given BinaryWriter.
* @param {!jspb.BinaryWriter} writer
*/
proto.protocol.PbftCommit.prototype.serializeBinaryToWriter = function (writer) {
var f = undefined;
f = this.getViewNumber();
if (f !== 0) {
writer.writeInt64(
1,
f
);
}
f = this.getSequence();
if (f !== 0) {
writer.writeInt64(
2,
f
);
}
f = this.getReplicaId();
if (f !== 0) {
writer.writeInt64(
3,
f
);
}
f = this.getValueDigest_asU8();
if (f.length > 0) {
writer.writeBytes(
4,
f
);
}
};
/**
* Creates a deep clone of this proto. No data is shared with the original.
* @return {!proto.protocol.PbftCommit} The clone.
*/
proto.protocol.PbftCommit.prototype.cloneMessage = function () {
return /** @type {!proto.protocol.PbftCommit} */ (jspb.Message.cloneMessage(this));
};
/**
* optional int64 view_number = 1;
* @return {number}
*/
proto.protocol.PbftCommit.prototype.getViewNumber = function () {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 1, 0));
};
/** @param {number} value */
proto.protocol.PbftCommit.prototype.setViewNumber = function (value) {
jspb.Message.setField(this, 1, value);
};
/**
* optional int64 sequence = 2;
* @return {number}
*/
proto.protocol.PbftCommit.prototype.getSequence = function () {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 2, 0));
};
/** @param {number} value */
proto.protocol.PbftCommit.prototype.setSequence = function (value) {
jspb.Message.setField(this, 2, value);
};
/**
* optional int64 replica_id = 3;
* @return {number}
*/
proto.protocol.PbftCommit.prototype.getReplicaId = function () {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 3, 0));
};
/** @param {number} value */
proto.protocol.PbftCommit.prototype.setReplicaId = function (value) {
jspb.Message.setField(this, 3, value);
};
/**
* optional bytes value_digest = 4;
* @return {!(string|Uint8Array)}
*/
proto.protocol.PbftCommit.prototype.getValueDigest = function () {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldProto3(this, 4, ""));
};
/**
* optional bytes value_digest = 4;
* This is a type-conversion wrapper around `getValueDigest()`
* @return {string}
*/
proto.protocol.PbftCommit.prototype.getValueDigest_asB64 = function () {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getValueDigest()));
};
/**
* optional bytes value_digest = 4;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getValueDigest()`
* @return {!Uint8Array}
*/
proto.protocol.PbftCommit.prototype.getValueDigest_asU8 = function () {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getValueDigest()));
};
/** @param {!(string|Uint8Array)} value */
proto.protocol.PbftCommit.prototype.setValueDigest = function (value) {
jspb.Message.setField(this, 4, value);
};
/**
* 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.protocol.PbftPreparedSet = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.protocol.PbftPreparedSet.repeatedFields_, null);
};
goog.inherits(proto.protocol.PbftPreparedSet, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.protocol.PbftPreparedSet.displayName = 'proto.protocol.PbftPreparedSet';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.protocol.PbftPreparedSet.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_<name>, 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.protocol.PbftPreparedSet.prototype.toObject = function (opt_includeInstance) {
return proto.protocol.PbftPreparedSet.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.protocol.PbftPreparedSet} msg The msg instance to transform.
* @return {!Object}
*/
proto.protocol.PbftPreparedSet.toObject = function (includeInstance, msg) {
var f, obj = {
prePrepare: (f = msg.getPrePrepare()) && proto.protocol.PbftEnv.toObject(includeInstance, f),
prepareList: jspb.Message.toObjectList(msg.getPrepareList(),
proto.protocol.PbftEnv.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.protocol.PbftPreparedSet}
*/
proto.protocol.PbftPreparedSet.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.protocol.PbftPreparedSet;
return proto.protocol.PbftPreparedSet.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.protocol.PbftPreparedSet} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.protocol.PbftPreparedSet}
*/
proto.protocol.PbftPreparedSet.deserializeBinaryFromReader = function (msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new proto.protocol.PbftEnv;
reader.readMessage(value, proto.protocol.PbftEnv.deserializeBinaryFromReader);
msg.setPrePrepare(value);
break;
case 2:
var value = new proto.protocol.PbftEnv;
reader.readMessage(value, proto.protocol.PbftEnv.deserializeBinaryFromReader);
msg.getPrepareList().push(value);
msg.setPrepareList(msg.getPrepareList());
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Class method variant: serializes the given message to binary data
* (in protobuf wire format), writing to the given BinaryWriter.
* @param {!proto.protocol.PbftPreparedSet} message
* @param {!jspb.BinaryWriter} writer
*/
proto.protocol.PbftPreparedSet.serializeBinaryToWriter = function (message, writer) {
message.serializeBinaryToWriter(writer);
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.protocol.PbftPreparedSet.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
this.serializeBinaryToWriter(writer);
return writer.getResultBuffer();
};
/**
* Serializes the message to binary data (in protobuf wire format),
* writing to the given BinaryWriter.
* @param {!jspb.BinaryWriter} writer
*/
proto.protocol.PbftPreparedSet.prototype.serializeBinaryToWriter = function (writer) {
var f = undefined;
f = this.getPrePrepare();
if (f != null) {
writer.writeMessage(
1,
f,
proto.protocol.PbftEnv.serializeBinaryToWriter
);
}
f = this.getPrepareList();
if (f.length > 0) {
writer.writeRepeatedMessage(
2,
f,
proto.protocol.PbftEnv.serializeBinaryToWriter
);
}
};
/**
* Creates a deep clone of this proto. No data is shared with the original.
* @return {!proto.protocol.PbftPreparedSet} The clone.
*/
proto.protocol.PbftPreparedSet.prototype.cloneMessage = function () {
return /** @type {!proto.protocol.PbftPreparedSet} */ (jspb.Message.cloneMessage(this));
};
/**
* optional PbftEnv pre_prepare = 1;
* @return {proto.protocol.PbftEnv}
*/
proto.protocol.PbftPreparedSet.prototype.getPrePrepare = function () {
return /** @type{proto.protocol.PbftEnv} */ (
jspb.Message.getWrapperField(this, proto.protocol.PbftEnv, 1));
};
/** @param {proto.protocol.PbftEnv|undefined} value */
proto.protocol.PbftPreparedSet.prototype.setPrePrepare = function (value) {
jspb.Message.setWrapperField(this, 1, value);
};
proto.protocol.PbftPreparedSet.prototype.clearPrePrepare = function () {
this.setPrePrepare(undefined);
};
/**
* Returns whether this field is set.
* @return{!boolean}
*/
proto.protocol.PbftPreparedSet.prototype.hasPrePrepare = function () {
return jspb.Message.getField(this, 1) != null;
};
/**
* repeated PbftEnv prepare = 2;
* If you change this array by adding, removing or replacing elements, or if you
* replace the array itself, then you must call the setter to update it.
* @return {!Array.<!proto.protocol.PbftEnv>}
*/
proto.protocol.PbftPreparedSet.prototype.getPrepareList = function () {
return /** @type{!Array.<!proto.protocol.PbftEnv>} */ (
jspb.Message.getRepeatedWrapperField(this, proto.protocol.PbftEnv, 2));
};
/** @param {Array.<!proto.protocol.PbftEnv>} value */
proto.protocol.PbftPreparedSet.prototype.setPrepareList = function (value) {
jspb.Message.setRepeatedWrapperField(this, 2, value);
};
proto.protocol.PbftPreparedSet.prototype.clearPrepareList = function () {
this.setPrepareList([]);
};
/**
* 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.protocol.PbftViewChange = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.protocol.PbftViewChange, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.protocol.PbftViewChange.displayName = 'proto.protocol.PbftViewChange';
}
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_<name>, 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.protocol.PbftViewChange.prototype.toObject = function (opt_includeInstance) {
return proto.protocol.PbftViewChange.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.protocol.PbftViewChange} msg The msg instance to transform.
* @return {!Object}
*/
proto.protocol.PbftViewChange.toObject = function (includeInstance, msg) {
var f, obj = {
viewNumber: msg.getViewNumber(),
sequence: msg.getSequence(),
prepredValueDigest: msg.getPrepredValueDigest_asB64(),
replicaId: msg.getReplicaId()
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.protocol.PbftViewChange}
*/
proto.protocol.PbftViewChange.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.protocol.PbftViewChange;
return proto.protocol.PbftViewChange.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.protocol.PbftViewChange} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.protocol.PbftViewChange}
*/
proto.protocol.PbftViewChange.deserializeBinaryFromReader = function (msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = /** @type {number} */ (reader.readInt64());
msg.setViewNumber(value);
break;
case 2:
var value = /** @type {number} */ (reader.readInt64());
msg.setSequence(value);
break;
case 3:
var value = /** @type {!Uint8Array} */ (reader.readBytes());
msg.setPrepredValueDigest(value);
break;
case 4:
var value = /** @type {number} */ (reader.readInt64());
msg.setReplicaId(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Class method variant: serializes the given message to binary data
* (in protobuf wire format), writing to the given BinaryWriter.
* @param {!proto.protocol.PbftViewChange} message
* @param {!jspb.BinaryWriter} writer
*/
proto.protocol.PbftViewChange.serializeBinaryToWriter = function (message, writer) {
message.serializeBinaryToWriter(writer);
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.protocol.PbftViewChange.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
this.serializeBinaryToWriter(writer);
return writer.getResultBuffer();
};
/**
* Serializes the message to binary data (in protobuf wire format),
* writing to the given BinaryWriter.
* @param {!jspb.BinaryWriter} writer
*/
proto.protocol.PbftViewChange.prototype.serializeBinaryToWriter = function (writer) {
var f = undefined;
f = this.getViewNumber();
if (f !== 0) {
writer.writeInt64(
1,
f
);
}
f = this.getSequence();
if (f !== 0) {
writer.writeInt64(
2,
f
);
}
f = this.getPrepredValueDigest_asU8();
if (f.length > 0) {
writer.writeBytes(
3,
f
);
}
f = this.getReplicaId();
if (f !== 0) {
writer.writeInt64(
4,
f
);
}
};
/**
* Creates a deep clone of this proto. No data is shared with the original.
* @return {!proto.protocol.PbftViewChange} The clone.
*/
proto.protocol.PbftViewChange.prototype.cloneMessage = function () {
return /** @type {!proto.protocol.PbftViewChange} */ (jspb.Message.cloneMessage(this));
};
/**
* optional int64 view_number = 1;
* @return {number}
*/
proto.protocol.PbftViewChange.prototype.getViewNumber = function () {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 1, 0));
};
/** @param {number} value */
proto.protocol.PbftViewChange.prototype.setViewNumber = function (value) {
jspb.Message.setField(this, 1, value);
};
/**
* optional int64 sequence = 2;
* @return {number}
*/
proto.protocol.PbftViewChange.prototype.getSequence = function () {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 2, 0));
};
/** @param {number} value */
proto.protocol.PbftViewChange.prototype.setSequence = function (value) {
jspb.Message.setField(this, 2, value);
};
/**
* optional bytes prepred_value_digest = 3;
* @return {!(string|Uint8Array)}
*/
proto.protocol.PbftViewChange.prototype.getPrepredValueDigest = function () {
return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldProto3(this, 3, ""));
};
/**
* optional bytes prepred_value_digest = 3;
* This is a type-conversion wrapper around `getPrepredValueDigest()`
* @return {string}
*/
proto.protocol.PbftViewChange.prototype.getPrepredValueDigest_asB64 = function () {
return /** @type {string} */ (jspb.Message.bytesAsB64(
this.getPrepredValueDigest()));
};
/**
* optional bytes prepred_value_digest = 3;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getPrepredValueDigest()`
* @return {!Uint8Array}
*/
proto.protocol.PbftViewChange.prototype.getPrepredValueDigest_asU8 = function () {
return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
this.getPrepredValueDigest()));
};
/** @param {!(string|Uint8Array)} value */
proto.protocol.PbftViewChange.prototype.setPrepredValueDigest = function (value) {
jspb.Message.setField(this, 3, value);
};
/**
* optional int64 replica_id = 4;
* @return {number}
*/
proto.protocol.PbftViewChange.prototype.getReplicaId = function () {
return /** @type {number} */ (jspb.Message.getFieldProto3(this, 4, 0));
};
/** @param {number} value */
proto.protocol.PbftViewChange.prototype.setReplicaId = function (value) {
jspb.Message.setField(this, 4, value);
};
/**
* 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.protocol.PbftViewChangeWithRawValue = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.protocol.PbftViewChangeWithRawValue, jspb.Message);
if (goog.DEBUG && !COMPILED) {
proto.protocol.PbftViewChangeWithRawValue.displayName = 'proto.protocol.PbftViewChangeWithRawValue';
}
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_<name>, 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.protocol.PbftViewChangeWithRawValue.prototype.toObject = function (opt_includeInstance) {
return proto.protocol.PbftViewChangeWithRawValue.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.protocol.PbftViewChangeWithRawValue} msg The msg instance to transform.
* @return {!Object}
*/
proto.protocol.PbftViewChangeWithRawValue.toObject = function (includeInstance, msg) {
var f, obj = {
viewChangeEnv: (f = msg.getViewChangeEnv()) && proto.protocol.PbftEnv.toObject(includeInstance, f),
preparedSet: (f = msg.getPreparedSet()) && proto.protocol.PbftPreparedSet.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.protocol.PbftViewChangeWithRawValue}
*/
proto.protocol.PbftViewChangeWithRawValue.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.protocol.PbftViewChangeWithRawValue;
return proto.protocol.PbftViewChangeWithRawValue.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.protocol.PbftViewChangeWithRawValue} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.protocol.PbftViewChangeWithRawValue}
*/
proto.protocol.PbftViewChangeWithRawValue.deserializeBinaryFromReader = function (msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new proto.protocol.PbftEnv;
reader.readMessage(value, proto.protocol.PbftEnv.deserializeBinaryFromReader);
msg.setViewChangeEnv(value);
break;
case 2:
var value = new proto.protocol.PbftPreparedSet;
reader.readMessage(value, proto.protocol.PbftPreparedSet.deserializeBinaryFromReader);
msg.setPreparedSet(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Class method variant: serializes the given message to binary data
* (in protobuf wire format), writing to the given BinaryWriter.
* @param {!proto.protocol.PbftViewChangeWithRawValue} message
* @param {!jspb.BinaryWriter} writer
*/
proto.protocol.PbftViewChangeWithRawValue.serializeBinaryToWriter = function (message, writer) {
message.serializeBinaryToWriter(writer);
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.protocol.PbftViewChangeWithRawValue.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
this.serializeBinaryToWriter(writer);
return writer.getResultBuffer();
};
/**
* Serializes the message to binary data (in protobuf wire format),
* writing to the given BinaryWriter.
* @param {!jspb.BinaryWriter} writer
*/
proto.protocol.PbftViewChangeWithRawValue.prototype.serializeBinaryToWriter = function (writer) {
var f = undefined;
f = this.getViewChangeEnv();
if (f != null) {
writer.writeMessage(
1,
f,
proto.protocol.PbftEnv.serializeBinaryToWriter
);
}
f = this.getPreparedSet();
if (f != null) {
writer.writeMessage(
2,
f,
proto.protocol.PbftPreparedSet.serializeBinaryToWriter
);
}
};
/**
* Creates a deep clone of this proto. No data is shared with the original.
* @return {!proto.protocol.PbftViewChangeWithRawValue} The clone.
*/
proto.protocol.PbftViewChangeWithRawValue.prototype.cloneMessage = function () {
return /** @type {!proto.protocol.PbftViewChangeWithRawValue} */ (jspb.Message.cloneMessage(this));
};
/**
* optional PbftEnv view_change_env = 1;
* @return {proto.protocol.PbftEnv}
*/
proto.protocol.PbftViewChangeWithRawValue.prototype.getViewChangeEnv = function () {
return /** @type{proto.protocol.PbftEnv} */ (
jspb.Message.getWrapperField(this, proto.protocol.PbftEnv, 1));
};
/** @param {proto.protocol.PbftEnv|undefined} value */
proto.protocol.PbftViewChangeWithRawValue.prototype.setViewChangeEnv = function (value) {
jspb.Message.setWrapperField(this, 1, value);
};
proto.protocol.PbftViewChangeWithRawValue.prototype.clearViewChangeEnv = function () {
this.setViewChangeEnv(undefined);
};
/**
* Returns whether this field is set.
* @return{!boolean}
*/
proto.protocol.PbftViewChangeWithRawValue.prototype.hasViewChangeEnv = function () {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional PbftPreparedSet prepared_set = 2;
* @return {proto.protocol.PbftPreparedSet}
*/
proto.protocol.PbftViewChangeWithRawValue.prototype.getPreparedSet = function () {
return /** @type{proto.protocol.PbftPreparedSet} */ (
jspb.Message.getWrapper