//@ts-nocheck
import { IidDocument } from "./iid";
import * as _m0 from "protobufjs/minimal";
/** GenesisState defines the did module's genesis state. */

/** GenesisState defines the did module's genesis state. */

function createBaseGenesisState() {
  return {
    iidDocs: []
  };
}
export const GenesisState = {
  encode(message, writer = _m0.Writer.create()) {
    for (const v of message.iidDocs) {
      IidDocument.encode(v, writer.uint32(10).fork()).ldelim();
    }
    return writer;
  },
  decode(input, length) {
    const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
    let end = length === undefined ? reader.len : reader.pos + length;
    const message = createBaseGenesisState();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.iidDocs.push(IidDocument.decode(reader, reader.uint32()));
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      iidDocs: Array.isArray(object === null || object === void 0 ? void 0 : object.iidDocs) ? object.iidDocs.map(e => IidDocument.fromJSON(e)) : []
    };
  },
  toJSON(message) {
    const obj = {};
    if (message.iidDocs) {
      obj.iidDocs = message.iidDocs.map(e => e ? IidDocument.toJSON(e) : undefined);
    } else {
      obj.iidDocs = [];
    }
    return obj;
  },
  fromPartial(object) {
    var _object$iidDocs;
    const message = createBaseGenesisState();
    message.iidDocs = ((_object$iidDocs = object.iidDocs) === null || _object$iidDocs === void 0 ? void 0 : _object$iidDocs.map(e => IidDocument.fromPartial(e))) || [];
    return message;
  }
};