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

cowprotocol / cow-sdk / #1780

29 May 2025 01:25PM UTC coverage: 76.278% (-1.2%) from 77.485%
#1780

Pull #324

shoom3301
chore: unknown status
Pull Request #324: feat(bridge): track order progress

485 of 689 branches covered (70.39%)

Branch coverage included in aggregate %.

27 of 76 new or added lines in 13 files covered. (35.53%)

2 existing lines in 2 files now uncovered.

1097 of 1385 relevant lines covered (79.21%)

20.11 hits per line

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

0.0
/src/bridging/BridgingSdk/findBridgeProviderFromHook.ts
1
import { getPostHooks } from '../utils'
2
import { HOOK_DAPP_BRIDGE_PROVIDER_PREFIX } from '../const'
3
import { BridgeProvider, BridgeQuoteResult } from '../types'
4

5
export function findBridgeProviderFromHook(
6
  fullAppData: string,
7
  providers: BridgeProvider<BridgeQuoteResult>[],
8
): BridgeProvider<BridgeQuoteResult> | undefined {
NEW
9
  const postHooks = getPostHooks(fullAppData)
×
10

11
  // Assuming we only have one bridging hook
NEW
12
  const bridgingHook = postHooks.find((hook) => {
×
NEW
13
    return hook.dappId?.startsWith(HOOK_DAPP_BRIDGE_PROVIDER_PREFIX)
×
14
  })
15

NEW
16
  if (!bridgingHook) {
×
NEW
17
    return undefined
×
18
  }
19
  // Bridge provider would be the last part of the dappId
NEW
20
  const bridgeProviderDappId = bridgingHook.dappId
×
21

22
  // Find the provider by name (note that I could just have use this.provider, but just wanted to leave it ready in case we implement multiple providers)
NEW
23
  return providers.find((provider) => provider.info.dappId === bridgeProviderDappId)
×
24
}
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