"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.MsgUnjailResponse = exports.MsgUnjail = void 0;
var _binary = require("../../../binary");
var _helpers = require("../../../helpers");
/** MsgUnjail defines the Msg/Unjail request type */

/** MsgUnjail defines the Msg/Unjail request type */

/** MsgUnjail defines the Msg/Unjail request type */

/** MsgUnjailResponse defines the Msg/Unjail response type */

/** MsgUnjailResponse defines the Msg/Unjail response type */

/** MsgUnjailResponse defines the Msg/Unjail response type */

function createBaseMsgUnjail() {
  return {
    validatorAddr: ""
  };
}
var MsgUnjail = exports.MsgUnjail = {
  typeUrl: "/cosmos.slashing.v1beta1.MsgUnjail",
  encode: function encode(message) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _binary.BinaryWriter.create();
    if (message.validatorAddr !== "") {
      writer.uint32(10).string(message.validatorAddr);
    }
    return writer;
  },
  fromJSON: function fromJSON(object) {
    return {
      validatorAddr: (0, _helpers.isSet)(object.validatorAddr) ? String(object.validatorAddr) : ""
    };
  },
  fromPartial: function fromPartial(object) {
    var _object$validatorAddr;
    var message = createBaseMsgUnjail();
    message.validatorAddr = (_object$validatorAddr = object.validatorAddr) !== null && _object$validatorAddr !== void 0 ? _object$validatorAddr : "";
    return message;
  },
  fromAmino: function fromAmino(object) {
    var message = createBaseMsgUnjail();
    if (object.validator_addr !== undefined && object.validator_addr !== null) {
      message.validatorAddr = object.validator_addr;
    }
    return message;
  },
  toAmino: function toAmino(message) {
    var _message$validatorAdd;
    var obj = {};
    obj.validator_addr = (_message$validatorAdd = message.validatorAddr) !== null && _message$validatorAdd !== void 0 ? _message$validatorAdd : "";
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return MsgUnjail.fromAmino(object.value);
  },
  toAminoMsg: function toAminoMsg(message) {
    return {
      type: "cosmos-sdk/MsgUnjail",
      value: MsgUnjail.toAmino(message)
    };
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return MsgUnjail.decode(message.value);
  },
  toProto: function toProto(message) {
    return MsgUnjail.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/cosmos.slashing.v1beta1.MsgUnjail",
      value: MsgUnjail.encode(message).finish()
    };
  }
};
function createBaseMsgUnjailResponse() {
  return {};
}
var MsgUnjailResponse = exports.MsgUnjailResponse = {
  typeUrl: "/cosmos.slashing.v1beta1.MsgUnjailResponse",
  encode: function encode(_) {
    var writer = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _binary.BinaryWriter.create();
    return writer;
  },
  fromJSON: function fromJSON(_) {
    return {};
  },
  fromPartial: function fromPartial(_) {
    var message = createBaseMsgUnjailResponse();
    return message;
  },
  fromAmino: function fromAmino(_) {
    var message = createBaseMsgUnjailResponse();
    return message;
  },
  toAmino: function toAmino(_) {
    var obj = {};
    return obj;
  },
  fromAminoMsg: function fromAminoMsg(object) {
    return MsgUnjailResponse.fromAmino(object.value);
  },
  toAminoMsg: function toAminoMsg(message) {
    return {
      type: "cosmos-sdk/MsgUnjailResponse",
      value: MsgUnjailResponse.toAmino(message)
    };
  },
  fromProtoMsg: function fromProtoMsg(message) {
    return MsgUnjailResponse.decode(message.value);
  },
  toProto: function toProto(message) {
    return MsgUnjailResponse.encode(message).finish();
  },
  toProtoMsg: function toProtoMsg(message) {
    return {
      typeUrl: "/cosmos.slashing.v1beta1.MsgUnjailResponse",
      value: MsgUnjailResponse.encode(message).finish()
    };
  }
};