"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const chai_1 = require("chai");
const src_1 = require("../../src");
const DogeMccConnection = {
    url: process.env.DOGE_URL || "",
    username: process.env.DOGE_USERNAME || "",
    password: process.env.DOGE_PASSWORD || "",
    apiTokenKey: process.env.FLARE_API_PORTAL_KEY || "",
};
describe("Chain tips test ", function () {
    let MccClient;
    before(async function () {
        MccClient = new src_1.MCC.DOGE(DogeMccConnection);
    });
    it("Should get only latest tips ", async function () {
        const tips = await MccClient.getBlockTips(4045000);
        (0, chai_1.expect)(tips.length).to.greaterThanOrEqual(70);
    });
    it("Should get latest orphaned block ", async function () {
        const tips = await MccClient.getBlockTips(0);
        let latest = tips.length > 0 ? tips[0] : undefined;
        let latestH = 0;
        for (const tip of tips) {
            if (tip.chainTipStatus !== "active") {
                if (tip.number > latestH) {
                    latestH = tip.number;
                    latest = tip;
                }
            }
        }
        (0, chai_1.expect)(latest === null || latest === void 0 ? void 0 : latest.number).to.greaterThanOrEqual(4406287);
    });
    it("Should get tips and all blocks to certain height ", async function () {
        const tips = await MccClient.getTopLiteBlocks(5);
        // Most of the time eq
        // console.log(tips);
        (0, chai_1.expect)(tips.length).to.greaterThanOrEqual(5);
    });
});
//# sourceMappingURL=tips.test.js.map