Skip to content

Commit

Permalink
feat(swap/pool): return swap/pool tokens set
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonKozAllB committed Jul 31, 2024
1 parent ce5b03d commit 1d56192
Show file tree
Hide file tree
Showing 47 changed files with 710 additions and 101 deletions.
2 changes: 1 addition & 1 deletion src/__tests__/client/core-api/caching-core-client.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AllbridgeCoreClientImpl } from "../../../client/core-api";
import { Messenger } from "../../../client/core-api/core-api.model";
import { AllbridgeCoreClientImpl } from "../../../client/core-api/core-client-base";
import { AllbridgeCoreClientPoolInfoCaching } from "../../../client/core-api/core-client-pool-info-caching";
import { ChainDetailsMap, PoolInfo, PoolInfoMap } from "../../../tokens-info";
import poolGRL from "../../data/pool-info/pool-info-GRL.json";
Expand Down
6 changes: 3 additions & 3 deletions src/__tests__/client/core-api/core-api-mapper.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { mapChainDetailsResponseToChainDetailsMap } from "../../../client/core-api/core-api-mapper";
import { ChainDetailsResponse } from "../../../client/core-api/core-api.model";
import { ChainDetailsWithTokens, ChainDetailsMap } from "../../../tokens-info";
import { ChainDetailsWithTokens, ChainDetailsMapWithFlags } from "../../../tokens-info";
import chainDetailsGRL from "../../data/tokens-info/ChainDetails-GRL.json";
import tokensGroupedByChain from "../../data/tokens-info/ChainDetailsMap.json";
import tokensGroupedByChain from "../../data/tokens-info/ChainDetailsMapWithFlags.json";
import tokensInfo from "../../mock/core-api/token-info.json";
import { initChainsWithTestnet } from "../../mock/utils";

const expectedTokensGroupedByChain = tokensGroupedByChain as unknown as ChainDetailsMap;
const expectedTokensGroupedByChain = tokensGroupedByChain as unknown as ChainDetailsMapWithFlags;

initChainsWithTestnet();

Expand Down
12 changes: 6 additions & 6 deletions src/__tests__/client/core-api/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import nock from "nock";
import { ChainSymbol } from "../../../chains/chain.enums";
import { AllbridgeCoreClientImpl } from "../../../client/core-api";
import { ApiClientImpl } from "../../../client/core-api/api-client";
import {
Messenger,
ReceiveTransactionCostRequest,
ReceiveTransactionCostResponse,
TransferStatusResponse,
} from "../../../client/core-api/core-api.model";
import { ChainDetailsMap, PoolInfoMap, PoolKeyObject } from "../../../tokens-info";
import { AllbridgeCoreClientImpl } from "../../../client/core-api/core-client-base";
import { ChainDetailsMapWithFlags, PoolInfoMap, PoolKeyObject } from "../../../tokens-info";
import poolMap from "../../data/pool-info/pool-info-map.json";
import tokensGroupedByChain from "../../data/tokens-info/ChainDetailsMap.json";
import tokensGroupedByChain from "../../data/tokens-info/ChainDetailsMapWithFlags.json";
import transferStatus from "../../data/transfer-status/TransferStatus.json";
import poolResponse from "../../mock/core-api/pool-info.json";
import transferStatusResponse from "../../mock/core-api/send-status.json";
import tokenInfoResponse from "../../mock/core-api/token-info.json";
import { getRequestBodyMatcher, initChainsWithTestnet } from "../../mock/utils";

const expectedTokensGroupedByChain = tokensGroupedByChain as unknown as ChainDetailsMap;
const expectedTokensGroupedByChain = tokensGroupedByChain as unknown as ChainDetailsMapWithFlags;
const expectedTransferStatus = transferStatus as unknown as TransferStatusResponse;

initChainsWithTestnet();
Expand All @@ -33,7 +33,7 @@ describe("AllbridgeCoreClient", () => {
let scope: nock.Scope;

beforeEach(() => {
scope = nock("http://localhost").get("/token-info").reply(200, tokenInfoResponse);
scope = nock("http://localhost").get("/token-info?filter=all").reply(200, tokenInfoResponse);
});

it("☀️ getChainDetailsMap() returns ChainDetailsMap", async () => {
Expand Down Expand Up @@ -122,7 +122,7 @@ describe("AllbridgeCoreClient", () => {

it("☀️ should be present", async () => {
const nockOptions = { reqheaders: customHeaders }; // cSpell:disable-line
const scope: nock.Scope = nock("http://localhost", nockOptions).get("/token-info").reply(200);
const scope: nock.Scope = nock("http://localhost", nockOptions).get("/token-info?filter=all").reply(200);

await api.getChainDetailsMap();

Expand Down
6 changes: 5 additions & 1 deletion src/__tests__/data/tokens-info/ChainDetailsMap-ETH-USDT.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@
}
},
"confirmations": 80,
"chainName": "Ethereum"
"chainName": "Ethereum",
"flags": {
"swap": true,
"pool": true
}
}
]
}
Expand Down
Loading

0 comments on commit 1d56192

Please sign in to comment.