//@ts-nocheck
import { Long, isSet } from "../../../helpers";
import * as _m0 from "protobufjs/minimal";
/** Params defines the parameters for the module. */

/** Params defines the parameters for the module. */

function createBaseParams() {
  return {
    maximumUnauthenticatedGas: Long.UZERO,
    isSmartAccountActive: false,
    circuitBreakerControllers: []
  };
}
export const Params = {
  encode(message, writer = _m0.Writer.create()) {
    if (!message.maximumUnauthenticatedGas.isZero()) {
      writer.uint32(8).uint64(message.maximumUnauthenticatedGas);
    }
    if (message.isSmartAccountActive === true) {
      writer.uint32(16).bool(message.isSmartAccountActive);
    }
    for (const v of message.circuitBreakerControllers) {
      writer.uint32(26).string(v);
    }
    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 = createBaseParams();
    while (reader.pos < end) {
      const tag = reader.uint32();
      switch (tag >>> 3) {
        case 1:
          message.maximumUnauthenticatedGas = reader.uint64();
          break;
        case 2:
          message.isSmartAccountActive = reader.bool();
          break;
        case 3:
          message.circuitBreakerControllers.push(reader.string());
          break;
        default:
          reader.skipType(tag & 7);
          break;
      }
    }
    return message;
  },
  fromJSON(object) {
    return {
      maximumUnauthenticatedGas: isSet(object.maximumUnauthenticatedGas) ? Long.fromValue(object.maximumUnauthenticatedGas) : Long.UZERO,
      isSmartAccountActive: isSet(object.isSmartAccountActive) ? Boolean(object.isSmartAccountActive) : false,
      circuitBreakerControllers: Array.isArray(object === null || object === void 0 ? void 0 : object.circuitBreakerControllers) ? object.circuitBreakerControllers.map(e => String(e)) : []
    };
  },
  toJSON(message) {
    const obj = {};
    message.maximumUnauthenticatedGas !== undefined && (obj.maximumUnauthenticatedGas = (message.maximumUnauthenticatedGas || Long.UZERO).toString());
    message.isSmartAccountActive !== undefined && (obj.isSmartAccountActive = message.isSmartAccountActive);
    if (message.circuitBreakerControllers) {
      obj.circuitBreakerControllers = message.circuitBreakerControllers.map(e => e);
    } else {
      obj.circuitBreakerControllers = [];
    }
    return obj;
  },
  fromPartial(object) {
    var _object$isSmartAccoun, _object$circuitBreake;
    const message = createBaseParams();
    message.maximumUnauthenticatedGas = object.maximumUnauthenticatedGas !== undefined && object.maximumUnauthenticatedGas !== null ? Long.fromValue(object.maximumUnauthenticatedGas) : Long.UZERO;
    message.isSmartAccountActive = (_object$isSmartAccoun = object.isSmartAccountActive) !== null && _object$isSmartAccoun !== void 0 ? _object$isSmartAccoun : false;
    message.circuitBreakerControllers = ((_object$circuitBreake = object.circuitBreakerControllers) === null || _object$circuitBreake === void 0 ? void 0 : _object$circuitBreake.map(e => e)) || [];
    return message;
  }
};