Skip to content

Commit

Permalink
Merge branch 'swap/complete-orders' into passwoard-error-reset
Browse files Browse the repository at this point in the history
Signed-off-by: Sorin Chis <[email protected]>
  • Loading branch information
SorinC6 authored Oct 10, 2023
2 parents f7c4d1c + b1e1ad2 commit 54e8ccb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 28 deletions.
2 changes: 2 additions & 0 deletions apps/wallet-mobile/src/features/Swap/common/useSwapTx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ export const useSwapTx = (options?: UseMutationOptions<YoroiUnsignedTx, Error, {
buyTokenId: orderData.amounts.buy.tokenId,
buyQuantity: orderData.amounts.buy.quantity,
feeTokenId: pool?.deposit.tokenId,
feeTokenId: pool?.deposit.tokenId,

}),
),
},
Expand Down
29 changes: 1 addition & 28 deletions packages/swap/src/adapters/openswap-api/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,34 +329,7 @@ describe('swapApiMaker', () => {
isMainnet: true,
stakingKey,
primaryTokenId,
},
{
openswap: mockOpenSwapApi,
},
)

const result = await api.getPrice({
baseToken: '',
quoteToken:
'29d222ce763455e3d7a09a665ce554f00ac89d2e99a1a83d267170c6.4d494e',
})

expect(result).toBe(0.07080044463)
expect(mockOpenSwapApi.getPrice).toHaveBeenCalledTimes(1)
})
})

describe('getPrice', () => {
it('mainnet', async () => {
mockOpenSwapApi.getPrice = jest
.fn()
.mockResolvedValue(openswapMocks.getPrice)

const api = swapApiMaker(
{
isMainnet: true,
stakingKey,
primaryTokenId,
supportedProviders,
},
{
openswap: mockOpenSwapApi,
Expand Down

0 comments on commit 54e8ccb

Please sign in to comment.