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

cowprotocol / cow-sdk / 6050580959

01 Sep 2023 02:21PM UTC coverage: 76.253% (+2.5%) from 73.747%
6050580959

Pull #161

github

web-flow
Merge e89b090ca into c1ed7971e
Pull Request #161: [Polling tests] Validate concrete orders

194 of 275 branches covered (0.0%)

Branch coverage included in aggregate %.

384 of 483 relevant lines covered (79.5%)

19.21 hits per line

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

0.0
/src/composable/ConditionalOrderFactory.ts
1
import { type ConditionalOrder } from './ConditionalOrder'
2
import { ConditionalOrderParams } from './types'
3

4
export type FromParams<D, S> = (params: ConditionalOrderParams) => ConditionalOrder<D, S>
5
export type ConditionalOrderRegistry = Record<string, FromParams<unknown, unknown>>
6

7
export class ConditionalOrderFactory {
8
  public knownOrderTypes
9

10
  constructor(registry: ConditionalOrderRegistry) {
11
    this.knownOrderTypes = registry
×
12
  }
13

14
  public fromParams(params: ConditionalOrderParams): ConditionalOrder<unknown, unknown> | undefined {
15
    const { handler } = params
×
16

17
    const factory = this.knownOrderTypes[handler]
×
18
    if (!factory) {
×
19
      return undefined
×
20
    }
21

22
    return factory(params)
×
23
  }
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