"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.GenesisState = void 0;
var _exercised_amount = require("./exercised_amount");
var _params = require("./params");
var _bounty = require("./bounty");
var _user = require("./user");
var _repository = require("./repository");
var _member = require("./member");
var _tag = require("./tag");
var _branch = require("./branch");
var _task = require("./task");
var _release = require("./release");
var _pullRequest = require("./pullRequest");
var _dao = require("./dao");
var _comment = require("./comment");
var _issue = require("./issue");
var _whois = require("./whois");
var _binary = require("../binary");
var _helpers = require("../helpers");
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
/** GenesisState defines the gitopia module's genesis state. */

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

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

function createBaseGenesisState() {
  return {
    exercisedAmountList: [],
    exercisedAmountCount: BigInt(0),
    params: _params.Params.fromPartial({}),
    bountyList: [],
    bountyCount: BigInt(0),
    userDaoList: [],
    baseRepositoryKeyList: [],
    memberList: [],
    memberCount: BigInt(0),
    tagList: [],
    tagCount: BigInt(0),
    branchList: [],
    branchCount: BigInt(0),
    taskList: [],
    taskCount: BigInt(0),
    releaseList: [],
    releaseCount: BigInt(0),
    pullRequestList: [],
    pullRequestCount: BigInt(0),
    daoList: [],
    daoCount: BigInt(0),
    commentList: [],
    commentCount: BigInt(0),
    issueList: [],
    issueCount: BigInt(0),
    repositoryList: [],
    repositoryCount: BigInt(0),
    userList: [],
    userCount: BigInt(0),
    whoisList: [],
    whoisCount: BigInt(0)
  };
}
var GenesisState = exports.GenesisState = {
  typeUrl: "/gitopia.gitopia.gitopia.GenesisState",
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _binary.BinaryWriter.create();
    var _iterator = _createForOfIteratorHelper(message.exercisedAmountList),
      _step;
    try {
      for (_iterator.s(); !(_step = _iterator.n()).done;) {
        var v = _step.value;
        _exercised_amount.ExercisedAmount.encode(v, writer.uint32(242).fork()).ldelim();
      }
    } catch (err) {
      _iterator.e(err);
    } finally {
      _iterator.f();
    }
    if (message.exercisedAmountCount !== BigInt(0)) {
      writer.uint32(248).uint64(message.exercisedAmountCount);
    }
    if (message.params !== undefined) {
      _params.Params.encode(message.params, writer.uint32(234).fork()).ldelim();
    }
    var _iterator2 = _createForOfIteratorHelper(message.bountyList),
      _step2;
    try {
      for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
        var _v = _step2.value;
        _bounty.Bounty.encode(_v, writer.uint32(218).fork()).ldelim();
      }
    } catch (err) {
      _iterator2.e(err);
    } finally {
      _iterator2.f();
    }
    if (message.bountyCount !== BigInt(0)) {
      writer.uint32(224).uint64(message.bountyCount);
    }
    var _iterator3 = _createForOfIteratorHelper(message.userDaoList),
      _step3;
    try {
      for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
        var _v2 = _step3.value;
        _user.UserDao.encode(_v2, writer.uint32(202).fork()).ldelim();
      }
    } catch (err) {
      _iterator3.e(err);
    } finally {
      _iterator3.f();
    }
    var _iterator4 = _createForOfIteratorHelper(message.baseRepositoryKeyList),
      _step4;
    try {
      for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
        var _v3 = _step4.value;
        _repository.BaseRepositoryKey.encode(_v3, writer.uint32(210).fork()).ldelim();
      }
    } catch (err) {
      _iterator4.e(err);
    } finally {
      _iterator4.f();
    }
    var _iterator5 = _createForOfIteratorHelper(message.memberList),
      _step5;
    try {
      for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
        var _v4 = _step5.value;
        _member.Member.encode(_v4, writer.uint32(186).fork()).ldelim();
      }
    } catch (err) {
      _iterator5.e(err);
    } finally {
      _iterator5.f();
    }
    if (message.memberCount !== BigInt(0)) {
      writer.uint32(192).uint64(message.memberCount);
    }
    var _iterator6 = _createForOfIteratorHelper(message.tagList),
      _step6;
    try {
      for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {
        var _v5 = _step6.value;
        _tag.Tag.encode(_v5, writer.uint32(170).fork()).ldelim();
      }
    } catch (err) {
      _iterator6.e(err);
    } finally {
      _iterator6.f();
    }
    if (message.tagCount !== BigInt(0)) {
      writer.uint32(176).uint64(message.tagCount);
    }
    var _iterator7 = _createForOfIteratorHelper(message.branchList),
      _step7;
    try {
      for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {
        var _v6 = _step7.value;
        _branch.Branch.encode(_v6, writer.uint32(154).fork()).ldelim();
      }
    } catch (err) {
      _iterator7.e(err);
    } finally {
      _iterator7.f();
    }
    if (message.branchCount !== BigInt(0)) {
      writer.uint32(160).uint64(message.branchCount);
    }
    var _iterator8 = _createForOfIteratorHelper(message.taskList),
      _step8;
    try {
      for (_iterator8.s(); !(_step8 = _iterator8.n()).done;) {
        var _v7 = _step8.value;
        _task.Task.encode(_v7, writer.uint32(138).fork()).ldelim();
      }
    } catch (err) {
      _iterator8.e(err);
    } finally {
      _iterator8.f();
    }
    if (message.taskCount !== BigInt(0)) {
      writer.uint32(144).uint64(message.taskCount);
    }
    var _iterator9 = _createForOfIteratorHelper(message.releaseList),
      _step9;
    try {
      for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {
        var _v8 = _step9.value;
        _release.Release.encode(_v8, writer.uint32(122).fork()).ldelim();
      }
    } catch (err) {
      _iterator9.e(err);
    } finally {
      _iterator9.f();
    }
    if (message.releaseCount !== BigInt(0)) {
      writer.uint32(128).uint64(message.releaseCount);
    }
    var _iterator10 = _createForOfIteratorHelper(message.pullRequestList),
      _step10;
    try {
      for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {
        var _v9 = _step10.value;
        _pullRequest.PullRequest.encode(_v9, writer.uint32(106).fork()).ldelim();
      }
    } catch (err) {
      _iterator10.e(err);
    } finally {
      _iterator10.f();
    }
    if (message.pullRequestCount !== BigInt(0)) {
      writer.uint32(112).uint64(message.pullRequestCount);
    }
    var _iterator11 = _createForOfIteratorHelper(message.daoList),
      _step11;
    try {
      for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {
        var _v10 = _step11.value;
        _dao.Dao.encode(_v10, writer.uint32(90).fork()).ldelim();
      }
    } catch (err) {
      _iterator11.e(err);
    } finally {
      _iterator11.f();
    }
    if (message.daoCount !== BigInt(0)) {
      writer.uint32(96).uint64(message.daoCount);
    }
    var _iterator12 = _createForOfIteratorHelper(message.commentList),
      _step12;
    try {
      for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {
        var _v11 = _step12.value;
        _comment.Comment.encode(_v11, writer.uint32(74).fork()).ldelim();
      }
    } catch (err) {
      _iterator12.e(err);
    } finally {
      _iterator12.f();
    }
    if (message.commentCount !== BigInt(0)) {
      writer.uint32(80).uint64(message.commentCount);
    }
    var _iterator13 = _createForOfIteratorHelper(message.issueList),
      _step13;
    try {
      for (_iterator13.s(); !(_step13 = _iterator13.n()).done;) {
        var _v12 = _step13.value;
        _issue.Issue.encode(_v12, writer.uint32(58).fork()).ldelim();
      }
    } catch (err) {
      _iterator13.e(err);
    } finally {
      _iterator13.f();
    }
    if (message.issueCount !== BigInt(0)) {
      writer.uint32(64).uint64(message.issueCount);
    }
    var _iterator14 = _createForOfIteratorHelper(message.repositoryList),
      _step14;
    try {
      for (_iterator14.s(); !(_step14 = _iterator14.n()).done;) {
        var _v13 = _step14.value;
        _repository.Repository.encode(_v13, writer.uint32(42).fork()).ldelim();
      }
    } catch (err) {
      _iterator14.e(err);
    } finally {
      _iterator14.f();
    }
    if (message.repositoryCount !== BigInt(0)) {
      writer.uint32(48).uint64(message.repositoryCount);
    }
    var _iterator15 = _createForOfIteratorHelper(message.userList),
      _step15;
    try {
      for (_iterator15.s(); !(_step15 = _iterator15.n()).done;) {
        var _v14 = _step15.value;
        _user.User.encode(_v14, writer.uint32(26).fork()).ldelim();
      }
    } catch (err) {
      _iterator15.e(err);
    } finally {
      _iterator15.f();
    }
    if (message.userCount !== BigInt(0)) {
      writer.uint32(32).uint64(message.userCount);
    }
    var _iterator16 = _createForOfIteratorHelper(message.whoisList),
      _step16;
    try {
      for (_iterator16.s(); !(_step16 = _iterator16.n()).done;) {
        var _v15 = _step16.value;
        _whois.Whois.encode(_v15, writer.uint32(10).fork()).ldelim();
      }
    } catch (err) {
      _iterator16.e(err);
    } finally {
      _iterator16.f();
    }
    if (message.whoisCount !== BigInt(0)) {
      writer.uint32(16).uint64(message.whoisCount);
    }
    return writer;
  },
  fromJSON: function fromJSON(object) {
    return {
      exercisedAmountList: Array.isArray(object === null || object === void 0 ? void 0 : object.exercisedAmountList) ? object.exercisedAmountList.map(function (e) {
        return _exercised_amount.ExercisedAmount.fromJSON(e);
      }) : [],
      exercisedAmountCount: (0, _helpers.isSet)(object.exercisedAmountCount) ? BigInt(object.exercisedAmountCount.toString()) : BigInt(0),
      params: (0, _helpers.isSet)(object.params) ? _params.Params.fromJSON(object.params) : undefined,
      bountyList: Array.isArray(object === null || object === void 0 ? void 0 : object.bountyList) ? object.bountyList.map(function (e) {
        return _bounty.Bounty.fromJSON(e);
      }) : [],
      bountyCount: (0, _helpers.isSet)(object.bountyCount) ? BigInt(object.bountyCount.toString()) : BigInt(0),
      userDaoList: Array.isArray(object === null || object === void 0 ? void 0 : object.userDaoList) ? object.userDaoList.map(function (e) {
        return _user.UserDao.fromJSON(e);
      }) : [],
      baseRepositoryKeyList: Array.isArray(object === null || object === void 0 ? void 0 : object.baseRepositoryKeyList) ? object.baseRepositoryKeyList.map(function (e) {
        return _repository.BaseRepositoryKey.fromJSON(e);
      }) : [],
      memberList: Array.isArray(object === null || object === void 0 ? void 0 : object.memberList) ? object.memberList.map(function (e) {
        return _member.Member.fromJSON(e);
      }) : [],
      memberCount: (0, _helpers.isSet)(object.memberCount) ? BigInt(object.memberCount.toString()) : BigInt(0),
      tagList: Array.isArray(object === null || object === void 0 ? void 0 : object.tagList) ? object.tagList.map(function (e) {
        return _tag.Tag.fromJSON(e);
      }) : [],
      tagCount: (0, _helpers.isSet)(object.tagCount) ? BigInt(object.tagCount.toString()) : BigInt(0),
      branchList: Array.isArray(object === null || object === void 0 ? void 0 : object.branchList) ? object.branchList.map(function (e) {
        return _branch.Branch.fromJSON(e);
      }) : [],
      branchCount: (0, _helpers.isSet)(object.branchCount) ? BigInt(object.branchCount.toString()) : BigInt(0),
      taskList: Array.isArray(object === null || object === void 0 ? void 0 : object.taskList) ? object.taskList.map(function (e) {
        return _task.Task.fromJSON(e);
      }) : [],
      taskCount: (0, _helpers.isSet)(object.taskCount) ? BigInt(object.taskCount.toString()) : BigInt(0),
      releaseList: Array.isArray(object === null || object === void 0 ? void 0 : object.releaseList) ? object.releaseList.map(function (e) {
        return _release.Release.fromJSON(e);
      }) : [],
      releaseCount: (0, _helpers.isSet)(object.releaseCount) ? BigInt(object.releaseCount.toString()) : BigInt(0),
      pullRequestList: Array.isArray(object === null || object === void 0 ? void 0 : object.pullRequestList) ? object.pullRequestList.map(function (e) {
        return _pullRequest.PullRequest.fromJSON(e);
      }) : [],
      pullRequestCount: (0, _helpers.isSet)(object.pullRequestCount) ? BigInt(object.pullRequestCount.toString()) : BigInt(0),
      daoList: Array.isArray(object === null || object === void 0 ? void 0 : object.daoList) ? object.daoList.map(function (e) {
        return _dao.Dao.fromJSON(e);
      }) : [],
      daoCount: (0, _helpers.isSet)(object.daoCount) ? BigInt(object.daoCount.toString()) : BigInt(0),
      commentList: Array.isArray(object === null || object === void 0 ? void 0 : object.commentList) ? object.commentList.map(function (e) {
        return _comment.Comment.fromJSON(e);
      }) : [],
      commentCount: (0, _helpers.isSet)(object.commentCount) ? BigInt(object.commentCount.toString()) : BigInt(0),
      issueList: Array.isArray(object === null || object === void 0 ? void 0 : object.issueList) ? object.issueList.map(function (e) {
        return _issue.Issue.fromJSON(e);
      }) : [],
      issueCount: (0, _helpers.isSet)(object.issueCount) ? BigInt(object.issueCount.toString()) : BigInt(0),
      repositoryList: Array.isArray(object === null || object === void 0 ? void 0 : object.repositoryList) ? object.repositoryList.map(function (e) {
        return _repository.Repository.fromJSON(e);
      }) : [],
      repositoryCount: (0, _helpers.isSet)(object.repositoryCount) ? BigInt(object.repositoryCount.toString()) : BigInt(0),
      userList: Array.isArray(object === null || object === void 0 ? void 0 : object.userList) ? object.userList.map(function (e) {
        return _user.User.fromJSON(e);
      }) : [],
      userCount: (0, _helpers.isSet)(object.userCount) ? BigInt(object.userCount.toString()) : BigInt(0),
      whoisList: Array.isArray(object === null || object === void 0 ? void 0 : object.whoisList) ? object.whoisList.map(function (e) {
        return _whois.Whois.fromJSON(e);
      }) : [],
      whoisCount: (0, _helpers.isSet)(object.whoisCount) ? BigInt(object.whoisCount.toString()) : BigInt(0)
    };
  },
  fromPartial: function fromPartial(object) {
    var _object$exercisedAmou, _object$bountyList, _object$userDaoList, _object$baseRepositor, _object$memberList, _object$tagList, _object$branchList, _object$taskList, _object$releaseList, _object$pullRequestLi, _object$daoList, _object$commentList, _object$issueList, _object$repositoryLis, _object$userList, _object$whoisList;
    var message = createBaseGenesisState();
    message.exercisedAmountList = ((_object$exercisedAmou = object.exercisedAmountList) === null || _object$exercisedAmou === void 0 ? void 0 : _object$exercisedAmou.map(function (e) {
      return _exercised_amount.ExercisedAmount.fromPartial(e);
    })) || [];
    message.exercisedAmountCount = object.exercisedAmountCount !== undefined && object.exercisedAmountCount !== null ? BigInt(object.exercisedAmountCount.toString()) : BigInt(0);
    message.params = object.params !== undefined && object.params !== null ? _params.Params.fromPartial(object.params) : undefined;
    message.bountyList = ((_object$bountyList = object.bountyList) === null || _object$bountyList === void 0 ? void 0 : _object$bountyList.map(function (e) {
      return _bounty.Bounty.fromPartial(e);
    })) || [];
    message.bountyCount = object.bountyCount !== undefined && object.bountyCount !== null ? BigInt(object.bountyCount.toString()) : BigInt(0);
    message.userDaoList = ((_object$userDaoList = object.userDaoList) === null || _object$userDaoList === void 0 ? void 0 : _object$userDaoList.map(function (e) {
      return _user.UserDao.fromPartial(e);
    })) || [];
    message.baseRepositoryKeyList = ((_object$baseRepositor = object.baseRepositoryKeyList) === null || _object$baseRepositor === void 0 ? void 0 : _object$baseRepositor.map(function (e) {
      return _repository.BaseRepositoryKey.fromPartial(e);
    })) || [];
    message.memberList = ((_object$memberList = object.memberList) === null || _object$memberList === void 0 ? void 0 : _object$memberList.map(function (e) {
      return _member.Member.fromPartial(e);
    })) || [];
    message.memberCount = object.memberCount !== undefined && object.memberCount !== null ? BigInt(object.memberCount.toString()) : BigInt(0);
    message.tagList = ((_object$tagList = object.tagList) === null || _object$tagList === void 0 ? void 0 : _object$tagList.map(function (e) {
      return _tag.Tag.fromPartial(e);
    })) || [];
    message.tagCount = object.tagCount !== undefined && object.tagCount !== null ? BigInt(object.tagCount.toString()) : BigInt(0);
    message.branchList = ((_object$branchList = object.branchList) === null || _object$branchList === void 0 ? void 0 : _object$branchList.map(function (e) {
      return _branch.Branch.fromPartial(e);
    })) || [];
    message.branchCount = object.branchCount !== undefined && object.branchCount !== null ? BigInt(object.branchCount.toString()) : BigInt(0);
    message.taskList = ((_object$taskList = object.taskList) === null || _object$taskList === void 0 ? void 0 : _object$taskList.map(function (e) {
      return _task.Task.fromPartial(e);
    })) || [];
    message.taskCount = object.taskCount !== undefined && object.taskCount !== null ? BigInt(object.taskCount.toString()) : BigInt(0);
    message.releaseList = ((_object$releaseList = object.releaseList) === null || _object$releaseList === void 0 ? void 0 : _object$releaseList.map(function (e) {
      return _release.Release.fromPartial(e);
    })) || [];
    message.releaseCount = object.releaseCount !== undefined && object.releaseCount !== null ? BigInt(object.releaseCount.toString()) : BigInt(0);
    message.pullRequestList = ((_object$pullRequestLi = object.pullRequestList) === null || _object$pullRequestLi === void 0 ? void 0 : _object$pullRequestLi.map(function (e) {
      return _pullRequest.PullRequest.fromPartial(e);
    })) || [];
    message.pullRequestCount = object.pullRequestCount !== undefined && object.pullRequestCount !== null ? BigInt(object.pullRequestCount.toString()) : BigInt(0);
    message.daoList = ((_object$daoList = object.daoList) === null || _object$daoList === void 0 ? void 0 : _object$daoList.map(function (e) {
      return _dao.Dao.fromPartial(e);
    })) || [];
    message.daoCount = object.daoCount !== undefined && object.daoCount !== null ? BigInt(object.daoCount.toString()) : BigInt(0);
    message.commentList = ((_object$commentList = object.commentList) === null || _object$commentList === void 0 ? void 0 : _object$commentList.map(function (e) {
      return _comment.Comment.fromPartial(e);
    })) || [];
    message.commentCount = object.commentCount !== undefined && object.commentCount !== null ? BigInt(object.commentCount.toString()) : BigInt(0);
    message.issueList = ((_object$issueList = object.issueList) === null || _object$issueList === void 0 ? void 0 : _object$issueList.map(function (e) {
      return _issue.Issue.fromPartial(e);
    })) || [];
    message.issueCount = object.issueCount !== undefined && object.issueCount !== null ? BigInt(object.issueCount.toString()) : BigInt(0);
    message.repositoryList = ((_object$repositoryLis = object.repositoryList) === null || _object$repositoryLis === void 0 ? void 0 : _object$repositoryLis.map(function (e) {
      return _repository.Repository.fromPartial(e);
    })) || [];
    message.repositoryCount = object.repositoryCount !== undefined && object.repositoryCount !== null ? BigInt(object.repositoryCount.toString()) : BigInt(0);
    message.userList = ((_object$userList = object.userList) === null || _object$userList === void 0 ? void 0 : _object$userList.map(function (e) {
      return _user.User.fromPartial(e);
    })) || [];
    message.userCount = object.userCount !== undefined && object.userCount !== null ? BigInt(object.userCount.toString()) : BigInt(0);
    message.whoisList = ((_object$whoisList = object.whoisList) === null || _object$whoisList === void 0 ? void 0 : _object$whoisList.map(function (e) {
      return _whois.Whois.fromPartial(e);
    })) || [];
    message.whoisCount = object.whoisCount !== undefined && object.whoisCount !== null ? BigInt(object.whoisCount.toString()) : BigInt(0);
    return message;
  },
  fromAmino: function fromAmino(object) {
    var _object$exercisedAmou2, _object$bountyList2, _object$userDaoList2, _object$baseRepositor2, _object$memberList2, _object$tagList2, _object$branchList2, _object$taskList2, _object$releaseList2, _object$pullRequestLi2, _object$daoList2, _object$commentList2, _object$issueList2, _object$repositoryLis2, _object$userList2, _object$whoisList2;
    var message = createBaseGenesisState();
    message.exercisedAmountList = ((_object$exercisedAmou2 = object.exercisedAmountList) === null || _object$exercisedAmou2 === void 0 ? void 0 : _object$exercisedAmou2.map(function (e) {
      return _exercised_amount.ExercisedAmount.fromAmino(e);
    })) || [];
    if (object.exercisedAmountCount !== undefined && object.exercisedAmountCount !== null) {
      message.exercisedAmountCount = BigInt(object.exercisedAmountCount);
    }
    if (object.params !== undefined && object.params !== null) {
      message.params = _params.Params.fromAmino(object.params);
    }
    message.bountyList = ((_object$bountyList2 = object.bountyList) === null || _object$bountyList2 === void 0 ? void 0 : _object$bountyList2.map(function (e) {
      return _bounty.Bounty.fromAmino(e);
    })) || [];
    if (object.bountyCount !== undefined && object.bountyCount !== null) {
      message.bountyCount = BigInt(object.bountyCount);
    }
    message.userDaoList = ((_object$userDaoList2 = object.userDaoList) === null || _object$userDaoList2 === void 0 ? void 0 : _object$userDaoList2.map(function (e) {
      return _user.UserDao.fromAmino(e);
    })) || [];
    message.baseRepositoryKeyList = ((_object$baseRepositor2 = object.baseRepositoryKeyList) === null || _object$baseRepositor2 === void 0 ? void 0 : _object$baseRepositor2.map(function (e) {
      return _repository.BaseRepositoryKey.fromAmino(e);
    })) || [];
    message.memberList = ((_object$memberList2 = object.memberList) === null || _object$memberList2 === void 0 ? void 0 : _object$memberList2.map(function (e) {
      return _member.Member.fromAmino(e);
    })) || [];
    if (object.memberCount !== undefined && object.memberCount !== null) {
      message.memberCount = BigInt(object.memberCount);
    }
    message.tagList = ((_object$tagList2 = object.tagList) === null || _object$tagList2 === void 0 ? void 0 : _object$tagList2.map(function (e) {
      return _tag.Tag.fromAmino(e);
    })) || [];
    if (object.tagCount !== undefined && object.tagCount !== null) {
      message.tagCount = BigInt(object.tagCount);
    }
    message.branchList = ((_object$branchList2 = object.branchList) === null || _object$branchList2 === void 0 ? void 0 : _object$branchList2.map(function (e) {
      return _branch.Branch.fromAmino(e);
    })) || [];
    if (object.branchCount !== undefined && object.branchCount !== null) {
      message.branchCount = BigInt(object.branchCount);
    }
    message.taskList = ((_object$taskList2 = object.taskList) === null || _object$taskList2 === void 0 ? void 0 : _object$taskList2.map(function (e) {
      return _task.Task.fromAmino(e);
    })) || [];
    if (object.taskCount !== undefined && object.taskCount !== null) {
      message.taskCount = BigInt(object.taskCount);
    }
    message.releaseList = ((_object$releaseList2 = object.releaseList) === null || _object$releaseList2 === void 0 ? void 0 : _object$releaseList2.map(function (e) {
      return _release.Release.fromAmino(e);
    })) || [];
    if (object.releaseCount !== undefined && object.releaseCount !== null) {
      message.releaseCount = BigInt(object.releaseCount);
    }
    message.pullRequestList = ((_object$pullRequestLi2 = object.pullRequestList) === null || _object$pullRequestLi2 === void 0 ? void 0 : _object$pullRequestLi2.map(function (e) {
      return _pullRequest.PullRequest.fromAmino(e);
    })) || [];
    if (object.pullRequestCount !== undefined && object.pullRequestCount !== null) {
      message.pullRequestCount = BigInt(object.pullRequestCount);
    }
    message.daoList = ((_object$daoList2 = object.daoList) === null || _object$daoList2 === void 0 ? void 0 : _object$daoList2.map(function (e) {
      return _dao.Dao.fromAmino(e);
    })) || [];
    if (object.daoCount !== undefined && object.daoCount !== null) {
      message.daoCount = BigInt(object.daoCount);
    }
    message.commentList = ((_object$commentList2 = object.commentList) === null || _object$commentList2 === void 0 ? void 0 : _object$commentList2.map(function (e) {
      return _comment.Comment.fromAmino(e);
    })) || [];
    if (object.commentCount !== undefined && object.commentCount !== null) {
      message.commentCount = BigInt(object.commentCount);
    }
    message.issueList = ((_object$issueList2 = object.issueList) === null || _object$issueList2 === void 0 ? void 0 : _object$issueList2.map(function (e) {
      return _issue.Issue.fromAmino(e);
    })) || [];
    if (object.issueCount !== undefined && object.issueCount !== null) {
      message.issueCount = BigInt(object.issueCount);
    }
    message.repositoryList = ((_object$repositoryLis2 = object.repositoryList) === null || _object$repositoryLis2 === void 0 ? void 0 : _object$repositoryLis2.map(function (e) {
      return _repository.Repository.fromAmino(e);
    })) || [];
    if (object.repositoryCount !== undefined && object.repositoryCount !== null) {
      message.repositoryCount = BigInt(object.repositoryCount);
    }
    message.userList = ((_object$userList2 = object.userList) === null || _object$userList2 === void 0 ? void 0 : _object$userList2.map(function (e) {
      return _user.User.fromAmino(e);
    })) || [];
    if (object.userCount !== undefined && object.userCount !== null) {
      message.userCount = BigInt(object.userCount);
    }
    message.whoisList = ((_object$whoisList2 = object.whoisList) === null || _object$whoisList2 === void 0 ? void 0 : _object$whoisList2.map(function (e) {
      return _whois.Whois.fromAmino(e);
    })) || [];
    if (object.whoisCount !== undefined && object.whoisCount !== null) {
      message.whoisCount = BigInt(object.whoisCount);
    }
    return message;
  },
  toAmino: function toAmino(message) {
    var obj = {};
    if (message.exercisedAmountList) {
      obj.exercisedAmountList = message.exercisedAmountList.map(function (e) {
        return e ? _exercised_amount.ExercisedAmount.toAmino(e) : undefined;
      });
    } else {
      obj.exercisedAmountList = message.exercisedAmountList;
    }
    obj.exercisedAmountCount = message.exercisedAmountCount !== BigInt(0) ? message.exercisedAmountCount.toString() : undefined;
    obj.params = message.params ? _params.Params.toAmino(message.params) : undefined;
    if (message.bountyList) {
      obj.bountyList = message.bountyList.map(function (e) {
        return e ? _bounty.Bounty.toAmino(e) : undefined;
      });
    } else {
      obj.bountyList = message.bountyList;
    }
    obj.bountyCount = message.bountyCount !== BigInt(0) ? message.bountyCount.toString() : undefined;
    if (message.userDaoList) {
      obj.userDaoList = message.userDaoList.map(function (e) {
        return e ? _user.UserDao.toAmino(e) : undefined;
      });
    } else {
      obj.userDaoList = message.userDaoList;
    }
    if (message.baseRepositoryKeyList) {
      obj.baseRepositoryKeyList = message.baseRepositoryKeyList.map(function (e) {
        return e ? _repository.BaseRepositoryKey.toAmino(e) : undefined;
      });
    } else {
      obj.baseRepositoryKeyList = message.baseRepositoryKeyList;
    }
    if (message.memberList) {
      obj.memberList = message.memberList.map(function (e) {
        return e ? _member.Member.toAmino(e) : undefined;
      });
    } else {
      obj.memberList = message.memberList;
    }
    obj.memberCount = message.memberCount !== BigInt(0) ? message.memberCount.toString() : undefined;
    if (message.tagList) {
      obj.tagList = message.tagList.map(function (e) {
        return e ? _tag.Tag.toAmino(e) : undefined;
      });
    } else {
      obj.tagList = message.tagList;
    }
    obj.tagCount = message.tagCount !== BigInt(0) ? message.tagCount.toString() : undefined;
    if (message.branchList) {
      obj.branchList = message.branchList.map(function (e) {
        return e ? _branch.Branch.toAmino(e) : undefined;
      });
    } else {
      obj.branchList = message.branchList;
    }
    obj.branchCount = message.branchCount !== BigInt(0) ? message.branchCount.toString() : undefined;
    if (message.taskList) {
      obj.taskList = message.taskList.map(function (e) {
        return e ? _task.Task.toAmino(e) : undefined;
      });
    } else {
      obj.taskList = message.taskList;
    }
    obj.taskCount = message.taskCount !== BigInt(0) ? message.taskCount.toString() : undefined;
    if (message.releaseList) {
      obj.releaseList = message.releaseList.map(function (e) {
        return e ? _release.Release.toAmino(e) : undefined;
      });
    } else {
      obj.releaseList = message.releaseList;
    }
    obj.releaseCount = message.releaseCount !== BigInt(0) ? message.releaseCount.toString() : undefined;
    if (message.pullRequestList) {
      obj.pullRequestList = message.pullRequestList.map(function (e) {
        return e ? _pullRequest.PullRequest.toAmino(e) : undefined;
      });
    } else {
      obj.pullRequestList = message.pullRequestList;
    }
    obj.pullRequestCount = message.pullRequestCount !== BigInt(0) ? message.pullRequestCount.toString() : undefined;
    if (message.daoList) {
      obj.daoList = message.daoList.map(function (e) {
        return e ? _dao.Dao.toAmino(e) : undefined;
      });
    } else {
      obj.daoList = message.daoList;
    }
    obj.daoCount = message.daoCount !== BigInt(0) ? message.daoCount.toString() : undefined;
    if (message.commentList) {
      obj.commentList = message.commentList.map(function (e) {
        return e ? _comment.Comment.toAmino(e) : undefined;
      });
    } else {
      obj.commentList = message.commentList;
    }
    obj.commentCount = message.commentCount !== BigInt(0) ? message.commentCount.toString() : undefined;
    if (message.issueList) {
      obj.issueList = message.issueList.map(function (e) {
        return e ? _issue.Issue.toAmino(e) : undefined;
      });
    } else {
      obj.issueList = message.issueList;
    }
    obj.issueCount = message.issueCount !== BigInt(0) ? message.issueCount.toString() : undefined;
    if (message.repositoryList) {
      obj.repositoryList = message.repositoryList.map(function (e) {
        return e ? _repository.Repository.toAmino(e) : undefined;
      });
    } else {
      obj.repositoryList = message.repositoryList;
    }
    obj.repositoryCount = message.repositoryCount !== BigInt(0) ? message.repositoryCount.toString() : undefined;
    if (message.userList) {
      obj.userList = message.userList.map(function (e) {
        return e ? _user.User.toAmino(e) : undefined;
      });
    } else {
      obj.userList = message.userList;
    }
    obj.userCount = message.userCount !== BigInt(0) ? message.userCount.toString() : undefined;
    if (message.whoisList) {
      obj.whoisList = message.whoisList.map(function (e) {
        return e ? _whois.Whois.toAmino(e) : undefined;
      });
    } else {
      obj.whoisList = message.whoisList;
    }
    obj.whoisCount = message.whoisCount !== BigInt(0) ? message.whoisCount.toString() : undefined;
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return GenesisState.fromAmino(object.value);
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return GenesisState.decode(message.value);
  },
  toProto: function toProto(message) {
    return GenesisState.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/gitopia.gitopia.gitopia.GenesisState",
      value: GenesisState.encode(message).finish()
    };
  }
};