From 0197741caf32c255bb193b96f17ba14cda8d120c Mon Sep 17 00:00:00 2001 From: Benjamin DeMann Date: Wed, 17 Jan 2024 12:18:29 -0700 Subject: [PATCH] WIP make sure tests pass --- .../complex_candid_definition_memo.ts | 32 +++---------------- .../candid/candid_definition_arb/index.ts | 10 ++---- .../recursive_candid_definition_memo.ts | 14 +++----- .../candid/candid_definition_arb/types.ts | 1 - .../constructed/opt_arb/definition_arb.ts | 7 ++-- .../candid/constructed/opt_arb/index.ts | 11 ++----- .../constructed/record_arb/definition_arb.ts | 5 ++- .../candid/constructed/record_arb/index.ts | 2 +- .../constructed/tuple_arb/definition_arb.ts | 5 ++- .../candid/constructed/tuple_arb/index.ts | 2 +- .../variant_arb/definition_arbs.ts | 17 +++------- .../candid/constructed/variant_arb/index.ts | 11 ++----- .../constructed/vec_arb/definition_arb.ts | 13 ++------ .../candid/constructed/vec_arb/index.ts | 11 ++----- .../candid/recursive/definition_arb.ts | 28 +++++++--------- .../arbitraries/candid/recursive/index.ts | 11 ++----- .../reference/func_arb/definition_arb.ts | 5 ++- .../candid/reference/func_arb/index.ts | 2 +- .../reference/service_arb/definition_arb.ts | 6 ++-- .../candid/reference/service_arb/index.ts | 2 +- 20 files changed, 55 insertions(+), 140 deletions(-) diff --git a/property_tests/arbitraries/candid/candid_definition_arb/complex_candid_definition_memo.ts b/property_tests/arbitraries/candid/candid_definition_arb/complex_candid_definition_memo.ts index 943ba46d04..08cb9f841f 100644 --- a/property_tests/arbitraries/candid/candid_definition_arb/complex_candid_definition_memo.ts +++ b/property_tests/arbitraries/candid/candid_definition_arb/complex_candid_definition_memo.ts @@ -31,7 +31,6 @@ export const COMPLEX_ARB_COUNT = 8; export function complexCandidDefinitionMemo( parents: RecursiveCandidName[], - recursiveShapes: RecursiveShapes, constraints: DefinitionConstraints = {} ): CandidDefinitionMemo { const weights = constraints.weights ?? {}; @@ -51,12 +50,7 @@ export function complexCandidDefinitionMemo( }, { arbitrary: FuncDefinitionArb( - candidDefinitionMemo( - [], - recursiveShapes, - newConstraints - )(depthLevel), - recursiveShapes + candidDefinitionMemo([], newConstraints)(depthLevel) ), weight: weights.func ?? 1 }, @@ -64,30 +58,19 @@ export function complexCandidDefinitionMemo( arbitrary: OptDefinitionArb( candidDefinitionMemo, parents, - recursiveShapes, newConstraints ), weight: weights.opt ?? 1 }, { arbitrary: RecordDefinitionArb( - candidDefinitionMemo( - [], - recursiveShapes, - newConstraints - )(depthLevel), - recursiveShapes + candidDefinitionMemo([], newConstraints)(depthLevel) ), weight: weights.record ?? 1 }, { arbitrary: TupleDefinitionArb( - candidDefinitionMemo( - [], - recursiveShapes, - newConstraints - )(depthLevel), - recursiveShapes + candidDefinitionMemo([], newConstraints)(depthLevel) ), weight: weights.tuple ?? 1 }, @@ -95,7 +78,6 @@ export function complexCandidDefinitionMemo( arbitrary: VariantDefinitionArb( candidDefinitionMemo, parents, - recursiveShapes, newConstraints ), weight: weights.variant ?? 1 @@ -104,19 +86,13 @@ export function complexCandidDefinitionMemo( arbitrary: VecDefinitionArb( candidDefinitionMemo, parents, - recursiveShapes, constraints ), weight: weights.vec ?? 1 }, { arbitrary: ServiceDefinitionArb( - candidDefinitionMemo( - [], - recursiveShapes, - newConstraints - )(depthLevel), - recursiveShapes + candidDefinitionMemo([], newConstraints)(depthLevel) ), weight: weights.service ?? 0 // TODO Service is disabled until it is more refined. Maybe the diff --git a/property_tests/arbitraries/candid/candid_definition_arb/index.ts b/property_tests/arbitraries/candid/candid_definition_arb/index.ts index a9aaaa6747..c86ea1aa33 100644 --- a/property_tests/arbitraries/candid/candid_definition_arb/index.ts +++ b/property_tests/arbitraries/candid/candid_definition_arb/index.ts @@ -27,14 +27,12 @@ export function candidDefinitionArb( ): CandidDefinitionArb { return candidDefinitionMemo( parents, - recursiveShapes, constraints )(constraints.depthLevel ?? DEFAULT_DEFINITION_MAX_DEPTH); } export function candidDefinitionMemo( parents: RecursiveCandidName[], - recursiveShapes: RecursiveShapes, constraints: DefinitionConstraints = {} ): CandidDefinitionMemo { return fc.memo((depthLevel) => { @@ -49,16 +47,14 @@ export function candidDefinitionMemo( { arbitrary: complexCandidDefinitionMemo( parents, - recursiveShapes, constraints )(depthLevel - 1), weight: COMPLEX_ARB_COUNT }, { - arbitrary: recursiveCandidDefinitionMemo( - parents, - recursiveShapes - )(depthLevel - 1), + arbitrary: recursiveCandidDefinitionMemo(parents)( + depthLevel - 1 + ), weight: REC_ARB_COUNT } ); diff --git a/property_tests/arbitraries/candid/candid_definition_arb/recursive_candid_definition_memo.ts b/property_tests/arbitraries/candid/candid_definition_arb/recursive_candid_definition_memo.ts index e79f8fa7fc..8505d31af7 100644 --- a/property_tests/arbitraries/candid/candid_definition_arb/recursive_candid_definition_memo.ts +++ b/property_tests/arbitraries/candid/candid_definition_arb/recursive_candid_definition_memo.ts @@ -12,17 +12,11 @@ export const REC_ARB_COUNT = 0; // https://github.com/demergent-labs/azle/issues/1525 export function recursiveCandidDefinitionMemo( - parents: RecursiveCandidName[], - recursiveShapes: RecursiveShapes + parents: RecursiveCandidName[] ): CandidDefinitionMemo { return fc.memo((depthLevel) => - RecursiveDefinitionArb( - complexCandidDefinitionMemo, - parents, - recursiveShapes, - { - depthLevel: depthLevel - } - ) + RecursiveDefinitionArb(complexCandidDefinitionMemo, parents, { + depthLevel: depthLevel + }) ); } diff --git a/property_tests/arbitraries/candid/candid_definition_arb/types.ts b/property_tests/arbitraries/candid/candid_definition_arb/types.ts index 80dd91b0b0..8011b9d371 100644 --- a/property_tests/arbitraries/candid/candid_definition_arb/types.ts +++ b/property_tests/arbitraries/candid/candid_definition_arb/types.ts @@ -11,7 +11,6 @@ export type CandidDefinitionMemo = ( ) => WithShapesArb; export type RecursiveCandidDefinitionMemo = ( parents: RecursiveCandidName[], - recursiveShapes: RecursiveShapes, constraints?: DefinitionConstraints ) => CandidDefinitionMemo; diff --git a/property_tests/arbitraries/candid/constructed/opt_arb/definition_arb.ts b/property_tests/arbitraries/candid/constructed/opt_arb/definition_arb.ts index 7b234e1dbd..c2baec9811 100644 --- a/property_tests/arbitraries/candid/constructed/opt_arb/definition_arb.ts +++ b/property_tests/arbitraries/candid/constructed/opt_arb/definition_arb.ts @@ -15,7 +15,6 @@ import { RecursiveShapes } from '../../recursive'; export function OptDefinitionArb( candidTypeArbForInnerType: RecursiveCandidDefinitionMemo, parents: RecursiveCandidName[], - recursiveShapes: RecursiveShapes, constraints: DefinitionConstraints ): WithShapesArb { return fc @@ -24,7 +23,6 @@ export function OptDefinitionArb( possiblyRecursiveArb( candidTypeArbForInnerType, parents, - recursiveShapes, constraints ), fc.boolean() @@ -82,7 +80,6 @@ export function OptDefinitionArb( function possiblyRecursiveArb( candidArb: RecursiveCandidDefinitionMemo, parents: RecursiveCandidName[], - recursiveShapes: RecursiveShapes, constraints: DefinitionConstraints ): WithShapesArb { const depthLevel = constraints.depthLevel ?? 0; @@ -90,7 +87,7 @@ function possiblyRecursiveArb( if (parents.length === 0 || depthLevel < 1) { // If there are no recursive parents or we have reached a depth // level of 0 just do a regular arb inner type - return candidArb(parents, recursiveShapes)(depthLevel); + return candidArb(parents)(depthLevel); } return fc.oneof( { @@ -101,7 +98,7 @@ function possiblyRecursiveArb( weight: 1 }, { - arbitrary: candidArb(parents, recursiveShapes)(depthLevel), + arbitrary: candidArb(parents)(depthLevel), weight: 1 } ); diff --git a/property_tests/arbitraries/candid/constructed/opt_arb/index.ts b/property_tests/arbitraries/candid/constructed/opt_arb/index.ts index fc73b9ef0c..0e3bd60fb2 100644 --- a/property_tests/arbitraries/candid/constructed/opt_arb/index.ts +++ b/property_tests/arbitraries/candid/constructed/opt_arb/index.ts @@ -11,14 +11,9 @@ export type Opt = [CorrespondingJSType] | never[]; export function OptArb(): fc.Arbitrary> { return CandidValueAndMetaArbGenerator( - OptDefinitionArb( - candidDefinitionMemo, - [], - {}, - { - depthLevel: DEFAULT_DEFINITION_MAX_DEPTH - } - ), + OptDefinitionArb(candidDefinitionMemo, [], { + depthLevel: DEFAULT_DEFINITION_MAX_DEPTH + }), OptValuesArb ); } diff --git a/property_tests/arbitraries/candid/constructed/record_arb/definition_arb.ts b/property_tests/arbitraries/candid/constructed/record_arb/definition_arb.ts index b208f7a88e..c38f41ad38 100644 --- a/property_tests/arbitraries/candid/constructed/record_arb/definition_arb.ts +++ b/property_tests/arbitraries/candid/constructed/record_arb/definition_arb.ts @@ -18,8 +18,7 @@ type RuntimeRecord = { }; export function RecordDefinitionArb( - fieldCandidDefArb: CandidDefinitionArb, - recShapes: RecursiveShapes + fieldCandidDefArb: CandidDefinitionArb ): WithShapesArb { return fc .tuple( @@ -44,7 +43,7 @@ export function RecordDefinitionArb( (acc, field): RecursiveShapes => { return { ...acc, ...field[1].recursiveShapes }; }, - recShapes + {} ); const candidTypeAnnotation = generateCandidTypeAnnotation( useTypeDeclaration, diff --git a/property_tests/arbitraries/candid/constructed/record_arb/index.ts b/property_tests/arbitraries/candid/constructed/record_arb/index.ts index bdfe77b3f0..6d49715010 100644 --- a/property_tests/arbitraries/candid/constructed/record_arb/index.ts +++ b/property_tests/arbitraries/candid/constructed/record_arb/index.ts @@ -16,7 +16,7 @@ export function RecordArb( arb: CandidDefinitionArb = candidDefinitionArb({}) ): fc.Arbitrary> { return CandidValueAndMetaArbGenerator( - RecordDefinitionArb(arb, {}), + RecordDefinitionArb(arb), RecordValuesArb ); } diff --git a/property_tests/arbitraries/candid/constructed/tuple_arb/definition_arb.ts b/property_tests/arbitraries/candid/constructed/tuple_arb/definition_arb.ts index cc15f27bb2..d207d1850e 100644 --- a/property_tests/arbitraries/candid/constructed/tuple_arb/definition_arb.ts +++ b/property_tests/arbitraries/candid/constructed/tuple_arb/definition_arb.ts @@ -10,8 +10,7 @@ import { CandidType, Tuple } from '../../../../../src/lib'; import { RecursiveShapes } from '../../recursive'; export function TupleDefinitionArb( - candidTypeArbForFields: WithShapesArb, - recShapes: RecursiveShapes + candidTypeArbForFields: WithShapesArb ): WithShapesArb { return fc .tuple( @@ -35,7 +34,7 @@ export function TupleDefinitionArb( (acc, field): RecursiveShapes => { return { ...acc, ...field.recursiveShapes }; }, - recShapes + {} ); const candidTypeAnnotation = generateCandidTypeAnnotation( useTypeDeclaration, diff --git a/property_tests/arbitraries/candid/constructed/tuple_arb/index.ts b/property_tests/arbitraries/candid/constructed/tuple_arb/index.ts index 9abb25bd1a..e3733c3cba 100644 --- a/property_tests/arbitraries/candid/constructed/tuple_arb/index.ts +++ b/property_tests/arbitraries/candid/constructed/tuple_arb/index.ts @@ -14,7 +14,7 @@ export function TupleArb( fieldCandidDefinitionArb = candidDefinitionArb({}) ): fc.Arbitrary> { return CandidValueAndMetaArbGenerator( - TupleDefinitionArb(fieldCandidDefinitionArb, {}), + TupleDefinitionArb(fieldCandidDefinitionArb), TupleValuesArb ); } diff --git a/property_tests/arbitraries/candid/constructed/variant_arb/definition_arbs.ts b/property_tests/arbitraries/candid/constructed/variant_arb/definition_arbs.ts index 9563bae0ae..3d3c0fcbfb 100644 --- a/property_tests/arbitraries/candid/constructed/variant_arb/definition_arbs.ts +++ b/property_tests/arbitraries/candid/constructed/variant_arb/definition_arbs.ts @@ -23,18 +23,12 @@ type RuntimeVariant = { export function VariantDefinitionArb( candidTypeArbForFields: RecursiveCandidDefinitionMemo, parents: RecursiveCandidName[], - recShapes: RecursiveShapes, constraints: DefinitionConstraints ): WithShapesArb { return fc .tuple( UniqueIdentifierArb('typeDeclaration'), - VariantFieldsArb( - candidTypeArbForFields, - parents, - recShapes, - constraints - ), + VariantFieldsArb(candidTypeArbForFields, parents, constraints), fc.boolean() ) .map( @@ -50,7 +44,7 @@ export function VariantDefinitionArb( (acc, field): RecursiveShapes => { return { ...acc, ...field[1].recursiveShapes }; }, - recShapes + {} ); const candidTypeAnnotation = generateCandidTypeAnnotation( useTypeDeclaration, @@ -97,7 +91,6 @@ export function VariantDefinitionArb( function VariantFieldsArb( candidTypeArb: RecursiveCandidDefinitionMemo, parents: RecursiveCandidName[], - recursiveShapes: RecursiveShapes, constraints: DefinitionConstraints ): fc.Arbitrary { // Although no minLength is technically required (according to the @@ -117,7 +110,6 @@ function VariantFieldsArb( candidTypeArb, index, parents, - recursiveShapes, constraints ) ) @@ -138,14 +130,13 @@ function possiblyRecursiveArb( candidArb: RecursiveCandidDefinitionMemo, index: number, parents: RecursiveCandidName[], - recursiveShapes: RecursiveShapes, constraints: DefinitionConstraints ): WithShapesArb { const depthLevel = constraints?.depthLevel ?? 0; return fc.nat(Math.max(parents.length - 1, 0)).chain((randomIndex) => { if (parents.length === 0 || index < 1) { // If there are no recursive parents or this is the first variant field just do a regular arb field - return candidArb(parents, recursiveShapes)(depthLevel); + return candidArb(parents)(depthLevel); } return fc.oneof( { @@ -156,7 +147,7 @@ function possiblyRecursiveArb( weight: 1 }, { - arbitrary: candidArb(parents, recursiveShapes)(depthLevel), + arbitrary: candidArb(parents)(depthLevel), weight: 1 } ); diff --git a/property_tests/arbitraries/candid/constructed/variant_arb/index.ts b/property_tests/arbitraries/candid/constructed/variant_arb/index.ts index 47059e4878..94624e9def 100644 --- a/property_tests/arbitraries/candid/constructed/variant_arb/index.ts +++ b/property_tests/arbitraries/candid/constructed/variant_arb/index.ts @@ -14,14 +14,9 @@ export type Variant = { export function VariantArb(): fc.Arbitrary> { return CandidValueAndMetaArbGenerator( - VariantDefinitionArb( - candidDefinitionMemo, - [], - {}, - { - depthLevel: DEFAULT_DEFINITION_MAX_DEPTH - 1 - } - ), + VariantDefinitionArb(candidDefinitionMemo, [], { + depthLevel: DEFAULT_DEFINITION_MAX_DEPTH - 1 + }), VariantValuesArb ); } diff --git a/property_tests/arbitraries/candid/constructed/vec_arb/definition_arb.ts b/property_tests/arbitraries/candid/constructed/vec_arb/definition_arb.ts index 92bfd56ded..94c5a7c65b 100644 --- a/property_tests/arbitraries/candid/constructed/vec_arb/definition_arb.ts +++ b/property_tests/arbitraries/candid/constructed/vec_arb/definition_arb.ts @@ -15,18 +15,12 @@ import { RecursiveShapes } from '../../recursive'; export function VecDefinitionArb( candidTypeArb: RecursiveCandidDefinitionMemo, parents: RecursiveCandidName[], - recursiveShapes: RecursiveShapes, constraints: DefinitionConstraints ): WithShapesArb { return fc .tuple( UniqueIdentifierArb('typeDeclaration'), - possiblyRecursiveArb( - candidTypeArb, - parents, - recursiveShapes, - constraints - ), + possiblyRecursiveArb(candidTypeArb, parents, constraints), fc.boolean() ) .map( @@ -82,14 +76,13 @@ export function VecDefinitionArb( function possiblyRecursiveArb( candidArb: RecursiveCandidDefinitionMemo, parents: RecursiveCandidName[], - recursiveShapes: RecursiveShapes, constraints: DefinitionConstraints ): WithShapesArb { const depthLevel = constraints?.depthLevel ?? 0; return fc.nat(Math.max(parents.length - 1, 0)).chain((randomIndex) => { if (parents.length === 0) { // If there are no recursive parents or this is the first variant field just do a regular arb field - return candidArb(parents, recursiveShapes)(depthLevel); + return candidArb(parents)(depthLevel); } return fc.oneof( { @@ -100,7 +93,7 @@ function possiblyRecursiveArb( weight: 1 }, { - arbitrary: candidArb(parents, recursiveShapes)(depthLevel), + arbitrary: candidArb(parents)(depthLevel), weight: 1 } ); diff --git a/property_tests/arbitraries/candid/constructed/vec_arb/index.ts b/property_tests/arbitraries/candid/constructed/vec_arb/index.ts index fa3929388d..55e0b8edbe 100644 --- a/property_tests/arbitraries/candid/constructed/vec_arb/index.ts +++ b/property_tests/arbitraries/candid/constructed/vec_arb/index.ts @@ -21,14 +21,9 @@ export type Vec = export function VecArb(): fc.Arbitrary> { return CandidValueAndMetaArbGenerator( - VecDefinitionArb( - candidDefinitionMemo, - [], - {}, - { - depthLevel: DEFAULT_DEFINITION_MAX_DEPTH - } - ), + VecDefinitionArb(candidDefinitionMemo, [], { + depthLevel: DEFAULT_DEFINITION_MAX_DEPTH + }), VecValuesArb ); } diff --git a/property_tests/arbitraries/candid/recursive/definition_arb.ts b/property_tests/arbitraries/candid/recursive/definition_arb.ts index 9c472a6e00..1c569fb803 100644 --- a/property_tests/arbitraries/candid/recursive/definition_arb.ts +++ b/property_tests/arbitraries/candid/recursive/definition_arb.ts @@ -15,7 +15,6 @@ import { RecursiveShapes } from '.'; export function RecursiveDefinitionArb( candidTypeArbForInnerType: RecursiveCandidDefinitionMemo, parents: RecursiveCandidName[], - recursiveShapes: RecursiveShapes, constraints: DefinitionConstraints ): WithShapesArb { return UniqueIdentifierArb('typeDeclaration') @@ -35,22 +34,18 @@ export function RecursiveDefinitionArb( }) .chain((innerRecDef) => { return fc.tuple( - candidTypeArbForInnerType( - [innerRecDef, ...parents], - recursiveShapes, - { - recursiveWeights: true, // This should be true so that the below weights will be respected all the way down. Until those issues are resolved we can't have blobs, tuples or vecs anywhere in any recursive shapes - weights: { - blob: 0, - tuple: 0, - vec: 0 - // TODO there are a lot of bugs with recursion so we are disabling the problematic types until the issues are resolved - // https://github.com/demergent-labs/azle/issues/1518 - // https://github.com/demergent-labs/azle/issues/1513 - // https://github.com/demergent-labs/azle/issues/1525 - } + candidTypeArbForInnerType([innerRecDef, ...parents], { + recursiveWeights: true, // This should be true so that the below weights will be respected all the way down. Until those issues are resolved we can't have blobs, tuples or vecs anywhere in any recursive shapes + weights: { + blob: 0, + tuple: 0, + vec: 0 + // TODO there are a lot of bugs with recursion so we are disabling the problematic types until the issues are resolved + // https://github.com/demergent-labs/azle/issues/1518 + // https://github.com/demergent-labs/azle/issues/1513 + // https://github.com/demergent-labs/azle/issues/1525 } - )(constraints.depthLevel ?? 0), + })(constraints.depthLevel ?? 0), fc.constant(innerRecDef) ); }) @@ -87,7 +82,6 @@ export function RecursiveDefinitionArb( return { definition: recursiveShape, recursiveShapes: { - ...recursiveShapes, [name]: recursiveShape } }; diff --git a/property_tests/arbitraries/candid/recursive/index.ts b/property_tests/arbitraries/candid/recursive/index.ts index 554aaa93dc..0d5f73adc7 100644 --- a/property_tests/arbitraries/candid/recursive/index.ts +++ b/property_tests/arbitraries/candid/recursive/index.ts @@ -12,14 +12,9 @@ export type RecursiveShapes = { [key: string]: RecursiveCandidDefinition }; export function RecursiveArb(): fc.Arbitrary> { return CandidValueAndMetaArbGenerator( - RecursiveDefinitionArb( - complexCandidDefinitionMemo, - [], - {}, - { - depthLevel: DEFAULT_DEFINITION_MAX_DEPTH - } - ), + RecursiveDefinitionArb(complexCandidDefinitionMemo, [], { + depthLevel: DEFAULT_DEFINITION_MAX_DEPTH + }), RecursiveValuesArb ); } diff --git a/property_tests/arbitraries/candid/reference/func_arb/definition_arb.ts b/property_tests/arbitraries/candid/reference/func_arb/definition_arb.ts index 68c7bd3b1e..d6c4d7f133 100644 --- a/property_tests/arbitraries/candid/reference/func_arb/definition_arb.ts +++ b/property_tests/arbitraries/candid/reference/func_arb/definition_arb.ts @@ -13,8 +13,7 @@ import { RecursiveShapes } from '../../recursive'; type Mode = 'query' | 'update' | 'oneway'; export function FuncDefinitionArb( - candidDefArb: WithShapesArb, - recShapes: RecursiveShapes + candidDefArb: WithShapesArb ): WithShapesArb { return (fc.constantFrom('query', 'update', 'oneway') as fc.Arbitrary) .chain((mode) => { @@ -45,7 +44,7 @@ export function FuncDefinitionArb( (acc, paramAndShapes) => { return { ...acc, ...paramAndShapes.recursiveShapes }; }, - { ...returnFuncAndShapes.recursiveShapes, ...recShapes } + returnFuncAndShapes.recursiveShapes ); const candidTypeAnnotation = generateCandidTypeAnnotation( useTypeDeclaration, diff --git a/property_tests/arbitraries/candid/reference/func_arb/index.ts b/property_tests/arbitraries/candid/reference/func_arb/index.ts index 5f5a5a58a7..570db157f2 100644 --- a/property_tests/arbitraries/candid/reference/func_arb/index.ts +++ b/property_tests/arbitraries/candid/reference/func_arb/index.ts @@ -19,7 +19,7 @@ export function FuncArb( ) ): fc.Arbitrary> { return CandidValueAndMetaArbGenerator( - FuncDefinitionArb(innerCandidDefinitionArb, {}), + FuncDefinitionArb(innerCandidDefinitionArb), FuncValueArb ); } diff --git a/property_tests/arbitraries/candid/reference/service_arb/definition_arb.ts b/property_tests/arbitraries/candid/reference/service_arb/definition_arb.ts index 2698d6b135..4f1059f496 100644 --- a/property_tests/arbitraries/candid/reference/service_arb/definition_arb.ts +++ b/property_tests/arbitraries/candid/reference/service_arb/definition_arb.ts @@ -12,11 +12,9 @@ import { } from '../../candid_definition_arb/types'; import { UniqueIdentifierArb } from '../../../unique_identifier_arb'; import { Canister } from '../../../../../src/lib/candid/types/reference/service'; -import { RecursiveShapes } from '../../recursive'; export function ServiceDefinitionArb( - fieldCandidDefArb: WithShapesArb, - recShapes: RecursiveShapes + fieldCandidDefArb: WithShapesArb ): WithShapesArb { return fc .tuple( @@ -39,7 +37,7 @@ export function ServiceDefinitionArb( (acc, fieldAndShapes) => { return { ...acc, ...fieldAndShapes.recursiveShapes }; }, - recShapes + {} ); useTypeDeclaration = true; diff --git a/property_tests/arbitraries/candid/reference/service_arb/index.ts b/property_tests/arbitraries/candid/reference/service_arb/index.ts index be651d3a0a..26d1f95507 100644 --- a/property_tests/arbitraries/candid/reference/service_arb/index.ts +++ b/property_tests/arbitraries/candid/reference/service_arb/index.ts @@ -29,7 +29,7 @@ export function ServiceArb( ) ): fc.Arbitrary> { return CandidValueAndMetaArbGenerator( - ServiceDefinitionArb(innerCandidDefinitionArb, {}), + ServiceDefinitionArb(innerCandidDefinitionArb), ServiceValueArb ); }