Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

Commit

Permalink
chore: remove redundant awaits
Browse files Browse the repository at this point in the history
  • Loading branch information
0xApotheosis committed Jul 2, 2022
1 parent 272ac37 commit 905f98c
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions packages/swapper/src/swappers/cow/CowSwapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ describe('CowSwapper', () => {
const swapper = new CowSwapper(COW_SWAPPER_DEPS)

describe('static properties', () => {
it('returns the correct swapper name', async () => {
it('returns the correct swapper name', () => {
expect(CowSwapper.swapperName).toEqual('CowSwapper')
})
})
Expand All @@ -58,78 +58,78 @@ describe('CowSwapper', () => {
})

describe('filterAssetIdsBySellable', () => {
it('returns empty array when called with an empty array', async () => {
expect(await swapper.filterAssetIdsBySellable([])).toEqual([])
it('returns empty array when called with an empty array', () => {
expect(swapper.filterAssetIdsBySellable([])).toEqual([])
})

it('returns array filtered out of non erc20 tokens', async () => {
expect(await swapper.filterAssetIdsBySellable(ASSET_IDS)).toEqual([
it('returns array filtered out of non erc20 tokens', () => {
expect(swapper.filterAssetIdsBySellable(ASSET_IDS)).toEqual([
WBTC.assetId,
WETH.assetId,
FOX.assetId
])
})

it('returns array filtered out of unsupported tokens', async () => {
it('returns array filtered out of unsupported tokens', () => {
const assetIds = [FOX.assetId, 'eip155:1/erc20:0xdc49108ce5c57bc3408c3a5e95f3d864ec386ed3']
expect(await swapper.filterAssetIdsBySellable(assetIds)).toEqual([FOX.assetId])
expect(swapper.filterAssetIdsBySellable(assetIds)).toEqual([FOX.assetId])
})
})

describe('filterBuyAssetsBySellAssetId', () => {
it('returns empty array when called with an empty assetIds array', async () => {
it('returns empty array when called with an empty assetIds array', () => {
expect(
await swapper.filterBuyAssetsBySellAssetId({ assetIds: [], sellAssetId: WETH.assetId })
swapper.filterBuyAssetsBySellAssetId({ assetIds: [], sellAssetId: WETH.assetId })
).toEqual([])
})

it('returns empty array when called with sellAssetId that is not sellable', async () => {
it('returns empty array when called with sellAssetId that is not sellable', () => {
expect(
await swapper.filterBuyAssetsBySellAssetId({
swapper.filterBuyAssetsBySellAssetId({
assetIds: ASSET_IDS,
sellAssetId: ETH.assetId
})
).toEqual([])
expect(
await swapper.filterBuyAssetsBySellAssetId({
swapper.filterBuyAssetsBySellAssetId({
assetIds: ASSET_IDS,
sellAssetId: 'eip155:1/erc20:0xdc49108ce5c57bc3408c3a5e95f3d864ec386ed3'
})
).toEqual([])
})

it('returns array filtered out of non erc20 tokens when called with a sellable sellAssetId', async () => {
it('returns array filtered out of non erc20 tokens when called with a sellable sellAssetId', () => {
expect(
await swapper.filterBuyAssetsBySellAssetId({
swapper.filterBuyAssetsBySellAssetId({
assetIds: ASSET_IDS,
sellAssetId: WETH.assetId
})
).toEqual([WBTC.assetId, FOX.assetId])
expect(
await swapper.filterBuyAssetsBySellAssetId({
swapper.filterBuyAssetsBySellAssetId({
assetIds: ASSET_IDS,
sellAssetId: WBTC.assetId
})
).toEqual([WETH.assetId, FOX.assetId])
expect(
await swapper.filterBuyAssetsBySellAssetId({
swapper.filterBuyAssetsBySellAssetId({
assetIds: ASSET_IDS,
sellAssetId: FOX.assetId
})
).toEqual([WBTC.assetId, WETH.assetId])
})

it('returns array filtered out of unsupported tokens when called with a sellable sellAssetId', async () => {
it('returns array filtered out of unsupported tokens when called with a sellable sellAssetId', () => {
const assetIds = [FOX.assetId, 'eip155:1/erc20:0xdc49108ce5c57bc3408c3a5e95f3d864ec386ed3']
expect(
await swapper.filterBuyAssetsBySellAssetId({
swapper.filterBuyAssetsBySellAssetId({
assetIds,
sellAssetId: WETH.assetId
})
).toEqual([FOX.assetId])
expect(
await swapper.filterBuyAssetsBySellAssetId({ assetIds, sellAssetId: FOX.assetId })
).toEqual([])
expect(swapper.filterBuyAssetsBySellAssetId({ assetIds, sellAssetId: FOX.assetId })).toEqual(
[]
)
})
})

Expand Down

0 comments on commit 905f98c

Please sign in to comment.