Skip to content

Commit 285645f

Browse files
committed
improves types
Signed-off-by: Konstantina Blazhukova <[email protected]>
1 parent 7425fb7 commit 285645f

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

packages/relay/src/lib/types/debug.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
// SPDX-License-Identifier: Apache-2.0
22

33
import { TracerType } from '../constants';
4-
import { ICallTracerConfig, IOpcodeLoggerConfig } from './ITracerConfig';
4+
import { ICallTracerConfig, ITracerConfig } from './ITracerConfig';
55

66
/**
77
* Configuration object for block tracing operations.
88
*/
9-
export interface BlockTracerConfig {
10-
/** The type of tracer to use for block tracing. */
9+
interface TracerConfig<T extends ITracerConfig = ITracerConfig> {
10+
/** The type of tracer to use for tracing. */
1111
tracer: TracerType;
12-
/** Optional configuration for the call tracer. */
13-
tracerConfig?: ICallTracerConfig;
12+
/** Optional configuration for the tracer. */
13+
tracerConfig?: T;
1414
}
1515

16-
export interface TransactionTracerConfig {
17-
/** The type of tracer to use for block tracing. */
18-
tracer: TracerType;
19-
/** Optional configuration for the call tracer. */
20-
tracerConfig?: ICallTracerConfig | IOpcodeLoggerConfig;
21-
}
16+
// Public exports
17+
export type BlockTracerConfig = TracerConfig<ICallTracerConfig>;
18+
export type TransactionTracerConfig = TracerConfig<ITracerConfig>;
2219

2320
/**
2421
* Represents the state of an entity during a trace operation.

0 commit comments

Comments
 (0)