From efcba45990901b4035c0aa161aced2259191edbb Mon Sep 17 00:00:00 2001 From: Ardit Marku Date: Tue, 24 Oct 2023 22:50:12 +0300 Subject: [PATCH] Move contracts map creation out of the importResolver closure --- internal/test/test.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/test/test.go b/internal/test/test.go index a978c8548..a94ded9a0 100644 --- a/internal/test/test.go +++ b/internal/test/test.go @@ -213,11 +213,12 @@ func testCode( } func importResolver(scriptPath string, state *flowkit.State) cdcTests.ImportResolver { + contracts := make(map[string]config.Contract, 0) + for _, contract := range *state.Contracts() { + contracts[contract.Name] = contract + } + return func(location common.Location) (string, error) { - contracts := make(map[string]config.Contract, 0) - for _, contract := range *state.Contracts() { - contracts[contract.Name] = contract - } contract := config.Contract{}