"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Module = void 0;
const binary_1 = require("../../../../binary");
function createBaseModule() {
    return {
        feeCollectorName: "",
        authority: ""
    };
}
exports.Module = {
    typeUrl: "/cosmos.crisis.module.v1.Module",
    aminoType: "cosmos-sdk/Module",
    encode(message, writer = binary_1.BinaryWriter.create()) {
        if (message.feeCollectorName !== "") {
            writer.uint32(10).string(message.feeCollectorName);
        }
        if (message.authority !== "") {
            writer.uint32(18).string(message.authority);
        }
        return writer;
    },
    decode(input, length) {
        const reader = input instanceof binary_1.BinaryReader ? input : new binary_1.BinaryReader(input);
        let end = length === undefined ? reader.len : reader.pos + length;
        const message = createBaseModule();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.feeCollectorName = reader.string();
                    break;
                case 2:
                    message.authority = reader.string();
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        const message = createBaseModule();
        message.feeCollectorName = object.feeCollectorName ?? "";
        message.authority = object.authority ?? "";
        return message;
    },
    fromAmino(object) {
        return {
            feeCollectorName: object.fee_collector_name,
            authority: object.authority
        };
    },
    toAmino(message) {
        const obj = {};
        obj.fee_collector_name = message.feeCollectorName;
        obj.authority = message.authority;
        return obj;
    },
    fromAminoMsg(object) {
        return exports.Module.fromAmino(object.value);
    },
    toAminoMsg(message) {
        return {
            type: "cosmos-sdk/Module",
            value: exports.Module.toAmino(message)
        };
    },
    fromProtoMsg(message) {
        return exports.Module.decode(message.value);
    },
    toProto(message) {
        return exports.Module.encode(message).finish();
    },
    toProtoMsg(message) {
        return {
            typeUrl: "/cosmos.crisis.module.v1.Module",
            value: exports.Module.encode(message).finish()
        };
    }
};
//# sourceMappingURL=module.js.map