@provenanceio/wallet-utils
Version:
Typescript Utilities for Provenance Blockchain Wallet
1,819 lines (1,503 loc) • 110 kB
JavaScript
// source: proofs.proto
/**
* @fileoverview
* @enhanceable
* @suppress {missingRequire} reports error on implicit type usages.
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck
var jspb = require('google-protobuf');
var goog = jspb;
var global = function () {
return this || window || global || self || Function('return this')();
}.call(null);
goog.exportSymbol('proto.ics23.BatchEntry', null, global);
goog.exportSymbol('proto.ics23.BatchEntry.ProofCase', null, global);
goog.exportSymbol('proto.ics23.BatchProof', null, global);
goog.exportSymbol('proto.ics23.CommitmentProof', null, global);
goog.exportSymbol('proto.ics23.CommitmentProof.ProofCase', null, global);
goog.exportSymbol('proto.ics23.CompressedBatchEntry', null, global);
goog.exportSymbol('proto.ics23.CompressedBatchEntry.ProofCase', null, global);
goog.exportSymbol('proto.ics23.CompressedBatchProof', null, global);
goog.exportSymbol('proto.ics23.CompressedExistenceProof', null, global);
goog.exportSymbol('proto.ics23.CompressedNonExistenceProof', null, global);
goog.exportSymbol('proto.ics23.ExistenceProof', null, global);
goog.exportSymbol('proto.ics23.HashOp', null, global);
goog.exportSymbol('proto.ics23.InnerOp', null, global);
goog.exportSymbol('proto.ics23.InnerSpec', null, global);
goog.exportSymbol('proto.ics23.LeafOp', null, global);
goog.exportSymbol('proto.ics23.LengthOp', null, global);
goog.exportSymbol('proto.ics23.NonExistenceProof', null, global);
goog.exportSymbol('proto.ics23.ProofSpec', 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.ics23.ExistenceProof = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.ics23.ExistenceProof.repeatedFields_, null);
};
goog.inherits(proto.ics23.ExistenceProof, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.ics23.ExistenceProof.displayName = 'proto.ics23.ExistenceProof';
}
/**
* 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.ics23.NonExistenceProof = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.ics23.NonExistenceProof, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.ics23.NonExistenceProof.displayName = 'proto.ics23.NonExistenceProof';
}
/**
* 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.ics23.CommitmentProof = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, proto.ics23.CommitmentProof.oneofGroups_);
};
goog.inherits(proto.ics23.CommitmentProof, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.ics23.CommitmentProof.displayName = 'proto.ics23.CommitmentProof';
}
/**
* 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.ics23.LeafOp = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.ics23.LeafOp, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.ics23.LeafOp.displayName = 'proto.ics23.LeafOp';
}
/**
* 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.ics23.InnerOp = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.ics23.InnerOp, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.ics23.InnerOp.displayName = 'proto.ics23.InnerOp';
}
/**
* 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.ics23.ProofSpec = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.ics23.ProofSpec, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.ics23.ProofSpec.displayName = 'proto.ics23.ProofSpec';
}
/**
* 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.ics23.InnerSpec = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.ics23.InnerSpec.repeatedFields_, null);
};
goog.inherits(proto.ics23.InnerSpec, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.ics23.InnerSpec.displayName = 'proto.ics23.InnerSpec';
}
/**
* 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.ics23.BatchProof = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.ics23.BatchProof.repeatedFields_, null);
};
goog.inherits(proto.ics23.BatchProof, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.ics23.BatchProof.displayName = 'proto.ics23.BatchProof';
}
/**
* 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.ics23.BatchEntry = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, proto.ics23.BatchEntry.oneofGroups_);
};
goog.inherits(proto.ics23.BatchEntry, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.ics23.BatchEntry.displayName = 'proto.ics23.BatchEntry';
}
/**
* 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.ics23.CompressedBatchProof = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.ics23.CompressedBatchProof.repeatedFields_, null);
};
goog.inherits(proto.ics23.CompressedBatchProof, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.ics23.CompressedBatchProof.displayName = 'proto.ics23.CompressedBatchProof';
}
/**
* 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.ics23.CompressedBatchEntry = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, proto.ics23.CompressedBatchEntry.oneofGroups_);
};
goog.inherits(proto.ics23.CompressedBatchEntry, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.ics23.CompressedBatchEntry.displayName = 'proto.ics23.CompressedBatchEntry';
}
/**
* 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.ics23.CompressedExistenceProof = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.ics23.CompressedExistenceProof.repeatedFields_, null);
};
goog.inherits(proto.ics23.CompressedExistenceProof, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.ics23.CompressedExistenceProof.displayName = 'proto.ics23.CompressedExistenceProof';
}
/**
* 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.ics23.CompressedNonExistenceProof = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.ics23.CompressedNonExistenceProof, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.ics23.CompressedNonExistenceProof.displayName = 'proto.ics23.CompressedNonExistenceProof';
}
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.ics23.ExistenceProof.repeatedFields_ = [4];
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.ics23.ExistenceProof.prototype.toObject = function (opt_includeInstance) {
return proto.ics23.ExistenceProof.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.ics23.ExistenceProof} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.ics23.ExistenceProof.toObject = function (includeInstance, msg) {
var f,
obj = {
key: msg.getKey_asB64(),
value: msg.getValue_asB64(),
leaf: (f = msg.getLeaf()) && proto.ics23.LeafOp.toObject(includeInstance, f),
pathList: jspb.Message.toObjectList(msg.getPathList(), proto.ics23.InnerOp.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.ics23.ExistenceProof}
*/
proto.ics23.ExistenceProof.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.ics23.ExistenceProof();
return proto.ics23.ExistenceProof.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.ics23.ExistenceProof} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.ics23.ExistenceProof}
*/
proto.ics23.ExistenceProof.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.setKey(value);
break;
case 2:
var value =
/** @type {!Uint8Array} */
reader.readBytes();
msg.setValue(value);
break;
case 3:
var value = new proto.ics23.LeafOp();
reader.readMessage(value, proto.ics23.LeafOp.deserializeBinaryFromReader);
msg.setLeaf(value);
break;
case 4:
var value = new proto.ics23.InnerOp();
reader.readMessage(value, proto.ics23.InnerOp.deserializeBinaryFromReader);
msg.addPath(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.ics23.ExistenceProof.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
proto.ics23.ExistenceProof.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.ics23.ExistenceProof} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.ics23.ExistenceProof.serializeBinaryToWriter = function (message, writer) {
var f = undefined;
f = message.getKey_asU8();
if (f.length > 0) {
writer.writeBytes(1, f);
}
f = message.getValue_asU8();
if (f.length > 0) {
writer.writeBytes(2, f);
}
f = message.getLeaf();
if (f != null) {
writer.writeMessage(3, f, proto.ics23.LeafOp.serializeBinaryToWriter);
}
f = message.getPathList();
if (f.length > 0) {
writer.writeRepeatedMessage(4, f, proto.ics23.InnerOp.serializeBinaryToWriter);
}
};
/**
* optional bytes key = 1;
* @return {!(string|Uint8Array)}
*/
proto.ics23.ExistenceProof.prototype.getKey = function () {
return (
/** @type {!(string|Uint8Array)} */
jspb.Message.getFieldWithDefault(this, 1, "")
);
};
/**
* optional bytes key = 1;
* This is a type-conversion wrapper around `getKey()`
* @return {string}
*/
proto.ics23.ExistenceProof.prototype.getKey_asB64 = function () {
return (
/** @type {string} */
jspb.Message.bytesAsB64(this.getKey())
);
};
/**
* optional bytes key = 1;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getKey()`
* @return {!Uint8Array}
*/
proto.ics23.ExistenceProof.prototype.getKey_asU8 = function () {
return (
/** @type {!Uint8Array} */
jspb.Message.bytesAsU8(this.getKey())
);
};
/**
* @param {!(string|Uint8Array)} value
* @return {!proto.ics23.ExistenceProof} returns this
*/
proto.ics23.ExistenceProof.prototype.setKey = function (value) {
return jspb.Message.setProto3BytesField(this, 1, value);
};
/**
* optional bytes value = 2;
* @return {!(string|Uint8Array)}
*/
proto.ics23.ExistenceProof.prototype.getValue = function () {
return (
/** @type {!(string|Uint8Array)} */
jspb.Message.getFieldWithDefault(this, 2, "")
);
};
/**
* optional bytes value = 2;
* This is a type-conversion wrapper around `getValue()`
* @return {string}
*/
proto.ics23.ExistenceProof.prototype.getValue_asB64 = function () {
return (
/** @type {string} */
jspb.Message.bytesAsB64(this.getValue())
);
};
/**
* optional bytes value = 2;
* 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.ics23.ExistenceProof.prototype.getValue_asU8 = function () {
return (
/** @type {!Uint8Array} */
jspb.Message.bytesAsU8(this.getValue())
);
};
/**
* @param {!(string|Uint8Array)} value
* @return {!proto.ics23.ExistenceProof} returns this
*/
proto.ics23.ExistenceProof.prototype.setValue = function (value) {
return jspb.Message.setProto3BytesField(this, 2, value);
};
/**
* optional LeafOp leaf = 3;
* @return {?proto.ics23.LeafOp}
*/
proto.ics23.ExistenceProof.prototype.getLeaf = function () {
return (
/** @type{?proto.ics23.LeafOp} */
jspb.Message.getWrapperField(this, proto.ics23.LeafOp, 3)
);
};
/**
* @param {?proto.ics23.LeafOp|undefined} value
* @return {!proto.ics23.ExistenceProof} returns this
*/
proto.ics23.ExistenceProof.prototype.setLeaf = function (value) {
return jspb.Message.setWrapperField(this, 3, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.ics23.ExistenceProof} returns this
*/
proto.ics23.ExistenceProof.prototype.clearLeaf = function () {
return this.setLeaf(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.ics23.ExistenceProof.prototype.hasLeaf = function () {
return jspb.Message.getField(this, 3) != null;
};
/**
* repeated InnerOp path = 4;
* @return {!Array<!proto.ics23.InnerOp>}
*/
proto.ics23.ExistenceProof.prototype.getPathList = function () {
return (
/** @type{!Array<!proto.ics23.InnerOp>} */
jspb.Message.getRepeatedWrapperField(this, proto.ics23.InnerOp, 4)
);
};
/**
* @param {!Array<!proto.ics23.InnerOp>} value
* @return {!proto.ics23.ExistenceProof} returns this
*/
proto.ics23.ExistenceProof.prototype.setPathList = function (value) {
return jspb.Message.setRepeatedWrapperField(this, 4, value);
};
/**
* @param {!proto.ics23.InnerOp=} opt_value
* @param {number=} opt_index
* @return {!proto.ics23.InnerOp}
*/
proto.ics23.ExistenceProof.prototype.addPath = function (opt_value, opt_index) {
return jspb.Message.addToRepeatedWrapperField(this, 4, opt_value, proto.ics23.InnerOp, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.ics23.ExistenceProof} returns this
*/
proto.ics23.ExistenceProof.prototype.clearPathList = function () {
return this.setPathList([]);
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.ics23.NonExistenceProof.prototype.toObject = function (opt_includeInstance) {
return proto.ics23.NonExistenceProof.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.ics23.NonExistenceProof} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.ics23.NonExistenceProof.toObject = function (includeInstance, msg) {
var f,
obj = {
key: msg.getKey_asB64(),
left: (f = msg.getLeft()) && proto.ics23.ExistenceProof.toObject(includeInstance, f),
right: (f = msg.getRight()) && proto.ics23.ExistenceProof.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.ics23.NonExistenceProof}
*/
proto.ics23.NonExistenceProof.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.ics23.NonExistenceProof();
return proto.ics23.NonExistenceProof.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.ics23.NonExistenceProof} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.ics23.NonExistenceProof}
*/
proto.ics23.NonExistenceProof.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.setKey(value);
break;
case 2:
var value = new proto.ics23.ExistenceProof();
reader.readMessage(value, proto.ics23.ExistenceProof.deserializeBinaryFromReader);
msg.setLeft(value);
break;
case 3:
var value = new proto.ics23.ExistenceProof();
reader.readMessage(value, proto.ics23.ExistenceProof.deserializeBinaryFromReader);
msg.setRight(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.ics23.NonExistenceProof.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
proto.ics23.NonExistenceProof.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.ics23.NonExistenceProof} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.ics23.NonExistenceProof.serializeBinaryToWriter = function (message, writer) {
var f = undefined;
f = message.getKey_asU8();
if (f.length > 0) {
writer.writeBytes(1, f);
}
f = message.getLeft();
if (f != null) {
writer.writeMessage(2, f, proto.ics23.ExistenceProof.serializeBinaryToWriter);
}
f = message.getRight();
if (f != null) {
writer.writeMessage(3, f, proto.ics23.ExistenceProof.serializeBinaryToWriter);
}
};
/**
* optional bytes key = 1;
* @return {!(string|Uint8Array)}
*/
proto.ics23.NonExistenceProof.prototype.getKey = function () {
return (
/** @type {!(string|Uint8Array)} */
jspb.Message.getFieldWithDefault(this, 1, "")
);
};
/**
* optional bytes key = 1;
* This is a type-conversion wrapper around `getKey()`
* @return {string}
*/
proto.ics23.NonExistenceProof.prototype.getKey_asB64 = function () {
return (
/** @type {string} */
jspb.Message.bytesAsB64(this.getKey())
);
};
/**
* optional bytes key = 1;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getKey()`
* @return {!Uint8Array}
*/
proto.ics23.NonExistenceProof.prototype.getKey_asU8 = function () {
return (
/** @type {!Uint8Array} */
jspb.Message.bytesAsU8(this.getKey())
);
};
/**
* @param {!(string|Uint8Array)} value
* @return {!proto.ics23.NonExistenceProof} returns this
*/
proto.ics23.NonExistenceProof.prototype.setKey = function (value) {
return jspb.Message.setProto3BytesField(this, 1, value);
};
/**
* optional ExistenceProof left = 2;
* @return {?proto.ics23.ExistenceProof}
*/
proto.ics23.NonExistenceProof.prototype.getLeft = function () {
return (
/** @type{?proto.ics23.ExistenceProof} */
jspb.Message.getWrapperField(this, proto.ics23.ExistenceProof, 2)
);
};
/**
* @param {?proto.ics23.ExistenceProof|undefined} value
* @return {!proto.ics23.NonExistenceProof} returns this
*/
proto.ics23.NonExistenceProof.prototype.setLeft = function (value) {
return jspb.Message.setWrapperField(this, 2, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.ics23.NonExistenceProof} returns this
*/
proto.ics23.NonExistenceProof.prototype.clearLeft = function () {
return this.setLeft(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.ics23.NonExistenceProof.prototype.hasLeft = function () {
return jspb.Message.getField(this, 2) != null;
};
/**
* optional ExistenceProof right = 3;
* @return {?proto.ics23.ExistenceProof}
*/
proto.ics23.NonExistenceProof.prototype.getRight = function () {
return (
/** @type{?proto.ics23.ExistenceProof} */
jspb.Message.getWrapperField(this, proto.ics23.ExistenceProof, 3)
);
};
/**
* @param {?proto.ics23.ExistenceProof|undefined} value
* @return {!proto.ics23.NonExistenceProof} returns this
*/
proto.ics23.NonExistenceProof.prototype.setRight = function (value) {
return jspb.Message.setWrapperField(this, 3, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.ics23.NonExistenceProof} returns this
*/
proto.ics23.NonExistenceProof.prototype.clearRight = function () {
return this.setRight(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.ics23.NonExistenceProof.prototype.hasRight = function () {
return jspb.Message.getField(this, 3) != null;
};
/**
* Oneof group definitions for this message. Each group defines the field
* numbers belonging to that group. When of these fields' value is set, all
* other fields in the group are cleared. During deserialization, if multiple
* fields are encountered for a group, only the last value seen will be kept.
* @private {!Array<!Array<number>>}
* @const
*/
proto.ics23.CommitmentProof.oneofGroups_ = [[1, 2, 3, 4]];
/**
* @enum {number}
*/
proto.ics23.CommitmentProof.ProofCase = {
PROOF_NOT_SET: 0,
EXIST: 1,
NONEXIST: 2,
BATCH: 3,
COMPRESSED: 4
};
/**
* @return {proto.ics23.CommitmentProof.ProofCase}
*/
proto.ics23.CommitmentProof.prototype.getProofCase = function () {
return (
/** @type {proto.ics23.CommitmentProof.ProofCase} */
jspb.Message.computeOneofCase(this, proto.ics23.CommitmentProof.oneofGroups_[0])
);
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.ics23.CommitmentProof.prototype.toObject = function (opt_includeInstance) {
return proto.ics23.CommitmentProof.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.ics23.CommitmentProof} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.ics23.CommitmentProof.toObject = function (includeInstance, msg) {
var f,
obj = {
exist: (f = msg.getExist()) && proto.ics23.ExistenceProof.toObject(includeInstance, f),
nonexist: (f = msg.getNonexist()) && proto.ics23.NonExistenceProof.toObject(includeInstance, f),
batch: (f = msg.getBatch()) && proto.ics23.BatchProof.toObject(includeInstance, f),
compressed: (f = msg.getCompressed()) && proto.ics23.CompressedBatchProof.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.ics23.CommitmentProof}
*/
proto.ics23.CommitmentProof.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.ics23.CommitmentProof();
return proto.ics23.CommitmentProof.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.ics23.CommitmentProof} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.ics23.CommitmentProof}
*/
proto.ics23.CommitmentProof.deserializeBinaryFromReader = function (msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new proto.ics23.ExistenceProof();
reader.readMessage(value, proto.ics23.ExistenceProof.deserializeBinaryFromReader);
msg.setExist(value);
break;
case 2:
var value = new proto.ics23.NonExistenceProof();
reader.readMessage(value, proto.ics23.NonExistenceProof.deserializeBinaryFromReader);
msg.setNonexist(value);
break;
case 3:
var value = new proto.ics23.BatchProof();
reader.readMessage(value, proto.ics23.BatchProof.deserializeBinaryFromReader);
msg.setBatch(value);
break;
case 4:
var value = new proto.ics23.CompressedBatchProof();
reader.readMessage(value, proto.ics23.CompressedBatchProof.deserializeBinaryFromReader);
msg.setCompressed(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.ics23.CommitmentProof.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
proto.ics23.CommitmentProof.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.ics23.CommitmentProof} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.ics23.CommitmentProof.serializeBinaryToWriter = function (message, writer) {
var f = undefined;
f = message.getExist();
if (f != null) {
writer.writeMessage(1, f, proto.ics23.ExistenceProof.serializeBinaryToWriter);
}
f = message.getNonexist();
if (f != null) {
writer.writeMessage(2, f, proto.ics23.NonExistenceProof.serializeBinaryToWriter);
}
f = message.getBatch();
if (f != null) {
writer.writeMessage(3, f, proto.ics23.BatchProof.serializeBinaryToWriter);
}
f = message.getCompressed();
if (f != null) {
writer.writeMessage(4, f, proto.ics23.CompressedBatchProof.serializeBinaryToWriter);
}
};
/**
* optional ExistenceProof exist = 1;
* @return {?proto.ics23.ExistenceProof}
*/
proto.ics23.CommitmentProof.prototype.getExist = function () {
return (
/** @type{?proto.ics23.ExistenceProof} */
jspb.Message.getWrapperField(this, proto.ics23.ExistenceProof, 1)
);
};
/**
* @param {?proto.ics23.ExistenceProof|undefined} value
* @return {!proto.ics23.CommitmentProof} returns this
*/
proto.ics23.CommitmentProof.prototype.setExist = function (value) {
return jspb.Message.setOneofWrapperField(this, 1, proto.ics23.CommitmentProof.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.ics23.CommitmentProof} returns this
*/
proto.ics23.CommitmentProof.prototype.clearExist = function () {
return this.setExist(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.ics23.CommitmentProof.prototype.hasExist = function () {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional NonExistenceProof nonexist = 2;
* @return {?proto.ics23.NonExistenceProof}
*/
proto.ics23.CommitmentProof.prototype.getNonexist = function () {
return (
/** @type{?proto.ics23.NonExistenceProof} */
jspb.Message.getWrapperField(this, proto.ics23.NonExistenceProof, 2)
);
};
/**
* @param {?proto.ics23.NonExistenceProof|undefined} value
* @return {!proto.ics23.CommitmentProof} returns this
*/
proto.ics23.CommitmentProof.prototype.setNonexist = function (value) {
return jspb.Message.setOneofWrapperField(this, 2, proto.ics23.CommitmentProof.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.ics23.CommitmentProof} returns this
*/
proto.ics23.CommitmentProof.prototype.clearNonexist = function () {
return this.setNonexist(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.ics23.CommitmentProof.prototype.hasNonexist = function () {
return jspb.Message.getField(this, 2) != null;
};
/**
* optional BatchProof batch = 3;
* @return {?proto.ics23.BatchProof}
*/
proto.ics23.CommitmentProof.prototype.getBatch = function () {
return (
/** @type{?proto.ics23.BatchProof} */
jspb.Message.getWrapperField(this, proto.ics23.BatchProof, 3)
);
};
/**
* @param {?proto.ics23.BatchProof|undefined} value
* @return {!proto.ics23.CommitmentProof} returns this
*/
proto.ics23.CommitmentProof.prototype.setBatch = function (value) {
return jspb.Message.setOneofWrapperField(this, 3, proto.ics23.CommitmentProof.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.ics23.CommitmentProof} returns this
*/
proto.ics23.CommitmentProof.prototype.clearBatch = function () {
return this.setBatch(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.ics23.CommitmentProof.prototype.hasBatch = function () {
return jspb.Message.getField(this, 3) != null;
};
/**
* optional CompressedBatchProof compressed = 4;
* @return {?proto.ics23.CompressedBatchProof}
*/
proto.ics23.CommitmentProof.prototype.getCompressed = function () {
return (
/** @type{?proto.ics23.CompressedBatchProof} */
jspb.Message.getWrapperField(this, proto.ics23.CompressedBatchProof, 4)
);
};
/**
* @param {?proto.ics23.CompressedBatchProof|undefined} value
* @return {!proto.ics23.CommitmentProof} returns this
*/
proto.ics23.CommitmentProof.prototype.setCompressed = function (value) {
return jspb.Message.setOneofWrapperField(this, 4, proto.ics23.CommitmentProof.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.ics23.CommitmentProof} returns this
*/
proto.ics23.CommitmentProof.prototype.clearCompressed = function () {
return this.setCompressed(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.ics23.CommitmentProof.prototype.hasCompressed = function () {
return jspb.Message.getField(this, 4) != null;
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.ics23.LeafOp.prototype.toObject = function (opt_includeInstance) {
return proto.ics23.LeafOp.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.ics23.LeafOp} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.ics23.LeafOp.toObject = function (includeInstance, msg) {
var f,
obj = {
hash: jspb.Message.getFieldWithDefault(msg, 1, 0),
prehashKey: jspb.Message.getFieldWithDefault(msg, 2, 0),
prehashValue: jspb.Message.getFieldWithDefault(msg, 3, 0),
length: jspb.Message.getFieldWithDefault(msg, 4, 0),
prefix: msg.getPrefix_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.ics23.LeafOp}
*/
proto.ics23.LeafOp.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.ics23.LeafOp();
return proto.ics23.LeafOp.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.ics23.LeafOp} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.ics23.LeafOp}
*/
proto.ics23.LeafOp.deserializeBinaryFromReader = function (msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value =
/** @type {!proto.ics23.HashOp} */
reader.readEnum();
msg.setHash(value);
break;
case 2:
var value =
/** @type {!proto.ics23.HashOp} */
reader.readEnum();
msg.setPrehashKey(value);
break;
case 3:
var value =
/** @type {!proto.ics23.HashOp} */
reader.readEnum();
msg.setPrehashValue(value);
break;
case 4:
var value =
/** @type {!proto.ics23.LengthOp} */
reader.readEnum();
msg.setLength(value);
break;
case 5:
var value =
/** @type {!Uint8Array} */
reader.readBytes();
msg.setPrefix(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.ics23.LeafOp.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
proto.ics23.LeafOp.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.ics23.LeafOp} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.ics23.LeafOp.serializeBinaryToWriter = function (message, writer) {
var f = undefined;
f = message.getHash();
if (f !== 0.0) {
writer.writeEnum(1, f);
}
f = message.getPrehashKey();
if (f !== 0.0) {
writer.writeEnum(2, f);
}
f = message.getPrehashValue();
if (f !== 0.0) {
writer.writeEnum(3, f);
}
f = message.getLength();
if (f !== 0.0) {
writer.writeEnum(4, f);
}
f = message.getPrefix_asU8();
if (f.length > 0) {
writer.writeBytes(5, f);
}
};
/**
* optional HashOp hash = 1;
* @return {!proto.ics23.HashOp}
*/
proto.ics23.LeafOp.prototype.getHash = function () {
return (
/** @type {!proto.ics23.HashOp} */
jspb.Message.getFieldWithDefault(this, 1, 0)
);
};
/**
* @param {!proto.ics23.HashOp} value
* @return {!proto.ics23.LeafOp} returns this
*/
proto.ics23.LeafOp.prototype.setHash = function (value) {
return jspb.Message.setProto3EnumField(this, 1, value);
};
/**
* optional HashOp prehash_key = 2;
* @return {!proto.ics23.HashOp}
*/
proto.ics23.LeafOp.prototype.getPrehashKey = function () {
return (
/** @type {!proto.ics23.HashOp} */
jspb.Message.getFieldWithDefault(this, 2, 0)
);
};
/**
* @param {!proto.ics23.HashOp} value
* @return {!proto.ics23.LeafOp} returns this
*/
proto.ics23.LeafOp.prototype.setPrehashKey = function (value) {
return jspb.Message.setProto3EnumField(this, 2, value);
};
/**
* optional HashOp prehash_value = 3;
* @return {!proto.ics23.HashOp}
*/
proto.ics23.LeafOp.prototype.getPrehashValue = function () {
return (
/** @type {!proto.ics23.HashOp} */
jspb.Message.getFieldWithDefault(this, 3, 0)
);
};
/**
* @param {!proto.ics23.HashOp} value
* @return {!proto.ics23.LeafOp} returns this
*/
proto.ics23.LeafOp.prototype.setPrehashValue = function (value) {
return jspb.Message.setProto3EnumField(this, 3, value);
};
/**
* optional LengthOp length = 4;
* @return {!proto.ics23.LengthOp}
*/
proto.ics23.LeafOp.prototype.getLength = function () {
return (
/** @type {!proto.ics23.LengthOp} */
jspb.Message.getFieldWithDefault(this, 4, 0)
);
};
/**
* @param {!proto.ics23.LengthOp} value
* @return {!proto.ics23.LeafOp} returns this
*/
proto.ics23.LeafOp.prototype.setLength = function (value) {
return jspb.Message.setProto3EnumField(this, 4, value);
};
/**
* optional bytes prefix = 5;
* @return {!(string|Uint8Array)}
*/
proto.ics23.LeafOp.prototype.getPrefix = function () {
return (
/** @type {!(string|Uint8Array)} */
jspb.Message.getFieldWithDefault(this, 5, "")
);
};
/**
* optional bytes prefix = 5;
* This is a type-conversion wrapper around `getPrefix()`
* @return {string}
*/
proto.ics23.LeafOp.prototype.getPrefix_asB64 = function () {
return (
/** @type {string} */
jspb.Message.bytesAsB64(this.getPrefix())
);
};
/**
* optional bytes prefix = 5;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getPrefix()`
* @return {!Uint8Array}
*/
proto.ics23.LeafOp.prototype.getPrefix_asU8 = function () {
return (
/** @type {!Uint8Array} */
jspb.Message.bytesAsU8(this.getPrefix())
);
};
/**
* @param {!(string|Uint8Array)} value
* @return {!proto.ics23.LeafOp} returns this
*/
proto.ics23.LeafOp.prototype.setPrefix = function (value) {
return jspb.Message.setProto3BytesField(this, 5, value);
};
if (jspb.Message.GENERATE_TO_OBJECT) {
/**
* Creates an object representation of this proto.
* Field names that are reserved in JavaScript and will be renamed to pb_name.
* Optional fields that are not set will be set to undefined.
* To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
* For the list of reserved names please see:
* net/proto2/compiler/js/internal/generator.cc#kKeyword.
* @param {boolean=} opt_includeInstance Deprecated. whether to include the
* JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @return {!Object}
*/
proto.ics23.InnerOp.prototype.toObject = function (opt_includeInstance) {
return proto.ics23.InnerOp.toObject(opt_includeInstance, this);
};
/**
* Static version of the {@see toObject} method.
* @param {boolean|undefined} includeInstance Deprecated. Whether to include
* the JSPB instance for transitional soy proto support:
* http://goto/soy-param-migration
* @param {!proto.ics23.InnerOp} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.ics23.InnerOp.toObject = function (includeInstance, msg) {
var f,
obj = {
hash: jspb.Message.getFieldWithDefault(msg, 1, 0),
prefix: msg.getPrefix_asB64(),
suffix: msg.getSuffix_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.ics23.InnerOp}
*/
proto.ics23.InnerOp.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.ics23.InnerOp();
return proto.ics23.InnerOp.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.ics23.InnerOp} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.ics23.InnerOp}
*/
proto.ics23.InnerOp.deserializeBinaryFromReader = function (msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value =
/** @type {!proto.ics23.HashOp} */
reader.readEnum();
msg.setHash(value);
break;
case 2:
var value =
/** @type {!Uint8Array} */
reader.readBytes();
msg.setPrefix(value);
break;
case 3:
var value =
/** @type {!Uint8Array} */
reader.readBytes();
msg.setSuffix(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.ics23.InnerOp.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
proto.ics23.InnerOp.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.ics23.InnerOp} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.ics23.InnerOp.serializeBinaryToWriter = function (message, writer) {
var f = undefined;
f = message.getHash();
if (f !== 0.0) {
writer.writeEnum(1, f);
}
f = message.getPrefix_asU8();
if (f.length > 0) {
writer.writeBytes(2, f);
}
f = message.getSuffix_asU8();
if (f.length > 0) {
writer.writeBytes(3, f);
}
};
/**
* optional HashOp hash = 1;
* @return {!proto.ics23.HashOp}
*/
proto.ics23.InnerOp.prototype.getHash = function () {
return (
/** @type {!proto.ics23.HashOp} */
jspb.Message.getFieldWithDefault(this, 1, 0)
);
};
/**
* @param {!proto.ics23.HashOp} value
* @return {!proto.ics23.InnerOp} returns this
*/
proto.ics23.InnerOp.prototype.setHash = function (value) {
return jspb.Message.setProto3EnumField(this, 1, value);
};
/**
* optional bytes prefix = 2;
* @return {!(string|Uint8Array)}
*/
proto.ics23.InnerOp.prototype.getPrefix = function () {
return (
/** @type {!(string|Uint8Array)} */
jspb.Message.getFieldWithDefault(this, 2, "")
);
};
/**
* optional bytes prefix = 2;
* This is a type-conversion wrapper around `getPrefix()`
* @return {string}
*/
proto.ics23.InnerOp.prototype.getPrefix_asB64 = function () {
return (
/** @type {string} */
jspb.Message.bytesAsB64(this.getPrefix())
);
};
/**
* optional bytes prefix = 2;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getPrefix()`
* @return {!Uint8Array}
*/
proto.ics23.InnerOp.prototype.getPrefix_asU8 = function () {
return (
/** @type {!Uint8Array} */
jspb.Message.bytesAsU8(this.getPrefix())
);
};
/**
* @param {!(string|Uint8Array)} value
* @return {!proto.ics23