//@ts-nocheck
import { BinaryReader, BinaryWriter } from '../../../../binary.js';
import { isSet } from '../../../../helpers.js';
import {} from '../../../../json-safe.js';
function createBaseConfig() {
    return {
        skipAnteHandler: false,
        skipPostHandler: false,
    };
}
export const Config = {
    typeUrl: '/cosmos.tx.config.v1.Config',
    encode(message, writer = BinaryWriter.create()) {
        if (message.skipAnteHandler === true) {
            writer.uint32(8).bool(message.skipAnteHandler);
        }
        if (message.skipPostHandler === true) {
            writer.uint32(16).bool(message.skipPostHandler);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseConfig();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.skipAnteHandler = reader.bool();
                    break;
                case 2:
                    message.skipPostHandler = reader.bool();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromJSON(object) {
        return {
            skipAnteHandler: isSet(object.skipAnteHandler)
                ? Boolean(object.skipAnteHandler)
                : false,
            skipPostHandler: isSet(object.skipPostHandler)
                ? Boolean(object.skipPostHandler)
                : false,
        };
    },
    toJSON(message) {
        const obj = {};
        message.skipAnteHandler !== undefined &&
            (obj.skipAnteHandler = message.skipAnteHandler);
        message.skipPostHandler !== undefined &&
            (obj.skipPostHandler = message.skipPostHandler);
        return obj;
    },
    fromPartial(object) {
        const message = createBaseConfig();
        message.skipAnteHandler = object.skipAnteHandler ?? false;
        message.skipPostHandler = object.skipPostHandler ?? false;
        return message;
    },
    fromProtoMsg(message) {
        return Config.decode(message.value);
    },
    toProto(message) {
        return Config.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: '/cosmos.tx.config.v1.Config',
            value: Config.encode(message).finish(),
        };
    },
};
//# sourceMappingURL=config.js.map