Skip to content

Commit

Permalink
fix: cowswap tests
Browse files Browse the repository at this point in the history
  • Loading branch information
woodenfurniture committed Nov 24, 2024
1 parent 8b82fdb commit 7f1ec5f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions packages/swapper/src/swappers/CowSwapper/CowSwapper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ describe('cowApi', () => {
buyAmount: '289305614806369753',
validTo: 1712259433,
appData:
'{"appCode":"shapeshift","metadata":{"orderClass":{"orderClass":"market"},"quote":{"slippageBips":"50"}},"version":"0.9.0"}',
appDataHash: '0x9b3c15b566e3b432f1ba3533bb0b071553fd03cec359caf3e6559b29fec1e62e',
'{"appCode":"shapeshift","metadata":{"orderClass":{"orderClass":"market"},"quote":{"slippageBips":50}},"version":"1.3.0"}',
appDataHash: '0x41fffc0127f56060cc551652721d84c336f87649a20c51fcff5b8841dfeabe5b',
feeAmount: '184116879335769833472',
kind: 'sell',
partiallyFillable: false,
Expand Down Expand Up @@ -306,8 +306,8 @@ describe('cowApi', () => {
buyAmount: '287859086732337904',
validTo: 1712259433,
appData:
'{"appCode":"shapeshift","metadata":{"orderClass":{"orderClass":"market"},"quote":{"slippageBips":"50"}},"version":"0.9.0"}',
appDataHash: '0x9b3c15b566e3b432f1ba3533bb0b071553fd03cec359caf3e6559b29fec1e62e',
'{"appCode":"shapeshift","metadata":{"orderClass":{"orderClass":"market"},"quote":{"slippageBips":50}},"version":"1.3.0"}',
appDataHash: '0x41fffc0127f56060cc551652721d84c336f87649a20c51fcff5b8841dfeabe5b',
feeAmount: '0',
kind: 'sell',
partiallyFillable: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ vi.mock('../../utils/helpers/helpers', async () => {

const expectedApiInputWethToFox: CowSwapSellQuoteApiInput = {
appData:
'{"appCode":"shapeshift","metadata":{"orderClass":{"orderClass":"market"},"quote":{"slippageBips":"50"}},"version":"0.9.0"}',
appDataHash: '0x9b3c15b566e3b432f1ba3533bb0b071553fd03cec359caf3e6559b29fec1e62e',
'{"appCode":"shapeshift","metadata":{"orderClass":{"orderClass":"market"},"quote":{"slippageBips":50}},"version":"1.3.0"}',
appDataHash: '0x41fffc0127f56060cc551652721d84c336f87649a20c51fcff5b8841dfeabe5b',
buyToken: '0xc770eefad204b5180df6a14ee197d99d808ee52d',
from: '0x0000000000000000000000000000000000000000',
kind: 'sell',
Expand All @@ -81,8 +81,8 @@ const expectedApiInputWethToFox: CowSwapSellQuoteApiInput = {

const expectedApiInputSmallAmountWethToFox: CowSwapSellQuoteApiInput = {
appData:
'{"appCode":"shapeshift","metadata":{"orderClass":{"orderClass":"market"},"quote":{"slippageBips":"50"}},"version":"0.9.0"}',
appDataHash: '0x9b3c15b566e3b432f1ba3533bb0b071553fd03cec359caf3e6559b29fec1e62e',
'{"appCode":"shapeshift","metadata":{"orderClass":{"orderClass":"market"},"quote":{"slippageBips":50}},"version":"1.3.0"}',
appDataHash: '0x41fffc0127f56060cc551652721d84c336f87649a20c51fcff5b8841dfeabe5b',
buyToken: '0xc770eefad204b5180df6a14ee197d99d808ee52d',
from: '0x0000000000000000000000000000000000000000',
kind: 'sell',
Expand All @@ -95,8 +95,8 @@ const expectedApiInputSmallAmountWethToFox: CowSwapSellQuoteApiInput = {

const expectedApiInputFoxToEth: CowSwapSellQuoteApiInput = {
appData:
'{"appCode":"shapeshift","metadata":{"orderClass":{"orderClass":"market"},"quote":{"slippageBips":"50"}},"version":"0.9.0"}',
appDataHash: '0x9b3c15b566e3b432f1ba3533bb0b071553fd03cec359caf3e6559b29fec1e62e',
'{"appCode":"shapeshift","metadata":{"orderClass":{"orderClass":"market"},"quote":{"slippageBips":50}},"version":"1.3.0"}',
appDataHash: '0x41fffc0127f56060cc551652721d84c336f87649a20c51fcff5b8841dfeabe5b',
buyToken: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
from: '0x0000000000000000000000000000000000000000',
kind: 'sell',
Expand All @@ -109,8 +109,8 @@ const expectedApiInputFoxToEth: CowSwapSellQuoteApiInput = {

const expectedApiInputUsdcGnosisToXdai: CowSwapSellQuoteApiInput = {
appData:
'{"appCode":"shapeshift","metadata":{"orderClass":{"orderClass":"market"},"quote":{"slippageBips":"50"}},"version":"0.9.0"}',
appDataHash: '0x9b3c15b566e3b432f1ba3533bb0b071553fd03cec359caf3e6559b29fec1e62e',
'{"appCode":"shapeshift","metadata":{"orderClass":{"orderClass":"market"},"quote":{"slippageBips":50}},"version":"1.3.0"}',
appDataHash: '0x41fffc0127f56060cc551652721d84c336f87649a20c51fcff5b8841dfeabe5b',
buyToken: COW_SWAP_NATIVE_ASSET_MARKER_ADDRESS,
from: '0x0000000000000000000000000000000000000000',
kind: 'sell',
Expand All @@ -123,8 +123,8 @@ const expectedApiInputUsdcGnosisToXdai: CowSwapSellQuoteApiInput = {

const expectedApiInputUsdcToEthArbitrum: CowSwapSellQuoteApiInput = {
appData:
'{"appCode":"shapeshift","metadata":{"orderClass":{"orderClass":"market"},"quote":{"slippageBips":"50"}},"version":"0.9.0"}',
appDataHash: '0x9b3c15b566e3b432f1ba3533bb0b071553fd03cec359caf3e6559b29fec1e62e',
'{"appCode":"shapeshift","metadata":{"orderClass":{"orderClass":"market"},"quote":{"slippageBips":50}},"version":"1.3.0"}',
appDataHash: '0x41fffc0127f56060cc551652721d84c336f87649a20c51fcff5b8841dfeabe5b',
buyToken: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
from: '0x0000000000000000000000000000000000000000',
kind: 'sell',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ describe('utils', () => {
expect(result).toHaveProperty('appDataHash')
expect(result).toHaveProperty('appData')
expect(result).toEqual({
appDataHash: '0x9b3c15b566e3b432f1ba3533bb0b071553fd03cec359caf3e6559b29fec1e62e',
appDataHash: '0x41fffc0127f56060cc551652721d84c336f87649a20c51fcff5b8841dfeabe5b',
appData:
'{"appCode":"shapeshift","metadata":{"orderClass":{"orderClass":"market"},"quote":{"slippageBips":"50"}},"version":"0.9.0"}',
'{"appCode":"shapeshift","metadata":{"orderClass":{"orderClass":"market"},"quote":{"slippageBips":50}},"version":"1.3.0"}',
})
})
it('should return correct AppData for given inputs for affiliate fee', async () => {
Expand All @@ -73,9 +73,9 @@ describe('utils', () => {
expect(result).toHaveProperty('appDataHash')
expect(result).toHaveProperty('appData')
expect(result).toEqual({
appDataHash: '0x415378688feaaa6cfcdb873d9b467c8201b821cfa3a567f058c04871d317da34',
appDataHash: '0x6a731164dc2bb01874c1537079a3f543894da3b5803dcfed23aaf8396c919be2',
appData:
'{"appCode":"shapeshift","metadata":{"orderClass":{"orderClass":"market"},"partnerFee":{"bps":48,"recipient":"0xb0E3175341794D1dc8E5F02a02F9D26989EbedB3"},"quote":{"slippageBips":"50"}},"version":"0.9.0"}',
'{"appCode":"shapeshift","metadata":{"orderClass":{"orderClass":"market"},"partnerFee":{"bps":48,"recipient":"0xb0E3175341794D1dc8E5F02a02F9D26989EbedB3"},"quote":{"slippageBips":50}},"version":"1.3.0"}',
})
})
})
Expand Down

0 comments on commit 7f1ec5f

Please sign in to comment.