"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.GenesisState = void 0;
var _coin = require("../../base/v1beta1/coin");
var _binary = require("../../../binary");
var _helpers = require("../../../helpers");
/** GenesisState defines the crisis module's genesis state. */

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

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

function createBaseGenesisState() {
  return {
    constantFee: _coin.Coin.fromPartial({})
  };
}
var GenesisState = exports.GenesisState = {
  typeUrl: "/cosmos.crisis.v1beta1.GenesisState",
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _binary.BinaryWriter.create();
    if (message.constantFee !== undefined) {
      _coin.Coin.encode(message.constantFee, writer.uint32(26).fork()).ldelim();
    }
    return writer;
  },
  fromJSON: function fromJSON(object) {
    return {
      constantFee: (0, _helpers.isSet)(object.constantFee) ? _coin.Coin.fromJSON(object.constantFee) : undefined
    };
  },
  fromPartial: function fromPartial(object) {
    var message = createBaseGenesisState();
    message.constantFee = object.constantFee !== undefined && object.constantFee !== null ? _coin.Coin.fromPartial(object.constantFee) : undefined;
    return message;
  },
  fromAmino: function fromAmino(object) {
    var message = createBaseGenesisState();
    if (object.constant_fee !== undefined && object.constant_fee !== null) {
      message.constantFee = _coin.Coin.fromAmino(object.constant_fee);
    }
    return message;
  },
  toAmino: function toAmino(message) {
    var obj = {};
    obj.constant_fee = message.constantFee ? _coin.Coin.toAmino(message.constantFee) : undefined;
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return GenesisState.fromAmino(object.value);
  },
  toAminoMsg: function toAminoMsg(message) {
    return {
      type: "cosmos-sdk/GenesisState",
      value: GenesisState.toAmino(message)
    };
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return GenesisState.decode(message.value);
  },
  toProto: function toProto(message) {
    return GenesisState.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/cosmos.crisis.v1beta1.GenesisState",
      value: GenesisState.encode(message).finish()
    };
  }
};