UNPKG

postchain-client

Version:

Client library for accessing a Postchain node through REST.

26 lines 1.5 kB
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()); }); }; import { nodeDiscovery } from "../../src/blockchainClient/utils"; import { createNodeManager } from "../../src/blockchainClient/nodeManager"; import { LOCAL_POOL } from "../common/mocks"; import dotenv from "dotenv"; import path from "path"; dotenv.config({ path: path.resolve(__dirname, ".env") }); describe("nodeDiscovery", () => { it("returns blockchain api urls", () => __awaiter(void 0, void 0, void 0, function* () { const blockchainApiUrls = yield nodeDiscovery({ nodeManager: createNodeManager({ nodeUrls: [LOCAL_POOL] }), directoryEndpointPool: [{ url: LOCAL_POOL, whenAvailable: 0 }], blockchainRid: process.env.DAPP_BLOCKCHAIN_RID, }); expect(blockchainApiUrls).toEqual([LOCAL_POOL]); })); }); //# sourceMappingURL=nodeDiscovery.test.js.map