-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check existence of the order in the orderbook, and add polledOrderInO…
…rderbook (#166) * Check existence of the order in the orderbook, and add polledOrderInOrderbook * Fix unit tests by mocking * Rename function to handle order in API * Fix tests
- Loading branch information
Showing
9 changed files
with
98 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
jest.mock('../api', () => { | ||
return { | ||
OrderBookApi: class MockedOrderBookApi { | ||
getOrder = mockGetOrder | ||
}, | ||
} | ||
}) | ||
|
||
export const mockGetOrder = jest.fn() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import type { Order } from '@cowprotocol/contracts' | ||
import type { SupportedChainId } from './common' | ||
import { OrderSigningUtils } from './order-signing' | ||
|
||
export async function computeOrderUid(chainId: SupportedChainId, owner: string, order: Order): Promise<string> { | ||
const { computeOrderUid: _computeOrderUid } = await import('@cowprotocol/contracts') | ||
const domain = await OrderSigningUtils.getDomain(chainId) | ||
|
||
return _computeOrderUid(domain, order, owner) | ||
} |