"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
Object.defineProperty(exports, "__esModule", { value: true });
const chai_1 = require("chai");
const factory_1 = require("../../../../src/factory");
const config_1 = require("../../../config");
const src_1 = require("../../../../src");
describe("BTCRelay", function () {
    this.timeout(10000); // API can be slightly slow
    let api;
    let interBtcAPI;
    before(() => __awaiter(this, void 0, void 0, function* () {
        api = yield factory_1.createSubstrateAPI(config_1.PARACHAIN_ENDPOINT);
        interBtcAPI = new src_1.DefaultInterBtcApi(api, "regtest", undefined, "testnet");
    }));
    after(() => __awaiter(this, void 0, void 0, function* () {
        yield api.disconnect();
    }));
    it("should getLatestBTCBlockFromBTCRelay", () => __awaiter(this, void 0, void 0, function* () {
        const latestBTCBlockFromBTCRelay = yield interBtcAPI.btcRelay.getLatestBlock();
        chai_1.assert.isDefined(latestBTCBlockFromBTCRelay);
    })).timeout(1500);
    it("should getLatestBTCBlockHeightFromBTCRelay", () => __awaiter(this, void 0, void 0, function* () {
        const latestBTCBlockHeightFromBTCRelay = yield interBtcAPI.btcRelay.getLatestBlockHeight();
        chai_1.assert.isDefined(latestBTCBlockHeightFromBTCRelay);
    })).timeout(1500);
});
//# sourceMappingURL=btc-relay.test.js.map