@provenanceio/wallet-utils
Version:
Typescript Utilities for Provenance Blockchain Wallet
1,585 lines (1,307 loc) • 74.6 kB
JavaScript
"use strict";
// source: cosmos/base/snapshots/v1beta1/snapshot.proto
/**
* @fileoverview
* @enhanceable
* @suppress {missingRequire} reports error on implicit type usages.
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
/* eslint-disable */
// @ts-nocheck
var jspb = require('google-protobuf');
var goog = jspb;
var global = function () {
return this || window || global || self || Function('return this')();
}.call(null);
var gogoproto_gogo_pb = require('../../../../gogoproto/gogo_pb.js');
goog.object.extend(proto, gogoproto_gogo_pb);
goog.exportSymbol('proto.cosmos.base.snapshots.v1beta1.Metadata', null, global);
goog.exportSymbol('proto.cosmos.base.snapshots.v1beta1.Snapshot', null, global);
goog.exportSymbol('proto.cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta', null, global);
goog.exportSymbol('proto.cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload', null, global);
goog.exportSymbol('proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem', null, global);
goog.exportSymbol('proto.cosmos.base.snapshots.v1beta1.SnapshotItem', null, global);
goog.exportSymbol('proto.cosmos.base.snapshots.v1beta1.SnapshotItem.ItemCase', null, global);
goog.exportSymbol('proto.cosmos.base.snapshots.v1beta1.SnapshotKVItem', null, global);
goog.exportSymbol('proto.cosmos.base.snapshots.v1beta1.SnapshotSchema', null, global);
goog.exportSymbol('proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem', 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.cosmos.base.snapshots.v1beta1.Snapshot = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cosmos.base.snapshots.v1beta1.Snapshot, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.cosmos.base.snapshots.v1beta1.Snapshot.displayName = 'proto.cosmos.base.snapshots.v1beta1.Snapshot';
}
/**
* 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.cosmos.base.snapshots.v1beta1.Metadata = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.cosmos.base.snapshots.v1beta1.Metadata.repeatedFields_, null);
};
goog.inherits(proto.cosmos.base.snapshots.v1beta1.Metadata, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.cosmos.base.snapshots.v1beta1.Metadata.displayName = 'proto.cosmos.base.snapshots.v1beta1.Metadata';
}
/**
* 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.cosmos.base.snapshots.v1beta1.SnapshotItem = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, proto.cosmos.base.snapshots.v1beta1.SnapshotItem.oneofGroups_);
};
goog.inherits(proto.cosmos.base.snapshots.v1beta1.SnapshotItem, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.displayName = 'proto.cosmos.base.snapshots.v1beta1.SnapshotItem';
}
/**
* 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.cosmos.base.snapshots.v1beta1.SnapshotStoreItem = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem.displayName = 'proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem';
}
/**
* 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.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem.displayName = 'proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem';
}
/**
* 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.cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta.displayName = 'proto.cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta';
}
/**
* 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.cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload.displayName = 'proto.cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload';
}
/**
* 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.cosmos.base.snapshots.v1beta1.SnapshotKVItem = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, null, null);
};
goog.inherits(proto.cosmos.base.snapshots.v1beta1.SnapshotKVItem, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotKVItem.displayName = 'proto.cosmos.base.snapshots.v1beta1.SnapshotKVItem';
}
/**
* 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.cosmos.base.snapshots.v1beta1.SnapshotSchema = function (opt_data) {
jspb.Message.initialize(this, opt_data, 0, -1, proto.cosmos.base.snapshots.v1beta1.SnapshotSchema.repeatedFields_, null);
};
goog.inherits(proto.cosmos.base.snapshots.v1beta1.SnapshotSchema, jspb.Message);
if (goog.DEBUG && !COMPILED) {
/**
* @public
* @override
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotSchema.displayName = 'proto.cosmos.base.snapshots.v1beta1.SnapshotSchema';
}
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.cosmos.base.snapshots.v1beta1.Snapshot.prototype.toObject = function (opt_includeInstance) {
return proto.cosmos.base.snapshots.v1beta1.Snapshot.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.cosmos.base.snapshots.v1beta1.Snapshot} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cosmos.base.snapshots.v1beta1.Snapshot.toObject = function (includeInstance, msg) {
var f,
obj = {
height: jspb.Message.getFieldWithDefault(msg, 1, 0),
format: jspb.Message.getFieldWithDefault(msg, 2, 0),
chunks: jspb.Message.getFieldWithDefault(msg, 3, 0),
hash: msg.getHash_asB64(),
metadata: (f = msg.getMetadata()) && proto.cosmos.base.snapshots.v1beta1.Metadata.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.cosmos.base.snapshots.v1beta1.Snapshot}
*/
proto.cosmos.base.snapshots.v1beta1.Snapshot.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cosmos.base.snapshots.v1beta1.Snapshot();
return proto.cosmos.base.snapshots.v1beta1.Snapshot.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cosmos.base.snapshots.v1beta1.Snapshot} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cosmos.base.snapshots.v1beta1.Snapshot}
*/
proto.cosmos.base.snapshots.v1beta1.Snapshot.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.setHeight(value);
break;
case 2:
var value =
/** @type {number} */
reader.readUint32();
msg.setFormat(value);
break;
case 3:
var value =
/** @type {number} */
reader.readUint32();
msg.setChunks(value);
break;
case 4:
var value =
/** @type {!Uint8Array} */
reader.readBytes();
msg.setHash(value);
break;
case 5:
var value = new proto.cosmos.base.snapshots.v1beta1.Metadata();
reader.readMessage(value, proto.cosmos.base.snapshots.v1beta1.Metadata.deserializeBinaryFromReader);
msg.setMetadata(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.cosmos.base.snapshots.v1beta1.Snapshot.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
proto.cosmos.base.snapshots.v1beta1.Snapshot.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.cosmos.base.snapshots.v1beta1.Snapshot} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cosmos.base.snapshots.v1beta1.Snapshot.serializeBinaryToWriter = function (message, writer) {
var f = undefined;
f = message.getHeight();
if (f !== 0) {
writer.writeUint64(1, f);
}
f = message.getFormat();
if (f !== 0) {
writer.writeUint32(2, f);
}
f = message.getChunks();
if (f !== 0) {
writer.writeUint32(3, f);
}
f = message.getHash_asU8();
if (f.length > 0) {
writer.writeBytes(4, f);
}
f = message.getMetadata();
if (f != null) {
writer.writeMessage(5, f, proto.cosmos.base.snapshots.v1beta1.Metadata.serializeBinaryToWriter);
}
};
/**
* optional uint64 height = 1;
* @return {number}
*/
proto.cosmos.base.snapshots.v1beta1.Snapshot.prototype.getHeight = function () {
return (
/** @type {number} */
jspb.Message.getFieldWithDefault(this, 1, 0)
);
};
/**
* @param {number} value
* @return {!proto.cosmos.base.snapshots.v1beta1.Snapshot} returns this
*/
proto.cosmos.base.snapshots.v1beta1.Snapshot.prototype.setHeight = function (value) {
return jspb.Message.setProto3IntField(this, 1, value);
};
/**
* optional uint32 format = 2;
* @return {number}
*/
proto.cosmos.base.snapshots.v1beta1.Snapshot.prototype.getFormat = function () {
return (
/** @type {number} */
jspb.Message.getFieldWithDefault(this, 2, 0)
);
};
/**
* @param {number} value
* @return {!proto.cosmos.base.snapshots.v1beta1.Snapshot} returns this
*/
proto.cosmos.base.snapshots.v1beta1.Snapshot.prototype.setFormat = function (value) {
return jspb.Message.setProto3IntField(this, 2, value);
};
/**
* optional uint32 chunks = 3;
* @return {number}
*/
proto.cosmos.base.snapshots.v1beta1.Snapshot.prototype.getChunks = function () {
return (
/** @type {number} */
jspb.Message.getFieldWithDefault(this, 3, 0)
);
};
/**
* @param {number} value
* @return {!proto.cosmos.base.snapshots.v1beta1.Snapshot} returns this
*/
proto.cosmos.base.snapshots.v1beta1.Snapshot.prototype.setChunks = function (value) {
return jspb.Message.setProto3IntField(this, 3, value);
};
/**
* optional bytes hash = 4;
* @return {!(string|Uint8Array)}
*/
proto.cosmos.base.snapshots.v1beta1.Snapshot.prototype.getHash = function () {
return (
/** @type {!(string|Uint8Array)} */
jspb.Message.getFieldWithDefault(this, 4, "")
);
};
/**
* optional bytes hash = 4;
* This is a type-conversion wrapper around `getHash()`
* @return {string}
*/
proto.cosmos.base.snapshots.v1beta1.Snapshot.prototype.getHash_asB64 = function () {
return (
/** @type {string} */
jspb.Message.bytesAsB64(this.getHash())
);
};
/**
* optional bytes hash = 4;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getHash()`
* @return {!Uint8Array}
*/
proto.cosmos.base.snapshots.v1beta1.Snapshot.prototype.getHash_asU8 = function () {
return (
/** @type {!Uint8Array} */
jspb.Message.bytesAsU8(this.getHash())
);
};
/**
* @param {!(string|Uint8Array)} value
* @return {!proto.cosmos.base.snapshots.v1beta1.Snapshot} returns this
*/
proto.cosmos.base.snapshots.v1beta1.Snapshot.prototype.setHash = function (value) {
return jspb.Message.setProto3BytesField(this, 4, value);
};
/**
* optional Metadata metadata = 5;
* @return {?proto.cosmos.base.snapshots.v1beta1.Metadata}
*/
proto.cosmos.base.snapshots.v1beta1.Snapshot.prototype.getMetadata = function () {
return (
/** @type{?proto.cosmos.base.snapshots.v1beta1.Metadata} */
jspb.Message.getWrapperField(this, proto.cosmos.base.snapshots.v1beta1.Metadata, 5)
);
};
/**
* @param {?proto.cosmos.base.snapshots.v1beta1.Metadata|undefined} value
* @return {!proto.cosmos.base.snapshots.v1beta1.Snapshot} returns this
*/
proto.cosmos.base.snapshots.v1beta1.Snapshot.prototype.setMetadata = function (value) {
return jspb.Message.setWrapperField(this, 5, value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.cosmos.base.snapshots.v1beta1.Snapshot} returns this
*/
proto.cosmos.base.snapshots.v1beta1.Snapshot.prototype.clearMetadata = function () {
return this.setMetadata(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.cosmos.base.snapshots.v1beta1.Snapshot.prototype.hasMetadata = function () {
return jspb.Message.getField(this, 5) != null;
};
/**
* List of repeated fields within this message type.
* @private {!Array<number>}
* @const
*/
proto.cosmos.base.snapshots.v1beta1.Metadata.repeatedFields_ = [1];
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.cosmos.base.snapshots.v1beta1.Metadata.prototype.toObject = function (opt_includeInstance) {
return proto.cosmos.base.snapshots.v1beta1.Metadata.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.cosmos.base.snapshots.v1beta1.Metadata} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cosmos.base.snapshots.v1beta1.Metadata.toObject = function (includeInstance, msg) {
var f,
obj = {
chunkHashesList: msg.getChunkHashesList_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.cosmos.base.snapshots.v1beta1.Metadata}
*/
proto.cosmos.base.snapshots.v1beta1.Metadata.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cosmos.base.snapshots.v1beta1.Metadata();
return proto.cosmos.base.snapshots.v1beta1.Metadata.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cosmos.base.snapshots.v1beta1.Metadata} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cosmos.base.snapshots.v1beta1.Metadata}
*/
proto.cosmos.base.snapshots.v1beta1.Metadata.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.addChunkHashes(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.cosmos.base.snapshots.v1beta1.Metadata.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
proto.cosmos.base.snapshots.v1beta1.Metadata.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.cosmos.base.snapshots.v1beta1.Metadata} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cosmos.base.snapshots.v1beta1.Metadata.serializeBinaryToWriter = function (message, writer) {
var f = undefined;
f = message.getChunkHashesList_asU8();
if (f.length > 0) {
writer.writeRepeatedBytes(1, f);
}
};
/**
* repeated bytes chunk_hashes = 1;
* @return {!(Array<!Uint8Array>|Array<string>)}
*/
proto.cosmos.base.snapshots.v1beta1.Metadata.prototype.getChunkHashesList = function () {
return (
/** @type {!(Array<!Uint8Array>|Array<string>)} */
jspb.Message.getRepeatedField(this, 1)
);
};
/**
* repeated bytes chunk_hashes = 1;
* This is a type-conversion wrapper around `getChunkHashesList()`
* @return {!Array<string>}
*/
proto.cosmos.base.snapshots.v1beta1.Metadata.prototype.getChunkHashesList_asB64 = function () {
return (
/** @type {!Array<string>} */
jspb.Message.bytesListAsB64(this.getChunkHashesList())
);
};
/**
* repeated bytes chunk_hashes = 1;
* Note that Uint8Array is not supported on all browsers.
* @see http://caniuse.com/Uint8Array
* This is a type-conversion wrapper around `getChunkHashesList()`
* @return {!Array<!Uint8Array>}
*/
proto.cosmos.base.snapshots.v1beta1.Metadata.prototype.getChunkHashesList_asU8 = function () {
return (
/** @type {!Array<!Uint8Array>} */
jspb.Message.bytesListAsU8(this.getChunkHashesList())
);
};
/**
* @param {!(Array<!Uint8Array>|Array<string>)} value
* @return {!proto.cosmos.base.snapshots.v1beta1.Metadata} returns this
*/
proto.cosmos.base.snapshots.v1beta1.Metadata.prototype.setChunkHashesList = function (value) {
return jspb.Message.setField(this, 1, value || []);
};
/**
* @param {!(string|Uint8Array)} value
* @param {number=} opt_index
* @return {!proto.cosmos.base.snapshots.v1beta1.Metadata} returns this
*/
proto.cosmos.base.snapshots.v1beta1.Metadata.prototype.addChunkHashes = function (value, opt_index) {
return jspb.Message.addToRepeatedField(this, 1, value, opt_index);
};
/**
* Clears the list making it empty but non-null.
* @return {!proto.cosmos.base.snapshots.v1beta1.Metadata} returns this
*/
proto.cosmos.base.snapshots.v1beta1.Metadata.prototype.clearChunkHashesList = function () {
return this.setChunkHashesList([]);
};
/**
* 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.cosmos.base.snapshots.v1beta1.SnapshotItem.oneofGroups_ = [[1, 2, 3, 4, 5, 6]];
/**
* @enum {number}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.ItemCase = {
ITEM_NOT_SET: 0,
STORE: 1,
IAVL: 2,
EXTENSION: 3,
EXTENSION_PAYLOAD: 4,
KV: 5,
SCHEMA: 6
};
/**
* @return {proto.cosmos.base.snapshots.v1beta1.SnapshotItem.ItemCase}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.getItemCase = function () {
return (
/** @type {proto.cosmos.base.snapshots.v1beta1.SnapshotItem.ItemCase} */
jspb.Message.computeOneofCase(this, proto.cosmos.base.snapshots.v1beta1.SnapshotItem.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.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.toObject = function (opt_includeInstance) {
return proto.cosmos.base.snapshots.v1beta1.SnapshotItem.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.cosmos.base.snapshots.v1beta1.SnapshotItem} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.toObject = function (includeInstance, msg) {
var f,
obj = {
store: (f = msg.getStore()) && proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem.toObject(includeInstance, f),
iavl: (f = msg.getIavl()) && proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem.toObject(includeInstance, f),
extension: (f = msg.getExtension$()) && proto.cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta.toObject(includeInstance, f),
extensionPayload: (f = msg.getExtensionPayload()) && proto.cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload.toObject(includeInstance, f),
kv: (f = msg.getKv()) && proto.cosmos.base.snapshots.v1beta1.SnapshotKVItem.toObject(includeInstance, f),
schema: (f = msg.getSchema()) && proto.cosmos.base.snapshots.v1beta1.SnapshotSchema.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.cosmos.base.snapshots.v1beta1.SnapshotItem}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cosmos.base.snapshots.v1beta1.SnapshotItem();
return proto.cosmos.base.snapshots.v1beta1.SnapshotItem.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cosmos.base.snapshots.v1beta1.SnapshotItem} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cosmos.base.snapshots.v1beta1.SnapshotItem}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.deserializeBinaryFromReader = function (msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
var value = new proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem();
reader.readMessage(value, proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem.deserializeBinaryFromReader);
msg.setStore(value);
break;
case 2:
var value = new proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem();
reader.readMessage(value, proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem.deserializeBinaryFromReader);
msg.setIavl(value);
break;
case 3:
var value = new proto.cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta();
reader.readMessage(value, proto.cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta.deserializeBinaryFromReader);
msg.setExtension$(value);
break;
case 4:
var value = new proto.cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload();
reader.readMessage(value, proto.cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload.deserializeBinaryFromReader);
msg.setExtensionPayload(value);
break;
case 5:
var value = new proto.cosmos.base.snapshots.v1beta1.SnapshotKVItem();
reader.readMessage(value, proto.cosmos.base.snapshots.v1beta1.SnapshotKVItem.deserializeBinaryFromReader);
msg.setKv(value);
break;
case 6:
var value = new proto.cosmos.base.snapshots.v1beta1.SnapshotSchema();
reader.readMessage(value, proto.cosmos.base.snapshots.v1beta1.SnapshotSchema.deserializeBinaryFromReader);
msg.setSchema(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.cosmos.base.snapshots.v1beta1.SnapshotItem} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.serializeBinaryToWriter = function (message, writer) {
var f = undefined;
f = message.getStore();
if (f != null) {
writer.writeMessage(1, f, proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem.serializeBinaryToWriter);
}
f = message.getIavl();
if (f != null) {
writer.writeMessage(2, f, proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem.serializeBinaryToWriter);
}
f = message.getExtension$();
if (f != null) {
writer.writeMessage(3, f, proto.cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta.serializeBinaryToWriter);
}
f = message.getExtensionPayload();
if (f != null) {
writer.writeMessage(4, f, proto.cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload.serializeBinaryToWriter);
}
f = message.getKv();
if (f != null) {
writer.writeMessage(5, f, proto.cosmos.base.snapshots.v1beta1.SnapshotKVItem.serializeBinaryToWriter);
}
f = message.getSchema();
if (f != null) {
writer.writeMessage(6, f, proto.cosmos.base.snapshots.v1beta1.SnapshotSchema.serializeBinaryToWriter);
}
};
/**
* optional SnapshotStoreItem store = 1;
* @return {?proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.getStore = function () {
return (
/** @type{?proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem} */
jspb.Message.getWrapperField(this, proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem, 1)
);
};
/**
* @param {?proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem|undefined} value
* @return {!proto.cosmos.base.snapshots.v1beta1.SnapshotItem} returns this
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.setStore = function (value) {
return jspb.Message.setOneofWrapperField(this, 1, proto.cosmos.base.snapshots.v1beta1.SnapshotItem.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.cosmos.base.snapshots.v1beta1.SnapshotItem} returns this
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.clearStore = function () {
return this.setStore(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.hasStore = function () {
return jspb.Message.getField(this, 1) != null;
};
/**
* optional SnapshotIAVLItem iavl = 2;
* @return {?proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.getIavl = function () {
return (
/** @type{?proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem} */
jspb.Message.getWrapperField(this, proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem, 2)
);
};
/**
* @param {?proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem|undefined} value
* @return {!proto.cosmos.base.snapshots.v1beta1.SnapshotItem} returns this
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.setIavl = function (value) {
return jspb.Message.setOneofWrapperField(this, 2, proto.cosmos.base.snapshots.v1beta1.SnapshotItem.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.cosmos.base.snapshots.v1beta1.SnapshotItem} returns this
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.clearIavl = function () {
return this.setIavl(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.hasIavl = function () {
return jspb.Message.getField(this, 2) != null;
};
/**
* optional SnapshotExtensionMeta extension = 3;
* @return {?proto.cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.getExtension$ = function () {
return (
/** @type{?proto.cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta} */
jspb.Message.getWrapperField(this, proto.cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta, 3)
);
};
/**
* @param {?proto.cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta|undefined} value
* @return {!proto.cosmos.base.snapshots.v1beta1.SnapshotItem} returns this
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.setExtension$ = function (value) {
return jspb.Message.setOneofWrapperField(this, 3, proto.cosmos.base.snapshots.v1beta1.SnapshotItem.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.cosmos.base.snapshots.v1beta1.SnapshotItem} returns this
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.clearExtension$ = function () {
return this.setExtension$(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.hasExtension$ = function () {
return jspb.Message.getField(this, 3) != null;
};
/**
* optional SnapshotExtensionPayload extension_payload = 4;
* @return {?proto.cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.getExtensionPayload = function () {
return (
/** @type{?proto.cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload} */
jspb.Message.getWrapperField(this, proto.cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload, 4)
);
};
/**
* @param {?proto.cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload|undefined} value
* @return {!proto.cosmos.base.snapshots.v1beta1.SnapshotItem} returns this
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.setExtensionPayload = function (value) {
return jspb.Message.setOneofWrapperField(this, 4, proto.cosmos.base.snapshots.v1beta1.SnapshotItem.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.cosmos.base.snapshots.v1beta1.SnapshotItem} returns this
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.clearExtensionPayload = function () {
return this.setExtensionPayload(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.hasExtensionPayload = function () {
return jspb.Message.getField(this, 4) != null;
};
/**
* optional SnapshotKVItem kv = 5;
* @return {?proto.cosmos.base.snapshots.v1beta1.SnapshotKVItem}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.getKv = function () {
return (
/** @type{?proto.cosmos.base.snapshots.v1beta1.SnapshotKVItem} */
jspb.Message.getWrapperField(this, proto.cosmos.base.snapshots.v1beta1.SnapshotKVItem, 5)
);
};
/**
* @param {?proto.cosmos.base.snapshots.v1beta1.SnapshotKVItem|undefined} value
* @return {!proto.cosmos.base.snapshots.v1beta1.SnapshotItem} returns this
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.setKv = function (value) {
return jspb.Message.setOneofWrapperField(this, 5, proto.cosmos.base.snapshots.v1beta1.SnapshotItem.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.cosmos.base.snapshots.v1beta1.SnapshotItem} returns this
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.clearKv = function () {
return this.setKv(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.hasKv = function () {
return jspb.Message.getField(this, 5) != null;
};
/**
* optional SnapshotSchema schema = 6;
* @return {?proto.cosmos.base.snapshots.v1beta1.SnapshotSchema}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.getSchema = function () {
return (
/** @type{?proto.cosmos.base.snapshots.v1beta1.SnapshotSchema} */
jspb.Message.getWrapperField(this, proto.cosmos.base.snapshots.v1beta1.SnapshotSchema, 6)
);
};
/**
* @param {?proto.cosmos.base.snapshots.v1beta1.SnapshotSchema|undefined} value
* @return {!proto.cosmos.base.snapshots.v1beta1.SnapshotItem} returns this
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.setSchema = function (value) {
return jspb.Message.setOneofWrapperField(this, 6, proto.cosmos.base.snapshots.v1beta1.SnapshotItem.oneofGroups_[0], value);
};
/**
* Clears the message field making it undefined.
* @return {!proto.cosmos.base.snapshots.v1beta1.SnapshotItem} returns this
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.clearSchema = function () {
return this.setSchema(undefined);
};
/**
* Returns whether this field is set.
* @return {boolean}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotItem.prototype.hasSchema = function () {
return jspb.Message.getField(this, 6) != 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.cosmos.base.snapshots.v1beta1.SnapshotStoreItem.prototype.toObject = function (opt_includeInstance) {
return proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem.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.cosmos.base.snapshots.v1beta1.SnapshotStoreItem} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem.toObject = function (includeInstance, msg) {
var f,
obj = {
name: jspb.Message.getFieldWithDefault(msg, 1, "")
};
if (includeInstance) {
obj.$jspbMessageInstance = msg;
}
return obj;
};
}
/**
* Deserializes binary data (in protobuf wire format).
* @param {jspb.ByteSource} bytes The bytes to deserialize.
* @return {!proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem();
return proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem.deserializeBinaryFromReader = function (msg, reader) {
while (reader.nextField()) {
if (reader.isEndGroup()) {
break;
}
var field = reader.getFieldNumber();
switch (field) {
case 1:
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.cosmos.base.snapshots.v1beta1.SnapshotStoreItem.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem.serializeBinaryToWriter = function (message, writer) {
var f = undefined;
f = message.getName();
if (f.length > 0) {
writer.writeString(1, f);
}
};
/**
* optional string name = 1;
* @return {string}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem.prototype.getName = function () {
return (
/** @type {string} */
jspb.Message.getFieldWithDefault(this, 1, "")
);
};
/**
* @param {string} value
* @return {!proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem} returns this
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotStoreItem.prototype.setName = function (value) {
return jspb.Message.setProto3StringField(this, 1, 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.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem.prototype.toObject = function (opt_includeInstance) {
return proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem.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.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem} msg The msg instance to transform.
* @return {!Object}
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem.toObject = function (includeInstance, msg) {
var f,
obj = {
key: msg.getKey_asB64(),
value: msg.getValue_asB64(),
version: jspb.Message.getFieldWithDefault(msg, 3, 0),
height: 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.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem.deserializeBinary = function (bytes) {
var reader = new jspb.BinaryReader(bytes);
var msg = new proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem();
return proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem.deserializeBinaryFromReader(msg, reader);
};
/**
* Deserializes binary data (in protobuf wire format) from the
* given reader into the given message object.
* @param {!proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem} msg The message object to deserialize into.
* @param {!jspb.BinaryReader} reader The BinaryReader to use.
* @return {!proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem.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 =
/** @type {number} */
reader.readInt64();
msg.setVersion(value);
break;
case 4:
var value =
/** @type {number} */
reader.readInt32();
msg.setHeight(value);
break;
default:
reader.skipField();
break;
}
}
return msg;
};
/**
* Serializes the message to binary data (in protobuf wire format).
* @return {!Uint8Array}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem.prototype.serializeBinary = function () {
var writer = new jspb.BinaryWriter();
proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem.serializeBinaryToWriter(this, writer);
return writer.getResultBuffer();
};
/**
* Serializes the given message to binary data (in protobuf wire
* format), writing to the given BinaryWriter.
* @param {!proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem} message
* @param {!jspb.BinaryWriter} writer
* @suppress {unusedLocalVariables} f is only used for nested messages
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem.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.getVersion();
if (f !== 0) {
writer.writeInt64(3, f);
}
f = message.getHeight();
if (f !== 0) {
writer.writeInt32(4, f);
}
};
/**
* optional bytes key = 1;
* @return {!(string|Uint8Array)}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem.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.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem.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.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem.prototype.getKey_asU8 = function () {
return (
/** @type {!Uint8Array} */
jspb.Message.bytesAsU8(this.getKey())
);
};
/**
* @param {!(string|Uint8Array)} value
* @return {!proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem} returns this
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem.prototype.setKey = function (value) {
return jspb.Message.setProto3BytesField(this, 1, value);
};
/**
* optional bytes value = 2;
* @return {!(string|Uint8Array)}
*/
proto.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem.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.cosmos.base.snapshots.v1beta1.SnapshotIAVLItem.prototype.getValue_asB64 = function () {
return (
/** @type {string} */
jspb.Message.bytesAsB64(this.getValue())
);
};
/**
* optional bytes value = 2;
* Note that Uint8Array