Skip to content

Commit

Permalink
chore: fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
shoom3301 committed Nov 27, 2024
1 parent 1cf851f commit 1ff1f2f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/trading/getEthFlowTransaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ describe('getEthFlowTransaction', () => {
const result = await getEthFlowTransaction(signer, appDataKeccak256, params)
const wrappedToken = WRAPPED_NATIVE_CURRENCIES[chainId]

expect(result.transaction.callData.includes(params.sellToken.slice(2))).toBe(false)
expect(result.transaction.callData.includes(wrappedToken.slice(2))).toBe(false)
expect(result.transaction.data.includes(params.sellToken.slice(2))).toBe(false)
expect(result.transaction.data.includes(wrappedToken.slice(2))).toBe(false)
})

it('Should call gas estimation and return estimated value + 20%', async () => {
const result = await getEthFlowTransaction(signer, appDataKeccak256, params)
const gasNum = +GAS

expect(+result.transaction.gasLimit).toBe(gasNum + gasNum * 0.2)
expect(+result.transaction.gas).toBe(gasNum + gasNum * 0.2)
})

it('Transaction value should be equal to sell amount', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/trading/getPreSignTransaction.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('getPreSignTransaction', () => {
const result = await getPreSignTransaction(signer, chainId, account, orderId)
const gasNum = +GAS

expect(+result.gasLimit).toBe(gasNum + gasNum * 0.2)
expect(+result.gas).toBe(gasNum + gasNum * 0.2)
})

it('Tx value should always be zero', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/trading/postOnChainTrade.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ describe('postOnChainTrade', () => {

const call = (signer.sendTransaction as jest.Mock).mock.calls[0][0]

expect(+call.gasLimit).toBe(180000) // 150000 by default + 20%
expect(+call.gas).toBe(180000) // 150000 by default + 20%
})

it('Should create an on-chain transaction with all specified parameters', async () => {
Expand Down

0 comments on commit 1ff1f2f

Please sign in to comment.