"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.GenesisState = void 0;
const params_1 = require("./params");
const bridge_event_info_1 = require("./bridge_event_info");
const withdrawal_1 = require("./withdrawal");
const bridge_event_1 = require("./bridge_event");
const _m0 = __importStar(require("protobufjs/minimal"));
function createBaseGenesisState() {
    return {
        eventParams: undefined,
        proposeParams: undefined,
        safetyParams: undefined,
        acknowledgedEventInfos: [],
        withdrawalParams: undefined,
        chainWithdrawalStates: [],
        withdrawalDailyUsage: [],
        withdrawalConfirmationInfos: []
    };
}
exports.GenesisState = {
    encode(message, writer = _m0.Writer.create()) {
        if (message.eventParams !== undefined) {
            params_1.EventParams.encode(message.eventParams, writer.uint32(10).fork()).ldelim();
        }
        if (message.proposeParams !== undefined) {
            params_1.ProposeParams.encode(message.proposeParams, writer.uint32(18).fork()).ldelim();
        }
        if (message.safetyParams !== undefined) {
            params_1.SafetyParams.encode(message.safetyParams, writer.uint32(26).fork()).ldelim();
        }
        for (const v of message.acknowledgedEventInfos) {
            bridge_event_info_1.ChainBridgeEventInfo.encode(v, writer.uint32(34).fork()).ldelim();
        }
        if (message.withdrawalParams !== undefined) {
            withdrawal_1.WithdrawalParams.encode(message.withdrawalParams, writer.uint32(42).fork()).ldelim();
        }
        for (const v of message.chainWithdrawalStates) {
            withdrawal_1.ChainWithdrawalState.encode(v, writer.uint32(50).fork()).ldelim();
        }
        for (const v of message.withdrawalDailyUsage) {
            withdrawal_1.AssetChainWithdrawalDailyUsage.encode(v, writer.uint32(58).fork()).ldelim();
        }
        for (const v of message.withdrawalConfirmationInfos) {
            bridge_event_1.ChainWithdrawalConfirmationInfo.encode(v, writer.uint32(66).fork()).ldelim();
        }
        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 = createBaseGenesisState();
        while (reader.pos < end) {
            const tag = reader.uint32();
            switch (tag >>> 3) {
                case 1:
                    message.eventParams = params_1.EventParams.decode(reader, reader.uint32());
                    break;
                case 2:
                    message.proposeParams = params_1.ProposeParams.decode(reader, reader.uint32());
                    break;
                case 3:
                    message.safetyParams = params_1.SafetyParams.decode(reader, reader.uint32());
                    break;
                case 4:
                    message.acknowledgedEventInfos.push(bridge_event_info_1.ChainBridgeEventInfo.decode(reader, reader.uint32()));
                    break;
                case 5:
                    message.withdrawalParams = withdrawal_1.WithdrawalParams.decode(reader, reader.uint32());
                    break;
                case 6:
                    message.chainWithdrawalStates.push(withdrawal_1.ChainWithdrawalState.decode(reader, reader.uint32()));
                    break;
                case 7:
                    message.withdrawalDailyUsage.push(withdrawal_1.AssetChainWithdrawalDailyUsage.decode(reader, reader.uint32()));
                    break;
                case 8:
                    message.withdrawalConfirmationInfos.push(bridge_event_1.ChainWithdrawalConfirmationInfo.decode(reader, reader.uint32()));
                    break;
                default:
                    reader.skipType(tag & 7);
                    break;
            }
        }
        return message;
    },
    fromPartial(object) {
        var _a, _b, _c, _d;
        const message = createBaseGenesisState();
        message.eventParams = object.eventParams !== undefined && object.eventParams !== null ? params_1.EventParams.fromPartial(object.eventParams) : undefined;
        message.proposeParams = object.proposeParams !== undefined && object.proposeParams !== null ? params_1.ProposeParams.fromPartial(object.proposeParams) : undefined;
        message.safetyParams = object.safetyParams !== undefined && object.safetyParams !== null ? params_1.SafetyParams.fromPartial(object.safetyParams) : undefined;
        message.acknowledgedEventInfos = ((_a = object.acknowledgedEventInfos) === null || _a === void 0 ? void 0 : _a.map(e => bridge_event_info_1.ChainBridgeEventInfo.fromPartial(e))) || [];
        message.withdrawalParams = object.withdrawalParams !== undefined && object.withdrawalParams !== null ? withdrawal_1.WithdrawalParams.fromPartial(object.withdrawalParams) : undefined;
        message.chainWithdrawalStates = ((_b = object.chainWithdrawalStates) === null || _b === void 0 ? void 0 : _b.map(e => withdrawal_1.ChainWithdrawalState.fromPartial(e))) || [];
        message.withdrawalDailyUsage = ((_c = object.withdrawalDailyUsage) === null || _c === void 0 ? void 0 : _c.map(e => withdrawal_1.AssetChainWithdrawalDailyUsage.fromPartial(e))) || [];
        message.withdrawalConfirmationInfos = ((_d = object.withdrawalConfirmationInfos) === null || _d === void 0 ? void 0 : _d.map(e => bridge_event_1.ChainWithdrawalConfirmationInfo.fromPartial(e))) || [];
        return message;
    }
};
//# sourceMappingURL=data:application/json;base64, 