Skip to content

Commit

Permalink
Move contracts map creation out of the importResolver closure
Browse files Browse the repository at this point in the history
  • Loading branch information
m-Peter committed Oct 24, 2023
1 parent 5d217a1 commit efcba45
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions internal/test/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{}

Expand Down

0 comments on commit efcba45

Please sign in to comment.