• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cowprotocol / cow-sdk / #1878

25 Jun 2025 10:06AM UTC coverage: 73.99% (-0.2%) from 74.222%
#1878

push

shoom3301
fix(bridge): use gasLimit for hook depending on proxy deployment

613 of 875 branches covered (70.06%)

Branch coverage included in aggregate %.

15 of 26 new or added lines in 9 files covered. (57.69%)

2 existing lines in 2 files now uncovered.

1273 of 1674 relevant lines covered (76.05%)

18.14 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/bridging/providers/utils/getGasLimitEstimationForHook.ts
1
import { QuoteBridgeRequest } from '../../types'
2
import type { JsonRpcProvider } from '@ethersproject/providers'
3
import { COW_SHED_PROXY_CREATION_GAS, DEFAULT_GAS_COST_FOR_HOOK_ESTIMATION } from '../../const'
4
import { CowShedSdk } from '../../../cow-shed'
5

6
export async function getGasLimitEstimationForHook(
7
  cowShedSdk: CowShedSdk,
8
  request: QuoteBridgeRequest,
9
  provider: JsonRpcProvider,
10
): Promise<number> {
NEW
11
  const proxyAddress = cowShedSdk.getCowShedAccount(request.sellTokenChainId, request.owner || request.account)
×
NEW
12
  const proxyCode = await provider.getCode(proxyAddress)
×
13

14
  // Proxy is not deployed
NEW
15
  if (!proxyCode || proxyCode === '0x') {
×
NEW
16
    return DEFAULT_GAS_COST_FOR_HOOK_ESTIMATION + COW_SHED_PROXY_CREATION_GAS
×
17
  }
18

NEW
19
  return DEFAULT_GAS_COST_FOR_HOOK_ESTIMATION
×
20
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc