@@ -123,12 +123,6 @@ export const OBJECTS_VALIDATIONS: { [key: string]: IObjectSchema } = {
123
123
nullable : false ,
124
124
required : false ,
125
125
} ,
126
- // CallTracer config properties at top level
127
- onlyTopCall : {
128
- type : 'boolean' ,
129
- nullable : false ,
130
- required : false ,
131
- } ,
132
126
// OpcodeLogger config properties at top level
133
127
enableMemory : {
134
128
type : 'boolean' ,
@@ -261,9 +255,8 @@ export function validateTracerConfigWrapper(param: any): boolean {
261
255
const callTracerKeys = Object . keys ( OBJECTS_VALIDATIONS . callTracerConfig . properties ) ;
262
256
const opcodeLoggerKeys = Object . keys ( OBJECTS_VALIDATIONS . opcodeLoggerConfig . properties ) ;
263
257
264
- // Check for tracer config properties at the top level
258
+ // Check for opcodeLogger config properties at the top level
265
259
const topLevelKeys = Object . keys ( param ) ;
266
- const hasTopLevelCallTracerKeys = topLevelKeys . some ( ( k ) => callTracerKeys . includes ( k ) ) ;
267
260
const hasTopLevelOpcodeLoggerKeys = topLevelKeys . some ( ( k ) => opcodeLoggerKeys . includes ( k ) ) ;
268
261
269
262
// Check for tracer config properties in nested tracerConfig
@@ -276,7 +269,7 @@ export function validateTracerConfigWrapper(param: any): boolean {
276
269
}
277
270
278
271
// Don't allow both top-level and nested config properties at the same time
279
- if ( ( hasTopLevelCallTracerKeys || hasTopLevelOpcodeLoggerKeys ) && tracerConfig ) {
272
+ if ( hasTopLevelOpcodeLoggerKeys && tracerConfig ) {
280
273
throw predefined . INVALID_PARAMETER (
281
274
1 ,
282
275
`Cannot specify tracer config properties both at top level and in 'tracerConfig' for ${ schema . name } ` ,
@@ -286,18 +279,23 @@ export function validateTracerConfigWrapper(param: any): boolean {
286
279
// Determine which tracer type should be used
287
280
const effectiveTracer = tracer ?? TracerType . OpcodeLogger ; // Default to opcodeLogger if no tracer specified
288
281
289
- // Validate that the right config properties are used with the right tracer
290
- const hasCallTracerKeys = hasTopLevelCallTracerKeys || hasNestedCallTracerKeys ;
291
- const hasOpcodeLoggerKeys = hasTopLevelOpcodeLoggerKeys || hasNestedOpcodeLoggerKeys ;
282
+ // Validate that opcodeLogger config properties are only used with opcodeLogger tracer
283
+ if ( hasTopLevelOpcodeLoggerKeys && effectiveTracer !== TracerType . OpcodeLogger ) {
284
+ throw predefined . INVALID_PARAMETER (
285
+ 1 ,
286
+ `opcodeLogger config properties for ${ schema . name } are only valid when tracer=${ TracerType . OpcodeLogger } ` ,
287
+ ) ;
288
+ }
292
289
293
- if ( hasCallTracerKeys && effectiveTracer === TracerType . OpcodeLogger ) {
290
+ // Validate nested config properties with tracer types (existing logic)
291
+ if ( hasNestedCallTracerKeys && effectiveTracer === TracerType . OpcodeLogger ) {
294
292
throw predefined . INVALID_PARAMETER (
295
293
1 ,
296
294
`callTracer config properties for ${ schema . name } are only valid when tracer=${ TracerType . CallTracer } ` ,
297
295
) ;
298
296
}
299
297
300
- if ( hasOpcodeLoggerKeys && effectiveTracer !== TracerType . OpcodeLogger ) {
298
+ if ( hasNestedOpcodeLoggerKeys && effectiveTracer !== TracerType . OpcodeLogger ) {
301
299
throw predefined . INVALID_PARAMETER (
302
300
1 ,
303
301
`opcodeLogger config properties for ${ schema . name } are only valid when tracer=${ TracerType . OpcodeLogger } ` ,
0 commit comments