@ledgerhq/coin-stellar
Version:
Ledger Stellar Coin integration
39 lines • 1.52 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const rxjs_1 = require("rxjs");
const index_1 = require("../bridge/index");
const bridge_fixture_1 = require("../types/bridge.fixture");
const defaultSyncConfig = {
paginationConfig: {},
blacklistedTokenIds: [],
};
function syncAccount(bridge, account, syncConfig = defaultSyncConfig) {
return (0, rxjs_1.firstValueFrom)(bridge.sync(account, syncConfig).pipe((0, rxjs_1.reduce)((a, f) => f(a), account)));
}
const dummyAccount = (0, bridge_fixture_1.createFixtureAccount)();
describe("Sync Accounts", () => {
let bridge;
beforeAll(() => {
const signer = jest.fn();
const coinConfig = () => ({
status: { type: "active" },
explorer: {
url: "https://stellar.coin.ledger.com",
fetchLimit: 100,
},
});
bridge = (0, index_1.createBridges)(signer, coinConfig);
});
test.each([
"GAT4LBXYJGJJJRSNK74NPFLO55CDDXSYVMQODSEAAH3M6EY4S7LPH5GV",
"GCDDN6T2LJN3T7SPWJQV6BCCL5KNY5GBN7X4CMSZLDEXDHXAH32TOAHS",
])("should always be sync without error for address %s", async (accountId) => {
const account = await syncAccount(bridge.accountBridge, {
...dummyAccount,
id: `js:2:stellar:${accountId}:`,
freshAddress: accountId,
});
expect(account.id).toEqual(`js:2:stellar:${accountId}:`);
});
});
//# sourceMappingURL=synchronization.integ.test.js.map