From aba82b4976f81c8ff6871192207de2a2770ede2d Mon Sep 17 00:00:00 2001 From: turbolent Date: Wed, 30 Oct 2024 15:08:14 +0000 Subject: [PATCH 01/13] v1.0.2 --- npm-packages/cadence-parser/package.json | 2 +- version.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/npm-packages/cadence-parser/package.json b/npm-packages/cadence-parser/package.json index 0a3cf1e26f..cc96f03cde 100644 --- a/npm-packages/cadence-parser/package.json +++ b/npm-packages/cadence-parser/package.json @@ -1,6 +1,6 @@ { "name": "@onflow/cadence-parser", - "version": "1.0.1-preview.52", + "version": "1.0.2-preview.52", "description": "The Cadence parser", "homepage": "https://github.com/onflow/cadence", "repository": { diff --git a/version.go b/version.go index 61904d635a..513d494f18 100644 --- a/version.go +++ b/version.go @@ -21,4 +21,4 @@ package cadence -const Version = "v1.0.1" +const Version = "v1.0.2" From 90f36e9d33c1631a3b74562b58ec0978edf14f02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Tue, 12 Nov 2024 10:40:27 -0800 Subject: [PATCH 02/13] report error when inference of return type of invocation fails --- runtime/runtime_test.go | 43 +++++++++++++++++ runtime/sema/check_invocation_expression.go | 8 +++- runtime/sema/errors.go | 17 +++++++ runtime/tests/checker/account_test.go | 45 ++++++++++-------- .../tests/checker/arrays_dictionaries_test.go | 8 ++-- .../tests/checker/builtinfunctions_test.go | 1 + runtime/tests/checker/capability_test.go | 5 +- runtime/tests/checker/conditions_test.go | 10 ++-- runtime/tests/checker/genericfunction_test.go | 5 +- runtime/tests/checker/invalid_test.go | 46 +++++++++++++++++++ 10 files changed, 158 insertions(+), 30 deletions(-) diff --git a/runtime/runtime_test.go b/runtime/runtime_test.go index c56c01d102..2d79c012c4 100644 --- a/runtime/runtime_test.go +++ b/runtime/runtime_test.go @@ -11548,3 +11548,46 @@ func TestRuntimeBuiltInFunctionConfusion(t *testing.T) { var redeclarationError *sema.RedeclarationError require.ErrorAs(t, err, &redeclarationError) } + +func TestRuntimeInvocationReturnTypeInferenceFailure(t *testing.T) { + + t.Parallel() + + address := common.MustBytesToAddress([]byte{0x1}) + + newRuntimeInterface := func() Interface { + + return &TestRuntimeInterface{ + Storage: NewTestLedger(nil, nil), + OnGetSigningAccounts: func() ([]common.Address, error) { + return []common.Address{address}, nil + }, + } + } + + runtime := NewTestInterpreterRuntime() + + nextTransactionLocation := NewTransactionLocationGenerator() + + tx := []byte(` + transaction{ + prepare(signer: auth(Storage) &Account){ + let functions = [signer.storage.save].reverse() + } + } + `) + + err := runtime.ExecuteTransaction( + Script{ + Source: tx, + }, + Context{ + Interface: newRuntimeInterface(), + Location: nextTransactionLocation(), + }, + ) + RequireError(t, err) + + var typeErr *sema.InvocationReturnTypeInferenceError + require.ErrorAs(t, err, &typeErr) +} diff --git a/runtime/sema/check_invocation_expression.go b/runtime/sema/check_invocation_expression.go index dc8a2ac634..3967fd06a9 100644 --- a/runtime/sema/check_invocation_expression.go +++ b/runtime/sema/check_invocation_expression.go @@ -503,7 +503,13 @@ func (checker *Checker) checkInvocation( returnType = functionType.ReturnTypeAnnotation.Type.Resolve(typeArguments) if returnType == nil { - // TODO: report error? does `checkTypeParameterInference` below already do that? + checker.report(&InvocationReturnTypeInferenceError{ + Range: ast.NewRangeFromPositioned( + checker.memoryGauge, + invocationExpression, + ), + }) + returnType = InvalidType } diff --git a/runtime/sema/errors.go b/runtime/sema/errors.go index 66efa2b57d..9b770b051e 100644 --- a/runtime/sema/errors.go +++ b/runtime/sema/errors.go @@ -4826,3 +4826,20 @@ func (*NestedReferenceError) IsUserError() {} func (e *NestedReferenceError) Error() string { return fmt.Sprintf("cannot create a nested reference to value of type %s", e.Type.QualifiedString()) } + +// InvocationReturnTypeInferenceError + +type InvocationReturnTypeInferenceError struct { + ast.Range +} + +var _ SemanticError = &InvocationReturnTypeInferenceError{} +var _ errors.UserError = &InvocationReturnTypeInferenceError{} + +func (e *InvocationReturnTypeInferenceError) isSemanticError() {} + +func (*InvocationReturnTypeInferenceError) IsUserError() {} + +func (e *InvocationReturnTypeInferenceError) Error() string { + return "cannot infer return type of invocation" +} diff --git a/runtime/tests/checker/account_test.go b/runtime/tests/checker/account_test.go index 870e9f6731..ac72e777fc 100644 --- a/runtime/tests/checker/account_test.go +++ b/runtime/tests/checker/account_test.go @@ -424,15 +424,17 @@ func TestCheckAccountStorageLoad(t *testing.T) { ) if domain == common.PathDomainStorage { - errs := RequireCheckerErrors(t, err, 1) + errs := RequireCheckerErrors(t, err, 2) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) } else { - errs := RequireCheckerErrors(t, err, 2) + errs := RequireCheckerErrors(t, err, 3) require.IsType(t, &sema.TypeMismatchError{}, errs[0]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + require.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[1]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) } }) } @@ -552,15 +554,17 @@ func TestCheckAccountStorageCopy(t *testing.T) { ) if domain == common.PathDomainStorage { - errs := RequireCheckerErrors(t, err, 1) + errs := RequireCheckerErrors(t, err, 2) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) } else { - errs := RequireCheckerErrors(t, err, 2) + errs := RequireCheckerErrors(t, err, 3) require.IsType(t, &sema.TypeMismatchError{}, errs[0]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + require.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[1]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) } }) } @@ -686,15 +690,17 @@ func TestCheckAccountStorageBorrow(t *testing.T) { ) if domain == common.PathDomainStorage { - errs := RequireCheckerErrors(t, err, 1) + errs := RequireCheckerErrors(t, err, 2) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) } else { - errs := RequireCheckerErrors(t, err, 2) + errs := RequireCheckerErrors(t, err, 3) require.IsType(t, &sema.TypeMismatchError{}, errs[0]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + require.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[1]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) } }) @@ -714,15 +720,17 @@ func TestCheckAccountStorageBorrow(t *testing.T) { ) if domain == common.PathDomainStorage { - errs := RequireCheckerErrors(t, err, 1) + errs := RequireCheckerErrors(t, err, 2) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) } else { - errs := RequireCheckerErrors(t, err, 2) + errs := RequireCheckerErrors(t, err, 3) require.IsType(t, &sema.TypeMismatchError{}, errs[0]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + require.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[1]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) } }) }) @@ -1026,9 +1034,10 @@ func TestCheckAccountContractsBorrow(t *testing.T) { } `) - errors := RequireCheckerErrors(t, err, 1) + errors := RequireCheckerErrors(t, err, 2) - assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errors[0]) + assert.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errors[0]) + assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errors[1]) }) } diff --git a/runtime/tests/checker/arrays_dictionaries_test.go b/runtime/tests/checker/arrays_dictionaries_test.go index ce98e677f7..c713c42726 100644 --- a/runtime/tests/checker/arrays_dictionaries_test.go +++ b/runtime/tests/checker/arrays_dictionaries_test.go @@ -1280,7 +1280,8 @@ func TestCheckArrayMapInvalidArgs(t *testing.T) { `, []sema.SemanticError{ &sema.TypeMismatchError{}, - &sema.TypeParameterTypeInferenceError{}, // since we're not passing a function. + &sema.InvocationReturnTypeInferenceError{}, // since we're not passing a function. + &sema.TypeParameterTypeInferenceError{}, // since we're not passing a function. }, ) @@ -2659,9 +2660,10 @@ func TestCheckArrayToConstantSizedMissingTypeArgument(t *testing.T) { } `) - errs := RequireCheckerErrors(t, err, 1) + errs := RequireCheckerErrors(t, err, 2) - assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[0]) + assert.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[0]) + assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) } func TestCheckArrayReferenceTypeInference(t *testing.T) { diff --git a/runtime/tests/checker/builtinfunctions_test.go b/runtime/tests/checker/builtinfunctions_test.go index c2ca8e39c6..e0259ddf99 100644 --- a/runtime/tests/checker/builtinfunctions_test.go +++ b/runtime/tests/checker/builtinfunctions_test.go @@ -430,6 +430,7 @@ func TestCheckRevertibleRandom(t *testing.T) { "missing type argument", `let rand = revertibleRandom()`, []error{ + &sema.InvocationReturnTypeInferenceError{}, &sema.TypeParameterTypeInferenceError{}, }, ) diff --git a/runtime/tests/checker/capability_test.go b/runtime/tests/checker/capability_test.go index a8899d567d..55cecebea2 100644 --- a/runtime/tests/checker/capability_test.go +++ b/runtime/tests/checker/capability_test.go @@ -85,9 +85,10 @@ func TestCheckCapability_borrow(t *testing.T) { let r = capability.borrow() `) - errs := RequireCheckerErrors(t, err, 1) + errs := RequireCheckerErrors(t, err, 2) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) }) for _, auth := range []sema.Access{sema.UnauthorizedAccess, diff --git a/runtime/tests/checker/conditions_test.go b/runtime/tests/checker/conditions_test.go index 74979ccc91..fb4b472064 100644 --- a/runtime/tests/checker/conditions_test.go +++ b/runtime/tests/checker/conditions_test.go @@ -265,10 +265,11 @@ func TestCheckInvalidFunctionPostConditionWithBeforeAndNoArgument(t *testing.T) } `) - errs := RequireCheckerErrors(t, err, 2) + errs := RequireCheckerErrors(t, err, 3) assert.IsType(t, &sema.InsufficientArgumentsError{}, errs[0]) - assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + assert.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[1]) + assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) }) t.Run("emit condition", func(t *testing.T) { @@ -284,10 +285,11 @@ func TestCheckInvalidFunctionPostConditionWithBeforeAndNoArgument(t *testing.T) } `) - errs := RequireCheckerErrors(t, err, 2) + errs := RequireCheckerErrors(t, err, 3) assert.IsType(t, &sema.InsufficientArgumentsError{}, errs[0]) - assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + assert.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[1]) + assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) }) } diff --git a/runtime/tests/checker/genericfunction_test.go b/runtime/tests/checker/genericfunction_test.go index ce52b291da..3c4786276c 100644 --- a/runtime/tests/checker/genericfunction_test.go +++ b/runtime/tests/checker/genericfunction_test.go @@ -452,9 +452,10 @@ func TestCheckGenericFunctionInvocation(t *testing.T) { }, ) - errs := RequireCheckerErrors(t, err, 1) + errs := RequireCheckerErrors(t, err, 2) - assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[0]) + assert.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[0]) + assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) }) t.Run("valid: one type parameter, one type argument, no parameters, no arguments, return type", func(t *testing.T) { diff --git a/runtime/tests/checker/invalid_test.go b/runtime/tests/checker/invalid_test.go index 42fd6953f8..a2a7b00df6 100644 --- a/runtime/tests/checker/invalid_test.go +++ b/runtime/tests/checker/invalid_test.go @@ -23,7 +23,9 @@ import ( "github.com/stretchr/testify/assert" + "github.com/onflow/cadence/runtime/common" "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/runtime/stdlib" ) func TestCheckSpuriousIdentifierAssignmentInvalidValueTypeMismatch(t *testing.T) { @@ -201,3 +203,47 @@ func TestCheckSpuriousCastWithInvalidValueTypeMismatch(t *testing.T) { assert.IsType(t, &sema.NotDeclaredError{}, errs[0]) } + +func TestCheckInvalidInvocationFunctionReturnType(t *testing.T) { + + t.Parallel() + + typeParameter := &sema.TypeParameter{ + Name: "T", + } + + fType := &sema.FunctionType{ + TypeParameters: []*sema.TypeParameter{ + typeParameter, + }, + ReturnTypeAnnotation: sema.NewTypeAnnotation( + &sema.GenericType{ + TypeParameter: typeParameter, + }, + ), + } + + baseValueActivation := sema.NewVariableActivation(sema.BaseValueActivation) + baseValueActivation.DeclareValue(stdlib.StandardLibraryValue{ + Type: fType, + Name: "f", + Kind: common.DeclarationKindFunction, + }) + + _, err := ParseAndCheckWithOptions(t, + ` + let res = [f].reverse() + `, + ParseAndCheckOptions{ + Config: &sema.Config{ + BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation { + return baseValueActivation + }, + }, + }, + ) + + errs := RequireCheckerErrors(t, err, 1) + + assert.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[0]) +} From 6de6720fc5123a4495720439d55f2cc6b4736bb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Tue, 12 Nov 2024 10:41:00 -0800 Subject: [PATCH 03/13] report error when AST type cannot be converted --- runtime/sema/checker.go | 8 +++---- runtime/sema/errors.go | 28 +++++++++++++++--------- runtime/tests/checker/dictionary_test.go | 4 +++- 3 files changed, 25 insertions(+), 15 deletions(-) diff --git a/runtime/sema/checker.go b/runtime/sema/checker.go index 51d5204b44..3d3f23a4c1 100644 --- a/runtime/sema/checker.go +++ b/runtime/sema/checker.go @@ -886,12 +886,12 @@ func (checker *Checker) ConvertType(t ast.Type) Type { case *ast.InstantiationType: return checker.convertInstantiationType(t) - case nil: - // The AST might contain "holes" if parsing failed + default: + checker.report(&UnconvertableTypeError{ + Range: ast.NewRangeFromPositioned(checker.memoryGauge, t), + }) return InvalidType } - - panic(&astTypeConversionError{invalidASTType: t}) } func CheckIntersectionType( diff --git a/runtime/sema/errors.go b/runtime/sema/errors.go index 9b770b051e..cfac1d6d86 100644 --- a/runtime/sema/errors.go +++ b/runtime/sema/errors.go @@ -51,16 +51,6 @@ func ErrorMessageExpectedActualTypes( return } -// astTypeConversionError - -type astTypeConversionError struct { - invalidASTType ast.Type -} - -func (e *astTypeConversionError) Error() string { - return fmt.Sprintf("cannot convert unsupported AST type: %#+v", e.invalidASTType) -} - // unsupportedOperation type unsupportedOperation struct { @@ -4843,3 +4833,21 @@ func (*InvocationReturnTypeInferenceError) IsUserError() {} func (e *InvocationReturnTypeInferenceError) Error() string { return "cannot infer return type of invocation" } + +// UnconvertableTypeError + +type UnconvertableTypeError struct { + Type ast.Type + ast.Range +} + +var _ SemanticError = &UnconvertableTypeError{} +var _ errors.UserError = &UnconvertableTypeError{} + +func (e *UnconvertableTypeError) isSemanticError() {} + +func (*UnconvertableTypeError) IsUserError() {} + +func (e *UnconvertableTypeError) Error() string { + return fmt.Sprintf("cannot convert type `%s`", e.Type) +} diff --git a/runtime/tests/checker/dictionary_test.go b/runtime/tests/checker/dictionary_test.go index 086315d76c..e0efc29cce 100644 --- a/runtime/tests/checker/dictionary_test.go +++ b/runtime/tests/checker/dictionary_test.go @@ -40,7 +40,9 @@ func TestCheckIncompleteDictionaryType(t *testing.T) { }, ) - require.NoError(t, err) + errs := RequireCheckerErrors(t, err, 1) + + assert.IsType(t, errs[0], &sema.UnconvertableTypeError{}) assert.Equal(t, &sema.DictionaryType{ From f52f6a92f75682aea3a9a3a87bd6d651d9417665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Tue, 12 Nov 2024 10:53:02 -0800 Subject: [PATCH 04/13] add defensive check to reject expressions with invalid type, but no error reported --- runtime/sema/checker.go | 10 +++++++ runtime/tests/checker/invalid_test.go | 38 +++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/runtime/sema/checker.go b/runtime/sema/checker.go index 3d3f23a4c1..5f46537842 100644 --- a/runtime/sema/checker.go +++ b/runtime/sema/checker.go @@ -2611,6 +2611,16 @@ func (checker *Checker) visitExpressionWithForceType( actualType = ast.AcceptExpression[Type](expr, checker) + // Defensive check: If an invalid type was produced, + // then also an error should have been reported for the invalid program. + // + // Check for errors first, which is cheap, + // before checking for an invalid type, which is more expensive. + + if len(checker.errors) == 0 && actualType.IsInvalidType() { + panic(errors.NewUnexpectedError("invalid type produced without error")) + } + if checker.Config.ExtendedElaborationEnabled { checker.Elaboration.SetExpressionTypes( expr, diff --git a/runtime/tests/checker/invalid_test.go b/runtime/tests/checker/invalid_test.go index a2a7b00df6..8d314fc89e 100644 --- a/runtime/tests/checker/invalid_test.go +++ b/runtime/tests/checker/invalid_test.go @@ -22,8 +22,10 @@ import ( "testing" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/runtime/errors" "github.com/onflow/cadence/runtime/sema" "github.com/onflow/cadence/runtime/stdlib" ) @@ -247,3 +249,39 @@ func TestCheckInvalidInvocationFunctionReturnType(t *testing.T) { assert.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[0]) } + +func TestCheckInvalidTypeDefensiveCheck(t *testing.T) { + + t.Parallel() + + baseValueActivation := sema.NewVariableActivation(sema.BaseValueActivation) + baseValueActivation.DeclareValue(stdlib.StandardLibraryValue{ + Type: sema.InvalidType, + Name: "invalid", + Kind: common.DeclarationKindConstant, + }) + + var r any + func() { + defer func() { + r = recover() + }() + + _, _ = ParseAndCheckWithOptions(t, + ` + let res = invalid + `, + ParseAndCheckOptions{ + Config: &sema.Config{ + BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation { + return baseValueActivation + }, + }, + }, + ) + }() + + require.IsType(t, errors.UnexpectedError{}, r) + err := r.(errors.UnexpectedError) + require.ErrorContains(t, err, "invalid type produced without error") +} From 1ec7b3c0b8007dcf487caed8997faec1ed034e63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Tue, 12 Nov 2024 11:19:06 -0800 Subject: [PATCH 05/13] report invalid type indexing error before returning invalid type --- runtime/sema/check_expression.go | 31 +++++++++++++++------------ runtime/tests/checker/invalid_test.go | 15 +++++++++++++ 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/runtime/sema/check_expression.go b/runtime/sema/check_expression.go index 233127c3af..6a863c8be8 100644 --- a/runtime/sema/check_expression.go +++ b/runtime/sema/check_expression.go @@ -417,20 +417,7 @@ func (checker *Checker) visitIndexExpression( return InvalidType } - elementType := checker.checkTypeIndexingExpression(typeIndexedType, indexExpression) - if elementType == InvalidType { - checker.report( - &InvalidTypeIndexingError{ - BaseType: typeIndexedType, - IndexingExpression: indexExpression.IndexingExpression, - Range: ast.NewRangeFromPositioned( - checker.memoryGauge, - indexExpression.IndexingExpression, - ), - }, - ) - } - return elementType + return checker.checkTypeIndexingExpression(typeIndexedType, indexExpression) } reportNonIndexable(targetType) @@ -450,19 +437,35 @@ func (checker *Checker) checkTypeIndexingExpression( }) } + reportInvalid := func() { + checker.report( + &InvalidTypeIndexingError{ + BaseType: targetType, + IndexingExpression: indexExpression.IndexingExpression, + Range: ast.NewRangeFromPositioned( + checker.memoryGauge, + indexExpression.IndexingExpression, + ), + }, + ) + } + expressionType := ast.ExpressionAsType(indexExpression.IndexingExpression) if expressionType == nil { + reportInvalid() return InvalidType } nominalTypeExpression, isNominalType := expressionType.(*ast.NominalType) if !isNominalType { + reportInvalid() return InvalidType } nominalType := checker.convertNominalType(nominalTypeExpression) if !targetType.IsValidIndexingType(nominalType) { + reportInvalid() return InvalidType } diff --git a/runtime/tests/checker/invalid_test.go b/runtime/tests/checker/invalid_test.go index 8d314fc89e..a06ddeaee6 100644 --- a/runtime/tests/checker/invalid_test.go +++ b/runtime/tests/checker/invalid_test.go @@ -285,3 +285,18 @@ func TestCheckInvalidTypeDefensiveCheck(t *testing.T) { err := r.(errors.UnexpectedError) require.ErrorContains(t, err, "invalid type produced without error") } + +func TestCheckInvalidTypeIndexing(t *testing.T) { + + t.Parallel() + + _, err := ParseAndCheck(t, ` + struct S {} + let s = S() + let res = s[[]] + `) + + errs := RequireCheckerErrors(t, err, 1) + + assert.IsType(t, &sema.InvalidTypeIndexingError{}, errs[0]) +} From 11fe59afd2c890288b9a352a22df822304e87942 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Tue, 12 Nov 2024 11:28:56 -0800 Subject: [PATCH 06/13] add test for remove with undeclared type --- runtime/tests/checker/invalid_test.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/runtime/tests/checker/invalid_test.go b/runtime/tests/checker/invalid_test.go index a06ddeaee6..e9f5fbc06f 100644 --- a/runtime/tests/checker/invalid_test.go +++ b/runtime/tests/checker/invalid_test.go @@ -300,3 +300,23 @@ func TestCheckInvalidTypeIndexing(t *testing.T) { assert.IsType(t, &sema.InvalidTypeIndexingError{}, errs[0]) } + +func TestCheckInvalidRemove(t *testing.T) { + + t.Parallel() + + _, err := ParseAndCheck(t, ` + struct S {} + + attachment A for S {} + + fun test() { + let s = S() + remove B from s + } + `) + + errs := RequireCheckerErrors(t, err, 1) + + assert.IsType(t, &sema.NotDeclaredError{}, errs[0]) +} From 4be6dea1fe27e3c940b82a6b298e06659533b43e Mon Sep 17 00:00:00 2001 From: Supun Setunga Date: Tue, 12 Nov 2024 12:00:57 -0800 Subject: [PATCH 07/13] Add test for invalid generic type --- runtime/tests/checker/invocation_test.go | 58 ++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/runtime/tests/checker/invocation_test.go b/runtime/tests/checker/invocation_test.go index b55d20d668..c1a1e442b3 100644 --- a/runtime/tests/checker/invocation_test.go +++ b/runtime/tests/checker/invocation_test.go @@ -592,3 +592,61 @@ func TestCheckArgumentLabels(t *testing.T) { }) } + +func TestCheckInvocationWithIncorrectTypeParameter(t *testing.T) { + + t.Parallel() + + // function type has incorrect type-arguments: + // `fun Foo(_ a: R)` + // + funcType := &sema.FunctionType{ + ReturnTypeAnnotation: sema.VoidTypeAnnotation, + TypeParameters: []*sema.TypeParameter{ + { + Name: "T", + TypeBound: sema.AnyStructType, + }, + }, + Parameters: []sema.Parameter{ + { + Label: sema.ArgumentLabelNotRequired, + Identifier: "a", + TypeAnnotation: sema.NewTypeAnnotation( + &sema.GenericType{ + TypeParameter: &sema.TypeParameter{ + Name: "R", // This is an incorrect/undefined type-parameter + TypeBound: sema.AnyStructType, + }, + }, + ), + }, + }, + IsConstructor: false, + } + + baseValueActivation := sema.NewVariableActivation(sema.BaseValueActivation) + baseValueActivation.DeclareValue(stdlib.NewStandardLibraryStaticFunction( + "foo", + funcType, + "", + nil, // no need, we only type-check + )) + + _, err := ParseAndCheckWithOptions(t, + ` + access(all) fun test() { + foo("hello") + } + `, + ParseAndCheckOptions{ + Config: &sema.Config{ + BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation { + return baseValueActivation + }, + }, + }, + ) + + require.Error(t, err) +} From a1f9e8be84876556280c75e0b228b369d153020f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Tue, 12 Nov 2024 12:40:43 -0800 Subject: [PATCH 08/13] report error when parameter type in invocation cannot be inferred --- runtime/runtime_test.go | 2 +- runtime/sema/check_invocation_expression.go | 14 +++++++++++++- runtime/sema/errors.go | 16 ++++++++-------- runtime/tests/checker/account_test.go | 18 +++++++++--------- .../tests/checker/arrays_dictionaries_test.go | 6 +++--- runtime/tests/checker/builtinfunctions_test.go | 2 +- runtime/tests/checker/capability_test.go | 2 +- runtime/tests/checker/conditions_test.go | 4 ++-- runtime/tests/checker/genericfunction_test.go | 2 +- runtime/tests/checker/invalid_test.go | 2 +- runtime/tests/checker/invocation_test.go | 5 +++-- 11 files changed, 43 insertions(+), 30 deletions(-) diff --git a/runtime/runtime_test.go b/runtime/runtime_test.go index 2d79c012c4..5efbfe7dab 100644 --- a/runtime/runtime_test.go +++ b/runtime/runtime_test.go @@ -11588,6 +11588,6 @@ func TestRuntimeInvocationReturnTypeInferenceFailure(t *testing.T) { ) RequireError(t, err) - var typeErr *sema.InvocationReturnTypeInferenceError + var typeErr *sema.InvocationTypeInferenceError require.ErrorAs(t, err, &typeErr) } diff --git a/runtime/sema/check_invocation_expression.go b/runtime/sema/check_invocation_expression.go index 3967fd06a9..bbf45de72d 100644 --- a/runtime/sema/check_invocation_expression.go +++ b/runtime/sema/check_invocation_expression.go @@ -503,7 +503,7 @@ func (checker *Checker) checkInvocation( returnType = functionType.ReturnTypeAnnotation.Type.Resolve(typeArguments) if returnType == nil { - checker.report(&InvocationReturnTypeInferenceError{ + checker.report(&InvocationTypeInferenceError{ Range: ast.NewRangeFromPositioned( checker.memoryGauge, invocationExpression, @@ -605,6 +605,12 @@ func (checker *Checker) checkInvocationRequiredArgument( parameterType = parameterType.Resolve(typeParameters) // If the type parameter could not be resolved, use the invalid type. if parameterType == nil { + checker.report(&InvocationTypeInferenceError{ + Range: ast.NewRangeFromPositioned( + checker.memoryGauge, + argument.Expression, + ), + }) parameterType = InvalidType } } @@ -680,6 +686,12 @@ func (checker *Checker) checkInvocationRequiredArgument( parameterType = parameterType.Resolve(typeParameters) // If the type parameter could not be resolved, use the invalid type. if parameterType == nil { + checker.report(&InvocationTypeInferenceError{ + Range: ast.NewRangeFromPositioned( + checker.memoryGauge, + argument.Expression, + ), + }) parameterType = InvalidType } } diff --git a/runtime/sema/errors.go b/runtime/sema/errors.go index cfac1d6d86..163c5ec5ba 100644 --- a/runtime/sema/errors.go +++ b/runtime/sema/errors.go @@ -4817,21 +4817,21 @@ func (e *NestedReferenceError) Error() string { return fmt.Sprintf("cannot create a nested reference to value of type %s", e.Type.QualifiedString()) } -// InvocationReturnTypeInferenceError +// InvocationTypeInferenceError -type InvocationReturnTypeInferenceError struct { +type InvocationTypeInferenceError struct { ast.Range } -var _ SemanticError = &InvocationReturnTypeInferenceError{} -var _ errors.UserError = &InvocationReturnTypeInferenceError{} +var _ SemanticError = &InvocationTypeInferenceError{} +var _ errors.UserError = &InvocationTypeInferenceError{} -func (e *InvocationReturnTypeInferenceError) isSemanticError() {} +func (e *InvocationTypeInferenceError) isSemanticError() {} -func (*InvocationReturnTypeInferenceError) IsUserError() {} +func (*InvocationTypeInferenceError) IsUserError() {} -func (e *InvocationReturnTypeInferenceError) Error() string { - return "cannot infer return type of invocation" +func (e *InvocationTypeInferenceError) Error() string { + return "cannot infer type of invocation" } // UnconvertableTypeError diff --git a/runtime/tests/checker/account_test.go b/runtime/tests/checker/account_test.go index ac72e777fc..c8c5ea0cf8 100644 --- a/runtime/tests/checker/account_test.go +++ b/runtime/tests/checker/account_test.go @@ -426,14 +426,14 @@ func TestCheckAccountStorageLoad(t *testing.T) { if domain == common.PathDomainStorage { errs := RequireCheckerErrors(t, err, 2) - require.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) } else { errs := RequireCheckerErrors(t, err, 3) require.IsType(t, &sema.TypeMismatchError{}, errs[0]) - require.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[1]) + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) } }) @@ -556,14 +556,14 @@ func TestCheckAccountStorageCopy(t *testing.T) { if domain == common.PathDomainStorage { errs := RequireCheckerErrors(t, err, 2) - require.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) } else { errs := RequireCheckerErrors(t, err, 3) require.IsType(t, &sema.TypeMismatchError{}, errs[0]) - require.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[1]) + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) } }) @@ -692,14 +692,14 @@ func TestCheckAccountStorageBorrow(t *testing.T) { if domain == common.PathDomainStorage { errs := RequireCheckerErrors(t, err, 2) - require.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) } else { errs := RequireCheckerErrors(t, err, 3) require.IsType(t, &sema.TypeMismatchError{}, errs[0]) - require.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[1]) + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) } }) @@ -722,14 +722,14 @@ func TestCheckAccountStorageBorrow(t *testing.T) { if domain == common.PathDomainStorage { errs := RequireCheckerErrors(t, err, 2) - require.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) } else { errs := RequireCheckerErrors(t, err, 3) require.IsType(t, &sema.TypeMismatchError{}, errs[0]) - require.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[1]) + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) } }) @@ -1036,7 +1036,7 @@ func TestCheckAccountContractsBorrow(t *testing.T) { errors := RequireCheckerErrors(t, err, 2) - assert.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errors[0]) + assert.IsType(t, &sema.InvocationTypeInferenceError{}, errors[0]) assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errors[1]) }) } diff --git a/runtime/tests/checker/arrays_dictionaries_test.go b/runtime/tests/checker/arrays_dictionaries_test.go index c713c42726..3952c1aa2b 100644 --- a/runtime/tests/checker/arrays_dictionaries_test.go +++ b/runtime/tests/checker/arrays_dictionaries_test.go @@ -1280,8 +1280,8 @@ func TestCheckArrayMapInvalidArgs(t *testing.T) { `, []sema.SemanticError{ &sema.TypeMismatchError{}, - &sema.InvocationReturnTypeInferenceError{}, // since we're not passing a function. - &sema.TypeParameterTypeInferenceError{}, // since we're not passing a function. + &sema.InvocationTypeInferenceError{}, // since we're not passing a function. + &sema.TypeParameterTypeInferenceError{}, // since we're not passing a function. }, ) @@ -2662,7 +2662,7 @@ func TestCheckArrayToConstantSizedMissingTypeArgument(t *testing.T) { errs := RequireCheckerErrors(t, err, 2) - assert.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[0]) + assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) } diff --git a/runtime/tests/checker/builtinfunctions_test.go b/runtime/tests/checker/builtinfunctions_test.go index e0259ddf99..79c931d13c 100644 --- a/runtime/tests/checker/builtinfunctions_test.go +++ b/runtime/tests/checker/builtinfunctions_test.go @@ -430,7 +430,7 @@ func TestCheckRevertibleRandom(t *testing.T) { "missing type argument", `let rand = revertibleRandom()`, []error{ - &sema.InvocationReturnTypeInferenceError{}, + &sema.InvocationTypeInferenceError{}, &sema.TypeParameterTypeInferenceError{}, }, ) diff --git a/runtime/tests/checker/capability_test.go b/runtime/tests/checker/capability_test.go index 55cecebea2..a842ed161f 100644 --- a/runtime/tests/checker/capability_test.go +++ b/runtime/tests/checker/capability_test.go @@ -87,7 +87,7 @@ func TestCheckCapability_borrow(t *testing.T) { errs := RequireCheckerErrors(t, err, 2) - require.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) }) diff --git a/runtime/tests/checker/conditions_test.go b/runtime/tests/checker/conditions_test.go index fb4b472064..cfe5f73fab 100644 --- a/runtime/tests/checker/conditions_test.go +++ b/runtime/tests/checker/conditions_test.go @@ -268,7 +268,7 @@ func TestCheckInvalidFunctionPostConditionWithBeforeAndNoArgument(t *testing.T) errs := RequireCheckerErrors(t, err, 3) assert.IsType(t, &sema.InsufficientArgumentsError{}, errs[0]) - assert.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[1]) + assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) }) @@ -288,7 +288,7 @@ func TestCheckInvalidFunctionPostConditionWithBeforeAndNoArgument(t *testing.T) errs := RequireCheckerErrors(t, err, 3) assert.IsType(t, &sema.InsufficientArgumentsError{}, errs[0]) - assert.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[1]) + assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) }) } diff --git a/runtime/tests/checker/genericfunction_test.go b/runtime/tests/checker/genericfunction_test.go index 3c4786276c..f7f89c87cf 100644 --- a/runtime/tests/checker/genericfunction_test.go +++ b/runtime/tests/checker/genericfunction_test.go @@ -454,7 +454,7 @@ func TestCheckGenericFunctionInvocation(t *testing.T) { errs := RequireCheckerErrors(t, err, 2) - assert.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[0]) + assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) }) diff --git a/runtime/tests/checker/invalid_test.go b/runtime/tests/checker/invalid_test.go index e9f5fbc06f..3ed32e3205 100644 --- a/runtime/tests/checker/invalid_test.go +++ b/runtime/tests/checker/invalid_test.go @@ -247,7 +247,7 @@ func TestCheckInvalidInvocationFunctionReturnType(t *testing.T) { errs := RequireCheckerErrors(t, err, 1) - assert.IsType(t, &sema.InvocationReturnTypeInferenceError{}, errs[0]) + assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) } func TestCheckInvalidTypeDefensiveCheck(t *testing.T) { diff --git a/runtime/tests/checker/invocation_test.go b/runtime/tests/checker/invocation_test.go index c1a1e442b3..3d0d8f6949 100644 --- a/runtime/tests/checker/invocation_test.go +++ b/runtime/tests/checker/invocation_test.go @@ -622,7 +622,6 @@ func TestCheckInvocationWithIncorrectTypeParameter(t *testing.T) { ), }, }, - IsConstructor: false, } baseValueActivation := sema.NewVariableActivation(sema.BaseValueActivation) @@ -648,5 +647,7 @@ func TestCheckInvocationWithIncorrectTypeParameter(t *testing.T) { }, ) - require.Error(t, err) + errs := RequireCheckerErrors(t, err, 1) + + assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) } From 39f6655dd835792dc9669802c674f80dc2e9982c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Tue, 12 Nov 2024 12:41:53 -0800 Subject: [PATCH 09/13] improve defensive check Co-authored-by: Supun Setunga --- runtime/sema/checker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/sema/checker.go b/runtime/sema/checker.go index 5f46537842..9747258d9c 100644 --- a/runtime/sema/checker.go +++ b/runtime/sema/checker.go @@ -2617,7 +2617,7 @@ func (checker *Checker) visitExpressionWithForceType( // Check for errors first, which is cheap, // before checking for an invalid type, which is more expensive. - if len(checker.errors) == 0 && actualType.IsInvalidType() { + if len(checker.errors) == 0 && (actualType.IsInvalidType() || (expectedType != nil && expectedType.IsInvalidType())) { panic(errors.NewUnexpectedError("invalid type produced without error")) } From d1d5626290f2fe48d4f0d420011ca594ff1e5057 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Tue, 12 Nov 2024 12:43:49 -0800 Subject: [PATCH 10/13] refactor defensive check into function --- runtime/sema/checker.go | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/runtime/sema/checker.go b/runtime/sema/checker.go index 9747258d9c..fa3486715a 100644 --- a/runtime/sema/checker.go +++ b/runtime/sema/checker.go @@ -2611,15 +2611,7 @@ func (checker *Checker) visitExpressionWithForceType( actualType = ast.AcceptExpression[Type](expr, checker) - // Defensive check: If an invalid type was produced, - // then also an error should have been reported for the invalid program. - // - // Check for errors first, which is cheap, - // before checking for an invalid type, which is more expensive. - - if len(checker.errors) == 0 && (actualType.IsInvalidType() || (expectedType != nil && expectedType.IsInvalidType())) { - panic(errors.NewUnexpectedError("invalid type produced without error")) - } + checker.checkErrorsForInvalidExpressionTypes(actualType, expectedType) if checker.Config.ExtendedElaborationEnabled { checker.Elaboration.SetExpressionTypes( @@ -2655,6 +2647,20 @@ func (checker *Checker) visitExpressionWithForceType( return actualType, actualType } +func (checker *Checker) checkErrorsForInvalidExpressionTypes(actualType Type, expectedType Type) { + // Defensive check: If an invalid type was produced, + // then also an error should have been reported for the invalid program. + // + // Check for errors first, which is cheap, + // before checking for an invalid type, which is more expensive. + + if len(checker.errors) == 0 && + (actualType.IsInvalidType() || (expectedType != nil && expectedType.IsInvalidType())) { + + panic(errors.NewUnexpectedError("invalid type produced without error")) + } +} + func (checker *Checker) expressionRange(expression ast.Expression) ast.Range { if indexExpr, ok := expression.(*ast.IndexExpression); ok { return ast.NewRange( From b4f27e1b5dba3a56cf2b49cd6b4e64abdbe229bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Wed, 13 Nov 2024 12:10:25 -0800 Subject: [PATCH 11/13] gate new behaviour (errors for all invalid type cases) behind a feature flag --- runtime/environment.go | 9 +- runtime/runtime_test.go | 85 ++++--- runtime/sema/check_invocation_expression.go | 42 ++-- runtime/sema/checker.go | 16 +- runtime/sema/config.go | 2 + runtime/sema/errors.go | 10 + runtime/tests/checker/account_test.go | 215 +++++++++++++----- .../tests/checker/arrays_dictionaries_test.go | 127 +++++++---- .../tests/checker/builtinfunctions_test.go | 2 +- runtime/tests/checker/capability_test.go | 50 +++- runtime/tests/checker/conditions_test.go | 113 ++++++--- runtime/tests/checker/dictionary_test.go | 58 +++-- runtime/tests/checker/genericfunction_test.go | 78 +++++-- runtime/tests/checker/invalid_test.go | 164 ++++++++----- runtime/tests/checker/invocation_test.go | 117 ++++++---- runtime/tests/checker/utils.go | 2 + 16 files changed, 750 insertions(+), 340 deletions(-) diff --git a/runtime/environment.go b/runtime/environment.go index f2607eb5bd..bcf2298df7 100644 --- a/runtime/environment.go +++ b/runtime/environment.go @@ -22,6 +22,7 @@ import ( "time" "go.opentelemetry.io/otel/attribute" + "golang.org/x/mod/semver" "github.com/onflow/cadence" "github.com/onflow/cadence/runtime/activations" @@ -1461,6 +1462,9 @@ func (e *interpreterEnvironment) newValidateAccountCapabilitiesPublishHandler() } } +// TODO: +const MinimumRequiredVersionForInvalidTypeErrorFixes = "v1.0.3" + func (e *interpreterEnvironment) configureVersionedFeatures() { var ( minimumRequiredVersion string @@ -1473,6 +1477,7 @@ func (e *interpreterEnvironment) configureVersionedFeatures() { panic(err) } - // No feature flags yet - _ = minimumRequiredVersion + e.CheckerConfig.InvalidTypeErrorFixesEnabled = + minimumRequiredVersion != "" && + semver.Compare(MinimumRequiredVersionForInvalidTypeErrorFixes, minimumRequiredVersion) >= 0 } diff --git a/runtime/runtime_test.go b/runtime/runtime_test.go index 5efbfe7dab..647ed2116b 100644 --- a/runtime/runtime_test.go +++ b/runtime/runtime_test.go @@ -11553,41 +11553,66 @@ func TestRuntimeInvocationReturnTypeInferenceFailure(t *testing.T) { t.Parallel() - address := common.MustBytesToAddress([]byte{0x1}) + test := func(invalidTypeErrorFixesEnabled bool) { - newRuntimeInterface := func() Interface { + name := fmt.Sprintf( + "error fixes enabled: %v", + invalidTypeErrorFixesEnabled, + ) - return &TestRuntimeInterface{ - Storage: NewTestLedger(nil, nil), - OnGetSigningAccounts: func() ([]common.Address, error) { - return []common.Address{address}, nil - }, - } - } + t.Run(name, func(t *testing.T) { + t.Parallel() - runtime := NewTestInterpreterRuntime() + address := common.MustBytesToAddress([]byte{0x1}) - nextTransactionLocation := NewTransactionLocationGenerator() + runtimeInterface := &TestRuntimeInterface{ + Storage: NewTestLedger(nil, nil), + OnGetSigningAccounts: func() ([]common.Address, error) { + return []common.Address{address}, nil + }, + OnMinimumRequiredVersion: func() (string, error) { + if invalidTypeErrorFixesEnabled { + return MinimumRequiredVersionForInvalidTypeErrorFixes, nil + } + return "", nil + }, + } - tx := []byte(` - transaction{ - prepare(signer: auth(Storage) &Account){ - let functions = [signer.storage.save].reverse() - } - } - `) + runtime := NewTestInterpreterRuntime() - err := runtime.ExecuteTransaction( - Script{ - Source: tx, - }, - Context{ - Interface: newRuntimeInterface(), - Location: nextTransactionLocation(), - }, - ) - RequireError(t, err) + nextTransactionLocation := NewTransactionLocationGenerator() - var typeErr *sema.InvocationTypeInferenceError - require.ErrorAs(t, err, &typeErr) + tx := []byte(` + transaction{ + prepare(signer: auth(Storage) &Account){ + let functions = [signer.storage.save].reverse() + } + } + `) + + err := runtime.ExecuteTransaction( + Script{ + Source: tx, + }, + Context{ + Interface: runtimeInterface, + Location: nextTransactionLocation(), + }, + ) + + RequireError(t, err) + + if invalidTypeErrorFixesEnabled { + var typeErr *sema.InvocationTypeInferenceError + require.ErrorAs(t, err, &typeErr) + } else { + var transferErr interpreter.ValueTransferTypeError + require.ErrorAs(t, err, &transferErr) + } + }) + } + + for _, invalidTypeErrorFixesEnabled := range []bool{true, false} { + test(invalidTypeErrorFixesEnabled) + } } diff --git a/runtime/sema/check_invocation_expression.go b/runtime/sema/check_invocation_expression.go index bbf45de72d..9c91033e75 100644 --- a/runtime/sema/check_invocation_expression.go +++ b/runtime/sema/check_invocation_expression.go @@ -503,12 +503,14 @@ func (checker *Checker) checkInvocation( returnType = functionType.ReturnTypeAnnotation.Type.Resolve(typeArguments) if returnType == nil { - checker.report(&InvocationTypeInferenceError{ - Range: ast.NewRangeFromPositioned( - checker.memoryGauge, - invocationExpression, - ), - }) + if checker.Config.InvalidTypeErrorFixesEnabled { + checker.report(&InvocationTypeInferenceError{ + Range: ast.NewRangeFromPositioned( + checker.memoryGauge, + invocationExpression, + ), + }) + } returnType = InvalidType } @@ -605,12 +607,14 @@ func (checker *Checker) checkInvocationRequiredArgument( parameterType = parameterType.Resolve(typeParameters) // If the type parameter could not be resolved, use the invalid type. if parameterType == nil { - checker.report(&InvocationTypeInferenceError{ - Range: ast.NewRangeFromPositioned( - checker.memoryGauge, - argument.Expression, - ), - }) + if checker.Config.InvalidTypeErrorFixesEnabled { + checker.report(&InvocationTypeInferenceError{ + Range: ast.NewRangeFromPositioned( + checker.memoryGauge, + argument.Expression, + ), + }) + } parameterType = InvalidType } } @@ -686,12 +690,14 @@ func (checker *Checker) checkInvocationRequiredArgument( parameterType = parameterType.Resolve(typeParameters) // If the type parameter could not be resolved, use the invalid type. if parameterType == nil { - checker.report(&InvocationTypeInferenceError{ - Range: ast.NewRangeFromPositioned( - checker.memoryGauge, - argument.Expression, - ), - }) + if checker.Config.InvalidTypeErrorFixesEnabled { + checker.report(&InvocationTypeInferenceError{ + Range: ast.NewRangeFromPositioned( + checker.memoryGauge, + argument.Expression, + ), + }) + } parameterType = InvalidType } } diff --git a/runtime/sema/checker.go b/runtime/sema/checker.go index fa3486715a..9fa38951f8 100644 --- a/runtime/sema/checker.go +++ b/runtime/sema/checker.go @@ -886,12 +886,16 @@ func (checker *Checker) ConvertType(t ast.Type) Type { case *ast.InstantiationType: return checker.convertInstantiationType(t) - default: - checker.report(&UnconvertableTypeError{ - Range: ast.NewRangeFromPositioned(checker.memoryGauge, t), - }) + case nil: + if checker.Config.InvalidTypeErrorFixesEnabled { + checker.report(&UnconvertableTypeError{ + Range: ast.NewRangeFromPositioned(checker.memoryGauge, t), + }) + } return InvalidType } + + panic(&astTypeConversionError{invalidASTType: t}) } func CheckIntersectionType( @@ -2611,7 +2615,9 @@ func (checker *Checker) visitExpressionWithForceType( actualType = ast.AcceptExpression[Type](expr, checker) - checker.checkErrorsForInvalidExpressionTypes(actualType, expectedType) + if checker.Config.InvalidTypeErrorFixesEnabled { + checker.checkErrorsForInvalidExpressionTypes(actualType, expectedType) + } if checker.Config.ExtendedElaborationEnabled { checker.Elaboration.SetExpressionTypes( diff --git a/runtime/sema/config.go b/runtime/sema/config.go index 06f6e9ce95..28c19feea5 100644 --- a/runtime/sema/config.go +++ b/runtime/sema/config.go @@ -55,4 +55,6 @@ type Config struct { AllowStaticDeclarations bool // AttachmentsEnabled determines if attachments are enabled AttachmentsEnabled bool + // InvalidTypeErrorFixesEnabled determines if errors for invalid type errors are reported + InvalidTypeErrorFixesEnabled bool } diff --git a/runtime/sema/errors.go b/runtime/sema/errors.go index 163c5ec5ba..04b32afeb0 100644 --- a/runtime/sema/errors.go +++ b/runtime/sema/errors.go @@ -51,6 +51,16 @@ func ErrorMessageExpectedActualTypes( return } +// astTypeConversionError + +type astTypeConversionError struct { + invalidASTType ast.Type +} + +func (e *astTypeConversionError) Error() string { + return fmt.Sprintf("cannot convert unsupported AST type: %#+v", e.invalidASTType) +} + // unsupportedOperation type unsupportedOperation struct { diff --git a/runtime/tests/checker/account_test.go b/runtime/tests/checker/account_test.go index c8c5ea0cf8..d6d4c0b65d 100644 --- a/runtime/tests/checker/account_test.go +++ b/runtime/tests/checker/account_test.go @@ -401,18 +401,19 @@ func TestCheckAccountStorageLoad(t *testing.T) { require.IsType(t, &sema.InvalidAccessError{}, errs[0]) }) - testMissingTypeArguments := func(domain common.PathDomain) { + testMissingTypeArguments := func(domain common.PathDomain, invalidTypeErrorFixesEnabled bool) { testName := fmt.Sprintf( - "missing type argument, %s", + "missing type argument, %s, %v", domain.Identifier(), + invalidTypeErrorFixesEnabled, ) t.Run(testName, func(t *testing.T) { t.Parallel() - _, err := ParseAndCheck(t, + _, err := ParseAndCheckWithOptions(t, fmt.Sprintf( ` fun test(storage: auth(Storage) &Account.Storage) { @@ -421,20 +422,38 @@ func TestCheckAccountStorageLoad(t *testing.T) { `, domain.Identifier(), ), + ParseAndCheckOptions{ + Config: &sema.Config{ + InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, + }, + }, ) if domain == common.PathDomainStorage { - errs := RequireCheckerErrors(t, err, 2) + if invalidTypeErrorFixesEnabled { + errs := RequireCheckerErrors(t, err, 2) + + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + } else { + errs := RequireCheckerErrors(t, err, 1) - require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[0]) + } } else { - errs := RequireCheckerErrors(t, err, 3) + if invalidTypeErrorFixesEnabled { + errs := RequireCheckerErrors(t, err, 3) - require.IsType(t, &sema.TypeMismatchError{}, errs[0]) - require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) + require.IsType(t, &sema.TypeMismatchError{}, errs[0]) + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) + } else { + errs := RequireCheckerErrors(t, err, 2) + + require.IsType(t, &sema.TypeMismatchError{}, errs[0]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + } } }) } @@ -506,7 +525,9 @@ func TestCheckAccountStorageLoad(t *testing.T) { } for _, domain := range common.AllPathDomainsByIdentifier { - testMissingTypeArguments(domain) + for _, invalidTypeErrorFixesEnabled := range []bool{false, true} { + testMissingTypeArguments(domain, invalidTypeErrorFixesEnabled) + } testExplicitTypeArgument(domain) } } @@ -529,18 +550,19 @@ func TestCheckAccountStorageCopy(t *testing.T) { require.IsType(t, &sema.InvalidAccessError{}, errs[0]) }) - testMissingTypeArgument := func(domain common.PathDomain) { + testMissingTypeArgument := func(domain common.PathDomain, invalidTypeErrorFixesEnabled bool) { testName := fmt.Sprintf( - "missing type argument, %s", + "missing type argument, %s, %v", domain.Identifier(), + invalidTypeErrorFixesEnabled, ) t.Run(testName, func(t *testing.T) { t.Parallel() - _, err := ParseAndCheck(t, + _, err := ParseAndCheckWithOptions(t, fmt.Sprintf( ` struct S {} @@ -551,20 +573,39 @@ func TestCheckAccountStorageCopy(t *testing.T) { `, domain.Identifier(), ), + ParseAndCheckOptions{ + Config: &sema.Config{ + InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, + }, + }, ) if domain == common.PathDomainStorage { - errs := RequireCheckerErrors(t, err, 2) - require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + if invalidTypeErrorFixesEnabled { + errs := RequireCheckerErrors(t, err, 2) + + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + } else { + errs := RequireCheckerErrors(t, err, 1) + + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[0]) + } } else { - errs := RequireCheckerErrors(t, err, 3) + if invalidTypeErrorFixesEnabled { + errs := RequireCheckerErrors(t, err, 3) - require.IsType(t, &sema.TypeMismatchError{}, errs[0]) - require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) + require.IsType(t, &sema.TypeMismatchError{}, errs[0]) + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) + } else { + errs := RequireCheckerErrors(t, err, 2) + + require.IsType(t, &sema.TypeMismatchError{}, errs[0]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + } } }) } @@ -640,7 +681,9 @@ func TestCheckAccountStorageCopy(t *testing.T) { } for _, domain := range common.AllPathDomainsByIdentifier { - testMissingTypeArgument(domain) + for _, invalidTypeErrorFixesEnabled := range []bool{false, true} { + testMissingTypeArgument(domain, invalidTypeErrorFixesEnabled) + } testExplicitTypeArgument(domain) } } @@ -663,11 +706,12 @@ func TestCheckAccountStorageBorrow(t *testing.T) { require.IsType(t, &sema.InvalidAccessError{}, errs[0]) }) - testMissingTypeArgument := func(domain common.PathDomain) { + testMissingTypeArgument := func(domain common.PathDomain, invalidTypeErrorFixesEnabled bool) { testName := fmt.Sprintf( - "missing type argument, %s", + "missing type argument, %s, %v", domain.Identifier(), + invalidTypeErrorFixesEnabled, ) t.Run(testName, func(t *testing.T) { @@ -678,7 +722,7 @@ func TestCheckAccountStorageBorrow(t *testing.T) { t.Parallel() - _, err := ParseAndCheck(t, + _, err := ParseAndCheckWithOptions(t, fmt.Sprintf( ` fun test(storage: auth(Storage) &Account.Storage) { @@ -687,20 +731,38 @@ func TestCheckAccountStorageBorrow(t *testing.T) { `, domain.Identifier(), ), + ParseAndCheckOptions{ + Config: &sema.Config{ + InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, + }, + }, ) if domain == common.PathDomainStorage { - errs := RequireCheckerErrors(t, err, 2) + if invalidTypeErrorFixesEnabled { + errs := RequireCheckerErrors(t, err, 2) - require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + } else { + errs := RequireCheckerErrors(t, err, 1) - } else { - errs := RequireCheckerErrors(t, err, 3) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[0]) + } - require.IsType(t, &sema.TypeMismatchError{}, errs[0]) - require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) + } else { + if invalidTypeErrorFixesEnabled { + errs := RequireCheckerErrors(t, err, 3) + + require.IsType(t, &sema.TypeMismatchError{}, errs[0]) + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) + } else { + errs := RequireCheckerErrors(t, err, 2) + + require.IsType(t, &sema.TypeMismatchError{}, errs[0]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + } } }) @@ -708,7 +770,7 @@ func TestCheckAccountStorageBorrow(t *testing.T) { t.Parallel() - _, err := ParseAndCheck(t, + _, err := ParseAndCheckWithOptions(t, fmt.Sprintf( ` fun test(storage: auth(Storage) &Account.Storage) { @@ -717,20 +779,38 @@ func TestCheckAccountStorageBorrow(t *testing.T) { `, domain.Identifier(), ), + ParseAndCheckOptions{ + Config: &sema.Config{ + InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, + }, + }, ) if domain == common.PathDomainStorage { - errs := RequireCheckerErrors(t, err, 2) + if invalidTypeErrorFixesEnabled { + errs := RequireCheckerErrors(t, err, 2) - require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + } else { + errs := RequireCheckerErrors(t, err, 1) - } else { - errs := RequireCheckerErrors(t, err, 3) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[0]) + } - require.IsType(t, &sema.TypeMismatchError{}, errs[0]) - require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) + } else { + if invalidTypeErrorFixesEnabled { + errs := RequireCheckerErrors(t, err, 3) + + require.IsType(t, &sema.TypeMismatchError{}, errs[0]) + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) + } else { + errs := RequireCheckerErrors(t, err, 2) + + require.IsType(t, &sema.TypeMismatchError{}, errs[0]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + } } }) }) @@ -888,7 +968,9 @@ func TestCheckAccountStorageBorrow(t *testing.T) { } for _, domain := range common.AllPathDomainsByIdentifier { - testMissingTypeArgument(domain) + for _, invalidTypeErrorFixesEnabled := range []bool{false, true} { + testMissingTypeArgument(domain, invalidTypeErrorFixesEnabled) + } for _, auth := range []sema.Access{ sema.UnauthorizedAccess, @@ -1023,22 +1105,45 @@ func TestCheckAccountContractsBorrow(t *testing.T) { require.NoError(t, err) }) - t.Run("invalid borrow contract: missing type argument", func(t *testing.T) { - t.Parallel() + testInvalidBorrowContractMissingTypeArgument := func(t *testing.T, invalidTypeErrorFixesEnabled bool) { + name := fmt.Sprintf( + "invalid borrow contract: missing type argument, error fixes enabled: %v", + invalidTypeErrorFixesEnabled, + ) + t.Run(name, func(t *testing.T) { + t.Parallel() - _, err := ParseAndCheck(t, ` - contract C {} + _, err := ParseAndCheckWithOptions(t, + ` + contract C {} - fun test(contracts: &Account.Contracts): &AnyStruct { - return contracts.borrow(name: "foo")! - } - `) + fun test(contracts: &Account.Contracts): &AnyStruct { + return contracts.borrow(name: "foo")! + } + `, + ParseAndCheckOptions{ + Config: &sema.Config{ + InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, + }, + }, + ) - errors := RequireCheckerErrors(t, err, 2) + if invalidTypeErrorFixesEnabled { + errors := RequireCheckerErrors(t, err, 2) - assert.IsType(t, &sema.InvocationTypeInferenceError{}, errors[0]) - assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errors[1]) - }) + assert.IsType(t, &sema.InvocationTypeInferenceError{}, errors[0]) + assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errors[1]) + } else { + errors := RequireCheckerErrors(t, err, 1) + + assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errors[0]) + } + }) + } + + for _, invalidTypeErrorFixesEnabled := range []bool{false, true} { + testInvalidBorrowContractMissingTypeArgument(t, invalidTypeErrorFixesEnabled) + } } func TestCheckAccountContractsAdd(t *testing.T) { diff --git a/runtime/tests/checker/arrays_dictionaries_test.go b/runtime/tests/checker/arrays_dictionaries_test.go index 3952c1aa2b..d98205bdb0 100644 --- a/runtime/tests/checker/arrays_dictionaries_test.go +++ b/runtime/tests/checker/arrays_dictionaries_test.go @@ -1262,44 +1262,64 @@ func TestCheckArrayMapInvalidArgs(t *testing.T) { t.Parallel() - testInvalidArgs := func(code string, expectedErrors []sema.SemanticError) { - _, err := ParseAndCheck(t, code) + testNotAFunction := func(invalidTypeErrorFixesEnabled bool) { - errs := RequireCheckerErrors(t, err, len(expectedErrors)) + name := fmt.Sprintf("not a function, error fixes enabled: %v", invalidTypeErrorFixesEnabled) + t.Run(name, func(t *testing.T) { + t.Parallel() - for i, e := range expectedErrors { - assert.IsType(t, e, errs[i]) - } + _, err := ParseAndCheckWithOptions(t, + ` + fun test() { + let x = [1, 2, 3] + let y = x.map(100) + } + `, + ParseAndCheckOptions{ + Config: &sema.Config{ + InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, + }, + }, + ) + + if invalidTypeErrorFixesEnabled { + errs := RequireCheckerErrors(t, err, 3) + + assert.IsType(t, &sema.TypeMismatchError{}, errs[0]) + assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) // since we're not passing a function. + assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) // since we're not passing a function. + } else { + errs := RequireCheckerErrors(t, err, 2) + + assert.IsType(t, &sema.TypeMismatchError{}, errs[0]) + assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) // since we're not passing a function. + } + }) } - testInvalidArgs(` - fun test() { - let x = [1, 2, 3] - let y = x.map(100) - } - `, - []sema.SemanticError{ - &sema.TypeMismatchError{}, - &sema.InvocationTypeInferenceError{}, // since we're not passing a function. - &sema.TypeParameterTypeInferenceError{}, // since we're not passing a function. - }, - ) + for _, invalidTypeErrorFixesEnabled := range []bool{true, false} { + testNotAFunction(invalidTypeErrorFixesEnabled) + } - testInvalidArgs(` - fun test() { - let x = [1, 2, 3] - let trueForEvenInt16 = - fun (_ x: Int16): Bool { - return x % 2 == 0 - } + t.Run("function, invalid parameter type", func(t *testing.T) { + t.Parallel() - let y: [Bool] = x.map(trueForEvenInt16) - } - `, - []sema.SemanticError{ - &sema.TypeMismatchError{}, - }, - ) + _, err := ParseAndCheck(t, ` + fun test() { + let x = [1, 2, 3] + let trueForEvenInt16 = + fun (_ x: Int16): Bool { + return x % 2 == 0 + } + + let y: [Bool] = x.map(trueForEvenInt16) + } + `) + + errs := RequireCheckerErrors(t, err, 1) + + assert.IsType(t, &sema.TypeMismatchError{}, errs[0]) + }) } func TestCheckResourceArrayMapInvalid(t *testing.T) { @@ -2653,17 +2673,42 @@ func TestCheckArrayToConstantSizedMissingTypeArgument(t *testing.T) { t.Parallel() - _, err := ParseAndCheck(t, ` - fun test() { - let x: [Int16] = [1, 2, 3] - let y = x.toConstantSized() - } - `) + test := func(invalidTypeErrorFixesEnabled bool) { - errs := RequireCheckerErrors(t, err, 2) + name := fmt.Sprintf("fixes enabled: %v", invalidTypeErrorFixesEnabled) + + t.Run(name, func(t *testing.T) { + t.Parallel() + + _, err := ParseAndCheckWithOptions(t, ` + fun test() { + let x: [Int16] = [1, 2, 3] + let y = x.toConstantSized() + } + `, + ParseAndCheckOptions{ + Config: &sema.Config{ + InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, + }, + }, + ) - assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) - assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + if invalidTypeErrorFixesEnabled { + errs := RequireCheckerErrors(t, err, 2) + + assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) + assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + } else { + errs := RequireCheckerErrors(t, err, 1) + + assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[0]) + } + }) + } + + for _, invalidTypeErrorFixesEnabled := range []bool{true, false} { + test(invalidTypeErrorFixesEnabled) + } } func TestCheckArrayReferenceTypeInference(t *testing.T) { diff --git a/runtime/tests/checker/builtinfunctions_test.go b/runtime/tests/checker/builtinfunctions_test.go index 79c931d13c..68d23e86ec 100644 --- a/runtime/tests/checker/builtinfunctions_test.go +++ b/runtime/tests/checker/builtinfunctions_test.go @@ -288,6 +288,7 @@ func TestCheckRevertibleRandom(t *testing.T) { BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation { return baseValueActivation }, + InvalidTypeErrorFixesEnabled: false, }, } } @@ -430,7 +431,6 @@ func TestCheckRevertibleRandom(t *testing.T) { "missing type argument", `let rand = revertibleRandom()`, []error{ - &sema.InvocationTypeInferenceError{}, &sema.TypeParameterTypeInferenceError{}, }, ) diff --git a/runtime/tests/checker/capability_test.go b/runtime/tests/checker/capability_test.go index a842ed161f..e8154db6e2 100644 --- a/runtime/tests/checker/capability_test.go +++ b/runtime/tests/checker/capability_test.go @@ -22,7 +22,9 @@ import ( "fmt" "testing" + "github.com/onflow/cadence/runtime/common" "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/runtime/stdlib" "github.com/onflow/cadence/runtime/tests/utils" "github.com/stretchr/testify/assert" @@ -76,20 +78,50 @@ func TestCheckCapability_borrow(t *testing.T) { t.Parallel() - t.Run("missing type argument", func(t *testing.T) { + testMissingTypeArgument := func(invalidTypeErrorFixesEnabled bool) { - _, err := ParseAndCheckWithPanic(t, ` + name := fmt.Sprintf( + "missing type argument, error fixes enabled: %v", + invalidTypeErrorFixesEnabled, + ) - let capability: Capability = panic("") + t.Run(name, func(t *testing.T) { + t.Parallel() - let r = capability.borrow() - `) + baseValueActivation := sema.NewVariableActivation(sema.BaseValueActivation) + baseValueActivation.DeclareValue(stdlib.PanicFunction) - errs := RequireCheckerErrors(t, err, 2) + _, err := ParseAndCheckWithOptions(t, + ` + let capability: Capability = panic("") - require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) - }) + let r = capability.borrow() + `, + ParseAndCheckOptions{ + Config: &sema.Config{ + BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation { + return baseValueActivation + }, + InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, + }, + }, + ) + if invalidTypeErrorFixesEnabled { + errs := RequireCheckerErrors(t, err, 2) + + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + } else { + errs := RequireCheckerErrors(t, err, 1) + + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[0]) + } + }) + } + + for _, invalidTypeErrorFixesEnabled := range []bool{false, true} { + testMissingTypeArgument(invalidTypeErrorFixesEnabled) + } for _, auth := range []sema.Access{sema.UnauthorizedAccess, sema.NewEntitlementSetAccess([]*sema.EntitlementType{{ diff --git a/runtime/tests/checker/conditions_test.go b/runtime/tests/checker/conditions_test.go index cfe5f73fab..772741f51d 100644 --- a/runtime/tests/checker/conditions_test.go +++ b/runtime/tests/checker/conditions_test.go @@ -19,6 +19,7 @@ package checker import ( + "fmt" "testing" "github.com/stretchr/testify/assert" @@ -254,43 +255,87 @@ func TestCheckInvalidFunctionPostConditionWithBeforeAndNoArgument(t *testing.T) t.Parallel() - t.Run("test condition", func(t *testing.T) { - t.Parallel() - - _, err := ParseAndCheck(t, ` - fun test(x: Int) { - post { - before() != 0 - } - } - `) - - errs := RequireCheckerErrors(t, err, 3) - - assert.IsType(t, &sema.InsufficientArgumentsError{}, errs[0]) - assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) - assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) - }) - - t.Run("emit condition", func(t *testing.T) { - t.Parallel() + test := func(invalidTypeErrorFixesEnabled bool) { - _, err := ParseAndCheck(t, ` - event Foo(x: Int) - - fun test(x: Int) { - post { - emit Foo(x: before()) - } - } - `) + name := fmt.Sprintf( + "error fixes enabled: %v", + invalidTypeErrorFixesEnabled, + ) - errs := RequireCheckerErrors(t, err, 3) + t.Run(name, func(t *testing.T) { + t.Parallel() + + t.Run("test condition", func(t *testing.T) { + t.Parallel() + + _, err := ParseAndCheckWithOptions(t, + ` + fun test(x: Int) { + post { + before() != 0 + } + } + `, + ParseAndCheckOptions{ + Config: &sema.Config{ + InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, + }, + }, + ) + + if invalidTypeErrorFixesEnabled { + errs := RequireCheckerErrors(t, err, 3) + + assert.IsType(t, &sema.InsufficientArgumentsError{}, errs[0]) + assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) + assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) + } else { + errs := RequireCheckerErrors(t, err, 2) + + assert.IsType(t, &sema.InsufficientArgumentsError{}, errs[0]) + assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + } + }) + + t.Run("emit condition", func(t *testing.T) { + t.Parallel() + + _, err := ParseAndCheckWithOptions(t, + ` + event Foo(x: Int) + + fun test(x: Int) { + post { + emit Foo(x: before()) + } + } + `, + ParseAndCheckOptions{ + Config: &sema.Config{ + InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, + }, + }, + ) + + if invalidTypeErrorFixesEnabled { + errs := RequireCheckerErrors(t, err, 3) + + assert.IsType(t, &sema.InsufficientArgumentsError{}, errs[0]) + assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) + assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) + } else { + errs := RequireCheckerErrors(t, err, 2) + + assert.IsType(t, &sema.InsufficientArgumentsError{}, errs[0]) + assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + } + }) + }) + } - assert.IsType(t, &sema.InsufficientArgumentsError{}, errs[0]) - assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) - assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) - }) + for _, invalidTypeErrorFixesEnabled := range []bool{true, false} { + test(invalidTypeErrorFixesEnabled) + } } func TestCheckInvalidFunctionPreConditionWithBefore(t *testing.T) { diff --git a/runtime/tests/checker/dictionary_test.go b/runtime/tests/checker/dictionary_test.go index e0efc29cce..1887e8a454 100644 --- a/runtime/tests/checker/dictionary_test.go +++ b/runtime/tests/checker/dictionary_test.go @@ -19,6 +19,7 @@ package checker import ( + "fmt" "testing" "github.com/stretchr/testify/assert" @@ -31,26 +32,49 @@ func TestCheckIncompleteDictionaryType(t *testing.T) { t.Parallel() - checker, err := ParseAndCheckWithOptions(t, - ` - let dict: {Int:} = {} - `, - ParseAndCheckOptions{ - IgnoreParseError: true, - }, - ) + test := func(invalidTypeErrorFixesEnabled bool) { - errs := RequireCheckerErrors(t, err, 1) + name := fmt.Sprintf( + "error fixes enabled: %v", + invalidTypeErrorFixesEnabled, + ) - assert.IsType(t, errs[0], &sema.UnconvertableTypeError{}) + t.Run(name, func(t *testing.T) { + t.Parallel() - assert.Equal(t, - &sema.DictionaryType{ - KeyType: sema.IntType, - ValueType: sema.InvalidType, - }, - RequireGlobalValue(t, checker.Elaboration, "dict"), - ) + checker, err := ParseAndCheckWithOptions(t, + ` + let dict: {Int:} = {} + `, + ParseAndCheckOptions{ + IgnoreParseError: true, + Config: &sema.Config{ + InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, + }, + }, + ) + + if invalidTypeErrorFixesEnabled { + errs := RequireCheckerErrors(t, err, 1) + + assert.IsType(t, errs[0], &sema.UnconvertableTypeError{}) + } else { + require.NoError(t, err) + } + + assert.Equal(t, + &sema.DictionaryType{ + KeyType: sema.IntType, + ValueType: sema.InvalidType, + }, + RequireGlobalValue(t, checker.Elaboration, "dict"), + ) + }) + } + + for _, invalidTypeErrorFixesEnabled := range []bool{true, false} { + test(invalidTypeErrorFixesEnabled) + } } func TestCheckMetaKeyType(t *testing.T) { diff --git a/runtime/tests/checker/genericfunction_test.go b/runtime/tests/checker/genericfunction_test.go index f7f89c87cf..b1310705f6 100644 --- a/runtime/tests/checker/genericfunction_test.go +++ b/runtime/tests/checker/genericfunction_test.go @@ -431,31 +431,67 @@ func TestCheckGenericFunctionInvocation(t *testing.T) { t.Parallel() - typeParameter := &sema.TypeParameter{ - Name: "T", - TypeBound: nil, - } + test := func(invalidTypeErrorFixesEnabled bool) { - _, err := parseAndCheckWithTestValue(t, - ` - let res = test() - `, - &sema.FunctionType{ - TypeParameters: []*sema.TypeParameter{ - typeParameter, - }, - ReturnTypeAnnotation: sema.NewTypeAnnotation( - &sema.GenericType{ - TypeParameter: typeParameter, + name := fmt.Sprintf( + "error fixes enabled: %v", + invalidTypeErrorFixesEnabled, + ) + + t.Run(name, func(t *testing.T) { + t.Parallel() + + typeParameter := &sema.TypeParameter{ + Name: "T", + TypeBound: nil, + } + + baseValueActivation := sema.NewVariableActivation(sema.BaseValueActivation) + baseValueActivation.DeclareValue(stdlib.StandardLibraryValue{ + Name: "test", + Type: &sema.FunctionType{ + TypeParameters: []*sema.TypeParameter{ + typeParameter, + }, + ReturnTypeAnnotation: sema.NewTypeAnnotation( + &sema.GenericType{ + TypeParameter: typeParameter, + }, + ), }, - ), - }, - ) + Kind: common.DeclarationKindConstant, + }) - errs := RequireCheckerErrors(t, err, 2) + _, err := ParseAndCheckWithOptions(t, + ` + let res = test() + `, + ParseAndCheckOptions{ + Config: &sema.Config{ + BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation { + return baseValueActivation + }, + InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, + }, + }, + ) - assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) - assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + if invalidTypeErrorFixesEnabled { + errs := RequireCheckerErrors(t, err, 2) + + assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) + assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + } else { + errs := RequireCheckerErrors(t, err, 1) + + assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[0]) + } + }) + } + + for _, invalidTypeErrorFixesEnabled := range []bool{true, false} { + test(invalidTypeErrorFixesEnabled) + } }) t.Run("valid: one type parameter, one type argument, no parameters, no arguments, return type", func(t *testing.T) { diff --git a/runtime/tests/checker/invalid_test.go b/runtime/tests/checker/invalid_test.go index 3ed32e3205..aa7d1aba6a 100644 --- a/runtime/tests/checker/invalid_test.go +++ b/runtime/tests/checker/invalid_test.go @@ -19,6 +19,7 @@ package checker import ( + "fmt" "testing" "github.com/stretchr/testify/assert" @@ -210,80 +211,123 @@ func TestCheckInvalidInvocationFunctionReturnType(t *testing.T) { t.Parallel() - typeParameter := &sema.TypeParameter{ - Name: "T", - } + test := func(invalidTypeErrorFixesEnabled bool) { - fType := &sema.FunctionType{ - TypeParameters: []*sema.TypeParameter{ - typeParameter, - }, - ReturnTypeAnnotation: sema.NewTypeAnnotation( - &sema.GenericType{ - TypeParameter: typeParameter, - }, - ), - } + name := fmt.Sprintf( + "error fixes enabled: %v", + invalidTypeErrorFixesEnabled, + ) - baseValueActivation := sema.NewVariableActivation(sema.BaseValueActivation) - baseValueActivation.DeclareValue(stdlib.StandardLibraryValue{ - Type: fType, - Name: "f", - Kind: common.DeclarationKindFunction, - }) + t.Run(name, func(t *testing.T) { + t.Parallel() - _, err := ParseAndCheckWithOptions(t, - ` - let res = [f].reverse() - `, - ParseAndCheckOptions{ - Config: &sema.Config{ - BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation { - return baseValueActivation + typeParameter := &sema.TypeParameter{ + Name: "T", + } + + fType := &sema.FunctionType{ + TypeParameters: []*sema.TypeParameter{ + typeParameter, }, - }, - }, - ) + ReturnTypeAnnotation: sema.NewTypeAnnotation( + &sema.GenericType{ + TypeParameter: typeParameter, + }, + ), + } + + baseValueActivation := sema.NewVariableActivation(sema.BaseValueActivation) + baseValueActivation.DeclareValue(stdlib.StandardLibraryValue{ + Type: fType, + Name: "f", + Kind: common.DeclarationKindFunction, + }) + + _, err := ParseAndCheckWithOptions(t, + ` + let res = [f].reverse() + `, + ParseAndCheckOptions{ + Config: &sema.Config{ + BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation { + return baseValueActivation + }, + InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, + }, + }, + ) - errs := RequireCheckerErrors(t, err, 1) + if invalidTypeErrorFixesEnabled { - assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) + errs := RequireCheckerErrors(t, err, 1) + + assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) + } else { + require.NoError(t, err) + } + }) + } + + for _, invalidTypeErrorFixesEnabled := range []bool{true, false} { + test(invalidTypeErrorFixesEnabled) + } } func TestCheckInvalidTypeDefensiveCheck(t *testing.T) { t.Parallel() - baseValueActivation := sema.NewVariableActivation(sema.BaseValueActivation) - baseValueActivation.DeclareValue(stdlib.StandardLibraryValue{ - Type: sema.InvalidType, - Name: "invalid", - Kind: common.DeclarationKindConstant, - }) - - var r any - func() { - defer func() { - r = recover() - }() - - _, _ = ParseAndCheckWithOptions(t, - ` - let res = invalid - `, - ParseAndCheckOptions{ - Config: &sema.Config{ - BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation { - return baseValueActivation - }, - }, - }, + test := func(invalidTypeErrorFixesEnabled bool) { + + name := fmt.Sprintf( + "error fixes enabled: %v", + invalidTypeErrorFixesEnabled, ) - }() - require.IsType(t, errors.UnexpectedError{}, r) - err := r.(errors.UnexpectedError) - require.ErrorContains(t, err, "invalid type produced without error") + t.Run(name, func(t *testing.T) { + t.Parallel() + + baseValueActivation := sema.NewVariableActivation(sema.BaseValueActivation) + baseValueActivation.DeclareValue(stdlib.StandardLibraryValue{ + Type: sema.InvalidType, + Name: "invalid", + Kind: common.DeclarationKindConstant, + }) + + var r any + func() { + defer func() { + r = recover() + }() + + _, _ = ParseAndCheckWithOptions(t, + ` + let res = invalid + `, + ParseAndCheckOptions{ + Config: &sema.Config{ + BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation { + return baseValueActivation + }, + InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, + }, + }, + ) + }() + + if invalidTypeErrorFixesEnabled { + require.IsType(t, errors.UnexpectedError{}, r) + err := r.(errors.UnexpectedError) + require.ErrorContains(t, err, "invalid type produced without error") + } else { + require.Nil(t, r) + } + }) + } + + for _, invalidTypeErrorFixesEnabled := range []bool{true, false} { + test(invalidTypeErrorFixesEnabled) + } } func TestCheckInvalidTypeIndexing(t *testing.T) { diff --git a/runtime/tests/checker/invocation_test.go b/runtime/tests/checker/invocation_test.go index 3d0d8f6949..fc88ec267d 100644 --- a/runtime/tests/checker/invocation_test.go +++ b/runtime/tests/checker/invocation_test.go @@ -19,6 +19,7 @@ package checker import ( + "fmt" "testing" "github.com/stretchr/testify/assert" @@ -597,57 +598,79 @@ func TestCheckInvocationWithIncorrectTypeParameter(t *testing.T) { t.Parallel() - // function type has incorrect type-arguments: - // `fun Foo(_ a: R)` - // - funcType := &sema.FunctionType{ - ReturnTypeAnnotation: sema.VoidTypeAnnotation, - TypeParameters: []*sema.TypeParameter{ - { - Name: "T", - TypeBound: sema.AnyStructType, - }, - }, - Parameters: []sema.Parameter{ - { - Label: sema.ArgumentLabelNotRequired, - Identifier: "a", - TypeAnnotation: sema.NewTypeAnnotation( - &sema.GenericType{ - TypeParameter: &sema.TypeParameter{ - Name: "R", // This is an incorrect/undefined type-parameter - TypeBound: sema.AnyStructType, - }, + test := func(invalidTypeErrorFixesEnabled bool) { + + name := fmt.Sprintf( + "error fixes enabled: %v", + invalidTypeErrorFixesEnabled, + ) + + t.Run(name, func(t *testing.T) { + t.Parallel() + + // function type has incorrect type-arguments: + // `fun Foo(_ a: R)` + // + funcType := &sema.FunctionType{ + ReturnTypeAnnotation: sema.VoidTypeAnnotation, + TypeParameters: []*sema.TypeParameter{ + { + Name: "T", + TypeBound: sema.AnyStructType, }, - ), - }, - }, - } + }, + Parameters: []sema.Parameter{ + { + Label: sema.ArgumentLabelNotRequired, + Identifier: "a", + TypeAnnotation: sema.NewTypeAnnotation( + &sema.GenericType{ + TypeParameter: &sema.TypeParameter{ + Name: "R", // This is an incorrect/undefined type-parameter + TypeBound: sema.AnyStructType, + }, + }, + ), + }, + }, + } - baseValueActivation := sema.NewVariableActivation(sema.BaseValueActivation) - baseValueActivation.DeclareValue(stdlib.NewStandardLibraryStaticFunction( - "foo", - funcType, - "", - nil, // no need, we only type-check - )) + baseValueActivation := sema.NewVariableActivation(sema.BaseValueActivation) + baseValueActivation.DeclareValue(stdlib.NewStandardLibraryStaticFunction( + "foo", + funcType, + "", + nil, // no need, we only type-check + )) - _, err := ParseAndCheckWithOptions(t, - ` - access(all) fun test() { - foo("hello") - } - `, - ParseAndCheckOptions{ - Config: &sema.Config{ - BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation { - return baseValueActivation + _, err := ParseAndCheckWithOptions(t, + ` + access(all) fun test() { + foo("hello") + } + `, + ParseAndCheckOptions{ + Config: &sema.Config{ + BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation { + return baseValueActivation + }, + InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, + }, }, - }, - }, - ) + ) - errs := RequireCheckerErrors(t, err, 1) + if invalidTypeErrorFixesEnabled { - assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) + errs := RequireCheckerErrors(t, err, 1) + + assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) + } else { + require.NoError(t, err) + } + }) + } + + for _, invalidTypeErrorFixesEnabled := range []bool{true, false} { + test(invalidTypeErrorFixesEnabled) + } } diff --git a/runtime/tests/checker/utils.go b/runtime/tests/checker/utils.go index 9849a13d66..c883e10c2d 100644 --- a/runtime/tests/checker/utils.go +++ b/runtime/tests/checker/utils.go @@ -170,6 +170,8 @@ func ParseAndCheckWithOptionsAndMemoryMetering( } func RequireCheckerErrors(t *testing.T, err error, count int) []error { + t.Helper() + if count <= 0 { require.NoError(t, err) return nil From aecd31a9651a811ab3e8968ca9891bcb9a9ad45d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Tue, 19 Nov 2024 15:44:31 -0800 Subject: [PATCH 12/13] Revert "gate new behaviour (errors for all invalid type cases) behind a feature flag" This reverts commit 3e2ecc99b3a819ffb123723f62777a2655bbbae6. --- runtime/environment.go | 9 +- runtime/runtime_test.go | 85 +++---- runtime/sema/check_invocation_expression.go | 42 ++-- runtime/sema/checker.go | 16 +- runtime/sema/config.go | 2 - runtime/sema/errors.go | 10 - runtime/tests/checker/account_test.go | 215 +++++------------- .../tests/checker/arrays_dictionaries_test.go | 127 ++++------- .../tests/checker/builtinfunctions_test.go | 2 +- runtime/tests/checker/capability_test.go | 50 +--- runtime/tests/checker/conditions_test.go | 113 +++------ runtime/tests/checker/dictionary_test.go | 58 ++--- runtime/tests/checker/genericfunction_test.go | 78 ++----- runtime/tests/checker/invalid_test.go | 164 +++++-------- runtime/tests/checker/invocation_test.go | 117 ++++------ runtime/tests/checker/utils.go | 2 - 16 files changed, 340 insertions(+), 750 deletions(-) diff --git a/runtime/environment.go b/runtime/environment.go index bcf2298df7..f2607eb5bd 100644 --- a/runtime/environment.go +++ b/runtime/environment.go @@ -22,7 +22,6 @@ import ( "time" "go.opentelemetry.io/otel/attribute" - "golang.org/x/mod/semver" "github.com/onflow/cadence" "github.com/onflow/cadence/runtime/activations" @@ -1462,9 +1461,6 @@ func (e *interpreterEnvironment) newValidateAccountCapabilitiesPublishHandler() } } -// TODO: -const MinimumRequiredVersionForInvalidTypeErrorFixes = "v1.0.3" - func (e *interpreterEnvironment) configureVersionedFeatures() { var ( minimumRequiredVersion string @@ -1477,7 +1473,6 @@ func (e *interpreterEnvironment) configureVersionedFeatures() { panic(err) } - e.CheckerConfig.InvalidTypeErrorFixesEnabled = - minimumRequiredVersion != "" && - semver.Compare(MinimumRequiredVersionForInvalidTypeErrorFixes, minimumRequiredVersion) >= 0 + // No feature flags yet + _ = minimumRequiredVersion } diff --git a/runtime/runtime_test.go b/runtime/runtime_test.go index 647ed2116b..5efbfe7dab 100644 --- a/runtime/runtime_test.go +++ b/runtime/runtime_test.go @@ -11553,66 +11553,41 @@ func TestRuntimeInvocationReturnTypeInferenceFailure(t *testing.T) { t.Parallel() - test := func(invalidTypeErrorFixesEnabled bool) { - - name := fmt.Sprintf( - "error fixes enabled: %v", - invalidTypeErrorFixesEnabled, - ) - - t.Run(name, func(t *testing.T) { - t.Parallel() - - address := common.MustBytesToAddress([]byte{0x1}) - - runtimeInterface := &TestRuntimeInterface{ - Storage: NewTestLedger(nil, nil), - OnGetSigningAccounts: func() ([]common.Address, error) { - return []common.Address{address}, nil - }, - OnMinimumRequiredVersion: func() (string, error) { - if invalidTypeErrorFixesEnabled { - return MinimumRequiredVersionForInvalidTypeErrorFixes, nil - } - return "", nil - }, - } + address := common.MustBytesToAddress([]byte{0x1}) - runtime := NewTestInterpreterRuntime() + newRuntimeInterface := func() Interface { - nextTransactionLocation := NewTransactionLocationGenerator() + return &TestRuntimeInterface{ + Storage: NewTestLedger(nil, nil), + OnGetSigningAccounts: func() ([]common.Address, error) { + return []common.Address{address}, nil + }, + } + } - tx := []byte(` - transaction{ - prepare(signer: auth(Storage) &Account){ - let functions = [signer.storage.save].reverse() - } - } - `) + runtime := NewTestInterpreterRuntime() - err := runtime.ExecuteTransaction( - Script{ - Source: tx, - }, - Context{ - Interface: runtimeInterface, - Location: nextTransactionLocation(), - }, - ) + nextTransactionLocation := NewTransactionLocationGenerator() - RequireError(t, err) + tx := []byte(` + transaction{ + prepare(signer: auth(Storage) &Account){ + let functions = [signer.storage.save].reverse() + } + } + `) - if invalidTypeErrorFixesEnabled { - var typeErr *sema.InvocationTypeInferenceError - require.ErrorAs(t, err, &typeErr) - } else { - var transferErr interpreter.ValueTransferTypeError - require.ErrorAs(t, err, &transferErr) - } - }) - } + err := runtime.ExecuteTransaction( + Script{ + Source: tx, + }, + Context{ + Interface: newRuntimeInterface(), + Location: nextTransactionLocation(), + }, + ) + RequireError(t, err) - for _, invalidTypeErrorFixesEnabled := range []bool{true, false} { - test(invalidTypeErrorFixesEnabled) - } + var typeErr *sema.InvocationTypeInferenceError + require.ErrorAs(t, err, &typeErr) } diff --git a/runtime/sema/check_invocation_expression.go b/runtime/sema/check_invocation_expression.go index 9c91033e75..bbf45de72d 100644 --- a/runtime/sema/check_invocation_expression.go +++ b/runtime/sema/check_invocation_expression.go @@ -503,14 +503,12 @@ func (checker *Checker) checkInvocation( returnType = functionType.ReturnTypeAnnotation.Type.Resolve(typeArguments) if returnType == nil { - if checker.Config.InvalidTypeErrorFixesEnabled { - checker.report(&InvocationTypeInferenceError{ - Range: ast.NewRangeFromPositioned( - checker.memoryGauge, - invocationExpression, - ), - }) - } + checker.report(&InvocationTypeInferenceError{ + Range: ast.NewRangeFromPositioned( + checker.memoryGauge, + invocationExpression, + ), + }) returnType = InvalidType } @@ -607,14 +605,12 @@ func (checker *Checker) checkInvocationRequiredArgument( parameterType = parameterType.Resolve(typeParameters) // If the type parameter could not be resolved, use the invalid type. if parameterType == nil { - if checker.Config.InvalidTypeErrorFixesEnabled { - checker.report(&InvocationTypeInferenceError{ - Range: ast.NewRangeFromPositioned( - checker.memoryGauge, - argument.Expression, - ), - }) - } + checker.report(&InvocationTypeInferenceError{ + Range: ast.NewRangeFromPositioned( + checker.memoryGauge, + argument.Expression, + ), + }) parameterType = InvalidType } } @@ -690,14 +686,12 @@ func (checker *Checker) checkInvocationRequiredArgument( parameterType = parameterType.Resolve(typeParameters) // If the type parameter could not be resolved, use the invalid type. if parameterType == nil { - if checker.Config.InvalidTypeErrorFixesEnabled { - checker.report(&InvocationTypeInferenceError{ - Range: ast.NewRangeFromPositioned( - checker.memoryGauge, - argument.Expression, - ), - }) - } + checker.report(&InvocationTypeInferenceError{ + Range: ast.NewRangeFromPositioned( + checker.memoryGauge, + argument.Expression, + ), + }) parameterType = InvalidType } } diff --git a/runtime/sema/checker.go b/runtime/sema/checker.go index 9fa38951f8..fa3486715a 100644 --- a/runtime/sema/checker.go +++ b/runtime/sema/checker.go @@ -886,16 +886,12 @@ func (checker *Checker) ConvertType(t ast.Type) Type { case *ast.InstantiationType: return checker.convertInstantiationType(t) - case nil: - if checker.Config.InvalidTypeErrorFixesEnabled { - checker.report(&UnconvertableTypeError{ - Range: ast.NewRangeFromPositioned(checker.memoryGauge, t), - }) - } + default: + checker.report(&UnconvertableTypeError{ + Range: ast.NewRangeFromPositioned(checker.memoryGauge, t), + }) return InvalidType } - - panic(&astTypeConversionError{invalidASTType: t}) } func CheckIntersectionType( @@ -2615,9 +2611,7 @@ func (checker *Checker) visitExpressionWithForceType( actualType = ast.AcceptExpression[Type](expr, checker) - if checker.Config.InvalidTypeErrorFixesEnabled { - checker.checkErrorsForInvalidExpressionTypes(actualType, expectedType) - } + checker.checkErrorsForInvalidExpressionTypes(actualType, expectedType) if checker.Config.ExtendedElaborationEnabled { checker.Elaboration.SetExpressionTypes( diff --git a/runtime/sema/config.go b/runtime/sema/config.go index 28c19feea5..06f6e9ce95 100644 --- a/runtime/sema/config.go +++ b/runtime/sema/config.go @@ -55,6 +55,4 @@ type Config struct { AllowStaticDeclarations bool // AttachmentsEnabled determines if attachments are enabled AttachmentsEnabled bool - // InvalidTypeErrorFixesEnabled determines if errors for invalid type errors are reported - InvalidTypeErrorFixesEnabled bool } diff --git a/runtime/sema/errors.go b/runtime/sema/errors.go index 04b32afeb0..163c5ec5ba 100644 --- a/runtime/sema/errors.go +++ b/runtime/sema/errors.go @@ -51,16 +51,6 @@ func ErrorMessageExpectedActualTypes( return } -// astTypeConversionError - -type astTypeConversionError struct { - invalidASTType ast.Type -} - -func (e *astTypeConversionError) Error() string { - return fmt.Sprintf("cannot convert unsupported AST type: %#+v", e.invalidASTType) -} - // unsupportedOperation type unsupportedOperation struct { diff --git a/runtime/tests/checker/account_test.go b/runtime/tests/checker/account_test.go index d6d4c0b65d..c8c5ea0cf8 100644 --- a/runtime/tests/checker/account_test.go +++ b/runtime/tests/checker/account_test.go @@ -401,19 +401,18 @@ func TestCheckAccountStorageLoad(t *testing.T) { require.IsType(t, &sema.InvalidAccessError{}, errs[0]) }) - testMissingTypeArguments := func(domain common.PathDomain, invalidTypeErrorFixesEnabled bool) { + testMissingTypeArguments := func(domain common.PathDomain) { testName := fmt.Sprintf( - "missing type argument, %s, %v", + "missing type argument, %s", domain.Identifier(), - invalidTypeErrorFixesEnabled, ) t.Run(testName, func(t *testing.T) { t.Parallel() - _, err := ParseAndCheckWithOptions(t, + _, err := ParseAndCheck(t, fmt.Sprintf( ` fun test(storage: auth(Storage) &Account.Storage) { @@ -422,38 +421,20 @@ func TestCheckAccountStorageLoad(t *testing.T) { `, domain.Identifier(), ), - ParseAndCheckOptions{ - Config: &sema.Config{ - InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, - }, - }, ) if domain == common.PathDomainStorage { - if invalidTypeErrorFixesEnabled { - errs := RequireCheckerErrors(t, err, 2) - - require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) - } else { - errs := RequireCheckerErrors(t, err, 1) + errs := RequireCheckerErrors(t, err, 2) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[0]) - } + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) } else { - if invalidTypeErrorFixesEnabled { - errs := RequireCheckerErrors(t, err, 3) + errs := RequireCheckerErrors(t, err, 3) - require.IsType(t, &sema.TypeMismatchError{}, errs[0]) - require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) - } else { - errs := RequireCheckerErrors(t, err, 2) - - require.IsType(t, &sema.TypeMismatchError{}, errs[0]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) - } + require.IsType(t, &sema.TypeMismatchError{}, errs[0]) + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) } }) } @@ -525,9 +506,7 @@ func TestCheckAccountStorageLoad(t *testing.T) { } for _, domain := range common.AllPathDomainsByIdentifier { - for _, invalidTypeErrorFixesEnabled := range []bool{false, true} { - testMissingTypeArguments(domain, invalidTypeErrorFixesEnabled) - } + testMissingTypeArguments(domain) testExplicitTypeArgument(domain) } } @@ -550,19 +529,18 @@ func TestCheckAccountStorageCopy(t *testing.T) { require.IsType(t, &sema.InvalidAccessError{}, errs[0]) }) - testMissingTypeArgument := func(domain common.PathDomain, invalidTypeErrorFixesEnabled bool) { + testMissingTypeArgument := func(domain common.PathDomain) { testName := fmt.Sprintf( - "missing type argument, %s, %v", + "missing type argument, %s", domain.Identifier(), - invalidTypeErrorFixesEnabled, ) t.Run(testName, func(t *testing.T) { t.Parallel() - _, err := ParseAndCheckWithOptions(t, + _, err := ParseAndCheck(t, fmt.Sprintf( ` struct S {} @@ -573,39 +551,20 @@ func TestCheckAccountStorageCopy(t *testing.T) { `, domain.Identifier(), ), - ParseAndCheckOptions{ - Config: &sema.Config{ - InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, - }, - }, ) if domain == common.PathDomainStorage { + errs := RequireCheckerErrors(t, err, 2) - if invalidTypeErrorFixesEnabled { - errs := RequireCheckerErrors(t, err, 2) - - require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) - } else { - errs := RequireCheckerErrors(t, err, 1) - - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[0]) - } + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) } else { - if invalidTypeErrorFixesEnabled { - errs := RequireCheckerErrors(t, err, 3) + errs := RequireCheckerErrors(t, err, 3) - require.IsType(t, &sema.TypeMismatchError{}, errs[0]) - require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) - } else { - errs := RequireCheckerErrors(t, err, 2) - - require.IsType(t, &sema.TypeMismatchError{}, errs[0]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) - } + require.IsType(t, &sema.TypeMismatchError{}, errs[0]) + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) } }) } @@ -681,9 +640,7 @@ func TestCheckAccountStorageCopy(t *testing.T) { } for _, domain := range common.AllPathDomainsByIdentifier { - for _, invalidTypeErrorFixesEnabled := range []bool{false, true} { - testMissingTypeArgument(domain, invalidTypeErrorFixesEnabled) - } + testMissingTypeArgument(domain) testExplicitTypeArgument(domain) } } @@ -706,12 +663,11 @@ func TestCheckAccountStorageBorrow(t *testing.T) { require.IsType(t, &sema.InvalidAccessError{}, errs[0]) }) - testMissingTypeArgument := func(domain common.PathDomain, invalidTypeErrorFixesEnabled bool) { + testMissingTypeArgument := func(domain common.PathDomain) { testName := fmt.Sprintf( - "missing type argument, %s, %v", + "missing type argument, %s", domain.Identifier(), - invalidTypeErrorFixesEnabled, ) t.Run(testName, func(t *testing.T) { @@ -722,7 +678,7 @@ func TestCheckAccountStorageBorrow(t *testing.T) { t.Parallel() - _, err := ParseAndCheckWithOptions(t, + _, err := ParseAndCheck(t, fmt.Sprintf( ` fun test(storage: auth(Storage) &Account.Storage) { @@ -731,38 +687,20 @@ func TestCheckAccountStorageBorrow(t *testing.T) { `, domain.Identifier(), ), - ParseAndCheckOptions{ - Config: &sema.Config{ - InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, - }, - }, ) if domain == common.PathDomainStorage { - if invalidTypeErrorFixesEnabled { - errs := RequireCheckerErrors(t, err, 2) - - require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) - } else { - errs := RequireCheckerErrors(t, err, 1) + errs := RequireCheckerErrors(t, err, 2) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[0]) - } + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) } else { - if invalidTypeErrorFixesEnabled { - errs := RequireCheckerErrors(t, err, 3) - - require.IsType(t, &sema.TypeMismatchError{}, errs[0]) - require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) - } else { - errs := RequireCheckerErrors(t, err, 2) - - require.IsType(t, &sema.TypeMismatchError{}, errs[0]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) - } + errs := RequireCheckerErrors(t, err, 3) + + require.IsType(t, &sema.TypeMismatchError{}, errs[0]) + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) } }) @@ -770,7 +708,7 @@ func TestCheckAccountStorageBorrow(t *testing.T) { t.Parallel() - _, err := ParseAndCheckWithOptions(t, + _, err := ParseAndCheck(t, fmt.Sprintf( ` fun test(storage: auth(Storage) &Account.Storage) { @@ -779,38 +717,20 @@ func TestCheckAccountStorageBorrow(t *testing.T) { `, domain.Identifier(), ), - ParseAndCheckOptions{ - Config: &sema.Config{ - InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, - }, - }, ) if domain == common.PathDomainStorage { - if invalidTypeErrorFixesEnabled { - errs := RequireCheckerErrors(t, err, 2) - - require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) - } else { - errs := RequireCheckerErrors(t, err, 1) + errs := RequireCheckerErrors(t, err, 2) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[0]) - } + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) } else { - if invalidTypeErrorFixesEnabled { - errs := RequireCheckerErrors(t, err, 3) - - require.IsType(t, &sema.TypeMismatchError{}, errs[0]) - require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) - } else { - errs := RequireCheckerErrors(t, err, 2) - - require.IsType(t, &sema.TypeMismatchError{}, errs[0]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) - } + errs := RequireCheckerErrors(t, err, 3) + + require.IsType(t, &sema.TypeMismatchError{}, errs[0]) + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) } }) }) @@ -968,9 +888,7 @@ func TestCheckAccountStorageBorrow(t *testing.T) { } for _, domain := range common.AllPathDomainsByIdentifier { - for _, invalidTypeErrorFixesEnabled := range []bool{false, true} { - testMissingTypeArgument(domain, invalidTypeErrorFixesEnabled) - } + testMissingTypeArgument(domain) for _, auth := range []sema.Access{ sema.UnauthorizedAccess, @@ -1105,45 +1023,22 @@ func TestCheckAccountContractsBorrow(t *testing.T) { require.NoError(t, err) }) - testInvalidBorrowContractMissingTypeArgument := func(t *testing.T, invalidTypeErrorFixesEnabled bool) { - name := fmt.Sprintf( - "invalid borrow contract: missing type argument, error fixes enabled: %v", - invalidTypeErrorFixesEnabled, - ) - t.Run(name, func(t *testing.T) { - t.Parallel() - - _, err := ParseAndCheckWithOptions(t, - ` - contract C {} - - fun test(contracts: &Account.Contracts): &AnyStruct { - return contracts.borrow(name: "foo")! - } - `, - ParseAndCheckOptions{ - Config: &sema.Config{ - InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, - }, - }, - ) + t.Run("invalid borrow contract: missing type argument", func(t *testing.T) { + t.Parallel() - if invalidTypeErrorFixesEnabled { - errors := RequireCheckerErrors(t, err, 2) + _, err := ParseAndCheck(t, ` + contract C {} - assert.IsType(t, &sema.InvocationTypeInferenceError{}, errors[0]) - assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errors[1]) - } else { - errors := RequireCheckerErrors(t, err, 1) + fun test(contracts: &Account.Contracts): &AnyStruct { + return contracts.borrow(name: "foo")! + } + `) - assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errors[0]) - } - }) - } + errors := RequireCheckerErrors(t, err, 2) - for _, invalidTypeErrorFixesEnabled := range []bool{false, true} { - testInvalidBorrowContractMissingTypeArgument(t, invalidTypeErrorFixesEnabled) - } + assert.IsType(t, &sema.InvocationTypeInferenceError{}, errors[0]) + assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errors[1]) + }) } func TestCheckAccountContractsAdd(t *testing.T) { diff --git a/runtime/tests/checker/arrays_dictionaries_test.go b/runtime/tests/checker/arrays_dictionaries_test.go index d98205bdb0..3952c1aa2b 100644 --- a/runtime/tests/checker/arrays_dictionaries_test.go +++ b/runtime/tests/checker/arrays_dictionaries_test.go @@ -1262,64 +1262,44 @@ func TestCheckArrayMapInvalidArgs(t *testing.T) { t.Parallel() - testNotAFunction := func(invalidTypeErrorFixesEnabled bool) { - - name := fmt.Sprintf("not a function, error fixes enabled: %v", invalidTypeErrorFixesEnabled) - t.Run(name, func(t *testing.T) { - t.Parallel() - - _, err := ParseAndCheckWithOptions(t, - ` - fun test() { - let x = [1, 2, 3] - let y = x.map(100) - } - `, - ParseAndCheckOptions{ - Config: &sema.Config{ - InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, - }, - }, - ) - - if invalidTypeErrorFixesEnabled { - errs := RequireCheckerErrors(t, err, 3) - - assert.IsType(t, &sema.TypeMismatchError{}, errs[0]) - assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) // since we're not passing a function. - assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) // since we're not passing a function. - } else { - errs := RequireCheckerErrors(t, err, 2) + testInvalidArgs := func(code string, expectedErrors []sema.SemanticError) { + _, err := ParseAndCheck(t, code) - assert.IsType(t, &sema.TypeMismatchError{}, errs[0]) - assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) // since we're not passing a function. - } - }) - } + errs := RequireCheckerErrors(t, err, len(expectedErrors)) - for _, invalidTypeErrorFixesEnabled := range []bool{true, false} { - testNotAFunction(invalidTypeErrorFixesEnabled) + for i, e := range expectedErrors { + assert.IsType(t, e, errs[i]) + } } - t.Run("function, invalid parameter type", func(t *testing.T) { - t.Parallel() - - _, err := ParseAndCheck(t, ` - fun test() { - let x = [1, 2, 3] - let trueForEvenInt16 = - fun (_ x: Int16): Bool { - return x % 2 == 0 - } - - let y: [Bool] = x.map(trueForEvenInt16) - } - `) + testInvalidArgs(` + fun test() { + let x = [1, 2, 3] + let y = x.map(100) + } + `, + []sema.SemanticError{ + &sema.TypeMismatchError{}, + &sema.InvocationTypeInferenceError{}, // since we're not passing a function. + &sema.TypeParameterTypeInferenceError{}, // since we're not passing a function. + }, + ) - errs := RequireCheckerErrors(t, err, 1) + testInvalidArgs(` + fun test() { + let x = [1, 2, 3] + let trueForEvenInt16 = + fun (_ x: Int16): Bool { + return x % 2 == 0 + } - assert.IsType(t, &sema.TypeMismatchError{}, errs[0]) - }) + let y: [Bool] = x.map(trueForEvenInt16) + } + `, + []sema.SemanticError{ + &sema.TypeMismatchError{}, + }, + ) } func TestCheckResourceArrayMapInvalid(t *testing.T) { @@ -2673,42 +2653,17 @@ func TestCheckArrayToConstantSizedMissingTypeArgument(t *testing.T) { t.Parallel() - test := func(invalidTypeErrorFixesEnabled bool) { - - name := fmt.Sprintf("fixes enabled: %v", invalidTypeErrorFixesEnabled) - - t.Run(name, func(t *testing.T) { - t.Parallel() - - _, err := ParseAndCheckWithOptions(t, ` - fun test() { - let x: [Int16] = [1, 2, 3] - let y = x.toConstantSized() - } - `, - ParseAndCheckOptions{ - Config: &sema.Config{ - InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, - }, - }, - ) - - if invalidTypeErrorFixesEnabled { - errs := RequireCheckerErrors(t, err, 2) - - assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) - assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) - } else { - errs := RequireCheckerErrors(t, err, 1) + _, err := ParseAndCheck(t, ` + fun test() { + let x: [Int16] = [1, 2, 3] + let y = x.toConstantSized() + } + `) - assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[0]) - } - }) - } + errs := RequireCheckerErrors(t, err, 2) - for _, invalidTypeErrorFixesEnabled := range []bool{true, false} { - test(invalidTypeErrorFixesEnabled) - } + assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) + assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) } func TestCheckArrayReferenceTypeInference(t *testing.T) { diff --git a/runtime/tests/checker/builtinfunctions_test.go b/runtime/tests/checker/builtinfunctions_test.go index 68d23e86ec..79c931d13c 100644 --- a/runtime/tests/checker/builtinfunctions_test.go +++ b/runtime/tests/checker/builtinfunctions_test.go @@ -288,7 +288,6 @@ func TestCheckRevertibleRandom(t *testing.T) { BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation { return baseValueActivation }, - InvalidTypeErrorFixesEnabled: false, }, } } @@ -431,6 +430,7 @@ func TestCheckRevertibleRandom(t *testing.T) { "missing type argument", `let rand = revertibleRandom()`, []error{ + &sema.InvocationTypeInferenceError{}, &sema.TypeParameterTypeInferenceError{}, }, ) diff --git a/runtime/tests/checker/capability_test.go b/runtime/tests/checker/capability_test.go index e8154db6e2..a842ed161f 100644 --- a/runtime/tests/checker/capability_test.go +++ b/runtime/tests/checker/capability_test.go @@ -22,9 +22,7 @@ import ( "fmt" "testing" - "github.com/onflow/cadence/runtime/common" "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" "github.com/onflow/cadence/runtime/tests/utils" "github.com/stretchr/testify/assert" @@ -78,50 +76,20 @@ func TestCheckCapability_borrow(t *testing.T) { t.Parallel() - testMissingTypeArgument := func(invalidTypeErrorFixesEnabled bool) { + t.Run("missing type argument", func(t *testing.T) { - name := fmt.Sprintf( - "missing type argument, error fixes enabled: %v", - invalidTypeErrorFixesEnabled, - ) + _, err := ParseAndCheckWithPanic(t, ` - t.Run(name, func(t *testing.T) { - t.Parallel() + let capability: Capability = panic("") - baseValueActivation := sema.NewVariableActivation(sema.BaseValueActivation) - baseValueActivation.DeclareValue(stdlib.PanicFunction) + let r = capability.borrow() + `) - _, err := ParseAndCheckWithOptions(t, - ` - let capability: Capability = panic("") + errs := RequireCheckerErrors(t, err, 2) - let r = capability.borrow() - `, - ParseAndCheckOptions{ - Config: &sema.Config{ - BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation { - return baseValueActivation - }, - InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, - }, - }, - ) - if invalidTypeErrorFixesEnabled { - errs := RequireCheckerErrors(t, err, 2) - - require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) - } else { - errs := RequireCheckerErrors(t, err, 1) - - require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[0]) - } - }) - } - - for _, invalidTypeErrorFixesEnabled := range []bool{false, true} { - testMissingTypeArgument(invalidTypeErrorFixesEnabled) - } + require.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) + require.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) + }) for _, auth := range []sema.Access{sema.UnauthorizedAccess, sema.NewEntitlementSetAccess([]*sema.EntitlementType{{ diff --git a/runtime/tests/checker/conditions_test.go b/runtime/tests/checker/conditions_test.go index 772741f51d..cfe5f73fab 100644 --- a/runtime/tests/checker/conditions_test.go +++ b/runtime/tests/checker/conditions_test.go @@ -19,7 +19,6 @@ package checker import ( - "fmt" "testing" "github.com/stretchr/testify/assert" @@ -255,87 +254,43 @@ func TestCheckInvalidFunctionPostConditionWithBeforeAndNoArgument(t *testing.T) t.Parallel() - test := func(invalidTypeErrorFixesEnabled bool) { + t.Run("test condition", func(t *testing.T) { + t.Parallel() - name := fmt.Sprintf( - "error fixes enabled: %v", - invalidTypeErrorFixesEnabled, - ) + _, err := ParseAndCheck(t, ` + fun test(x: Int) { + post { + before() != 0 + } + } + `) - t.Run(name, func(t *testing.T) { - t.Parallel() - - t.Run("test condition", func(t *testing.T) { - t.Parallel() - - _, err := ParseAndCheckWithOptions(t, - ` - fun test(x: Int) { - post { - before() != 0 - } - } - `, - ParseAndCheckOptions{ - Config: &sema.Config{ - InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, - }, - }, - ) - - if invalidTypeErrorFixesEnabled { - errs := RequireCheckerErrors(t, err, 3) - - assert.IsType(t, &sema.InsufficientArgumentsError{}, errs[0]) - assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) - assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) - } else { - errs := RequireCheckerErrors(t, err, 2) - - assert.IsType(t, &sema.InsufficientArgumentsError{}, errs[0]) - assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) - } - }) - - t.Run("emit condition", func(t *testing.T) { - t.Parallel() - - _, err := ParseAndCheckWithOptions(t, - ` - event Foo(x: Int) - - fun test(x: Int) { - post { - emit Foo(x: before()) - } - } - `, - ParseAndCheckOptions{ - Config: &sema.Config{ - InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, - }, - }, - ) - - if invalidTypeErrorFixesEnabled { - errs := RequireCheckerErrors(t, err, 3) - - assert.IsType(t, &sema.InsufficientArgumentsError{}, errs[0]) - assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) - assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) - } else { - errs := RequireCheckerErrors(t, err, 2) - - assert.IsType(t, &sema.InsufficientArgumentsError{}, errs[0]) - assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) - } - }) - }) - } + errs := RequireCheckerErrors(t, err, 3) + + assert.IsType(t, &sema.InsufficientArgumentsError{}, errs[0]) + assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) + assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) + }) + + t.Run("emit condition", func(t *testing.T) { + t.Parallel() - for _, invalidTypeErrorFixesEnabled := range []bool{true, false} { - test(invalidTypeErrorFixesEnabled) - } + _, err := ParseAndCheck(t, ` + event Foo(x: Int) + + fun test(x: Int) { + post { + emit Foo(x: before()) + } + } + `) + + errs := RequireCheckerErrors(t, err, 3) + + assert.IsType(t, &sema.InsufficientArgumentsError{}, errs[0]) + assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[1]) + assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[2]) + }) } func TestCheckInvalidFunctionPreConditionWithBefore(t *testing.T) { diff --git a/runtime/tests/checker/dictionary_test.go b/runtime/tests/checker/dictionary_test.go index 1887e8a454..e0efc29cce 100644 --- a/runtime/tests/checker/dictionary_test.go +++ b/runtime/tests/checker/dictionary_test.go @@ -19,7 +19,6 @@ package checker import ( - "fmt" "testing" "github.com/stretchr/testify/assert" @@ -32,49 +31,26 @@ func TestCheckIncompleteDictionaryType(t *testing.T) { t.Parallel() - test := func(invalidTypeErrorFixesEnabled bool) { - - name := fmt.Sprintf( - "error fixes enabled: %v", - invalidTypeErrorFixesEnabled, - ) - - t.Run(name, func(t *testing.T) { - t.Parallel() - - checker, err := ParseAndCheckWithOptions(t, - ` - let dict: {Int:} = {} - `, - ParseAndCheckOptions{ - IgnoreParseError: true, - Config: &sema.Config{ - InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, - }, - }, - ) - - if invalidTypeErrorFixesEnabled { - errs := RequireCheckerErrors(t, err, 1) + checker, err := ParseAndCheckWithOptions(t, + ` + let dict: {Int:} = {} + `, + ParseAndCheckOptions{ + IgnoreParseError: true, + }, + ) - assert.IsType(t, errs[0], &sema.UnconvertableTypeError{}) - } else { - require.NoError(t, err) - } + errs := RequireCheckerErrors(t, err, 1) - assert.Equal(t, - &sema.DictionaryType{ - KeyType: sema.IntType, - ValueType: sema.InvalidType, - }, - RequireGlobalValue(t, checker.Elaboration, "dict"), - ) - }) - } + assert.IsType(t, errs[0], &sema.UnconvertableTypeError{}) - for _, invalidTypeErrorFixesEnabled := range []bool{true, false} { - test(invalidTypeErrorFixesEnabled) - } + assert.Equal(t, + &sema.DictionaryType{ + KeyType: sema.IntType, + ValueType: sema.InvalidType, + }, + RequireGlobalValue(t, checker.Elaboration, "dict"), + ) } func TestCheckMetaKeyType(t *testing.T) { diff --git a/runtime/tests/checker/genericfunction_test.go b/runtime/tests/checker/genericfunction_test.go index b1310705f6..f7f89c87cf 100644 --- a/runtime/tests/checker/genericfunction_test.go +++ b/runtime/tests/checker/genericfunction_test.go @@ -431,67 +431,31 @@ func TestCheckGenericFunctionInvocation(t *testing.T) { t.Parallel() - test := func(invalidTypeErrorFixesEnabled bool) { - - name := fmt.Sprintf( - "error fixes enabled: %v", - invalidTypeErrorFixesEnabled, - ) - - t.Run(name, func(t *testing.T) { - t.Parallel() - - typeParameter := &sema.TypeParameter{ - Name: "T", - TypeBound: nil, - } - - baseValueActivation := sema.NewVariableActivation(sema.BaseValueActivation) - baseValueActivation.DeclareValue(stdlib.StandardLibraryValue{ - Name: "test", - Type: &sema.FunctionType{ - TypeParameters: []*sema.TypeParameter{ - typeParameter, - }, - ReturnTypeAnnotation: sema.NewTypeAnnotation( - &sema.GenericType{ - TypeParameter: typeParameter, - }, - ), - }, - Kind: common.DeclarationKindConstant, - }) + typeParameter := &sema.TypeParameter{ + Name: "T", + TypeBound: nil, + } - _, err := ParseAndCheckWithOptions(t, - ` - let res = test() - `, - ParseAndCheckOptions{ - Config: &sema.Config{ - BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation { - return baseValueActivation - }, - InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, - }, + _, err := parseAndCheckWithTestValue(t, + ` + let res = test() + `, + &sema.FunctionType{ + TypeParameters: []*sema.TypeParameter{ + typeParameter, + }, + ReturnTypeAnnotation: sema.NewTypeAnnotation( + &sema.GenericType{ + TypeParameter: typeParameter, }, - ) - - if invalidTypeErrorFixesEnabled { - errs := RequireCheckerErrors(t, err, 2) - - assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) - assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) - } else { - errs := RequireCheckerErrors(t, err, 1) + ), + }, + ) - assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[0]) - } - }) - } + errs := RequireCheckerErrors(t, err, 2) - for _, invalidTypeErrorFixesEnabled := range []bool{true, false} { - test(invalidTypeErrorFixesEnabled) - } + assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) + assert.IsType(t, &sema.TypeParameterTypeInferenceError{}, errs[1]) }) t.Run("valid: one type parameter, one type argument, no parameters, no arguments, return type", func(t *testing.T) { diff --git a/runtime/tests/checker/invalid_test.go b/runtime/tests/checker/invalid_test.go index aa7d1aba6a..3ed32e3205 100644 --- a/runtime/tests/checker/invalid_test.go +++ b/runtime/tests/checker/invalid_test.go @@ -19,7 +19,6 @@ package checker import ( - "fmt" "testing" "github.com/stretchr/testify/assert" @@ -211,123 +210,80 @@ func TestCheckInvalidInvocationFunctionReturnType(t *testing.T) { t.Parallel() - test := func(invalidTypeErrorFixesEnabled bool) { - - name := fmt.Sprintf( - "error fixes enabled: %v", - invalidTypeErrorFixesEnabled, - ) + typeParameter := &sema.TypeParameter{ + Name: "T", + } - t.Run(name, func(t *testing.T) { - t.Parallel() + fType := &sema.FunctionType{ + TypeParameters: []*sema.TypeParameter{ + typeParameter, + }, + ReturnTypeAnnotation: sema.NewTypeAnnotation( + &sema.GenericType{ + TypeParameter: typeParameter, + }, + ), + } - typeParameter := &sema.TypeParameter{ - Name: "T", - } + baseValueActivation := sema.NewVariableActivation(sema.BaseValueActivation) + baseValueActivation.DeclareValue(stdlib.StandardLibraryValue{ + Type: fType, + Name: "f", + Kind: common.DeclarationKindFunction, + }) - fType := &sema.FunctionType{ - TypeParameters: []*sema.TypeParameter{ - typeParameter, - }, - ReturnTypeAnnotation: sema.NewTypeAnnotation( - &sema.GenericType{ - TypeParameter: typeParameter, - }, - ), - } - - baseValueActivation := sema.NewVariableActivation(sema.BaseValueActivation) - baseValueActivation.DeclareValue(stdlib.StandardLibraryValue{ - Type: fType, - Name: "f", - Kind: common.DeclarationKindFunction, - }) - - _, err := ParseAndCheckWithOptions(t, - ` - let res = [f].reverse() - `, - ParseAndCheckOptions{ - Config: &sema.Config{ - BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation { - return baseValueActivation - }, - InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, - }, + _, err := ParseAndCheckWithOptions(t, + ` + let res = [f].reverse() + `, + ParseAndCheckOptions{ + Config: &sema.Config{ + BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation { + return baseValueActivation }, - ) - - if invalidTypeErrorFixesEnabled { - - errs := RequireCheckerErrors(t, err, 1) + }, + }, + ) - assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) - } else { - require.NoError(t, err) - } - }) - } + errs := RequireCheckerErrors(t, err, 1) - for _, invalidTypeErrorFixesEnabled := range []bool{true, false} { - test(invalidTypeErrorFixesEnabled) - } + assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) } func TestCheckInvalidTypeDefensiveCheck(t *testing.T) { t.Parallel() - test := func(invalidTypeErrorFixesEnabled bool) { - - name := fmt.Sprintf( - "error fixes enabled: %v", - invalidTypeErrorFixesEnabled, - ) - - t.Run(name, func(t *testing.T) { - t.Parallel() - - baseValueActivation := sema.NewVariableActivation(sema.BaseValueActivation) - baseValueActivation.DeclareValue(stdlib.StandardLibraryValue{ - Type: sema.InvalidType, - Name: "invalid", - Kind: common.DeclarationKindConstant, - }) - - var r any - func() { - defer func() { - r = recover() - }() - - _, _ = ParseAndCheckWithOptions(t, - ` - let res = invalid - `, - ParseAndCheckOptions{ - Config: &sema.Config{ - BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation { - return baseValueActivation - }, - InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, - }, + baseValueActivation := sema.NewVariableActivation(sema.BaseValueActivation) + baseValueActivation.DeclareValue(stdlib.StandardLibraryValue{ + Type: sema.InvalidType, + Name: "invalid", + Kind: common.DeclarationKindConstant, + }) + + var r any + func() { + defer func() { + r = recover() + }() + + _, _ = ParseAndCheckWithOptions(t, + ` + let res = invalid + `, + ParseAndCheckOptions{ + Config: &sema.Config{ + BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation { + return baseValueActivation }, - ) - }() - - if invalidTypeErrorFixesEnabled { - require.IsType(t, errors.UnexpectedError{}, r) - err := r.(errors.UnexpectedError) - require.ErrorContains(t, err, "invalid type produced without error") - } else { - require.Nil(t, r) - } - }) - } + }, + }, + ) + }() - for _, invalidTypeErrorFixesEnabled := range []bool{true, false} { - test(invalidTypeErrorFixesEnabled) - } + require.IsType(t, errors.UnexpectedError{}, r) + err := r.(errors.UnexpectedError) + require.ErrorContains(t, err, "invalid type produced without error") } func TestCheckInvalidTypeIndexing(t *testing.T) { diff --git a/runtime/tests/checker/invocation_test.go b/runtime/tests/checker/invocation_test.go index fc88ec267d..3d0d8f6949 100644 --- a/runtime/tests/checker/invocation_test.go +++ b/runtime/tests/checker/invocation_test.go @@ -19,7 +19,6 @@ package checker import ( - "fmt" "testing" "github.com/stretchr/testify/assert" @@ -598,79 +597,57 @@ func TestCheckInvocationWithIncorrectTypeParameter(t *testing.T) { t.Parallel() - test := func(invalidTypeErrorFixesEnabled bool) { - - name := fmt.Sprintf( - "error fixes enabled: %v", - invalidTypeErrorFixesEnabled, - ) - - t.Run(name, func(t *testing.T) { - t.Parallel() - - // function type has incorrect type-arguments: - // `fun Foo(_ a: R)` - // - funcType := &sema.FunctionType{ - ReturnTypeAnnotation: sema.VoidTypeAnnotation, - TypeParameters: []*sema.TypeParameter{ - { - Name: "T", - TypeBound: sema.AnyStructType, - }, - }, - Parameters: []sema.Parameter{ - { - Label: sema.ArgumentLabelNotRequired, - Identifier: "a", - TypeAnnotation: sema.NewTypeAnnotation( - &sema.GenericType{ - TypeParameter: &sema.TypeParameter{ - Name: "R", // This is an incorrect/undefined type-parameter - TypeBound: sema.AnyStructType, - }, - }, - ), - }, - }, - } - - baseValueActivation := sema.NewVariableActivation(sema.BaseValueActivation) - baseValueActivation.DeclareValue(stdlib.NewStandardLibraryStaticFunction( - "foo", - funcType, - "", - nil, // no need, we only type-check - )) - - _, err := ParseAndCheckWithOptions(t, - ` - access(all) fun test() { - foo("hello") - } - `, - ParseAndCheckOptions{ - Config: &sema.Config{ - BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation { - return baseValueActivation + // function type has incorrect type-arguments: + // `fun Foo(_ a: R)` + // + funcType := &sema.FunctionType{ + ReturnTypeAnnotation: sema.VoidTypeAnnotation, + TypeParameters: []*sema.TypeParameter{ + { + Name: "T", + TypeBound: sema.AnyStructType, + }, + }, + Parameters: []sema.Parameter{ + { + Label: sema.ArgumentLabelNotRequired, + Identifier: "a", + TypeAnnotation: sema.NewTypeAnnotation( + &sema.GenericType{ + TypeParameter: &sema.TypeParameter{ + Name: "R", // This is an incorrect/undefined type-parameter + TypeBound: sema.AnyStructType, }, - InvalidTypeErrorFixesEnabled: invalidTypeErrorFixesEnabled, }, - }, - ) + ), + }, + }, + } - if invalidTypeErrorFixesEnabled { + baseValueActivation := sema.NewVariableActivation(sema.BaseValueActivation) + baseValueActivation.DeclareValue(stdlib.NewStandardLibraryStaticFunction( + "foo", + funcType, + "", + nil, // no need, we only type-check + )) - errs := RequireCheckerErrors(t, err, 1) + _, err := ParseAndCheckWithOptions(t, + ` + access(all) fun test() { + foo("hello") + } + `, + ParseAndCheckOptions{ + Config: &sema.Config{ + BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation { + return baseValueActivation + }, + }, + }, + ) - assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) - } else { - require.NoError(t, err) - } - }) - } + errs := RequireCheckerErrors(t, err, 1) - for _, invalidTypeErrorFixesEnabled := range []bool{true, false} { - test(invalidTypeErrorFixesEnabled) - } + assert.IsType(t, &sema.InvocationTypeInferenceError{}, errs[0]) } diff --git a/runtime/tests/checker/utils.go b/runtime/tests/checker/utils.go index c883e10c2d..9849a13d66 100644 --- a/runtime/tests/checker/utils.go +++ b/runtime/tests/checker/utils.go @@ -170,8 +170,6 @@ func ParseAndCheckWithOptionsAndMemoryMetering( } func RequireCheckerErrors(t *testing.T, err error, count int) []error { - t.Helper() - if count <= 0 { require.NoError(t, err) return nil From 127b0ee4ea48650ef5dae101864b116212930efd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Thu, 21 Nov 2024 09:55:42 -0800 Subject: [PATCH 13/13] go mod tidy --- tools/storage-explorer/go.mod | 18 +++--- tools/storage-explorer/go.sum | 111 ++++++++++++++++++++++++++++++---- 2 files changed, 107 insertions(+), 22 deletions(-) diff --git a/tools/storage-explorer/go.mod b/tools/storage-explorer/go.mod index d2286e3049..ea57ef6fae 100644 --- a/tools/storage-explorer/go.mod +++ b/tools/storage-explorer/go.mod @@ -4,7 +4,7 @@ go 1.22 require ( github.com/gorilla/mux v1.8.1 - github.com/onflow/atree v0.8.0-rc.5 + github.com/onflow/atree v0.8.0-rc.6 github.com/onflow/cadence v1.0.0-preview-atree-register-inlining.29 github.com/onflow/flow-go v0.35.7-crescendo-preview.23-atree-inlining github.com/rs/zerolog v1.32.0 @@ -170,15 +170,15 @@ require ( go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.26.0 // indirect - golang.org/x/crypto v0.19.0 // indirect + golang.org/x/crypto v0.28.0 // indirect golang.org/x/exp v0.0.0-20240119083558-1b970713d09a // indirect - golang.org/x/mod v0.14.0 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/term v0.17.0 // indirect - golang.org/x/text v0.14.0 // indirect - golang.org/x/tools v0.17.0 // indirect + golang.org/x/mod v0.17.0 // indirect + golang.org/x/net v0.25.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/term v0.25.0 // indirect + golang.org/x/text v0.19.0 // indirect + golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect gonum.org/v1/gonum v0.14.0 // indirect google.golang.org/appengine v1.6.8 // indirect diff --git a/tools/storage-explorer/go.sum b/tools/storage-explorer/go.sum index f4f1729c66..56e4f510fa 100644 --- a/tools/storage-explorer/go.sum +++ b/tools/storage-explorer/go.sum @@ -45,6 +45,7 @@ cloud.google.com/go v0.110.6/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5x cloud.google.com/go v0.110.7/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= cloud.google.com/go v0.110.8/go.mod h1:Iz8AkXJf1qmxC3Oxoep8R1T36w8B92yU29PcBhHO5fk= cloud.google.com/go v0.112.0 h1:tpFCD7hpHFlQ8yPwT3x+QeXqc2T6+n6T+hmABHfDUSM= +cloud.google.com/go v0.112.0/go.mod h1:3jEEVwZ/MHU4djK5t5RHuKOA/GbLddgTdVubX1qnPD4= cloud.google.com/go/accessapproval v1.4.0/go.mod h1:zybIuC3KpDOvotz59lFe5qxRZx6C75OtwbisN56xYB4= cloud.google.com/go/accessapproval v1.5.0/go.mod h1:HFy3tuiGvMdcd/u+Cu5b9NkO1pEICJ46IR82PoUdplw= cloud.google.com/go/accessapproval v1.6.0/go.mod h1:R0EiYnwV5fsRFiKZkPHr6mwyk2wxUJ30nL4j2pcFY2E= @@ -257,6 +258,7 @@ cloud.google.com/go/compute v1.21.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdi cloud.google.com/go/compute v1.23.0/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= cloud.google.com/go/compute v1.23.1/go.mod h1:CqB3xpmPKKt3OJpW2ndFIXnA9A4xAy/F3Xp1ixncW78= cloud.google.com/go/compute v1.24.0 h1:phWcR2eWzRJaL/kOiJwfFsPs4BaKq1j6vnpZrc1YlVg= +cloud.google.com/go/compute v1.24.0/go.mod h1:kw1/T+h/+tK2LJK0wiPPx1intgdAM3j/g3hFDlscY40= cloud.google.com/go/compute/metadata v0.1.0/go.mod h1:Z1VN+bulIf6bt4P/C37K4DyZYZEXYonfTBHHFPO/4UU= cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= cloud.google.com/go/compute/metadata v0.2.1/go.mod h1:jgHgmJd2RKBGzXqF5LR2EZMGxBkeanZ9wwa75XHJgOM= @@ -488,6 +490,7 @@ cloud.google.com/go/iam v1.1.1/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+K cloud.google.com/go/iam v1.1.2/go.mod h1:A5avdyVL2tCppe4unb0951eI9jreack+RJ0/d+KUZOU= cloud.google.com/go/iam v1.1.3/go.mod h1:3khUlaBXfPKKe7huYgEpDn6FtgRyMEqbkvBxrQyY5SE= cloud.google.com/go/iam v1.1.6 h1:bEa06k05IO4f4uJonbB5iAgKTPpABy1ayxaIZV/GHVc= +cloud.google.com/go/iam v1.1.6/go.mod h1:O0zxdPeGBoFdWW3HWmBxJsk0pfvNM/p/qa82rWOGTwI= cloud.google.com/go/iap v1.4.0/go.mod h1:RGFwRJdihTINIe4wZ2iCP0zF/qu18ZwyKxrhMhygBEc= cloud.google.com/go/iap v1.5.0/go.mod h1:UH/CGgKd4KyohZL5Pt0jSKE4m3FR51qg6FKQ/z/Ix9A= cloud.google.com/go/iap v1.6.0/go.mod h1:NSuvI9C/j7UdjGjIde7t7HBz+QTwBcapPE07+sSRcLk= @@ -822,6 +825,7 @@ cloud.google.com/go/storage v1.28.1/go.mod h1:Qnisd4CqDdo6BGs2AD5LLnEsmSQ80wQ5og cloud.google.com/go/storage v1.29.0/go.mod h1:4puEjyTKnku6gfKoTfNOU/W+a9JyuVNxjpS5GBrB8h4= cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E= cloud.google.com/go/storage v1.36.0 h1:P0mOkAcaJxhCTvAkMhxMfrTKiNcub4YmmPBtlhAyTr8= +cloud.google.com/go/storage v1.36.0/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8= cloud.google.com/go/storagetransfer v1.5.0/go.mod h1:dxNzUopWy7RQevYFHewchb29POFv3/AaBgnhqzqiK0w= cloud.google.com/go/storagetransfer v1.6.0/go.mod h1:y77xm4CQV/ZhFZH75PLEXY0ROiS7Gh6pSKrM8dJyg6I= cloud.google.com/go/storagetransfer v1.7.0/go.mod h1:8Giuj1QNb1kfLAiWM1bN6dHzfdlDAVC9rv9abHot2W4= @@ -966,6 +970,7 @@ github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migc github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8= +github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= github.com/PuerkitoBio/goquery v1.5.0/go.mod h1:qD2PgZ9lccMbQlc7eEOjaeRlFQON7xY8kdmcsrnKqMg= github.com/SaveTheRbtz/mph v0.1.1-0.20240117162131-4166ec7869bc h1:DCHzPQOcU/7gwDTWbFQZc5qHMPS1g0xTO56k8NXsv9M= github.com/SaveTheRbtz/mph v0.1.1-0.20240117162131-4166ec7869bc/go.mod h1:LJM5a3zcIJ/8TmZwlUczvROEJT8ntOdhdG9jjcR1B0I= @@ -1005,6 +1010,7 @@ github.com/aws/aws-sdk-go-v2 v1.2.0/go.mod h1:zEQs02YRBw1DjK0PoJv3ygDYOFTre1ejlJ github.com/aws/aws-sdk-go-v2 v1.21.2/go.mod h1:ErQhvNuEMhJjweavOYhxVkn2RUx7kQXVATHrjKtxIpM= github.com/aws/aws-sdk-go-v2 v1.23.1/go.mod h1:i1XDttT4rnf6vxc9AuskLc6s7XBee8rlLilKlc03uAA= github.com/aws/aws-sdk-go-v2 v1.26.1 h1:5554eUqIYVWpU0YmeeYZ0wU64H2VLBs8TlhRB2L+EkA= +github.com/aws/aws-sdk-go-v2 v1.26.1/go.mod h1:ffIFB97e2yNsv4aTSGkqtHnppsIJzw7G7BReUZ3jCXM= github.com/aws/aws-sdk-go-v2/config v1.1.1/go.mod h1:0XsVy9lBI/BCXm+2Tuvt39YmdHwS5unDQmxZOYe8F5Y= github.com/aws/aws-sdk-go-v2/config v1.18.45/go.mod h1:ZwDUgFnQgsazQTnWfeLWk5GjeqTQTL8lMkoE1UXzxdE= github.com/aws/aws-sdk-go-v2/config v1.25.5/go.mod h1:Bf4gDvy4ZcFIK0rqDu1wp9wrubNba2DojiPB2rt6nvI= @@ -1015,6 +1021,7 @@ github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.0.2/go.mod h1:3hGg3PpiEjHnrkrla github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13/go.mod h1:f/Ib/qYjhV2/qdsf79H3QP/eRE4AkVyEf6sk7XfZ1tg= github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.14.5/go.mod h1:VhnExhw6uXy9QzetvpXDolo1/hjhx4u9qukBGkuUwjs= github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.5.1 h1:VGkV9KmhGqOQWnHyi4gLG98kE6OecT42fdrCGFWxJsc= +github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.5.1/go.mod h1:PLlnMiki//sGnCJiW+aVpvP/C8Kcm8mEj/IVm9+9qk4= github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43/go.mod h1:auo+PiyLl0n1l8A0e8RIeR8tOzYPfZZH/JNlrJ8igTQ= github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.4/go.mod h1:xEhvbJcyUf/31yfGSQBe01fukXwXJ0gxDp7rLfymWE0= github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37/go.mod h1:Qe+2KtKml+FEsQF/DHmDV+xjtche/hwoF75EG4UlHW8= @@ -1023,15 +1030,19 @@ github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45/go.mod h1:lD5M20o09/LCuQ2mE62M github.com/aws/aws-sdk-go-v2/internal/ini v1.7.1/go.mod h1:6fQQgfuGmw8Al/3M2IgIllycxV7ZW7WCdVSqfBeUiCY= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.10.1/go.mod h1:l9ymW25HOqymeU2m1gbUQ3rUIsTwKs8gYHXkqDQUhiI= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2 h1:Ji0DY1xUsUr3I8cHps0G+XM3WWU16lP6yG8qu1GAZAs= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.2/go.mod h1:5CsjAbs3NlGQyZNFACh+zztPDI7fU6eW9QsxjfnuBKg= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.0.2/go.mod h1:45MfaXZ0cNbeuT0KQ1XJylq8A6+OpVV2E5kvY/Kq+u8= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37/go.mod h1:vBmDnwWXWxNPFRMmG2m/3MKOe+xEcMDo1tanpaWCcck= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.10.4/go.mod h1:aYCGNjyUCUelhofxlZyj63srdxWUSsBSGg5l6MCuXuE= github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7 h1:ogRAwT1/gxJBcSWDMZlgyFUM962F51A5CRhDLbxLdmo= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.7/go.mod h1:YCsIZhXfRPLFFCl5xxY+1T9RKzOKjCut+28JSX2DnAk= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.7.0 h1:HWsM0YQWX76V6MOp07YuTYacm8k7h69ObJuw7Nck+og= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.7.0/go.mod h1:LKb3cKNQIMh+itGnEpKGcnL/6OIjPZqrtYah1w5f+3o= github.com/aws/aws-sdk-go-v2/service/kms v1.26.3/go.mod h1:N3++/sLV97B8Zliz7KRqNcojOX7iMBZWKiuit5FKtH0= github.com/aws/aws-sdk-go-v2/service/route53 v1.1.1/go.mod h1:rLiOUrPLW/Er5kRcQ7NkwbjlijluLsrIbu/iyl35RO4= github.com/aws/aws-sdk-go-v2/service/route53 v1.30.2/go.mod h1:TQZBt/WaQy+zTHoW++rnl8JBrmZ0VO6EUbVua1+foCA= github.com/aws/aws-sdk-go-v2/service/s3 v1.15.0 h1:nPLfLPfglacc29Y949sDxpr3X/blaY40s3B85WT2yZU= +github.com/aws/aws-sdk-go-v2/service/s3 v1.15.0/go.mod h1:Iv2aJVtVSm/D22rFoX99cLG4q4uB7tppuCsulGe98k4= github.com/aws/aws-sdk-go-v2/service/sso v1.1.1/go.mod h1:SuZJxklHxLAXgLTc1iFXbEWkXs7QRTQpCLGaKIprQW0= github.com/aws/aws-sdk-go-v2/service/sso v1.15.2/go.mod h1:gsL4keucRCgW+xA85ALBpRFfdSLH4kHOVSnLMSuBECo= github.com/aws/aws-sdk-go-v2/service/sso v1.17.3/go.mod h1:oA6VjNsLll2eVuUoF2D+CMyORgNzPEW/3PyUdq6WQjI= @@ -1044,9 +1055,11 @@ github.com/aws/smithy-go v1.1.0/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB github.com/aws/smithy-go v1.15.0/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= github.com/aws/smithy-go v1.17.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= github.com/aws/smithy-go v1.20.2 h1:tbp628ireGtzcHDDmLT/6ADHidqnwgF57XOXZe6tp4Q= +github.com/aws/smithy-go v1.20.2/go.mod h1:krry+ya/rV9RDcV/Q16kpu6ypI4K2czasz0NC3qS14E= github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g= github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz5o= +github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -1064,6 +1077,7 @@ github.com/btcsuite/btcd/btcec/v2 v2.2.1 h1:xP60mv8fvp+0khmrN0zTdPC3cNm24rfeE6lh github.com/btcsuite/btcd/btcec/v2 v2.2.1/go.mod h1:9/CSmJxmuvqzX9Wh2fXMWToLOHhPd11lSPuIupwTkI8= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2 h1:KdUfX2zKommPRa+PD0sWZUyXe9w277ABlgELO7H04IM= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.2/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= github.com/bytecodealliance/wasmtime-go/v7 v7.0.0/go.mod h1:bu6fic7trDt20w+LMooX7j3fsOwv4/ln6j8gAdP6vmA= github.com/c-bata/go-prompt v0.2.2/go.mod h1:VzqtzE2ksDBcdln8G7mk2RX9QyGjH+OVqOCSiVIqS34= github.com/c-bata/go-prompt v0.2.6/go.mod h1:/LMAke8wD2FsNu9EXNdHxNLbd9MedkPnCdfpU9wwHfY= @@ -1132,6 +1146,7 @@ github.com/consensys/gnark-crypto v0.10.0/go.mod h1:Iq/P3HHl0ElSjsg2E1gsMwhAyxnx github.com/consensys/gnark-crypto v0.12.1 h1:lHH39WuuFgVHONRl3J0LRBtuYdQTumFSDtJF7HpyG8M= github.com/consensys/gnark-crypto v0.12.1/go.mod h1:v2Gy7L/4ZRosZ7Ivs+9SfUDr0f5UlG+EM5t7MPHiLuY= github.com/containerd/cgroups v1.1.0 h1:v8rEWFl6EoqHB+swVNjVoCJE8o3jX7e8nqBGPLaDFBM= +github.com/containerd/cgroups v1.1.0/go.mod h1:6ppBcbh/NOOUU+dMKrykgaBnK9lCIBxHqJDGwsa1mIw= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= @@ -1168,6 +1183,7 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c h1:pFUpOrbxDR6AkioZ1ySsx5yxlDQZ8stG2b88gTPxgJU= +github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U= github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= github.com/deckarep/golang-set/v2 v2.1.0/go.mod h1:VAky9rY/yGXJOLEDv3OMci+7wtDpOF4IN+y82NBOac4= @@ -1212,6 +1228,7 @@ github.com/ef-ds/deque v1.0.4 h1:iFAZNmveMT9WERAkqLJ+oaABF9AcVQ5AjXem/hroniI= github.com/ef-ds/deque v1.0.4/go.mod h1:gXDnTC3yqvBcHbq2lcExjtAcVrOnJCbMcZXmuj8Z4tg= github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385/go.mod h1:0vRUJqYpeSZifjYj7uP3BG/gKcuzL9xWVV/Y+cK33KM= github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/4= +github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -1244,6 +1261,7 @@ github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5Kwzbycv github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= +github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/fjl/gencodec v0.0.0-20220412091415-8bb9e558978c/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY= github.com/fjl/gencodec v0.0.0-20230517082657-f9840df7b83e/go.mod h1:AzA8Lj6YtixmJWL+wkKoBGsLWy9gFrAzi4g+5bCKwpY= github.com/fjl/memsize v0.0.0-20190710130421-bcb5799ab5e5/go.mod h1:VvhXpOYNQvB+uIk2RvXzuaQtkQJzzIx6lSBe1xv7hi0= @@ -1251,7 +1269,9 @@ github.com/flosch/pongo2 v0.0.0-20190707114632-bbf5a6c351f4/go.mod h1:T9YF2M40nI github.com/fogleman/gg v1.2.1-0.20190220221249-0403632d5b90/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/fogleman/gg v1.3.0/go.mod h1:R/bRT+9gY/C5z7JzPU0zXsXHKM4/ayA+zqcVNZzPa1k= github.com/francoispqt/gojay v1.2.13 h1:d2m3sFjloqoIUQU3TsHBgj6qg/BVGlTBeHDUmyJnXKk= +github.com/francoispqt/gojay v1.2.13/go.mod h1:ehT5mTG4ua4581f1++1WLG0vPdaA9HaiDsoyrBGkyDY= github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE= +github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= @@ -1262,8 +1282,11 @@ github.com/fxamacker/cbor/v2 v2.4.1-0.20230228173756-c0c9f774e40c/go.mod h1:TA1x github.com/fxamacker/circlehash v0.3.0 h1:XKdvTtIJV9t7DDUtsf0RIpC1OcxZtPbmgIH7ekx28WA= github.com/fxamacker/circlehash v0.3.0/go.mod h1:3aq3OfVvsWtkWMb6A1owjOQFA+TLsD5FgJflnaQwtMM= github.com/gabriel-vasile/mimetype v1.4.3 h1:in2uUcidCuFcDKtdcBxlR0rJ1+fsokWf+uqxgUFjbI0= +github.com/gabriel-vasile/mimetype v1.4.3/go.mod h1:d8uq/6HKRL6CGdk+aubisF/M5GcPfT7nKyLpA0lbSSk= github.com/gammazero/deque v0.1.0 h1:f9LnNmq66VDeuAlSAapemq/U7hJ2jpIWa4c09q8Dlik= +github.com/gammazero/deque v0.1.0/go.mod h1:KQw7vFau1hHuM8xmI9RbgKFbAsQFWmBpqQ2KenFLk6M= github.com/gammazero/workerpool v1.1.2 h1:vuioDQbgrz4HoaCi2q1HLlOXdpbap5AET7xu5/qj87g= +github.com/gammazero/workerpool v1.1.2/go.mod h1:UelbXcO0zCIGFcufcirHhq2/xtLXJdQ29qZNlXG9OjQ= github.com/garslo/gogen v0.0.0-20170306192744-1d203ffc1f61/go.mod h1:Q0X6pkwTILDlzrGEckF6HKjXe48EgsY/l7K7vhY4MW8= github.com/gavv/httpexpect v2.0.0+incompatible/go.mod h1:x+9tiU1YnrOvnB725RkpoLv1M62hOWzwo5OXotisrKc= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= @@ -1278,12 +1301,14 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME github.com/gin-contrib/sse v0.0.0-20190301062529-5545eab6dad3/go.mod h1:VJ0WA2NBN22VlZ2dKZQPAPnyWw5XTlK1KymzLKsr59s= github.com/gin-gonic/gin v1.4.0/go.mod h1:OW2EZn3DO8Ln9oIKOvM++LBO+5UPHJJDH72/q/3rZdM= github.com/glebarez/go-sqlite v1.22.0 h1:uAcMJhaA6r3LHMTFgP0SifzgXg46yJkgxqyuyec+ruQ= +github.com/glebarez/go-sqlite v1.22.0/go.mod h1:PlBIdHe0+aUEFn+r2/uthrWq4FxbzugL0L8Li6yQJbc= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= github.com/go-check/check v0.0.0-20180628173108-788fd7840127/go.mod h1:9ES+weclKsC9YodN5RgxqK/VD9HM9JsCSh7rNhMZE98= github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= +github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-fonts/dejavu v0.1.0/go.mod h1:4Wt4I4OU2Nq9asgDCteaAaWZOV24E+0/Pwo0gppep4g= github.com/go-fonts/latin-modern v0.2.0/go.mod h1:rQVLdDMK+mK1xscDwsqM5J8U2jrRa3T0ecnM9pNujks= github.com/go-fonts/latin-modern v0.3.0/go.mod h1:ysEQXnuT/sCDOAONxC7ImeEDVINbltClhasMAqEtRK0= @@ -1326,14 +1351,18 @@ github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh github.com/go-pdf/fpdf v0.5.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-pdf/fpdf v0.6.0/go.mod h1:HzcnA+A23uwogo0tp9yU+l3V+KXhiESpt1PMayhOh5M= github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= github.com/go-playground/validator/v10 v10.14.1 h1:9c50NUPC30zyuKprjL3vNZ0m5oG+jU0zvx4AqHGnv4k= +github.com/go-playground/validator/v10 v10.14.1/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-stack/stack v1.8.1 h1:ntEHSVwIt7PNXNpgPmVfMrNhLtgjlmnZha2kOpuRiDw= github.com/go-stack/stack v1.8.1/go.mod h1:dcoOX6HbPZSZptuspn9bctJ+N/CnF5gGygcUP3XYfe4= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/gobwas/httphead v0.0.0-20180130184737-2c6c146eadee/go.mod h1:L0fX3K22YWvt/FAX9NnzrNzcI4wNYi9Yku4O0LKYflo= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= @@ -1341,6 +1370,7 @@ github.com/goccy/go-json v0.9.11/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MG github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.1.0 h1:4KLkAxT3aOY8Li4FRJe/KvhoNFFxo0m6fNuFUO8QJUk= +github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= @@ -1443,6 +1473,7 @@ github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17 github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.1-0.20200604201612-c04b05f3adfa/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF8= +github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -1465,6 +1496,7 @@ github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20230207041349-798e818bf904/go.mod h1:uglQLonpP8qtYCYyzA+8c/9qtqgA3qsXGYqCPKARAFg= github.com/google/pprof v0.0.0-20231229205709-960ae82b1e42 h1:dHLYa5D8/Ta0aLR2XcPsrkpAgGeFs6thhMcQK0oQ0n8= +github.com/google/pprof v0.0.0-20231229205709-960ae82b1e42/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/s2a-go v0.1.0/go.mod h1:OJpEgntRZo8ugHpF9hkoLJbS5dSI20XZeXJ9JVywLlM= github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= @@ -1523,6 +1555,7 @@ github.com/graph-gophers/graphql-go v1.3.0/go.mod h1:9CQHMSxwO4MprSdzoIEobiHpoLt github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 h1:Iju5GlWwrvL6UBg4zJJt3btmonfrMlCDdsejg4CZE7c= github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0 h1:pRhl55Yx1eC7BZ1N+BBWwnKaMyD8uC+34TLdndZMAKk= +github.com/grpc-ecosystem/go-grpc-middleware/v2 v2.1.0/go.mod h1:XKMd7iuf/RGPSMJ/U4HP0zS2Z9Fh8Ps9a+6X26m/tmI= github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -1601,11 +1634,13 @@ github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LK github.com/ipfs/go-datastore v0.6.0 h1:JKyz+Gvz1QEZw0LsX1IBn+JFCJQH4SJVFtM4uWU0Myk= github.com/ipfs/go-datastore v0.6.0/go.mod h1:rt5M3nNbSO/8q1t4LNkLyUwRs8HupMeN/8O4Vn9YAT8= github.com/ipfs/go-detect-race v0.0.1 h1:qX/xay2W3E4Q1U7d9lNs1sU9nvguX0a7319XbyQ6cOk= +github.com/ipfs/go-detect-race v0.0.1/go.mod h1:8BNT7shDZPo99Q74BpGMK+4D8Mn4j46UU0LZ723meps= github.com/ipfs/go-ipfs-util v0.0.3 h1:2RFdGez6bu2ZlZdI+rWfIdbQb1KudQp3VGwPtdNCmE0= github.com/ipfs/go-ipfs-util v0.0.3/go.mod h1:LHzG1a0Ig4G+iZ26UUOMjHd+lfM84LZCrn17xAKWBvs= github.com/ipfs/go-ipld-format v0.6.0 h1:VEJlA2kQ3LqFSIm5Vu6eIlSxD/Ze90xtc4Meten1F5U= github.com/ipfs/go-ipld-format v0.6.0/go.mod h1:g4QVMTn3marU3qXchwjpKPKgJv+zF+OlaKMyhJ4LHPg= github.com/ipfs/go-log v1.0.5 h1:2dOuUCB1Z7uoczMWgAyDck5JLb72zHzrMnGnCNNbvY8= +github.com/ipfs/go-log v1.0.5/go.mod h1:j0b8ZoR+7+R99LD9jZ6+AJsrzkPbSXbZfGakb5JPtIo= github.com/ipfs/go-log/v2 v2.5.1 h1:1XdUzF7048prq4aBjDQQ4SL5RxftpRGdXhNRwKSAlcY= github.com/ipfs/go-log/v2 v2.5.1/go.mod h1:prSpmC1Gpllc9UYWxDiZDreBYw7zp4Iqp1kOLU9U5UI= github.com/ipfs/go-metrics-interface v0.0.1 h1:j+cpbjYvu4R8zbleSs36gvB7jR+wsL2fGD6n0jO4kdg= @@ -1621,6 +1656,7 @@ github.com/itchyny/timefmt-go v0.1.5/go.mod h1:nEP7L+2YmAbT2kZ2HfSs1d8Xtw9LY8D2s github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc= github.com/jbenet/go-cienv v0.1.0/go.mod h1:TqNnHUmJgXau0nCzC7kXWeotg3J9W34CUv5Djy1+FlA= github.com/jbenet/go-temp-err-catcher v0.1.0 h1:zpb3ZH6wIE8Shj2sKS+khgRvf7T7RABoLk/+KKHggpk= +github.com/jbenet/go-temp-err-catcher v0.1.0/go.mod h1:0kJRvmDZXNMIiJirNPEYfhpPwbGVtZVWC34vc5WLsDk= github.com/jbenet/goprocess v0.1.4 h1:DRGOFReOMqqDNXwW70QkacFW0YN9QnwLV0Vqk+3oU0o= github.com/jbenet/goprocess v0.1.4/go.mod h1:5yspPrukOVuOLORacaBi858NqyClJPQxYZlqdZVfqY4= github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1CVv03EnqU1wYL2dFwXxW2An0az9JTl/ZsqXQeBlkU= @@ -1717,23 +1753,32 @@ github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= github.com/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8= github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/libp2p/go-cidranger v1.1.0 h1:ewPN8EZ0dd1LSnrtuwd4709PXVcITVeuwbag38yPW7c= +github.com/libp2p/go-cidranger v1.1.0/go.mod h1:KWZTfSr+r9qEo9OkI9/SIEeAtw+NNoU0dXIXt15Okic= github.com/libp2p/go-flow-metrics v0.1.0 h1:0iPhMI8PskQwzh57jB9WxIuIOQ0r+15PChFGkx3Q3WM= +github.com/libp2p/go-flow-metrics v0.1.0/go.mod h1:4Xi8MX8wj5aWNDAZttg6UPmc0ZrnFNsMtpsYUClFtro= github.com/libp2p/go-libp2p v0.32.2 h1:s8GYN4YJzgUoyeYNPdW7JZeZ5Ee31iNaIBfGYMAY4FQ= github.com/libp2p/go-libp2p v0.32.2/go.mod h1:E0LKe+diV/ZVJVnOJby8VC5xzHF0660osg71skcxJvk= github.com/libp2p/go-libp2p-asn-util v0.4.1 h1:xqL7++IKD9TBFMgnLPZR6/6iYhawHKHl950SO9L6n94= +github.com/libp2p/go-libp2p-asn-util v0.4.1/go.mod h1:d/NI6XZ9qxw67b4e+NgpQexCIiFYJjErASrYW4PFDN8= github.com/libp2p/go-libp2p-kbucket v0.6.3 h1:p507271wWzpy2f1XxPzCQG9NiN6R6lHL9GiSErbQQo0= +github.com/libp2p/go-libp2p-kbucket v0.6.3/go.mod h1:RCseT7AH6eJWxxk2ol03xtP9pEHetYSPXOaJnOiD8i0= github.com/libp2p/go-libp2p-pubsub v0.10.0 h1:wS0S5FlISavMaAbxyQn3dxMOe2eegMfswM471RuHJwA= github.com/libp2p/go-libp2p-pubsub v0.10.0/go.mod h1:1OxbaT/pFRO5h+Dpze8hdHQ63R0ke55XTs6b6NwLLkw= github.com/libp2p/go-libp2p-testing v0.12.0 h1:EPvBb4kKMWO29qP4mZGyhVzUyR25dvfUIK5WDu6iPUA= +github.com/libp2p/go-libp2p-testing v0.12.0/go.mod h1:KcGDRXyN7sQCllucn1cOOS+Dmm7ujhfEyXQL5lvkcPg= github.com/libp2p/go-msgio v0.3.0 h1:mf3Z8B1xcFN314sWX+2vOTShIE0Mmn2TXn3YCUQGNj0= github.com/libp2p/go-msgio v0.3.0/go.mod h1:nyRM819GmVaF9LX3l03RMh10QdOroF++NBbxAb0mmDM= github.com/libp2p/go-netroute v0.2.1 h1:V8kVrpD8GK0Riv15/7VN6RbUQ3URNZVosw7H2v9tksU= +github.com/libp2p/go-netroute v0.2.1/go.mod h1:hraioZr0fhBjG0ZRXJJ6Zj2IVEVNx6tDTFQfSmcq7mQ= github.com/libp2p/go-reuseport v0.4.0 h1:nR5KU7hD0WxXCJbmw7r2rhRYruNRl2koHw8fQscQm2s= +github.com/libp2p/go-reuseport v0.4.0/go.mod h1:ZtI03j/wO5hZVDFo2jKywN6bYKWLOy8Se6DrI2E1cLU= github.com/libp2p/go-yamux/v4 v4.0.1 h1:FfDR4S1wj6Bw2Pqbc8Uz7pCxeRBPbwsBbEdfwiCypkQ= +github.com/libp2p/go-yamux/v4 v4.0.1/go.mod h1:NWjl8ZTLOGlozrXSOZ/HlfG++39iKNnM5wwmtQP1YB4= github.com/logrusorgru/aurora/v4 v4.0.0 h1:sRjfPpun/63iADiSvGGjgA1cAYegEWMPCJdUpJYn9JA= github.com/logrusorgru/aurora/v4 v4.0.0/go.mod h1:lP0iIa2nrnT/qoFXcOZSrZQpJ1o6n2CUf/hyHi2Q4ZQ= github.com/lyft/protoc-gen-star v0.6.0/go.mod h1:TGAoBVkt8w7MPG72TrKIu85MIdXwDuzJYeZuUPFPNwA= @@ -1746,6 +1791,7 @@ github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3v github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd h1:br0buuQ854V8u83wA0rVZ8ttrq5CpaPZdvrK0LP2lOk= +github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd/go.mod h1:QuCEs1Nt24+FYQEqAAncTDPJIuGs+LxK1MCiFL25pMU= github.com/matryer/moq v0.0.0-20190312154309-6cfb0558e1bd/go.mod h1:9ELz6aaclSIGnZBoaSLZ3NAl1VTufbOrXBPvtcy6WiQ= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= @@ -1792,8 +1838,11 @@ github.com/mediocregopher/radix/v3 v3.3.0/go.mod h1:EmfVyvspXz1uZEyPBMyGK+kjWiKQ github.com/mediocregopher/radix/v3 v3.4.2/go.mod h1:8FL3F6UQRXHXIBSPUs5h0RybMF8i4n7wVopoX3x7Bv8= github.com/microcosm-cc/bluemonday v1.0.2/go.mod h1:iVP4YcDBq+n/5fb23BhYFvIMq/leAFZyRl6bYmGDlGc= github.com/miekg/dns v1.1.57 h1:Jzi7ApEIzwEPLHWRcafCN9LZSBbqQpxjt/wpgvg7wcM= +github.com/miekg/dns v1.1.57/go.mod h1:uqRjCRUuEAA6qsOiJvDd+CFo/vW+y5WR6SNmHE55hZk= github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b h1:z78hV3sbSMAUoyUMM0I83AUIT6Hu17AWfgjzIbtrYFc= +github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b/go.mod h1:lxPUiZwKoFL8DUUmalo2yJJUCxbPKtm8OKfqr2/FTNU= github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc h1:PTfri+PuQmWDqERdnNMiD9ZejrlswWrCpBEZgWOiTrc= +github.com/mikioh/tcpopt v0.0.0-20190314235656-172688c1accc/go.mod h1:cGKTAVKx4SxOuR/czcZ/E2RSJ3sfHs8FpHhQ5CWMf9s= github.com/minio/asm2plan9s v0.0.0-20200509001527-cdd76441f9d8/go.mod h1:mC1jAcsrzbxHt8iiaC+zU4b1ylILSosueou12R++wfY= github.com/minio/c2goasm v0.0.0-20190812172519-36a3d3bbc4f3/go.mod h1:RagcQ7I8IeTMnF8JTXieKnO4Z6JCsikNEzj0DwauVzE= github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM= @@ -1828,7 +1877,9 @@ github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a github.com/multiformats/go-multiaddr v0.12.2 h1:9G9sTY/wCYajKa9lyfWPmpZAwe6oV+Wb1zcmMS1HG24= github.com/multiformats/go-multiaddr v0.12.2/go.mod h1:GKyaTYjZRdcUhyOetrxTk9z0cW+jA/YrnqTOvKgi44M= github.com/multiformats/go-multiaddr-dns v0.3.1 h1:QgQgR+LQVt3NPTjbrLLpsaT2ufAA2y0Mkk+QRVJbW3A= +github.com/multiformats/go-multiaddr-dns v0.3.1/go.mod h1:G/245BRQ6FJGmryJCrOuTdB37AMA5AMOVuO6NY3JwTk= github.com/multiformats/go-multiaddr-fmt v0.1.0 h1:WLEFClPycPkp4fnIzoFoV9FVd49/eQsuaL3/CWe167E= +github.com/multiformats/go-multiaddr-fmt v0.1.0/go.mod h1:hGtDIW4PU4BqJ50gW2quDuPVjyWNZxToGUh/HwTZYJo= github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g= github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk= github.com/multiformats/go-multicodec v0.9.0 h1:pb/dlPnzee/Sxv/j4PmkDRxCOi3hXTz3IbPKOXWJkmg= @@ -1852,13 +1903,13 @@ github.com/nats-io/nuid v1.0.1/go.mod h1:19wcPz3Ph3q0Jbyiqsd0kePYG7A95tJPxeL+1OS github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onflow/atree v0.6.1-0.20230711151834-86040b30171f/go.mod h1:xvP61FoOs95K7IYdIYRnNcYQGf4nbF/uuJ0tHf4DRuM= -github.com/onflow/atree v0.8.0-rc.3 h1:BHVkJLrBHhHo7ET8gkuS1+lyQGNekYYOyoICGK3RFNM= -github.com/onflow/atree v0.8.0-rc.3/go.mod h1:7YNAyCd5JENq+NzH+fR1ABUZVzbSq9dkt0+5fZH3L2A= -github.com/onflow/atree v0.8.0-rc.5/go.mod h1:yccR+LR7xc1Jdic0mrjocbHvUD7lnVvg8/Ct1AA5zBo= +github.com/onflow/atree v0.8.0-rc.6 h1:GWgaylK24b5ta2Hq+TvyOF7X5tZLiLzMMn7lEt59fsA= +github.com/onflow/atree v0.8.0-rc.6/go.mod h1:yccR+LR7xc1Jdic0mrjocbHvUD7lnVvg8/Ct1AA5zBo= github.com/onflow/crypto v0.25.0/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI= github.com/onflow/crypto v0.25.1 h1:0txy2PKPMM873JbpxQNbJmuOJtD56bfs48RQfm0ts5A= github.com/onflow/crypto v0.25.1/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI= @@ -1895,14 +1946,17 @@ github.com/onsi/ginkgo v1.13.0/go.mod h1:+REjRxOmWfHCjfv9TTWB1jD1Frx4XydAD3zm1ls github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA= github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo/v2 v2.13.2 h1:Bi2gGVkfn6gQcjNjZJVO8Gf0FHzMPf2phUei9tejVMs= +github.com/onsi/ginkgo/v2 v2.13.2/go.mod h1:XStQ8QcGwLyF4HdfcZB8SFOS/MWCgDuXMSBe6zrvLgM= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/opencontainers/runtime-spec v1.1.0 h1:HHUyrt9mwHUjtasSbXSMvs4cyFxh+Bll4AjJ9odEGpg= +github.com/opencontainers/runtime-spec v1.1.0/go.mod h1:jwyrGlmzljRJv/Fgzds9SsS/C5hL+LL3ko9hs6T5lQ0= github.com/opentracing/opentracing-go v1.0.2/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.0.3-0.20180606204148-bd9c31933947/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs= +github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc= github.com/paulbellamy/ratecounter v0.2.0/go.mod h1:Hfx1hDpSGoqxkVVpBi/IlYD7kChlfo5C6hzIHwPqfFE= github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 h1:onHthvaw9LFnH4t2DcNVpwGmV9E1BkGknEliJkfwQj0= github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58/go.mod h1:DXv8WO4yhMYhSNPKjeNKa5WY9YCIEBRbNzFFPJbWO6Y= @@ -1974,8 +2028,11 @@ github.com/protolambda/bls12-381-util v0.0.0-20220416220906-d8552aa452c7/go.mod github.com/psiemens/sconfig v0.1.0 h1:xfWqW+TRpih7mXZIqKYTmpRhlZLQ1kbxV8EjllPv76s= github.com/psiemens/sconfig v0.1.0/go.mod h1:+MLKqdledP/8G3rOBpknbLh0IclCf4WneJUtS26JB2U= github.com/quic-go/qtls-go1-20 v0.4.1 h1:D33340mCNDAIKBqXuAvexTNMUByrYmFYVfKfDN5nfFs= +github.com/quic-go/qtls-go1-20 v0.4.1/go.mod h1:X9Nh97ZL80Z+bX/gUXMbipO6OxdiDi58b/fMC9mAL+k= github.com/quic-go/quic-go v0.40.1 h1:X3AGzUNFs0jVuO3esAGnTfvdgvL4fq655WaOi1snv1Q= +github.com/quic-go/quic-go v0.40.1/go.mod h1:PeN7kuVJ4xZbxSv/4OX6S1USOX8MJvydwpTx31vx60c= github.com/raulk/go-watchdog v1.3.0 h1:oUmdlHxdkXRJlwfG0O9omj8ukerm8MEQavSiDTEtBsk= +github.com/raulk/go-watchdog v1.3.0/go.mod h1:fIvOnLbF0b0ZwkB9YU4mOW9Did//4vPZtDqv66NfsMU= github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= @@ -2160,7 +2217,9 @@ go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0 h1:UNQQKPfTDe1J81ViolILjTKPr9WetKW6uei2hFgJmFs= +go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.47.0/go.mod h1:r9vWsPS/3AQItv3OSlEJ/E4mbrhUbbw18meOjArPtKQ= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0 h1:sv9kVfal0MK0wBMCOGr+HeJm9v803BkJxGrk2au7j08= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.47.0/go.mod h1:SK2UL73Zy1quvRPonmOmRDiWk1KBV3LyIeeIxcEApWw= go.opentelemetry.io/otel v1.8.0/go.mod h1:2pkj+iMj0o03Y+cW6/m8Y4WkRdYN3AvCXCnzRMp9yvM= go.opentelemetry.io/otel v1.16.0/go.mod h1:vl0h9NUa1D5s1nv3A5vZOYWn8av4K8Ml6JDeHrT/bx4= go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= @@ -2193,7 +2252,9 @@ go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= @@ -2233,8 +2294,10 @@ golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98y golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -2306,8 +2369,10 @@ golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -2392,8 +2457,9 @@ golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/oauth2 v0.0.0-20170207211851-4464e7848382/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -2429,6 +2495,7 @@ golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQ golang.org/x/oauth2 v0.11.0/go.mod h1:LdF7O/8bLR/qWK9DrpXmbHLTouvRHK0SgJl0GmDBchk= golang.org/x/oauth2 v0.13.0/go.mod h1:/JMhi4ZRXAf4HG9LiNmxvk+45+96RUlVThiH8FzNBn0= golang.org/x/oauth2 v0.17.0 h1:6m3ZPmLEFdVxKKWnKq4VqZ60gutO35zm+zrAHVmHyDQ= +golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5HA= golang.org/x/perf v0.0.0-20230113213139-801c7ef9e5c5/go.mod h1:UBKtEnL8aqnd+0JHqZ+2qoMDwtuy6cYhhKNoHLBiTQc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -2450,8 +2517,10 @@ golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -2577,8 +2646,11 @@ golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -2596,8 +2668,10 @@ golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0= -golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= +golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= +golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2618,8 +2692,10 @@ golang.org/x/text v0.10.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -2629,6 +2705,7 @@ golang.org/x/time v0.0.0-20220922220347-f3bd1da661af/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.1.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= +golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180525024113-a5b4c53f6e8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -2708,8 +2785,8 @@ golang.org/x/tools v0.9.1/go.mod h1:owI94Op576fPu3cIGQeHs3joujW/2Oc6MtlxbF5dfNc= golang.org/x/tools v0.10.0/go.mod h1:UJwyiVBsOA2uwvK/e5OY3GTpDUJriEd+/YlqAwLPmyM= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0= -golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= -golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d h1:vU5i/LfpvrRCpgM/VPfJLg5KjxD3E+hfT1SH+d9zLwg= +golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2804,6 +2881,7 @@ google.golang.org/api v0.139.0/go.mod h1:CVagp6Eekz9CjGZ718Z+sloknzkDJE7Vc1Ckj9+ google.golang.org/api v0.149.0/go.mod h1:Mwn1B7JTXrzXtnvmzQE2BD6bYZQ8DShKZDZbeN9I7qI= google.golang.org/api v0.151.0/go.mod h1:ccy+MJ6nrYFgE3WgRx/AMXOxOmU8Q4hSa+jjibzhxcg= google.golang.org/api v0.162.0 h1:Vhs54HkaEpkMBdgGdOT2P6F0csGG/vxDS0hWHJzmmps= +google.golang.org/api v0.162.0/go.mod h1:6SulDkfoBIg4NFmCuZ39XeeAgSHCPecfSUuDyYlAHs0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -2967,6 +3045,7 @@ google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97/go.mod h1:t1VqOqqv google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a/go.mod h1:EMfReVxb80Dq1hhioy0sOsY9jCE46YDgHlJ7fWVUWRE= google.golang.org/genproto v0.0.0-20231016165738-49dd2c1f3d0b/go.mod h1:CgAqfJo+Xmu0GwA0411Ht3OU3OntXwsGmrmjI8ioGXI= google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= google.golang.org/genproto/googleapis/api v0.0.0-20230525234020-1aefcd67740a/go.mod h1:ts19tUU+Z0ZShN1y3aPyq2+O3d5FUNNgT6FtOzmrNn8= google.golang.org/genproto/googleapis/api v0.0.0-20230525234035-dd9d682886f9/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= google.golang.org/genproto/googleapis/api v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= @@ -3118,6 +3197,7 @@ gopkg.in/yaml.v3 v3.0.0/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= +gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= @@ -3127,8 +3207,8 @@ honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9 honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.1.3/go.mod h1:NgwopIslSNH47DimFoV78dnkksY2EFtX0ajyb3K/las= lukechampine.com/blake3 v1.1.7/go.mod h1:tkKEOtDkNtklkXtLNEOGNq5tcV90tJiA1vAA12R78LA= -lukechampine.com/blake3 v1.2.1 h1:YuqqRuaqsGV71BV/nm9xlI0MKUv4QC54jQnBChWbGnI= lukechampine.com/blake3 v1.2.1/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= +lukechampine.com/blake3 v1.3.0 h1:sJ3XhFINmHSrYCgl958hscfIa3bw8x4DqMP3u1YvoYE= lukechampine.com/blake3 v1.3.0/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k= lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk= @@ -3161,10 +3241,12 @@ modernc.org/libc v1.20.3/go.mod h1:ZRfIaEkgrYgZDl6pa4W39HgN5G/yDW+NRmNKZBDFrk0= modernc.org/libc v1.21.4/go.mod h1:przBsL5RDOZajTVslkugzLBj1evTue36jEomFQOoYuI= modernc.org/libc v1.22.2/go.mod h1:uvQavJ1pZ0hIoC/jfqNoMLURIMhKzINIWypNM17puug= modernc.org/libc v1.37.6 h1:orZH3c5wmhIQFTXF+Nt+eeauyd+ZIt2BX6ARe+kD+aw= +modernc.org/libc v1.37.6/go.mod h1:YAXkAZ8ktnkCKaN9sw/UDeUVkGYJ/YquGO4FTi5nmHE= modernc.org/mathutil v1.2.2/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/mathutil v1.4.1/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E= modernc.org/mathutil v1.6.0 h1:fRe9+AmYlaej+64JsEEhoWuAYBkOtQiMEU7n/XgfYi4= +modernc.org/mathutil v1.6.0/go.mod h1:Ui5Q9q1TR2gFm0AQRqQUaBWFLAhQpCwNcuhBOSedWPo= modernc.org/memory v1.1.1/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= modernc.org/memory v1.2.0/go.mod h1:/0wo5ibyrQiaoUoH7f9D8dnglAmILJ5/cxZlRECf+Nw= modernc.org/memory v1.2.1/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= @@ -3172,11 +3254,13 @@ modernc.org/memory v1.3.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= modernc.org/memory v1.4.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU= modernc.org/memory v1.7.2 h1:Klh90S215mmH8c9gO98QxQFsY+W451E8AnzjoE2ee1E= +modernc.org/memory v1.7.2/go.mod h1:NO4NVCQy0N7ln+T9ngWqOQfi7ley4vpwvARR+Hjw95E= modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0= modernc.org/sqlite v1.18.1/go.mod h1:6ho+Gow7oX5V+OiOQ6Tr4xeqbx13UZ6t+Fw9IRUG4d4= modernc.org/sqlite v1.18.2/go.mod h1:kvrTLEWgxUcHa2GfHBQtanR1H9ht3hTJNtKpzH9k1u0= modernc.org/sqlite v1.28.0 h1:Zx+LyDDmXczNnEQdvPuEfcFVA2ZPyaD7UCZDjef3BHQ= +modernc.org/sqlite v1.28.0/go.mod h1:Qxpazz0zH8Z1xCFyi5GSL3FzbtZ3fvbjmywNogldEW0= modernc.org/strutil v1.1.1/go.mod h1:DE+MQQ/hjKBZS2zNInV5hhcipt5rLPWkmpbGeW5mmdw= modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw= modernc.org/tcl v1.13.1/go.mod h1:XOLfOwzhkljL4itZkK6T72ckMgvj0BDsnKNdZVUOecw= @@ -3187,6 +3271,7 @@ modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= modernc.org/z v1.5.1/go.mod h1:eWFB510QWW5Th9YGZT81s+LwvaAs3Q2yr4sP0rmLkv8= pgregory.net/rapid v0.4.7/go.mod h1:UYpPVyjFHzYBGHIxLFoupi8vwk6rXNzRY9OMvVxFIOU= pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= +pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=