@ledgerhq/coin-stellar
Version:
Ledger Stellar Coin integration
34 lines • 1.24 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const _1 = require(".");
const nock_1 = __importDefault(require("nock"));
describe("Stellar Api", () => {
let module;
const ADDRESS = "GBAUZBDXMVV7HII4JWBGFMLVKVJ6OLQAKOCGXM5E2FM4TAZB6C7JO2L7";
beforeAll(() => {
(0, nock_1.default)("https://horizon-testnet.stellar.org")
.get(/.*/)
.reply(() => {
return [429, { error: "whatever, only status code is important" }];
})
.get(/.*/)
.reply(() => {
return [200, { _links: {}, _embedded: { records: [] } }];
});
module = (0, _1.createApi)({
explorer: {
url: "https://horizon-testnet.stellar.org/",
},
});
});
describe("listOperations can handle 429 errors", () => {
it("retrieved operations", async () => {
const [txs] = await module.listOperations(ADDRESS, { minHeight: 0 });
expect(txs.length).toBe(0);
});
});
});
//# sourceMappingURL=index_error.test.js.map