Skip to content

Commit

Permalink
fix: fixed api tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mckrava committed Feb 10, 2025
1 parent 3b2c393 commit 93d65bf
Show file tree
Hide file tree
Showing 9 changed files with 16,200 additions and 36,086 deletions.
1 change: 1 addition & 0 deletions indexers/liquidity-pools/.env.hydration-paseo.test
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ PROCESS_OTC=true
OMNIPOOL_ADDRESS=0x6d6f646c6f6d6e69706f6f6c0000000000000000000000000000000000000000

NODE_ENV=test
UNIFIED_EVENTS_GENESIS_SPEC_VERSION=282

USE_STORAGE_DICTIONARY=false

Expand Down
6 changes: 4 additions & 2 deletions indexers/liquidity-pools/.env.hydration.test
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ PROCESS_OTC=true

OMNIPOOL_ADDRESS=0x6d6f646c6f6d6e69706f6f6c0000000000000000000000000000000000000000

UNIFIED_EVENTS_GENESIS_SPEC_VERSION=282

NODE_ENV=test
PROCESS_FROM_BLOCK=3640100
PROCESS_TO_BLOCK=3680100
PROCESS_FROM_BLOCK=4187498
PROCESS_TO_BLOCK=4198534

USE_STORAGE_DICTIONARY=false
STORAGE_DICTIONARY_LBPPOOL_URL=https://galacticcouncil.squids.live/hydration-storage-dictionary:lbppool/api/graphql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ describe('Validation of indexed data against blockchain storage state', () => {
};

const rpcResultTestUnit = {
start: poolDataDecorated.start
startBlockNumber: poolDataDecorated.start
? +removeStringSeparators(poolDataDecorated.start)
: null,
end: poolDataDecorated.end
endBlockNumber: poolDataDecorated.end
? +removeStringSeparators(poolDataDecorated.end)
: null,
initialWeight: +removeStringSeparators(
Expand All @@ -116,7 +116,7 @@ describe('Validation of indexed data against blockchain storage state', () => {
assetBBalance: BigInt(
removeStringSeparators(assertBBalancesDecorated.free)
),
paraChainBlockHeight: blockHeight,
paraBlockHeight: blockHeight,
};

expect(apiResultTestUnit).toStrictEqual(rpcResultTestUnit);
Expand Down
20 changes: 9 additions & 11 deletions tests/api-tests/src/liquidity-pools-api/specs/swaps.xyk.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ describe('Validation of indexed data against blockchain storage state', () => {

expect(!!apiResult && apiResult.swapFees.nodes.length > 0).toBe(true);

expect(
!!apiResult && apiResult.swapInputAssetBalances.nodes.length > 0
).toBe(true);
expect(!!apiResult && apiResult.swapInputs.nodes.length > 0).toBe(true);

expect(
!!apiResult && apiResult.swapOutputAssetBalances.nodes.length > 0
).toBe(true);
expect(!!apiResult && apiResult.swapOutputs.nodes.length > 0).toBe(
true
);

if (!apiResult) return null;

Expand All @@ -45,17 +43,17 @@ describe('Validation of indexed data against blockchain storage state', () => {
fillerId: apiResult.fillerId,
fillerType: apiResult.fillerType,
swapFee: {
assetId: apiResult.swapFees.nodes[0]?.assetId,
assetId: apiResult.swapFees.nodes[0]?.asset?.id,
amount: BigInt(apiResult.swapFees.nodes[0]?.amount),
recipientId: apiResult.swapFees.nodes[0]?.recipientId,
},
swapInputAssetBalances: {
amount: BigInt(apiResult.swapInputAssetBalances.nodes[0]?.amount),
assetId: apiResult.swapInputAssetBalances.nodes[0]?.assetId,
amount: BigInt(apiResult.swapInputs.nodes[0]?.amount),
assetId: apiResult.swapInputs.nodes[0]?.asset?.id,
},
swapOutputAssetBalances: {
amount: BigInt(apiResult.swapOutputAssetBalances.nodes[0]?.amount),
assetId: apiResult.swapOutputAssetBalances.nodes[0]?.assetId,
amount: BigInt(apiResult.swapOutputs.nodes[0]?.amount),
assetId: apiResult.swapOutputs.nodes[0]?.asset?.id,
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe('Validation of indexed data against blockchain storage state', () => {
removeStringSeparators(assertBBalancesDecorated.free)
),
poolId: poolAddress,
paraChainBlockHeight: blockHeight,
paraBlockHeight: blockHeight,
};

expect(apiResultTestUnit).toStrictEqual(rpcResultTestUnit);
Expand Down
Loading

0 comments on commit 93d65bf

Please sign in to comment.