UNPKG

@kyve/core-beta

Version:

🚀 The base KYVE node implementation.

39 lines (38 loc) • 1.69 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.validateIsPoolActive = void 0; const pool_1 = require("@kyve/proto-beta/lcd/kyve/pool/v1beta1/pool"); /** * validateIsPoolActive checks if the pool is active or not. * It returns true or false, wether it is active or not. * * @method validateIsPoolActive * @param {Node} this * @return {boolean} */ function validateIsPoolActive() { this.logger.debug(`Validating if pool is active: ${this.pool.status}`); switch (this.pool.status) { case pool_1.PoolStatus.POOL_STATUS_ACTIVE: return false; case pool_1.PoolStatus.POOL_STATUS_PAUSED: this.logger.info("Pool is paused. Waiting for pool being unpaused. Idling ..."); return true; case pool_1.PoolStatus.POOL_STATUS_NO_FUNDS: this.logger.info("Pool is out of funds. Waiting for additional funds. Idling ..."); return true; case pool_1.PoolStatus.POOL_STATUS_NOT_ENOUGH_DELEGATION: this.logger.info("Not enough delegation in pool. Waiting for additional delegation. Idling ..."); return true; case pool_1.PoolStatus.POOL_STATUS_UPGRADING: this.logger.info("Pool is currently upgrading. Waiting for upgrade being applied. Idling ..."); return true; case pool_1.PoolStatus.POOL_STATUS_UNSPECIFIED: this.logger.info("Pool status is currently unspecified. Idling ..."); return true; default: this.logger.info("Pool status is currently unknown. Idling ..."); return true; } } exports.validateIsPoolActive = validateIsPoolActive;