diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 2946ef28c1..62ecb0179d 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -48,7 +48,7 @@ jobs: - name: Run benchmark on current branch run: | - ( for i in {1..${{ steps.settings.outputs.benchmark_repetitions }}}; do go test ./... -run=XXX -bench=. -benchmem -shuffle=on; done | sed 's/pkg:.*/pkg: github.com\/onflow\/cadence\/runtime/' ) | tee new.txt + ( for i in {1..${{ steps.settings.outputs.benchmark_repetitions }}}; do go test ./... -run=XXX -bench=. -benchmem -shuffle=on; done | sed 's/pkg:.*/pkg: github.com\/onflow\/cadence\/' ) | tee new.txt # the package replace line above is to make the results table more readable, since it is not fragmented by package - name: Checkout base branch @@ -56,7 +56,7 @@ jobs: - name: Run benchmark on base branch run: | - ( for i in {1..${{ steps.settings.outputs.benchmark_repetitions }}}; do go test ./... -run=XXX -bench=. -benchmem -shuffle=on; done | sed 's/pkg:.*/pkg: github.com\/onflow\/cadence\/runtime/' ) | tee old.txt + ( for i in {1..${{ steps.settings.outputs.benchmark_repetitions }}}; do go test ./... -run=XXX -bench=. -benchmem -shuffle=on; done | sed 's/pkg:.*/pkg: github.com\/onflow\/cadence\/' ) | tee old.txt # see https://trstringer.com/github-actions-multiline-strings/ to see why this part is complex - name: Use benchstat for comparison diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 634088911f..9929240d55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,7 +49,7 @@ jobs: run: make ci - name: Cadence Testing Framework - run: cd runtime/stdlib/contracts && flow test --cover --covercode="contracts" crypto_test.cdc + run: cd stdlib/contracts && flow test --cover --covercode="contracts" crypto_test.cdc - name: Upload coverage report uses: codecov/codecov-action@v2 diff --git a/.gitignore b/.gitignore index 16cc4beeb4..78ad24c7ea 100644 --- a/.gitignore +++ b/.gitignore @@ -34,10 +34,10 @@ suppressions coverage.txt coverage.txt-e -runtime/cmd/check/check -runtime/cmd/main/main -runtime/cmd/parse/parse -runtime/cmd/parse/parse.wasm +cmd/check/check +cmd/main/main +cmd/parse/parse +cmd/parse/parse.wasm tools/golangci-lint/golangci-lint tools/maprange/maprange tools/unkeyed/unkeyed diff --git a/Makefile b/Makefile index f9234e7304..e0914ca4e1 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ GOPATH ?= $(HOME)/go # Ensure go bin path is in path (Especially for CI) PATH := $(PATH):$(GOPATH)/bin -COVERPKGS := $(shell go list ./... | grep -v /cmd | grep -v /runtime/test | tr "\n" "," | sed 's/,*$$//') +COVERPKGS := $(shell go list ./... | grep -v /cmd | grep -v /test | tr "\n" "," | sed 's/,*$$//') LINTERS := @@ -30,19 +30,19 @@ ifneq ($(linters),) endif .PHONY: build -build: build-tools ./runtime/cmd/parse/parse ./runtime/cmd/parse/parse.wasm ./runtime/cmd/check/check ./runtime/cmd/main/main +build: build-tools ./cmd/parse/parse ./cmd/parse/parse.wasm ./cmd/check/check ./cmd/main/main -./runtime/cmd/parse/parse: - go build -o $@ ./runtime/cmd/parse +./cmd/parse/parse: + go build -o $@ ./cmd/parse -./runtime/cmd/parse/parse.wasm: - GOARCH=wasm GOOS=js go build -o $@ ./runtime/cmd/parse +./cmd/parse/parse.wasm: + GOARCH=wasm GOOS=js go build -o $@ ./cmd/parse -./runtime/cmd/check/check: - go build -o $@ ./runtime/cmd/check +./cmd/check/check: + go build -o $@ ./cmd/check -./runtime/cmd/main/main: - go build -o $@ ./runtime/cmd/main +./cmd/main/main: + go build -o $@ ./cmd/main .PHONY: build-tools build-tools: build-analysis build-get-contracts @@ -60,7 +60,7 @@ ci: # test all packages go test -coverprofile=coverage.txt -covermode=atomic -parallel 8 -race -coverpkg $(COVERPKGS) ./... # run interpreter smoke tests. results from run above are reused, so no tests runs are duplicated - go test -count=5 ./runtime/tests/interpreter/... -runSmokeTests=true -validateAtree=false + go test -count=5 ./tests/interpreter/... -runSmokeTests=true -validateAtree=false # remove coverage of empty functions from report sed -i -e 's/^.* 0 0$$//' coverage.txt diff --git a/runtime/activations/activations.go b/activations/activations.go similarity index 99% rename from runtime/activations/activations.go rename to activations/activations.go index 44f2b54cdc..5ebb4ce349 100644 --- a/runtime/activations/activations.go +++ b/activations/activations.go @@ -19,7 +19,7 @@ package activations import ( - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) // Activation is a map of strings to values. diff --git a/runtime/activations/activations_test.go b/activations/activations_test.go similarity index 100% rename from runtime/activations/activations_test.go rename to activations/activations_test.go diff --git a/runtime/ast/access.go b/ast/access.go similarity index 98% rename from runtime/ast/access.go rename to ast/access.go index 136ba24351..f9d6cd72e9 100644 --- a/runtime/ast/access.go +++ b/ast/access.go @@ -22,8 +22,8 @@ import ( "encoding/json" "strings" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" ) //go:generate go run golang.org/x/tools/cmd/stringer -type=PrimitiveAccess diff --git a/runtime/ast/access_test.go b/ast/access_test.go similarity index 100% rename from runtime/ast/access_test.go rename to ast/access_test.go diff --git a/runtime/ast/argument.go b/ast/argument.go similarity index 98% rename from runtime/ast/argument.go rename to ast/argument.go index 539355bbea..e7d5429bd0 100644 --- a/runtime/ast/argument.go +++ b/ast/argument.go @@ -23,7 +23,7 @@ import ( "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) type Argument struct { diff --git a/runtime/ast/argument_test.go b/ast/argument_test.go similarity index 100% rename from runtime/ast/argument_test.go rename to ast/argument_test.go diff --git a/runtime/ast/ast.go b/ast/ast.go similarity index 100% rename from runtime/ast/ast.go rename to ast/ast.go diff --git a/runtime/ast/attachment.go b/ast/attachment.go similarity index 99% rename from runtime/ast/attachment.go rename to ast/attachment.go index 32cd047473..39a9c3eded 100644 --- a/runtime/ast/attachment.go +++ b/ast/attachment.go @@ -23,7 +23,7 @@ import ( "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) // AttachmentDeclaration diff --git a/runtime/ast/attachment_test.go b/ast/attachment_test.go similarity index 100% rename from runtime/ast/attachment_test.go rename to ast/attachment_test.go diff --git a/runtime/ast/block.go b/ast/block.go similarity index 99% rename from runtime/ast/block.go rename to ast/block.go index 757233a843..7524dbfa12 100644 --- a/runtime/ast/block.go +++ b/ast/block.go @@ -23,7 +23,7 @@ import ( "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) type Block struct { diff --git a/runtime/ast/block_test.go b/ast/block_test.go similarity index 100% rename from runtime/ast/block_test.go rename to ast/block_test.go diff --git a/runtime/ast/composite.go b/ast/composite.go similarity index 99% rename from runtime/ast/composite.go rename to ast/composite.go index dae942b6af..40f1d1e8b3 100644 --- a/runtime/ast/composite.go +++ b/ast/composite.go @@ -23,8 +23,8 @@ import ( "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" ) // ConformingDeclaration diff --git a/runtime/ast/composite_test.go b/ast/composite_test.go similarity index 99% rename from runtime/ast/composite_test.go rename to ast/composite_test.go index 104e0cfa4e..cf8b441d95 100644 --- a/runtime/ast/composite_test.go +++ b/ast/composite_test.go @@ -26,7 +26,7 @@ import ( "github.com/stretchr/testify/require" "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) func TestFieldDeclaration_MarshalJSON(t *testing.T) { diff --git a/runtime/ast/conditionkind.go b/ast/conditionkind.go similarity index 97% rename from runtime/ast/conditionkind.go rename to ast/conditionkind.go index c0112eec6f..2354f189dd 100644 --- a/runtime/ast/conditionkind.go +++ b/ast/conditionkind.go @@ -21,7 +21,7 @@ package ast import ( "encoding/json" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) //go:generate go run golang.org/x/tools/cmd/stringer -type=ConditionKind diff --git a/runtime/ast/conditionkind_string.go b/ast/conditionkind_string.go similarity index 100% rename from runtime/ast/conditionkind_string.go rename to ast/conditionkind_string.go diff --git a/runtime/ast/conditionkind_test.go b/ast/conditionkind_test.go similarity index 100% rename from runtime/ast/conditionkind_test.go rename to ast/conditionkind_test.go diff --git a/runtime/ast/declaration.go b/ast/declaration.go similarity index 95% rename from runtime/ast/declaration.go rename to ast/declaration.go index ce509fbb45..51b38ae0ff 100644 --- a/runtime/ast/declaration.go +++ b/ast/declaration.go @@ -23,7 +23,7 @@ import ( "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) type Declaration interface { diff --git a/runtime/ast/elementtype.go b/ast/elementtype.go similarity index 100% rename from runtime/ast/elementtype.go rename to ast/elementtype.go diff --git a/runtime/ast/elementtype_string.go b/ast/elementtype_string.go similarity index 100% rename from runtime/ast/elementtype_string.go rename to ast/elementtype_string.go diff --git a/runtime/ast/entitlement_declaration.go b/ast/entitlement_declaration.go similarity index 99% rename from runtime/ast/entitlement_declaration.go rename to ast/entitlement_declaration.go index 6a53e4e445..a512bd320f 100644 --- a/runtime/ast/entitlement_declaration.go +++ b/ast/entitlement_declaration.go @@ -23,7 +23,7 @@ import ( "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) // EntitlementDeclaration diff --git a/runtime/ast/entitlement_declaration_test.go b/ast/entitlement_declaration_test.go similarity index 100% rename from runtime/ast/entitlement_declaration_test.go rename to ast/entitlement_declaration_test.go diff --git a/runtime/ast/expression.go b/ast/expression.go similarity index 99% rename from runtime/ast/expression.go rename to ast/expression.go index 0142b92b20..097b8a7311 100644 --- a/runtime/ast/expression.go +++ b/ast/expression.go @@ -26,9 +26,9 @@ import ( "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) const NilConstant = "nil" diff --git a/runtime/ast/expression_as_type.go b/ast/expression_as_type.go similarity index 100% rename from runtime/ast/expression_as_type.go rename to ast/expression_as_type.go diff --git a/runtime/ast/expression_extractor.go b/ast/expression_extractor.go similarity index 99% rename from runtime/ast/expression_extractor.go rename to ast/expression_extractor.go index 777dc8e4d3..002ff7794d 100644 --- a/runtime/ast/expression_extractor.go +++ b/ast/expression_extractor.go @@ -21,8 +21,8 @@ package ast import ( "fmt" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" ) type VoidExtractor interface { diff --git a/runtime/ast/expression_extractor_test.go b/ast/expression_extractor_test.go similarity index 100% rename from runtime/ast/expression_extractor_test.go rename to ast/expression_extractor_test.go diff --git a/runtime/ast/expression_test.go b/ast/expression_test.go similarity index 100% rename from runtime/ast/expression_test.go rename to ast/expression_test.go diff --git a/runtime/ast/function_declaration.go b/ast/function_declaration.go similarity index 98% rename from runtime/ast/function_declaration.go rename to ast/function_declaration.go index f86f6be670..1e334cebba 100644 --- a/runtime/ast/function_declaration.go +++ b/ast/function_declaration.go @@ -23,8 +23,8 @@ import ( "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" ) type FunctionPurity int diff --git a/runtime/ast/function_declaration_test.go b/ast/function_declaration_test.go similarity index 99% rename from runtime/ast/function_declaration_test.go rename to ast/function_declaration_test.go index c164a67da4..f4ba620fa3 100644 --- a/runtime/ast/function_declaration_test.go +++ b/ast/function_declaration_test.go @@ -26,7 +26,7 @@ import ( "github.com/stretchr/testify/require" "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) func TestFunctionDeclaration_MarshalJSON(t *testing.T) { diff --git a/runtime/ast/identifier.go b/ast/identifier.go similarity index 97% rename from runtime/ast/identifier.go rename to ast/identifier.go index 515ea7699b..6acf9ebc46 100644 --- a/runtime/ast/identifier.go +++ b/ast/identifier.go @@ -21,7 +21,7 @@ package ast import ( "encoding/json" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) // Identifier diff --git a/runtime/ast/import.go b/ast/import.go similarity index 98% rename from runtime/ast/import.go rename to ast/import.go index 312cc9903f..ea877fe7d9 100644 --- a/runtime/ast/import.go +++ b/ast/import.go @@ -23,7 +23,7 @@ import ( "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) // ImportDeclaration diff --git a/runtime/ast/import_test.go b/ast/import_test.go similarity index 99% rename from runtime/ast/import_test.go rename to ast/import_test.go index 462dd63313..2b6490f8e9 100644 --- a/runtime/ast/import_test.go +++ b/ast/import_test.go @@ -26,7 +26,7 @@ import ( "github.com/stretchr/testify/require" "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) func TestImportDeclaration_MarshalJSON(t *testing.T) { diff --git a/runtime/ast/inspect.go b/ast/inspect.go similarity index 100% rename from runtime/ast/inspect.go rename to ast/inspect.go diff --git a/runtime/ast/inspector.go b/ast/inspector.go similarity index 100% rename from runtime/ast/inspector.go rename to ast/inspector.go diff --git a/runtime/ast/inspector_test.go b/ast/inspector_test.go similarity index 97% rename from runtime/ast/inspector_test.go rename to ast/inspector_test.go index dd1beb653a..17979ef95f 100644 --- a/runtime/ast/inspector_test.go +++ b/ast/inspector_test.go @@ -23,9 +23,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/tests/examples" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/parser" + "github.com/onflow/cadence/tests/examples" ) // TestInspector_Elements compares Inspector against Inspect. diff --git a/runtime/ast/interface.go b/ast/interface.go similarity index 98% rename from runtime/ast/interface.go rename to ast/interface.go index 8fa4c622f1..b551abe582 100644 --- a/runtime/ast/interface.go +++ b/ast/interface.go @@ -23,7 +23,7 @@ import ( "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) // InterfaceDeclaration diff --git a/runtime/ast/interface_test.go b/ast/interface_test.go similarity index 99% rename from runtime/ast/interface_test.go rename to ast/interface_test.go index 24819d9c35..578cc08871 100644 --- a/runtime/ast/interface_test.go +++ b/ast/interface_test.go @@ -26,7 +26,7 @@ import ( "github.com/stretchr/testify/require" "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) func TestInterfaceDeclaration_MarshalJSON(t *testing.T) { diff --git a/runtime/ast/memberindices.go b/ast/memberindices.go similarity index 99% rename from runtime/ast/memberindices.go rename to ast/memberindices.go index 5c9c421cc4..2b3c7153d2 100644 --- a/runtime/ast/memberindices.go +++ b/ast/memberindices.go @@ -21,7 +21,7 @@ package ast import ( "sync" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) // programIndices is a container for all indices of members diff --git a/runtime/ast/memberindices_test.go b/ast/memberindices_test.go similarity index 98% rename from runtime/ast/memberindices_test.go rename to ast/memberindices_test.go index b05ab02e80..489f32e505 100644 --- a/runtime/ast/memberindices_test.go +++ b/ast/memberindices_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) func TestMemberIndices(t *testing.T) { diff --git a/runtime/ast/members.go b/ast/members.go similarity index 99% rename from runtime/ast/members.go rename to ast/members.go index 5ad8354540..dde0581ccf 100644 --- a/runtime/ast/members.go +++ b/ast/members.go @@ -23,7 +23,7 @@ import ( "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) // Members diff --git a/runtime/ast/members_test.go b/ast/members_test.go similarity index 100% rename from runtime/ast/members_test.go rename to ast/members_test.go diff --git a/runtime/ast/operation.go b/ast/operation.go similarity index 98% rename from runtime/ast/operation.go rename to ast/operation.go index 160512ed5e..ca046c9946 100644 --- a/runtime/ast/operation.go +++ b/ast/operation.go @@ -21,7 +21,7 @@ package ast import ( "encoding/json" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) //go:generate go run golang.org/x/tools/cmd/stringer -type=Operation diff --git a/runtime/ast/operation_string.go b/ast/operation_string.go similarity index 100% rename from runtime/ast/operation_string.go rename to ast/operation_string.go diff --git a/runtime/ast/operation_test.go b/ast/operation_test.go similarity index 100% rename from runtime/ast/operation_test.go rename to ast/operation_test.go diff --git a/runtime/ast/parameter.go b/ast/parameter.go similarity index 98% rename from runtime/ast/parameter.go rename to ast/parameter.go index 937ae2a3aa..d31d6f8c22 100644 --- a/runtime/ast/parameter.go +++ b/ast/parameter.go @@ -23,7 +23,7 @@ import ( "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) type Parameter struct { diff --git a/runtime/ast/parameterlist.go b/ast/parameterlist.go similarity index 98% rename from runtime/ast/parameterlist.go rename to ast/parameterlist.go index 97eef6a0f0..27f1efe289 100644 --- a/runtime/ast/parameterlist.go +++ b/ast/parameterlist.go @@ -23,7 +23,7 @@ import ( "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) type ParameterList struct { diff --git a/runtime/ast/parameterlist_test.go b/ast/parameterlist_test.go similarity index 100% rename from runtime/ast/parameterlist_test.go rename to ast/parameterlist_test.go diff --git a/runtime/ast/position.go b/ast/position.go similarity index 98% rename from runtime/ast/position.go rename to ast/position.go index 3a7dc42f89..f62e368365 100644 --- a/runtime/ast/position.go +++ b/ast/position.go @@ -21,7 +21,7 @@ package ast import ( "fmt" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) var EmptyPosition = Position{} diff --git a/runtime/ast/pragma.go b/ast/pragma.go similarity index 98% rename from runtime/ast/pragma.go rename to ast/pragma.go index 5ade93660e..6eab0c7dba 100644 --- a/runtime/ast/pragma.go +++ b/ast/pragma.go @@ -23,7 +23,7 @@ import ( "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) // Pragma diff --git a/runtime/ast/pragma_test.go b/ast/pragma_test.go similarity index 100% rename from runtime/ast/pragma_test.go rename to ast/pragma_test.go diff --git a/runtime/ast/precedence.go b/ast/precedence.go similarity index 100% rename from runtime/ast/precedence.go rename to ast/precedence.go diff --git a/runtime/ast/precedence_string.go b/ast/precedence_string.go similarity index 100% rename from runtime/ast/precedence_string.go rename to ast/precedence_string.go diff --git a/runtime/ast/prettier.go b/ast/prettier.go similarity index 100% rename from runtime/ast/prettier.go rename to ast/prettier.go diff --git a/runtime/ast/primitiveaccess_string.go b/ast/primitiveaccess_string.go similarity index 100% rename from runtime/ast/primitiveaccess_string.go rename to ast/primitiveaccess_string.go diff --git a/runtime/ast/program.go b/ast/program.go similarity index 99% rename from runtime/ast/program.go rename to ast/program.go index 743aa86ddb..2fec028dfd 100644 --- a/runtime/ast/program.go +++ b/ast/program.go @@ -23,7 +23,7 @@ import ( "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) type Program struct { diff --git a/runtime/ast/program_test.go b/ast/program_test.go similarity index 100% rename from runtime/ast/program_test.go rename to ast/program_test.go diff --git a/runtime/ast/programindices.go b/ast/programindices.go similarity index 100% rename from runtime/ast/programindices.go rename to ast/programindices.go diff --git a/runtime/ast/programindices_test.go b/ast/programindices_test.go similarity index 99% rename from runtime/ast/programindices_test.go rename to ast/programindices_test.go index 019b27175e..8efe0877af 100644 --- a/runtime/ast/programindices_test.go +++ b/ast/programindices_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) func TestProgramIndices(t *testing.T) { diff --git a/runtime/ast/statement.go b/ast/statement.go similarity index 99% rename from runtime/ast/statement.go rename to ast/statement.go index e1e3b6c519..c6b2f25abd 100644 --- a/runtime/ast/statement.go +++ b/ast/statement.go @@ -24,7 +24,7 @@ import ( "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) type Statement interface { diff --git a/runtime/ast/statement_test.go b/ast/statement_test.go similarity index 100% rename from runtime/ast/statement_test.go rename to ast/statement_test.go diff --git a/runtime/ast/string.go b/ast/string.go similarity index 100% rename from runtime/ast/string.go rename to ast/string.go diff --git a/runtime/ast/string_test.go b/ast/string_test.go similarity index 95% rename from runtime/ast/string_test.go rename to ast/string_test.go index f3d76503e2..99d86b8846 100644 --- a/runtime/ast/string_test.go +++ b/ast/string_test.go @@ -24,8 +24,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/parser" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/parser" ) func TestQuoteString(t *testing.T) { diff --git a/runtime/ast/transaction_declaration.go b/ast/transaction_declaration.go similarity index 98% rename from runtime/ast/transaction_declaration.go rename to ast/transaction_declaration.go index a9b6d91b23..aad73b308f 100644 --- a/runtime/ast/transaction_declaration.go +++ b/ast/transaction_declaration.go @@ -23,7 +23,7 @@ import ( "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) type TransactionDeclaration struct { diff --git a/runtime/ast/transaction_declaration_test.go b/ast/transaction_declaration_test.go similarity index 99% rename from runtime/ast/transaction_declaration_test.go rename to ast/transaction_declaration_test.go index 9713bad7fe..9f06ea98b4 100644 --- a/runtime/ast/transaction_declaration_test.go +++ b/ast/transaction_declaration_test.go @@ -26,7 +26,7 @@ import ( "github.com/stretchr/testify/require" "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) func TestTransactionDeclaration_MarshalJSON(t *testing.T) { diff --git a/runtime/ast/transfer.go b/ast/transfer.go similarity index 97% rename from runtime/ast/transfer.go rename to ast/transfer.go index 90ab2f5a79..ade8f9fc80 100644 --- a/runtime/ast/transfer.go +++ b/ast/transfer.go @@ -23,7 +23,7 @@ import ( "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) // Transfer represents the operation in variable declarations diff --git a/runtime/ast/transfer_test.go b/ast/transfer_test.go similarity index 100% rename from runtime/ast/transfer_test.go rename to ast/transfer_test.go diff --git a/runtime/ast/transferoperation.go b/ast/transferoperation.go similarity index 97% rename from runtime/ast/transferoperation.go rename to ast/transferoperation.go index c4e7925c2e..80008f1685 100644 --- a/runtime/ast/transferoperation.go +++ b/ast/transferoperation.go @@ -21,7 +21,7 @@ package ast import ( "encoding/json" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) //go:generate go run golang.org/x/tools/cmd/stringer -type=TransferOperation diff --git a/runtime/ast/transferoperation_string.go b/ast/transferoperation_string.go similarity index 100% rename from runtime/ast/transferoperation_string.go rename to ast/transferoperation_string.go diff --git a/runtime/ast/transferoperation_test.go b/ast/transferoperation_test.go similarity index 100% rename from runtime/ast/transferoperation_test.go rename to ast/transferoperation_test.go diff --git a/runtime/ast/type.go b/ast/type.go similarity index 99% rename from runtime/ast/type.go rename to ast/type.go index 095653afd4..65a01edd43 100644 --- a/runtime/ast/type.go +++ b/ast/type.go @@ -24,8 +24,8 @@ import ( "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" ) const typeSeparatorSpaceDoc = prettier.Text(": ") diff --git a/runtime/ast/type_test.go b/ast/type_test.go similarity index 100% rename from runtime/ast/type_test.go rename to ast/type_test.go diff --git a/runtime/ast/typeparameter.go b/ast/typeparameter.go similarity index 96% rename from runtime/ast/typeparameter.go rename to ast/typeparameter.go index 55b26958b9..00880a5633 100644 --- a/runtime/ast/typeparameter.go +++ b/ast/typeparameter.go @@ -18,7 +18,7 @@ package ast -import "github.com/onflow/cadence/runtime/common" +import "github.com/onflow/cadence/common" type TypeParameter struct { Identifier Identifier diff --git a/runtime/ast/typeparameterlist.go b/ast/typeparameterlist.go similarity index 98% rename from runtime/ast/typeparameterlist.go rename to ast/typeparameterlist.go index 5abed2e88f..01beb524a0 100644 --- a/runtime/ast/typeparameterlist.go +++ b/ast/typeparameterlist.go @@ -23,7 +23,7 @@ import ( "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) type TypeParameterList struct { diff --git a/runtime/ast/variable_declaration.go b/ast/variable_declaration.go similarity index 99% rename from runtime/ast/variable_declaration.go rename to ast/variable_declaration.go index bc82b55a5a..32fe597a6e 100644 --- a/runtime/ast/variable_declaration.go +++ b/ast/variable_declaration.go @@ -23,7 +23,7 @@ import ( "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) type VariableDeclaration struct { diff --git a/runtime/ast/variable_declaration_test.go b/ast/variable_declaration_test.go similarity index 100% rename from runtime/ast/variable_declaration_test.go rename to ast/variable_declaration_test.go diff --git a/runtime/ast/variablekind.go b/ast/variablekind.go similarity index 97% rename from runtime/ast/variablekind.go rename to ast/variablekind.go index d3a8ff683c..55a50e650f 100644 --- a/runtime/ast/variablekind.go +++ b/ast/variablekind.go @@ -21,7 +21,7 @@ package ast import ( "encoding/json" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) //go:generate go run golang.org/x/tools/cmd/stringer -type=VariableKind diff --git a/runtime/ast/variablekind_string.go b/ast/variablekind_string.go similarity index 100% rename from runtime/ast/variablekind_string.go rename to ast/variablekind_string.go diff --git a/runtime/ast/variablekind_test.go b/ast/variablekind_test.go similarity index 100% rename from runtime/ast/variablekind_test.go rename to ast/variablekind_test.go diff --git a/runtime/ast/visitor.go b/ast/visitor.go similarity index 99% rename from runtime/ast/visitor.go rename to ast/visitor.go index c18fdd797f..dba16b2678 100644 --- a/runtime/ast/visitor.go +++ b/ast/visitor.go @@ -19,7 +19,7 @@ package ast import ( - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) type Element interface { diff --git a/runtime/ast/walk.go b/ast/walk.go similarity index 100% rename from runtime/ast/walk.go rename to ast/walk.go diff --git a/runtime/cmd/check/main.go b/cmd/check/main.go similarity index 96% rename from runtime/cmd/check/main.go rename to cmd/check/main.go index 69112b4aa4..b30f51d3de 100644 --- a/runtime/cmd/check/main.go +++ b/cmd/check/main.go @@ -31,12 +31,12 @@ import ( "text/tabwriter" "time" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/cmd" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/pretty" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/cmd" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/pretty" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" ) type memberAccountAccessFlags []string diff --git a/runtime/cmd/cmd.go b/cmd/cmd.go similarity index 97% rename from runtime/cmd/cmd.go rename to cmd/cmd.go index bbd43b2397..a267e30a27 100644 --- a/runtime/cmd/cmd.go +++ b/cmd/cmd.go @@ -26,14 +26,14 @@ import ( "strings" "time" - "github.com/onflow/cadence/runtime/activations" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/pretty" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/activations" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/parser" + "github.com/onflow/cadence/pretty" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" ) func must(err error, location common.Location, codes map[common.Location][]byte) { diff --git a/runtime/cmd/compile/main.go b/cmd/compile/main.go similarity index 87% rename from runtime/cmd/compile/main.go rename to cmd/compile/main.go index 192dfc5d62..59c5de9eba 100644 --- a/runtime/cmd/compile/main.go +++ b/cmd/compile/main.go @@ -21,13 +21,13 @@ package main import ( "os" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/cmd" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/compiler" - "github.com/onflow/cadence/runtime/compiler/ir" - "github.com/onflow/cadence/runtime/compiler/wasm" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/cmd" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/compiler" + "github.com/onflow/cadence/compiler/ir" + "github.com/onflow/cadence/compiler/wasm" + "github.com/onflow/cadence/stdlib" ) func main() { diff --git a/runtime/cmd/decode-state-values/main.go b/cmd/decode-state-values/main.go similarity index 98% rename from runtime/cmd/decode-state-values/main.go rename to cmd/decode-state-values/main.go index 69a693dc88..70ecd7e7b4 100644 --- a/runtime/cmd/decode-state-values/main.go +++ b/cmd/decode-state-values/main.go @@ -38,9 +38,9 @@ import ( "github.com/onflow/atree" "github.com/schollz/progressbar/v3" - "github.com/onflow/cadence/runtime/common" - runtimeErr "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" + "github.com/onflow/cadence/common" + runtimeErr "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" ) type stringSlice []string diff --git a/runtime/cmd/execute/colors.go b/cmd/execute/colors.go similarity index 95% rename from runtime/cmd/execute/colors.go rename to cmd/execute/colors.go index 1b26be954a..f3da4cf40e 100644 --- a/runtime/cmd/execute/colors.go +++ b/cmd/execute/colors.go @@ -21,7 +21,7 @@ package execute import ( "github.com/logrusorgru/aurora/v4" - "github.com/onflow/cadence/runtime/interpreter" + "github.com/onflow/cadence/interpreter" ) func colorizeResult(result string) string { diff --git a/runtime/cmd/execute/debugger.go b/cmd/execute/debugger.go similarity index 98% rename from runtime/cmd/execute/debugger.go rename to cmd/execute/debugger.go index 43c26caf9e..c86052073e 100644 --- a/runtime/cmd/execute/debugger.go +++ b/cmd/execute/debugger.go @@ -26,7 +26,7 @@ import ( "github.com/c-bata/go-prompt" - "github.com/onflow/cadence/runtime/interpreter" + "github.com/onflow/cadence/interpreter" ) const commandShortHelp = "h" diff --git a/runtime/cmd/execute/execute.go b/cmd/execute/execute.go similarity index 93% rename from runtime/cmd/execute/execute.go rename to cmd/execute/execute.go index 6b2000170d..8f717937e5 100644 --- a/runtime/cmd/execute/execute.go +++ b/cmd/execute/execute.go @@ -19,8 +19,8 @@ package execute import ( - "github.com/onflow/cadence/runtime/cmd" - "github.com/onflow/cadence/runtime/interpreter" + "github.com/onflow/cadence/cmd" + "github.com/onflow/cadence/interpreter" ) // Execute parses the given filename and prints any syntax errors. diff --git a/runtime/cmd/execute/repl.go b/cmd/execute/repl.go similarity index 98% rename from runtime/cmd/execute/repl.go rename to cmd/execute/repl.go index 5532ba4eab..3d8226f4d9 100644 --- a/runtime/cmd/execute/repl.go +++ b/cmd/execute/repl.go @@ -31,12 +31,12 @@ import ( prettyJSON "github.com/tidwall/pretty" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" jsoncdc "github.com/onflow/cadence/encoding/json" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/pretty" "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/pretty" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) type ConsoleREPL struct { diff --git a/runtime/cmd/info/README.md b/cmd/info/README.md similarity index 100% rename from runtime/cmd/info/README.md rename to cmd/info/README.md diff --git a/runtime/cmd/info/main.go b/cmd/info/main.go similarity index 95% rename from runtime/cmd/info/main.go rename to cmd/info/main.go index fb8a56b277..5f737ba99c 100644 --- a/runtime/cmd/info/main.go +++ b/cmd/info/main.go @@ -25,13 +25,13 @@ import ( "golang.org/x/exp/slices" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - "github.com/onflow/cadence/runtime/tests/checker" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/parser" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + "github.com/onflow/cadence/tests/checker" ) type command struct { diff --git a/runtime/cmd/json-cdc/main.go b/cmd/json-cdc/main.go similarity index 100% rename from runtime/cmd/json-cdc/main.go rename to cmd/json-cdc/main.go diff --git a/runtime/cmd/main/main.go b/cmd/main/main.go similarity index 92% rename from runtime/cmd/main/main.go rename to cmd/main/main.go index 790ccc9c03..b62d037909 100644 --- a/runtime/cmd/main/main.go +++ b/cmd/main/main.go @@ -22,8 +22,8 @@ import ( "os" "os/signal" - "github.com/onflow/cadence/runtime/cmd/execute" - "github.com/onflow/cadence/runtime/interpreter" + "github.com/onflow/cadence/cmd/execute" + "github.com/onflow/cadence/interpreter" ) func main() { diff --git a/runtime/cmd/minifier/minifier.go b/cmd/minifier/minifier.go similarity index 100% rename from runtime/cmd/minifier/minifier.go rename to cmd/minifier/minifier.go diff --git a/runtime/cmd/minifier/minifier_test.go b/cmd/minifier/minifier_test.go similarity index 100% rename from runtime/cmd/minifier/minifier_test.go rename to cmd/minifier/minifier_test.go diff --git a/runtime/cmd/parse/main.go b/cmd/parse/main.go similarity index 97% rename from runtime/cmd/parse/main.go rename to cmd/parse/main.go index 1f2d3d4b93..6717f7f081 100644 --- a/runtime/cmd/parse/main.go +++ b/cmd/parse/main.go @@ -36,10 +36,10 @@ import ( "github.com/itchyny/gojq" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/pretty" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/parser" + "github.com/onflow/cadence/pretty" ) var benchFlag = flag.Bool("bench", false, "benchmark the parser") diff --git a/runtime/cmd/parse/main_wasm.go b/cmd/parse/main_wasm.go similarity index 94% rename from runtime/cmd/parse/main_wasm.go rename to cmd/parse/main_wasm.go index dcd089a91a..a9b8ce75de 100644 --- a/runtime/cmd/parse/main_wasm.go +++ b/cmd/parse/main_wasm.go @@ -26,8 +26,8 @@ import ( "runtime/debug" "syscall/js" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/parser" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/parser" ) const globalFunctionNamePrefix = "CADENCE_PARSER" diff --git a/runtime/common/address.go b/common/address.go similarity index 100% rename from runtime/common/address.go rename to common/address.go diff --git a/runtime/common/address_test.go b/common/address_test.go similarity index 100% rename from runtime/common/address_test.go rename to common/address_test.go diff --git a/runtime/common/addresslocation.go b/common/addresslocation.go similarity index 99% rename from runtime/common/addresslocation.go rename to common/addresslocation.go index ec296e7c31..e3047e135b 100644 --- a/runtime/common/addresslocation.go +++ b/common/addresslocation.go @@ -24,7 +24,7 @@ import ( "fmt" "strings" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) const AddressLocationPrefix = "A" diff --git a/runtime/common/addresslocation_test.go b/common/addresslocation_test.go similarity index 100% rename from runtime/common/addresslocation_test.go rename to common/addresslocation_test.go diff --git a/runtime/common/bigint.go b/common/bigint.go similarity index 98% rename from runtime/common/bigint.go rename to common/bigint.go index 63d58ce0e4..c71ae77fa3 100644 --- a/runtime/common/bigint.go +++ b/common/bigint.go @@ -21,7 +21,7 @@ package common import ( "math/big" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) var bigIntSize = BigIntByteLength(new(big.Int)) diff --git a/runtime/common/bigint_test.go b/common/bigint_test.go similarity index 100% rename from runtime/common/bigint_test.go rename to common/bigint_test.go diff --git a/runtime/common/bimap/bimap.go b/common/bimap/bimap.go similarity index 100% rename from runtime/common/bimap/bimap.go rename to common/bimap/bimap.go diff --git a/runtime/common/bimap/bimap_test.go b/common/bimap/bimap_test.go similarity index 100% rename from runtime/common/bimap/bimap_test.go rename to common/bimap/bimap_test.go diff --git a/runtime/common/compositekind.go b/common/compositekind.go similarity index 99% rename from runtime/common/compositekind.go rename to common/compositekind.go index c5f0198400..0139164eb8 100644 --- a/runtime/common/compositekind.go +++ b/common/compositekind.go @@ -21,7 +21,7 @@ package common import ( "encoding/json" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) //go:generate go run golang.org/x/tools/cmd/stringer -type=CompositeKind diff --git a/runtime/common/compositekind_string.go b/common/compositekind_string.go similarity index 100% rename from runtime/common/compositekind_string.go rename to common/compositekind_string.go diff --git a/runtime/common/compositekind_test.go b/common/compositekind_test.go similarity index 100% rename from runtime/common/compositekind_test.go rename to common/compositekind_test.go diff --git a/runtime/common/computationkind.go b/common/computationkind.go similarity index 100% rename from runtime/common/computationkind.go rename to common/computationkind.go diff --git a/runtime/common/computationkind_string.go b/common/computationkind_string.go similarity index 100% rename from runtime/common/computationkind_string.go rename to common/computationkind_string.go diff --git a/runtime/common/concat.go b/common/concat.go similarity index 100% rename from runtime/common/concat.go rename to common/concat.go diff --git a/runtime/common/controlstatement.go b/common/controlstatement.go similarity index 96% rename from runtime/common/controlstatement.go rename to common/controlstatement.go index b04ecfe8e5..46da80e5d6 100644 --- a/runtime/common/controlstatement.go +++ b/common/controlstatement.go @@ -19,7 +19,7 @@ package common import ( - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) //go:generate go run golang.org/x/tools/cmd/stringer -type=ControlStatement diff --git a/runtime/common/controlstatement_string.go b/common/controlstatement_string.go similarity index 100% rename from runtime/common/controlstatement_string.go rename to common/controlstatement_string.go diff --git a/runtime/common/declarationkind.go b/common/declarationkind.go similarity index 99% rename from runtime/common/declarationkind.go rename to common/declarationkind.go index 002b2b13f7..34f92a2db0 100644 --- a/runtime/common/declarationkind.go +++ b/common/declarationkind.go @@ -22,7 +22,7 @@ import ( "encoding/json" "math" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) //go:generate go run golang.org/x/tools/cmd/stringer -type=DeclarationKind diff --git a/runtime/common/declarationkind_string.go b/common/declarationkind_string.go similarity index 100% rename from runtime/common/declarationkind_string.go rename to common/declarationkind_string.go diff --git a/runtime/common/declarationkind_test.go b/common/declarationkind_test.go similarity index 100% rename from runtime/common/declarationkind_test.go rename to common/declarationkind_test.go diff --git a/runtime/common/deps/node.go b/common/deps/node.go similarity index 100% rename from runtime/common/deps/node.go rename to common/deps/node.go diff --git a/runtime/common/deps/node_test.go b/common/deps/node_test.go similarity index 98% rename from runtime/common/deps/node_test.go rename to common/deps/node_test.go index 3d96b1c807..689180e640 100644 --- a/runtime/common/deps/node_test.go +++ b/common/deps/node_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common/deps" + "github.com/onflow/cadence/common/deps" ) func TestNode_AllDependents(t *testing.T) { diff --git a/runtime/common/deps/set.go b/common/deps/set.go similarity index 97% rename from runtime/common/deps/set.go rename to common/deps/set.go index b638e827e0..c3f3361076 100644 --- a/runtime/common/deps/set.go +++ b/common/deps/set.go @@ -18,7 +18,7 @@ package deps -import "github.com/onflow/cadence/runtime/common/orderedmap" +import "github.com/onflow/cadence/common/orderedmap" // NodeSet is a set of Node type NodeSet interface { diff --git a/runtime/common/enumerate.go b/common/enumerate.go similarity index 100% rename from runtime/common/enumerate.go rename to common/enumerate.go diff --git a/runtime/common/identifierlocation.go b/common/identifierlocation.go similarity index 98% rename from runtime/common/identifierlocation.go rename to common/identifierlocation.go index d7e7ad794c..8ec05d9664 100644 --- a/runtime/common/identifierlocation.go +++ b/common/identifierlocation.go @@ -23,7 +23,7 @@ import ( "fmt" "strings" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) const IdentifierLocationPrefix = "I" diff --git a/runtime/common/identifierlocation_test.go b/common/identifierlocation_test.go similarity index 100% rename from runtime/common/identifierlocation_test.go rename to common/identifierlocation_test.go diff --git a/runtime/common/incomparable.go b/common/incomparable.go similarity index 100% rename from runtime/common/incomparable.go rename to common/incomparable.go diff --git a/runtime/common/integerliteralkind.go b/common/integerliteralkind.go similarity index 97% rename from runtime/common/integerliteralkind.go rename to common/integerliteralkind.go index 4275fa4955..c32d47f92a 100644 --- a/runtime/common/integerliteralkind.go +++ b/common/integerliteralkind.go @@ -19,7 +19,7 @@ package common import ( - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) //go:generate go run golang.org/x/tools/cmd/stringer -type=IntegerLiteralKind diff --git a/runtime/common/integerliteralkind_string.go b/common/integerliteralkind_string.go similarity index 100% rename from runtime/common/integerliteralkind_string.go rename to common/integerliteralkind_string.go diff --git a/runtime/common/intervalst/interval.go b/common/intervalst/interval.go similarity index 100% rename from runtime/common/intervalst/interval.go rename to common/intervalst/interval.go diff --git a/runtime/common/intervalst/intervalst.go b/common/intervalst/intervalst.go similarity index 100% rename from runtime/common/intervalst/intervalst.go rename to common/intervalst/intervalst.go diff --git a/runtime/common/intervalst/intervalst_test.go b/common/intervalst/intervalst_test.go similarity index 100% rename from runtime/common/intervalst/intervalst_test.go rename to common/intervalst/intervalst_test.go diff --git a/runtime/common/intervalst/node.go b/common/intervalst/node.go similarity index 100% rename from runtime/common/intervalst/node.go rename to common/intervalst/node.go diff --git a/runtime/common/list/list.go b/common/list/list.go similarity index 100% rename from runtime/common/list/list.go rename to common/list/list.go diff --git a/runtime/common/location.go b/common/location.go similarity index 99% rename from runtime/common/location.go rename to common/location.go index 239c669f8a..7765e19fd0 100644 --- a/runtime/common/location.go +++ b/common/location.go @@ -23,7 +23,7 @@ import ( "fmt" "strings" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) // Location describes the origin of a Cadence script. diff --git a/runtime/common/location_test.go b/common/location_test.go similarity index 100% rename from runtime/common/location_test.go rename to common/location_test.go diff --git a/runtime/common/memorykind.go b/common/memorykind.go similarity index 100% rename from runtime/common/memorykind.go rename to common/memorykind.go diff --git a/runtime/common/memorykind_string.go b/common/memorykind_string.go similarity index 100% rename from runtime/common/memorykind_string.go rename to common/memorykind_string.go diff --git a/runtime/common/metering.go b/common/metering.go similarity index 99% rename from runtime/common/metering.go rename to common/metering.go index a4b4afc2dd..43dce778d8 100644 --- a/runtime/common/metering.go +++ b/common/metering.go @@ -23,7 +23,7 @@ import ( "math/big" "unsafe" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) type MemoryUsage struct { diff --git a/runtime/common/operandside.go b/common/operandside.go similarity index 95% rename from runtime/common/operandside.go rename to common/operandside.go index 403d3bc29b..571b47645c 100644 --- a/runtime/common/operandside.go +++ b/common/operandside.go @@ -19,7 +19,7 @@ package common import ( - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) //go:generate go run golang.org/x/tools/cmd/stringer -type=OperandSide diff --git a/runtime/common/operandside_string.go b/common/operandside_string.go similarity index 100% rename from runtime/common/operandside_string.go rename to common/operandside_string.go diff --git a/runtime/common/operationkind.go b/common/operationkind.go similarity index 96% rename from runtime/common/operationkind.go rename to common/operationkind.go index 4a3279f54e..43b5a18e77 100644 --- a/runtime/common/operationkind.go +++ b/common/operationkind.go @@ -19,7 +19,7 @@ package common import ( - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) //go:generate go run golang.org/x/tools/cmd/stringer -type=OperationKind diff --git a/runtime/common/operationkind_string.go b/common/operationkind_string.go similarity index 100% rename from runtime/common/operationkind_string.go rename to common/operationkind_string.go diff --git a/runtime/common/orderedmap/orderedmap.go b/common/orderedmap/orderedmap.go similarity index 99% rename from runtime/common/orderedmap/orderedmap.go rename to common/orderedmap/orderedmap.go index 341721a0d8..0f96a457b4 100644 --- a/runtime/common/orderedmap/orderedmap.go +++ b/common/orderedmap/orderedmap.go @@ -22,7 +22,7 @@ package orderedmap import ( - "github.com/onflow/cadence/runtime/common/list" + "github.com/onflow/cadence/common/list" ) // OrderedMap diff --git a/runtime/common/orderedmap/orderedmap_test.go b/common/orderedmap/orderedmap_test.go similarity index 100% rename from runtime/common/orderedmap/orderedmap_test.go rename to common/orderedmap/orderedmap_test.go diff --git a/runtime/common/pathdomain.go b/common/pathdomain.go similarity index 97% rename from runtime/common/pathdomain.go rename to common/pathdomain.go index 61dab3009b..943301dc4c 100644 --- a/runtime/common/pathdomain.go +++ b/common/pathdomain.go @@ -19,7 +19,7 @@ package common import ( - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) //go:generate go run golang.org/x/tools/cmd/stringer -type=PathDomain diff --git a/runtime/common/pathdomain_string.go b/common/pathdomain_string.go similarity index 100% rename from runtime/common/pathdomain_string.go rename to common/pathdomain_string.go diff --git a/runtime/common/persistent/orderedset.go b/common/persistent/orderedset.go similarity index 98% rename from runtime/common/persistent/orderedset.go rename to common/persistent/orderedset.go index 86ef92f68e..3e2964c5a6 100644 --- a/runtime/common/persistent/orderedset.go +++ b/common/persistent/orderedset.go @@ -19,7 +19,7 @@ package persistent import ( - "github.com/onflow/cadence/runtime/common/orderedmap" + "github.com/onflow/cadence/common/orderedmap" ) type OrderedSet[T comparable] struct { diff --git a/runtime/common/persistent/orderedset_test.go b/common/persistent/orderedset_test.go similarity index 98% rename from runtime/common/persistent/orderedset_test.go rename to common/persistent/orderedset_test.go index 1b3f1682d5..09c3bd14d1 100644 --- a/runtime/common/persistent/orderedset_test.go +++ b/common/persistent/orderedset_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/onflow/cadence/runtime/common/persistent" + "github.com/onflow/cadence/common/persistent" ) func TestOrderedSet(t *testing.T) { diff --git a/runtime/common/repllocation.go b/common/repllocation.go similarity index 98% rename from runtime/common/repllocation.go rename to common/repllocation.go index a8dc95d353..c8130a5ec0 100644 --- a/runtime/common/repllocation.go +++ b/common/repllocation.go @@ -22,7 +22,7 @@ import ( "encoding/json" "strings" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) const REPLLocationPrefix = "REPL" diff --git a/runtime/common/repllocation_test.go b/common/repllocation_test.go similarity index 100% rename from runtime/common/repllocation_test.go rename to common/repllocation_test.go diff --git a/runtime/common/scriptlocation.go b/common/scriptlocation.go similarity index 98% rename from runtime/common/scriptlocation.go rename to common/scriptlocation.go index 24729706e1..a1b2607e88 100644 --- a/runtime/common/scriptlocation.go +++ b/common/scriptlocation.go @@ -24,7 +24,7 @@ import ( "fmt" "strings" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) const ScriptLocationPrefix = "s" diff --git a/runtime/common/scriptlocation_test.go b/common/scriptlocation_test.go similarity index 100% rename from runtime/common/scriptlocation_test.go rename to common/scriptlocation_test.go diff --git a/runtime/common/slice_utils.go b/common/slice_utils.go similarity index 100% rename from runtime/common/slice_utils.go rename to common/slice_utils.go diff --git a/runtime/common/slice_utils_test.go b/common/slice_utils_test.go similarity index 100% rename from runtime/common/slice_utils_test.go rename to common/slice_utils_test.go diff --git a/runtime/common/stringlocation.go b/common/stringlocation.go similarity index 98% rename from runtime/common/stringlocation.go rename to common/stringlocation.go index 304ebb44d1..205911b851 100644 --- a/runtime/common/stringlocation.go +++ b/common/stringlocation.go @@ -23,7 +23,7 @@ import ( "fmt" "strings" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) const StringLocationPrefix = "S" diff --git a/runtime/common/stringlocation_test.go b/common/stringlocation_test.go similarity index 100% rename from runtime/common/stringlocation_test.go rename to common/stringlocation_test.go diff --git a/runtime/common/transactionlocation.go b/common/transactionlocation.go similarity index 98% rename from runtime/common/transactionlocation.go rename to common/transactionlocation.go index 53647270d5..629dbc9e12 100644 --- a/runtime/common/transactionlocation.go +++ b/common/transactionlocation.go @@ -24,7 +24,7 @@ import ( "fmt" "strings" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) const TransactionLocationPrefix = "t" diff --git a/runtime/common/transactionlocation_test.go b/common/transactionlocation_test.go similarity index 100% rename from runtime/common/transactionlocation_test.go rename to common/transactionlocation_test.go diff --git a/runtime/compiler/codegen.go b/compiler/codegen.go similarity index 97% rename from runtime/compiler/codegen.go rename to compiler/codegen.go index b8ccfcafe4..9e67e0f9f0 100644 --- a/runtime/compiler/codegen.go +++ b/compiler/codegen.go @@ -21,9 +21,9 @@ package compiler import ( "fmt" - "github.com/onflow/cadence/runtime/compiler/ir" - "github.com/onflow/cadence/runtime/compiler/wasm" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/compiler/ir" + "github.com/onflow/cadence/compiler/wasm" + "github.com/onflow/cadence/errors" ) const RuntimeModuleName = "crt" diff --git a/runtime/compiler/codegen_test.go b/compiler/codegen_test.go similarity index 97% rename from runtime/compiler/codegen_test.go rename to compiler/codegen_test.go index 25be5ac816..ad1bd9fea8 100644 --- a/runtime/compiler/codegen_test.go +++ b/compiler/codegen_test.go @@ -23,8 +23,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/compiler/ir" - "github.com/onflow/cadence/runtime/compiler/wasm" + "github.com/onflow/cadence/compiler/ir" + "github.com/onflow/cadence/compiler/wasm" ) func TestWasmCodeGenSimple(t *testing.T) { diff --git a/runtime/compiler/compiler.go b/compiler/compiler.go similarity index 98% rename from runtime/compiler/compiler.go rename to compiler/compiler.go index 342333adaa..e879b50d46 100644 --- a/runtime/compiler/compiler.go +++ b/compiler/compiler.go @@ -19,11 +19,11 @@ package compiler import ( - "github.com/onflow/cadence/runtime/activations" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/compiler/ir" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/activations" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/compiler/ir" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/sema" ) type Compiler struct { diff --git a/runtime/compiler/compiler_test.go b/compiler/compiler_test.go similarity index 94% rename from runtime/compiler/compiler_test.go rename to compiler/compiler_test.go index 95061f2104..17acf177d1 100644 --- a/runtime/compiler/compiler_test.go +++ b/compiler/compiler_test.go @@ -23,8 +23,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/compiler/ir" - "github.com/onflow/cadence/runtime/tests/checker" + "github.com/onflow/cadence/compiler/ir" + "github.com/onflow/cadence/tests/checker" ) func TestCompilerSimple(t *testing.T) { diff --git a/runtime/compiler/ir/binop.go b/compiler/ir/binop.go similarity index 100% rename from runtime/compiler/ir/binop.go rename to compiler/ir/binop.go diff --git a/runtime/compiler/ir/binop_string.go b/compiler/ir/binop_string.go similarity index 100% rename from runtime/compiler/ir/binop_string.go rename to compiler/ir/binop_string.go diff --git a/runtime/compiler/ir/constant.go b/compiler/ir/constant.go similarity index 100% rename from runtime/compiler/ir/constant.go rename to compiler/ir/constant.go diff --git a/runtime/compiler/ir/expr.go b/compiler/ir/expr.go similarity index 100% rename from runtime/compiler/ir/expr.go rename to compiler/ir/expr.go diff --git a/runtime/compiler/ir/func.go b/compiler/ir/func.go similarity index 100% rename from runtime/compiler/ir/func.go rename to compiler/ir/func.go diff --git a/runtime/compiler/ir/local.go b/compiler/ir/local.go similarity index 100% rename from runtime/compiler/ir/local.go rename to compiler/ir/local.go diff --git a/runtime/compiler/ir/stmt.go b/compiler/ir/stmt.go similarity index 100% rename from runtime/compiler/ir/stmt.go rename to compiler/ir/stmt.go diff --git a/runtime/compiler/ir/unop.go b/compiler/ir/unop.go similarity index 100% rename from runtime/compiler/ir/unop.go rename to compiler/ir/unop.go diff --git a/runtime/compiler/ir/unop_string.go b/compiler/ir/unop_string.go similarity index 100% rename from runtime/compiler/ir/unop_string.go rename to compiler/ir/unop_string.go diff --git a/runtime/compiler/ir/valtype.go b/compiler/ir/valtype.go similarity index 100% rename from runtime/compiler/ir/valtype.go rename to compiler/ir/valtype.go diff --git a/runtime/compiler/ir/valtype_string.go b/compiler/ir/valtype_string.go similarity index 100% rename from runtime/compiler/ir/valtype_string.go rename to compiler/ir/valtype_string.go diff --git a/runtime/compiler/ir/visitor.go b/compiler/ir/visitor.go similarity index 100% rename from runtime/compiler/ir/visitor.go rename to compiler/ir/visitor.go diff --git a/runtime/compiler/local.go b/compiler/local.go similarity index 94% rename from runtime/compiler/local.go rename to compiler/local.go index 8ba8f7030d..8dc5ad765f 100644 --- a/runtime/compiler/local.go +++ b/compiler/local.go @@ -19,7 +19,7 @@ package compiler import ( - "github.com/onflow/cadence/runtime/compiler/ir" + "github.com/onflow/cadence/compiler/ir" ) type Local struct { diff --git a/runtime/compiler/wasm/block.go b/compiler/wasm/block.go similarity index 100% rename from runtime/compiler/wasm/block.go rename to compiler/wasm/block.go diff --git a/runtime/compiler/wasm/blocktype.go b/compiler/wasm/blocktype.go similarity index 100% rename from runtime/compiler/wasm/blocktype.go rename to compiler/wasm/blocktype.go diff --git a/runtime/compiler/wasm/buf.go b/compiler/wasm/buf.go similarity index 100% rename from runtime/compiler/wasm/buf.go rename to compiler/wasm/buf.go diff --git a/runtime/compiler/wasm/data.go b/compiler/wasm/data.go similarity index 100% rename from runtime/compiler/wasm/data.go rename to compiler/wasm/data.go diff --git a/runtime/compiler/wasm/errors.go b/compiler/wasm/errors.go similarity index 100% rename from runtime/compiler/wasm/errors.go rename to compiler/wasm/errors.go diff --git a/runtime/compiler/wasm/export.go b/compiler/wasm/export.go similarity index 100% rename from runtime/compiler/wasm/export.go rename to compiler/wasm/export.go diff --git a/runtime/compiler/wasm/function.go b/compiler/wasm/function.go similarity index 100% rename from runtime/compiler/wasm/function.go rename to compiler/wasm/function.go diff --git a/runtime/compiler/wasm/functiontype.go b/compiler/wasm/functiontype.go similarity index 100% rename from runtime/compiler/wasm/functiontype.go rename to compiler/wasm/functiontype.go diff --git a/runtime/compiler/wasm/gen/main.go b/compiler/wasm/gen/main.go similarity index 100% rename from runtime/compiler/wasm/gen/main.go rename to compiler/wasm/gen/main.go diff --git a/runtime/compiler/wasm/import.go b/compiler/wasm/import.go similarity index 100% rename from runtime/compiler/wasm/import.go rename to compiler/wasm/import.go diff --git a/runtime/compiler/wasm/instruction.go b/compiler/wasm/instruction.go similarity index 100% rename from runtime/compiler/wasm/instruction.go rename to compiler/wasm/instruction.go diff --git a/runtime/compiler/wasm/instructions.go b/compiler/wasm/instructions.go similarity index 100% rename from runtime/compiler/wasm/instructions.go rename to compiler/wasm/instructions.go diff --git a/runtime/compiler/wasm/leb128.go b/compiler/wasm/leb128.go similarity index 100% rename from runtime/compiler/wasm/leb128.go rename to compiler/wasm/leb128.go diff --git a/runtime/compiler/wasm/leb128_test.go b/compiler/wasm/leb128_test.go similarity index 100% rename from runtime/compiler/wasm/leb128_test.go rename to compiler/wasm/leb128_test.go diff --git a/runtime/compiler/wasm/magic.go b/compiler/wasm/magic.go similarity index 100% rename from runtime/compiler/wasm/magic.go rename to compiler/wasm/magic.go diff --git a/runtime/compiler/wasm/memory.go b/compiler/wasm/memory.go similarity index 100% rename from runtime/compiler/wasm/memory.go rename to compiler/wasm/memory.go diff --git a/runtime/compiler/wasm/module.go b/compiler/wasm/module.go similarity index 100% rename from runtime/compiler/wasm/module.go rename to compiler/wasm/module.go diff --git a/runtime/compiler/wasm/modulebuilder.go b/compiler/wasm/modulebuilder.go similarity index 100% rename from runtime/compiler/wasm/modulebuilder.go rename to compiler/wasm/modulebuilder.go diff --git a/runtime/compiler/wasm/opcode.go b/compiler/wasm/opcode.go similarity index 100% rename from runtime/compiler/wasm/opcode.go rename to compiler/wasm/opcode.go diff --git a/runtime/compiler/wasm/reader.go b/compiler/wasm/reader.go similarity index 100% rename from runtime/compiler/wasm/reader.go rename to compiler/wasm/reader.go diff --git a/runtime/compiler/wasm/reader_test.go b/compiler/wasm/reader_test.go similarity index 100% rename from runtime/compiler/wasm/reader_test.go rename to compiler/wasm/reader_test.go diff --git a/runtime/compiler/wasm/section.go b/compiler/wasm/section.go similarity index 100% rename from runtime/compiler/wasm/section.go rename to compiler/wasm/section.go diff --git a/runtime/compiler/wasm/valuetype.go b/compiler/wasm/valuetype.go similarity index 100% rename from runtime/compiler/wasm/valuetype.go rename to compiler/wasm/valuetype.go diff --git a/runtime/compiler/wasm/wasm.go b/compiler/wasm/wasm.go similarity index 100% rename from runtime/compiler/wasm/wasm.go rename to compiler/wasm/wasm.go diff --git a/runtime/compiler/wasm/wasm2wat.go b/compiler/wasm/wasm2wat.go similarity index 100% rename from runtime/compiler/wasm/wasm2wat.go rename to compiler/wasm/wasm2wat.go diff --git a/runtime/compiler/wasm/writer.go b/compiler/wasm/writer.go similarity index 100% rename from runtime/compiler/wasm/writer.go rename to compiler/wasm/writer.go diff --git a/runtime/compiler/wasm/writer_test.go b/compiler/wasm/writer_test.go similarity index 100% rename from runtime/compiler/wasm/writer_test.go rename to compiler/wasm/writer_test.go diff --git a/docs/FAQ.md b/docs/FAQ.md index 59c80927a9..54b497e611 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -43,7 +43,7 @@ There are several options to run the analyzer pass with the linter tool: ## Analyzing Cadence values / state snapshots -To analyze Cadence values (`interpreter.Value`), you can use the function [`interpreter.InspectValue`](https://github.com/onflow/cadence/blob/master/runtime/interpreter/inspect.go#L31). +To analyze Cadence values (`interpreter.Value`), you can use the function [`interpreter.InspectValue`](https://github.com/onflow/cadence/blob/master/interpreter/inspect.go#L31). To find static types in Cadence values (e.g. in type values, containers, capabilities), you can see which values contain static types in the [Cadence 1.0 static type migration code](https://github.com/onflow/cadence/blob/master/migrations/statictypes/statictype_migration.go#L67). diff --git a/docs/development.md b/docs/development.md index 77544d51ab..4a166bba19 100644 --- a/docs/development.md +++ b/docs/development.md @@ -2,17 +2,17 @@ ## Tools -The [`runtime/cmd` directory](https://github.com/onflow/cadence/tree/master/runtime/cmd) +The [`cmd` directory](https://github.com/onflow/cadence/tree/master/cmd) contains command-line tools that are useful when working on the implementation for Cadence, or with Cadence code: -- The [`parse`](https://github.com/onflow/cadence/tree/master/runtime/cmd/parse) tool +- The [`parse`](https://github.com/onflow/cadence/tree/master/cmd/parse) tool can be used to parse (syntactically analyze) Cadence code. By default, it reports syntactical errors in the given Cadence program, if any, in a human-readable format. By providing the `-json` it returns the AST of the program in JSON format if the given program is syntactically valid, or syntactical errors in JSON format (including position information). ``` - $ echo "X" | go run ./runtime/cmd/parse + $ echo "X" | go run ./cmd/parse error: unexpected token: identifier --> :1:0 | @@ -21,7 +21,7 @@ contains command-line tools that are useful when working on the implementation f ``` ``` - $ echo "let x = 1" | go run ./runtime/cmd/parse -json + $ echo "let x = 1" | go run ./cmd/parse -json [ { "program": { @@ -42,13 +42,13 @@ contains command-line tools that are useful when working on the implementation f [...] ``` -- The [`check`](https://github.com/onflow/cadence/tree/master/runtime/cmd/check) tool +- The [`check`](https://github.com/onflow/cadence/tree/master/cmd/check) tool can be used to check (semantically analyze) Cadence code. By default, it reports semantic errors in the given Cadence program, if any, in a human-readable format. By providing the `-json` it returns the AST in JSON format, or semantic errors in JSON format (including position information). ``` - $ echo "let x = 1" | go run ./runtime/cmd/check 1 ↵ + $ echo "let x = 1" | go run ./cmd/check 1 ↵ error: error: missing access modifier for constant --> :1:0 | @@ -56,14 +56,14 @@ contains command-line tools that are useful when working on the implementation f | ^ ``` -- The [`main`](https://github.com/onflow/cadence/tree/master/runtime/cmd/check) tools +- The [`main`](https://github.com/onflow/cadence/tree/master/cmd/check) tools can be used to execute Cadence programs. If a no argument is provided, the REPL (Read-Eval-Print-Loop) is started. If an argument is provided, the Cadence program at the given path is executed. The program must have a function named `main` which has no parameters and no return type. ``` - $ go run ./runtime/cmd/main 130 ↵ + $ go run ./cmd/main 130 ↵ Welcome to Cadence v0.12.3! Type '.help' for assistance. @@ -74,7 +74,7 @@ contains command-line tools that are useful when working on the implementation f ``` $ echo 'pub fun main () { log("Hello, world!") }' > hello.cdc - $ go run ./runtime/cmd/main hello.cdc + $ go run ./cmd/main hello.cdc "Hello, world!" ``` @@ -83,7 +83,7 @@ contains command-line tools that are useful when working on the implementation f Run the checker tests with the `cadence.checkConcurrently` flag, e.g. ```shell -go test -race -v ./runtime/tests/checker -cadence.checkConcurrently=10 +go test -race -v ./tests/checker -cadence.checkConcurrently=10 ``` This runs each check of a checker test 10 times, concurrently, diff --git a/encoding/ccf/ccf_test.go b/encoding/ccf/ccf_test.go index f4eeacce09..db427edd67 100644 --- a/encoding/ccf/ccf_test.go +++ b/encoding/ccf/ccf_test.go @@ -32,15 +32,15 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" "github.com/onflow/cadence/encoding/ccf" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/checker" - "github.com/onflow/cadence/runtime/tests/runtime_utils" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/checker" + "github.com/onflow/cadence/tests/runtime_utils" + "github.com/onflow/cadence/tests/utils" ) var deterministicEncMode, _ = ccf.EncOptions{ diff --git a/encoding/ccf/ccf_type_id_test.go b/encoding/ccf/ccf_type_id_test.go index eda0d4938c..271623e4e4 100644 --- a/encoding/ccf/ccf_type_id_test.go +++ b/encoding/ccf/ccf_type_id_test.go @@ -25,7 +25,7 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/tests/utils" ) func TestCCFTypeID(t *testing.T) { diff --git a/encoding/ccf/consts.go b/encoding/ccf/consts.go index a3d642b7c0..f4d25b2d01 100644 --- a/encoding/ccf/consts.go +++ b/encoding/ccf/consts.go @@ -20,7 +20,7 @@ package ccf import ( "github.com/onflow/cadence" - "github.com/onflow/cadence/runtime/common/bimap" + "github.com/onflow/cadence/common/bimap" ) // CCF uses CBOR tag numbers 128-255, which are unassigned by [IANA] diff --git a/encoding/ccf/decode.go b/encoding/ccf/decode.go index 990b21605b..db5ab6d09f 100644 --- a/encoding/ccf/decode.go +++ b/encoding/ccf/decode.go @@ -29,8 +29,8 @@ import ( "github.com/fxamacker/cbor/v2" "github.com/onflow/cadence" - "github.com/onflow/cadence/runtime/common" - cadenceErrors "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/common" + cadenceErrors "github.com/onflow/cadence/errors" ) // HasMsgPrefix returns true if the msg prefix (first few bytes) diff --git a/encoding/ccf/decode_type.go b/encoding/ccf/decode_type.go index 97ca958718..6d8eb3ba13 100644 --- a/encoding/ccf/decode_type.go +++ b/encoding/ccf/decode_type.go @@ -25,8 +25,8 @@ import ( "github.com/fxamacker/cbor/v2" "github.com/onflow/cadence" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) type cadenceTypeID string diff --git a/encoding/ccf/decode_typedef.go b/encoding/ccf/decode_typedef.go index 11c4dd583e..192260d52e 100644 --- a/encoding/ccf/decode_typedef.go +++ b/encoding/ccf/decode_typedef.go @@ -23,8 +23,8 @@ import ( "fmt" "github.com/onflow/cadence" - "github.com/onflow/cadence/runtime/common" - cadenceErrors "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/common" + cadenceErrors "github.com/onflow/cadence/errors" ) type rawFieldsWithCCFTypeID struct { diff --git a/encoding/ccf/encode.go b/encoding/ccf/encode.go index f7fa8a8ca5..1c79c148b9 100644 --- a/encoding/ccf/encode.go +++ b/encoding/ccf/encode.go @@ -30,7 +30,7 @@ import ( "github.com/fxamacker/cbor/v2" "github.com/onflow/cadence" - cadenceErrors "github.com/onflow/cadence/runtime/errors" + cadenceErrors "github.com/onflow/cadence/errors" ) // defaultCBOREncMode diff --git a/encoding/ccf/encode_type.go b/encoding/ccf/encode_type.go index 6cec19e9bc..d952fe6e93 100644 --- a/encoding/ccf/encode_type.go +++ b/encoding/ccf/encode_type.go @@ -23,7 +23,7 @@ import ( "sort" "github.com/onflow/cadence" - cadenceErrors "github.com/onflow/cadence/runtime/errors" + cadenceErrors "github.com/onflow/cadence/errors" ) type encodeTypeFn func(typ cadence.Type, tids ccfTypeIDByCadenceType) error diff --git a/encoding/ccf/encode_typedef.go b/encoding/ccf/encode_typedef.go index 844f1cc0d0..50e84687f2 100644 --- a/encoding/ccf/encode_typedef.go +++ b/encoding/ccf/encode_typedef.go @@ -20,7 +20,7 @@ package ccf import ( "github.com/onflow/cadence" - cadenceErrors "github.com/onflow/cadence/runtime/errors" + cadenceErrors "github.com/onflow/cadence/errors" ) // encodeCompositeType encodes cadence.CompositeType in type definition as diff --git a/encoding/ccf/service_events_test.go b/encoding/ccf/service_events_test.go index b6e7c3c74a..d2b727e4cd 100644 --- a/encoding/ccf/service_events_test.go +++ b/encoding/ccf/service_events_test.go @@ -24,8 +24,8 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" "github.com/onflow/cadence/encoding/ccf" - "github.com/onflow/cadence/runtime/common" ) func TestEpochSetupEvent(t *testing.T) { diff --git a/encoding/ccf/simpletype.go b/encoding/ccf/simpletype.go index ec80866428..f30e6b44f8 100644 --- a/encoding/ccf/simpletype.go +++ b/encoding/ccf/simpletype.go @@ -22,7 +22,7 @@ package ccf import ( "github.com/onflow/cadence" - "github.com/onflow/cadence/runtime/common/bimap" + "github.com/onflow/cadence/common/bimap" ) // Simple type ID is a compact representation of a type diff --git a/encoding/ccf/simpletype_test.go b/encoding/ccf/simpletype_test.go index ea4e2d0b0d..528df7d2c7 100644 --- a/encoding/ccf/simpletype_test.go +++ b/encoding/ccf/simpletype_test.go @@ -24,9 +24,9 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/interpreter" "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestTypeConversion(t *testing.T) { diff --git a/encoding/ccf/sort.go b/encoding/ccf/sort.go index 78e22dc2f3..5d098745a8 100644 --- a/encoding/ccf/sort.go +++ b/encoding/ccf/sort.go @@ -22,7 +22,7 @@ import ( "bytes" "github.com/onflow/cadence" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) // bytewiseFieldSorter diff --git a/encoding/json/decode.go b/encoding/json/decode.go index ff9b3400fd..0c01820f57 100644 --- a/encoding/json/decode.go +++ b/encoding/json/decode.go @@ -29,10 +29,10 @@ import ( _ "unsafe" "github.com/onflow/cadence" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) // A Decoder decodes JSON-encoded representations of Cadence values. diff --git a/encoding/json/encode.go b/encoding/json/encode.go index 5edfeab676..633f411ae2 100644 --- a/encoding/json/encode.go +++ b/encoding/json/encode.go @@ -30,8 +30,8 @@ import ( _ "unsafe" "github.com/onflow/cadence" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) // An Encoder converts Cadence values into JSON-encoded bytes. diff --git a/encoding/json/encoding_test.go b/encoding/json/encoding_test.go index c9fc888abc..5a22360dd0 100644 --- a/encoding/json/encoding_test.go +++ b/encoding/json/encoding_test.go @@ -28,14 +28,14 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/tests/checker" + "github.com/onflow/cadence/tests/checker" "github.com/onflow/cadence" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/utils" ) type encodeTest struct { diff --git a/runtime/errors/errors.go b/errors/errors.go similarity index 100% rename from runtime/errors/errors.go rename to errors/errors.go diff --git a/runtime/errors/wrappanic.go b/errors/wrappanic.go similarity index 100% rename from runtime/errors/wrappanic.go rename to errors/wrappanic.go diff --git a/runtime/format/address.go b/format/address.go similarity index 94% rename from runtime/format/address.go rename to format/address.go index ac21faafc9..c68a3d9c58 100644 --- a/runtime/format/address.go +++ b/format/address.go @@ -19,7 +19,7 @@ package format import ( - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) func Address(address common.Address) string { diff --git a/runtime/format/array.go b/format/array.go similarity index 100% rename from runtime/format/array.go rename to format/array.go diff --git a/runtime/format/bool.go b/format/bool.go similarity index 100% rename from runtime/format/bool.go rename to format/bool.go diff --git a/runtime/format/bytes.go b/format/bytes.go similarity index 100% rename from runtime/format/bytes.go rename to format/bytes.go diff --git a/runtime/format/bytes_test.go b/format/bytes_test.go similarity index 100% rename from runtime/format/bytes_test.go rename to format/bytes_test.go diff --git a/runtime/format/capability.go b/format/capability.go similarity index 100% rename from runtime/format/capability.go rename to format/capability.go diff --git a/runtime/format/composite.go b/format/composite.go similarity index 100% rename from runtime/format/composite.go rename to format/composite.go diff --git a/runtime/format/dictionary.go b/format/dictionary.go similarity index 100% rename from runtime/format/dictionary.go rename to format/dictionary.go diff --git a/runtime/format/fix.go b/format/fix.go similarity index 100% rename from runtime/format/fix.go rename to format/fix.go diff --git a/runtime/format/fix_test.go b/format/fix_test.go similarity index 100% rename from runtime/format/fix_test.go rename to format/fix_test.go diff --git a/runtime/format/int.go b/format/int.go similarity index 100% rename from runtime/format/int.go rename to format/int.go diff --git a/runtime/format/nil.go b/format/nil.go similarity index 100% rename from runtime/format/nil.go rename to format/nil.go diff --git a/runtime/format/pad.go b/format/pad.go similarity index 100% rename from runtime/format/pad.go rename to format/pad.go diff --git a/runtime/format/path.go b/format/path.go similarity index 100% rename from runtime/format/path.go rename to format/path.go diff --git a/runtime/format/reference.go b/format/reference.go similarity index 100% rename from runtime/format/reference.go rename to format/reference.go diff --git a/runtime/format/string.go b/format/string.go similarity index 96% rename from runtime/format/string.go rename to format/string.go index 2bea75f9b3..cc37c507ff 100644 --- a/runtime/format/string.go +++ b/format/string.go @@ -19,7 +19,7 @@ package format import ( - "github.com/onflow/cadence/runtime/ast" + "github.com/onflow/cadence/ast" ) func String(s string) string { diff --git a/runtime/format/type.go b/format/type.go similarity index 100% rename from runtime/format/type.go rename to format/type.go diff --git a/runtime/format/void.go b/format/void.go similarity index 100% rename from runtime/format/void.go rename to format/void.go diff --git a/fuzz.go b/fuzz.go index f8506c96ea..35774a3137 100644 --- a/fuzz.go +++ b/fuzz.go @@ -21,9 +21,9 @@ package cadence import ( "unicode/utf8" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/parser" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/utils" ) func Fuzz(data []byte) int { diff --git a/runtime/interpreter/big.go b/interpreter/big.go similarity index 98% rename from runtime/interpreter/big.go rename to interpreter/big.go index 5a503a2a14..463bcc3f7b 100644 --- a/runtime/interpreter/big.go +++ b/interpreter/big.go @@ -21,7 +21,7 @@ package interpreter import ( "math/big" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) func SignedBigIntToBigEndianBytes(bigInt *big.Int) []byte { diff --git a/runtime/interpreter/config.go b/interpreter/config.go similarity index 98% rename from runtime/interpreter/config.go rename to interpreter/config.go index dc052342d1..1d921085f2 100644 --- a/runtime/interpreter/config.go +++ b/interpreter/config.go @@ -19,7 +19,7 @@ package interpreter import ( - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) type Config struct { diff --git a/runtime/interpreter/conversion.go b/interpreter/conversion.go similarity index 97% rename from runtime/interpreter/conversion.go rename to interpreter/conversion.go index 4e43b56c04..7c1288c1e8 100644 --- a/runtime/interpreter/conversion.go +++ b/interpreter/conversion.go @@ -21,8 +21,8 @@ package interpreter import ( "math" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" ) func ByteArrayValueToByteSlice(interpreter *Interpreter, value Value, locationRange LocationRange) ([]byte, error) { diff --git a/runtime/interpreter/conversion_test.go b/interpreter/conversion_test.go similarity index 97% rename from runtime/interpreter/conversion_test.go rename to interpreter/conversion_test.go index 35de4bc0e9..a3eb0122a0 100644 --- a/runtime/interpreter/conversion_test.go +++ b/interpreter/conversion_test.go @@ -25,9 +25,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - . "github.com/onflow/cadence/runtime/interpreter" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/common" + . "github.com/onflow/cadence/interpreter" + . "github.com/onflow/cadence/tests/utils" ) func TestByteArrayValueToByteSlice(t *testing.T) { diff --git a/runtime/interpreter/debugger.go b/interpreter/debugger.go similarity index 96% rename from runtime/interpreter/debugger.go rename to interpreter/debugger.go index 541a5cefaa..9b99f8cb5d 100644 --- a/runtime/interpreter/debugger.go +++ b/interpreter/debugger.go @@ -23,8 +23,8 @@ import ( "github.com/bits-and-blooms/bitset" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) type Stop struct { diff --git a/runtime/interpreter/decode.go b/interpreter/decode.go similarity index 99% rename from runtime/interpreter/decode.go rename to interpreter/decode.go index 905f4e90a1..8fd29b9c90 100644 --- a/runtime/interpreter/decode.go +++ b/interpreter/decode.go @@ -26,9 +26,9 @@ import ( "github.com/fxamacker/cbor/v2" "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/sema" ) var CBORDecMode = func() cbor.DecMode { diff --git a/runtime/interpreter/deepcopyremove_test.go b/interpreter/deepcopyremove_test.go similarity index 93% rename from runtime/interpreter/deepcopyremove_test.go rename to interpreter/deepcopyremove_test.go index 3f855e1784..5521332900 100644 --- a/runtime/interpreter/deepcopyremove_test.go +++ b/interpreter/deepcopyremove_test.go @@ -25,9 +25,9 @@ import ( "github.com/onflow/atree" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - . "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/common" + . "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/tests/utils" ) func TestValueDeepCopyAndDeepRemove(t *testing.T) { diff --git a/runtime/interpreter/div_mod_test.go b/interpreter/div_mod_test.go similarity index 99% rename from runtime/interpreter/div_mod_test.go rename to interpreter/div_mod_test.go index 9b84104fdf..a2f303040d 100644 --- a/runtime/interpreter/div_mod_test.go +++ b/interpreter/div_mod_test.go @@ -25,8 +25,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - . "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + . "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) func TestDivModUInt8(t *testing.T) { diff --git a/runtime/interpreter/encode.go b/interpreter/encode.go similarity index 99% rename from runtime/interpreter/encode.go rename to interpreter/encode.go index ddb2415575..02a86e5819 100644 --- a/runtime/interpreter/encode.go +++ b/interpreter/encode.go @@ -27,8 +27,8 @@ import ( "github.com/fxamacker/cbor/v2" "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" ) const cborTagSize = 2 diff --git a/runtime/interpreter/encoding_benchmark_test.go b/interpreter/encoding_benchmark_test.go similarity index 98% rename from runtime/interpreter/encoding_benchmark_test.go rename to interpreter/encoding_benchmark_test.go index 3c00608d65..abaa0231fc 100644 --- a/runtime/interpreter/encoding_benchmark_test.go +++ b/interpreter/encoding_benchmark_test.go @@ -33,7 +33,7 @@ package interpreter_test // "strings" // "testing" // -// "github.com/onflow/cadence/runtime/common" +// "github.com/onflow/cadence/common" // "github.com/stretchr/testify/require" //) // diff --git a/runtime/interpreter/encoding_test.go b/interpreter/encoding_test.go similarity index 99% rename from runtime/interpreter/encoding_test.go rename to interpreter/encoding_test.go index ff43bb8663..5bcc19bc7e 100644 --- a/runtime/interpreter/encoding_test.go +++ b/interpreter/encoding_test.go @@ -30,12 +30,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - . "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + . "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/tests/utils" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/tests/utils" + . "github.com/onflow/cadence/tests/utils" ) type encodeDecodeTest struct { diff --git a/runtime/interpreter/errors.go b/interpreter/errors.go similarity index 99% rename from runtime/interpreter/errors.go rename to interpreter/errors.go index 331e0db9bb..d70dcf4848 100644 --- a/runtime/interpreter/errors.go +++ b/interpreter/errors.go @@ -23,11 +23,11 @@ import ( "runtime" "strings" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/pretty" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/pretty" + "github.com/onflow/cadence/sema" ) // unsupportedOperation diff --git a/runtime/interpreter/errors_test.go b/interpreter/errors_test.go similarity index 89% rename from runtime/interpreter/errors_test.go rename to interpreter/errors_test.go index 7ade010b1d..568158cf58 100644 --- a/runtime/interpreter/errors_test.go +++ b/interpreter/errors_test.go @@ -23,10 +23,10 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - . "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + . "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/tests/utils" ) func TestOverwriteError_Error(t *testing.T) { diff --git a/runtime/interpreter/globalvariables.go b/interpreter/globalvariables.go similarity index 100% rename from runtime/interpreter/globalvariables.go rename to interpreter/globalvariables.go diff --git a/runtime/interpreter/hashablevalue.go b/interpreter/hashablevalue.go similarity index 100% rename from runtime/interpreter/hashablevalue.go rename to interpreter/hashablevalue.go diff --git a/runtime/interpreter/hashablevalue_test.go b/interpreter/hashablevalue_test.go similarity index 100% rename from runtime/interpreter/hashablevalue_test.go rename to interpreter/hashablevalue_test.go diff --git a/runtime/interpreter/import.go b/interpreter/import.go similarity index 96% rename from runtime/interpreter/import.go rename to interpreter/import.go index 6ae7582d85..16f25ea8c8 100644 --- a/runtime/interpreter/import.go +++ b/interpreter/import.go @@ -19,7 +19,7 @@ package interpreter import ( - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) // Import diff --git a/runtime/interpreter/inclusive_range_iterator.go b/interpreter/inclusive_range_iterator.go similarity index 96% rename from runtime/interpreter/inclusive_range_iterator.go rename to interpreter/inclusive_range_iterator.go index 5ee532a1fa..72f94cf000 100644 --- a/runtime/interpreter/inclusive_range_iterator.go +++ b/interpreter/inclusive_range_iterator.go @@ -19,8 +19,8 @@ package interpreter import ( - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/sema" ) type InclusiveRangeIterator struct { diff --git a/runtime/interpreter/inspect.go b/interpreter/inspect.go similarity index 100% rename from runtime/interpreter/inspect.go rename to interpreter/inspect.go diff --git a/runtime/interpreter/inspect_test.go b/interpreter/inspect_test.go similarity index 95% rename from runtime/interpreter/inspect_test.go rename to interpreter/inspect_test.go index afb4862f2c..da6e78537e 100644 --- a/runtime/interpreter/inspect_test.go +++ b/interpreter/inspect_test.go @@ -21,9 +21,9 @@ package interpreter_test import ( "testing" - "github.com/onflow/cadence/runtime/common" - . "github.com/onflow/cadence/runtime/interpreter" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/common" + . "github.com/onflow/cadence/interpreter" + . "github.com/onflow/cadence/tests/utils" ) func TestInspectValue(t *testing.T) { diff --git a/runtime/interpreter/integer.go b/interpreter/integer.go similarity index 98% rename from runtime/interpreter/integer.go rename to interpreter/integer.go index 873b8c0028..adf603fee6 100644 --- a/runtime/interpreter/integer.go +++ b/interpreter/integer.go @@ -21,7 +21,7 @@ package interpreter import ( "sync" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) func GetSmallIntegerValue(value int8, staticType StaticType) IntegerValue { diff --git a/runtime/interpreter/interpreter.go b/interpreter/interpreter.go similarity index 99% rename from runtime/interpreter/interpreter.go rename to interpreter/interpreter.go index 27b0735ea0..2835c13112 100644 --- a/runtime/interpreter/interpreter.go +++ b/interpreter/interpreter.go @@ -34,13 +34,13 @@ import ( "github.com/onflow/atree" "go.opentelemetry.io/otel/attribute" + "github.com/onflow/cadence/activations" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/common/orderedmap" + "github.com/onflow/cadence/errors" "github.com/onflow/cadence/fixedpoint" - "github.com/onflow/cadence/runtime/activations" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/common/orderedmap" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) type getterSetter struct { diff --git a/runtime/interpreter/interpreter_expression.go b/interpreter/interpreter_expression.go similarity index 99% rename from runtime/interpreter/interpreter_expression.go rename to interpreter/interpreter_expression.go index e7b315f387..60cf329af1 100644 --- a/runtime/interpreter/interpreter_expression.go +++ b/interpreter/interpreter_expression.go @@ -24,11 +24,11 @@ import ( "github.com/onflow/atree" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" "github.com/onflow/cadence/fixedpoint" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) // assignmentGetterSetter returns a getter/setter function pair diff --git a/runtime/interpreter/interpreter_import.go b/interpreter/interpreter_import.go similarity index 96% rename from runtime/interpreter/interpreter_import.go rename to interpreter/interpreter_import.go index 1318a43466..4d92962417 100644 --- a/runtime/interpreter/interpreter_import.go +++ b/interpreter/interpreter_import.go @@ -22,9 +22,9 @@ import ( "sort" "time" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) func (interpreter *Interpreter) VisitImportDeclaration(declaration *ast.ImportDeclaration) StatementResult { diff --git a/runtime/interpreter/interpreter_invocation.go b/interpreter/interpreter_invocation.go similarity index 98% rename from runtime/interpreter/interpreter_invocation.go rename to interpreter/interpreter_invocation.go index afc19e7a3f..19eb4050ad 100644 --- a/runtime/interpreter/interpreter_invocation.go +++ b/interpreter/interpreter_invocation.go @@ -21,8 +21,8 @@ package interpreter import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/sema" ) func (interpreter *Interpreter) InvokeFunctionValue( diff --git a/runtime/interpreter/interpreter_statement.go b/interpreter/interpreter_statement.go similarity index 98% rename from runtime/interpreter/interpreter_statement.go rename to interpreter/interpreter_statement.go index 9170eaa0ce..da7aaa0d2c 100644 --- a/runtime/interpreter/interpreter_statement.go +++ b/interpreter/interpreter_statement.go @@ -19,10 +19,10 @@ package interpreter import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/sema" ) func (interpreter *Interpreter) evalStatement(statement ast.Statement) StatementResult { diff --git a/runtime/interpreter/interpreter_test.go b/interpreter/interpreter_test.go similarity index 96% rename from runtime/interpreter/interpreter_test.go rename to interpreter/interpreter_test.go index bf79b8b9ba..f69e7d77ea 100644 --- a/runtime/interpreter/interpreter_test.go +++ b/interpreter/interpreter_test.go @@ -24,9 +24,9 @@ import ( "github.com/stretchr/testify/assert" - "github.com/onflow/cadence/runtime/common" - . "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + . "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) func TestInterpreterOptionalBoxing(t *testing.T) { diff --git a/runtime/interpreter/interpreter_tracing.go b/interpreter/interpreter_tracing.go similarity index 100% rename from runtime/interpreter/interpreter_tracing.go rename to interpreter/interpreter_tracing.go diff --git a/runtime/interpreter/interpreter_tracing_test.go b/interpreter/interpreter_tracing_test.go similarity index 97% rename from runtime/interpreter/interpreter_tracing_test.go rename to interpreter/interpreter_tracing_test.go index 99b0f682d2..dfcfc16521 100644 --- a/runtime/interpreter/interpreter_tracing_test.go +++ b/interpreter/interpreter_tracing_test.go @@ -26,9 +26,9 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/otel/attribute" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/tests/utils" ) func setupInterpreterWithTracingCallBack( diff --git a/runtime/interpreter/interpreter_transaction.go b/interpreter/interpreter_transaction.go similarity index 98% rename from runtime/interpreter/interpreter_transaction.go rename to interpreter/interpreter_transaction.go index bf594e791e..bc8c696fc4 100644 --- a/runtime/interpreter/interpreter_transaction.go +++ b/interpreter/interpreter_transaction.go @@ -19,8 +19,8 @@ package interpreter import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/sema" ) func (interpreter *Interpreter) VisitTransactionDeclaration(declaration *ast.TransactionDeclaration) StatementResult { diff --git a/runtime/interpreter/invocation.go b/interpreter/invocation.go similarity index 95% rename from runtime/interpreter/invocation.go rename to interpreter/invocation.go index 7fde502b71..a96601f3aa 100644 --- a/runtime/interpreter/invocation.go +++ b/interpreter/invocation.go @@ -19,8 +19,8 @@ package interpreter import ( - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) // Invocation diff --git a/runtime/interpreter/location.go b/interpreter/location.go similarity index 94% rename from runtime/interpreter/location.go rename to interpreter/location.go index 674ebb8842..7e24b31c9c 100644 --- a/runtime/interpreter/location.go +++ b/interpreter/location.go @@ -19,8 +19,8 @@ package interpreter import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) // LocationRange defines a range in the source of the import tree. diff --git a/runtime/interpreter/location_test.go b/interpreter/location_test.go similarity index 97% rename from runtime/interpreter/location_test.go rename to interpreter/location_test.go index 35eac77d2e..dc5d97c7a6 100644 --- a/runtime/interpreter/location_test.go +++ b/interpreter/location_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/onflow/cadence/runtime/ast" + "github.com/onflow/cadence/ast" ) func TestLocationRange_HasPosition(t *testing.T) { diff --git a/runtime/interpreter/minus_test.go b/interpreter/minus_test.go similarity index 99% rename from runtime/interpreter/minus_test.go rename to interpreter/minus_test.go index 541b269740..4626dccd26 100644 --- a/runtime/interpreter/minus_test.go +++ b/interpreter/minus_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - . "github.com/onflow/cadence/runtime/interpreter" + . "github.com/onflow/cadence/interpreter" ) func TestMinusUInt8(t *testing.T) { diff --git a/runtime/interpreter/mul_test.go b/interpreter/mul_test.go similarity index 99% rename from runtime/interpreter/mul_test.go rename to interpreter/mul_test.go index 172b21fdb9..75f7946914 100644 --- a/runtime/interpreter/mul_test.go +++ b/interpreter/mul_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - . "github.com/onflow/cadence/runtime/interpreter" + . "github.com/onflow/cadence/interpreter" ) func TestMulUInt8(t *testing.T) { diff --git a/runtime/interpreter/negate_test.go b/interpreter/negate_test.go similarity index 94% rename from runtime/interpreter/negate_test.go rename to interpreter/negate_test.go index 668a66b4b9..113f6f79fb 100644 --- a/runtime/interpreter/negate_test.go +++ b/interpreter/negate_test.go @@ -25,8 +25,8 @@ import ( "github.com/stretchr/testify/assert" - . "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + . "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) func TestNegate(t *testing.T) { diff --git a/runtime/interpreter/number.go b/interpreter/number.go similarity index 97% rename from runtime/interpreter/number.go rename to interpreter/number.go index c0149567c6..b719a041df 100644 --- a/runtime/interpreter/number.go +++ b/interpreter/number.go @@ -22,8 +22,8 @@ import ( "math" "math/big" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" ) const goIntSize = 32 << (^uint(0) >> 63) // 32 or 64 diff --git a/runtime/interpreter/number_test.go b/interpreter/number_test.go similarity index 100% rename from runtime/interpreter/number_test.go rename to interpreter/number_test.go diff --git a/runtime/interpreter/plus_test.go b/interpreter/plus_test.go similarity index 99% rename from runtime/interpreter/plus_test.go rename to interpreter/plus_test.go index 61d72f25d9..cdf046d9dd 100644 --- a/runtime/interpreter/plus_test.go +++ b/interpreter/plus_test.go @@ -26,8 +26,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - . "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + . "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) func TestPlusUInt8(t *testing.T) { diff --git a/runtime/interpreter/primitivestatictype.go b/interpreter/primitivestatictype.go similarity index 99% rename from runtime/interpreter/primitivestatictype.go rename to interpreter/primitivestatictype.go index 1bb5234b24..c41f4ff2d7 100644 --- a/runtime/interpreter/primitivestatictype.go +++ b/interpreter/primitivestatictype.go @@ -22,9 +22,9 @@ import ( "fmt" "strconv" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/sema" ) //go:generate go run golang.org/x/tools/cmd/stringer -type=PrimitiveStaticType -trimprefix=PrimitiveStaticType diff --git a/runtime/interpreter/primitivestatictype_string.go b/interpreter/primitivestatictype_string.go similarity index 100% rename from runtime/interpreter/primitivestatictype_string.go rename to interpreter/primitivestatictype_string.go diff --git a/runtime/interpreter/primitivestatictype_test.go b/interpreter/primitivestatictype_test.go similarity index 100% rename from runtime/interpreter/primitivestatictype_test.go rename to interpreter/primitivestatictype_test.go diff --git a/runtime/interpreter/program.go b/interpreter/program.go similarity index 91% rename from runtime/interpreter/program.go rename to interpreter/program.go index 3ec1b59583..e0e3ddd6a6 100644 --- a/runtime/interpreter/program.go +++ b/interpreter/program.go @@ -19,8 +19,8 @@ package interpreter import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/sema" ) type Program struct { diff --git a/runtime/interpreter/sharedstate.go b/interpreter/sharedstate.go similarity index 96% rename from runtime/interpreter/sharedstate.go rename to interpreter/sharedstate.go index eca51c9a32..70fd23cd02 100644 --- a/runtime/interpreter/sharedstate.go +++ b/interpreter/sharedstate.go @@ -21,8 +21,8 @@ package interpreter import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) type AddressPath struct { diff --git a/runtime/interpreter/simplecompositevalue.go b/interpreter/simplecompositevalue.go similarity index 98% rename from runtime/interpreter/simplecompositevalue.go rename to interpreter/simplecompositevalue.go index 526847c28c..01620523e7 100644 --- a/runtime/interpreter/simplecompositevalue.go +++ b/interpreter/simplecompositevalue.go @@ -21,9 +21,9 @@ package interpreter import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // SimpleCompositeValue diff --git a/runtime/interpreter/statementresult.go b/interpreter/statementresult.go similarity index 100% rename from runtime/interpreter/statementresult.go rename to interpreter/statementresult.go diff --git a/runtime/interpreter/statictype.go b/interpreter/statictype.go similarity index 99% rename from runtime/interpreter/statictype.go rename to interpreter/statictype.go index 2a3bf14551..1b80201088 100644 --- a/runtime/interpreter/statictype.go +++ b/interpreter/statictype.go @@ -25,10 +25,10 @@ import ( "github.com/fxamacker/cbor/v2" "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/common/orderedmap" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/common/orderedmap" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/sema" ) const UnknownElementSize = 0 diff --git a/runtime/interpreter/statictype_test.go b/interpreter/statictype_test.go similarity index 99% rename from runtime/interpreter/statictype_test.go rename to interpreter/statictype_test.go index 9a2517c99f..76f3570deb 100644 --- a/runtime/interpreter/statictype_test.go +++ b/interpreter/statictype_test.go @@ -24,10 +24,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - . "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/common" + . "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/utils" ) func TestCapabilityStaticType_Equal(t *testing.T) { diff --git a/runtime/interpreter/storage.go b/interpreter/storage.go similarity index 98% rename from runtime/interpreter/storage.go rename to interpreter/storage.go index 4276f975de..c5bdcb0b87 100644 --- a/runtime/interpreter/storage.go +++ b/interpreter/storage.go @@ -27,9 +27,9 @@ import ( "github.com/fxamacker/cbor/v2" "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) func StoredValue(gauge common.MemoryGauge, storable atree.Storable, storage atree.SlabStorage) Value { diff --git a/runtime/interpreter/storage_test.go b/interpreter/storage_test.go similarity index 99% rename from runtime/interpreter/storage_test.go rename to interpreter/storage_test.go index 7dc2a13356..01e9299c38 100644 --- a/runtime/interpreter/storage_test.go +++ b/interpreter/storage_test.go @@ -25,12 +25,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/sema" - - "github.com/onflow/cadence/runtime/common" - . "github.com/onflow/cadence/runtime/interpreter" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + . "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + . "github.com/onflow/cadence/tests/utils" ) func TestCompositeStorage(t *testing.T) { diff --git a/runtime/interpreter/storagemap.go b/interpreter/storagemap.go similarity index 98% rename from runtime/interpreter/storagemap.go rename to interpreter/storagemap.go index e681c0e9f4..54c9e2acbb 100644 --- a/runtime/interpreter/storagemap.go +++ b/interpreter/storagemap.go @@ -23,8 +23,8 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" ) // StorageMap is an ordered map which stores values in an account. diff --git a/runtime/interpreter/storagemapkey.go b/interpreter/storagemapkey.go similarity index 98% rename from runtime/interpreter/storagemapkey.go rename to interpreter/storagemapkey.go index 291fbf3774..37f472966f 100644 --- a/runtime/interpreter/storagemapkey.go +++ b/interpreter/storagemapkey.go @@ -21,7 +21,7 @@ package interpreter import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) type StorageMapKey interface { diff --git a/runtime/interpreter/stringatreevalue.go b/interpreter/stringatreevalue.go similarity index 98% rename from runtime/interpreter/stringatreevalue.go rename to interpreter/stringatreevalue.go index 94ecc51bec..7860ce1004 100644 --- a/runtime/interpreter/stringatreevalue.go +++ b/interpreter/stringatreevalue.go @@ -21,7 +21,7 @@ package interpreter import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) type StringAtreeValue string diff --git a/runtime/interpreter/stringatreevalue_test.go b/interpreter/stringatreevalue_test.go similarity index 97% rename from runtime/interpreter/stringatreevalue_test.go rename to interpreter/stringatreevalue_test.go index ddcc53878b..f2e622a8a9 100644 --- a/runtime/interpreter/stringatreevalue_test.go +++ b/interpreter/stringatreevalue_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) func TestLargeStringAtreeValueInSeparateSlab(t *testing.T) { diff --git a/runtime/interpreter/testdata/comp_v2_96d7e06eaf4b3fcf.cbor.gz b/interpreter/testdata/comp_v2_96d7e06eaf4b3fcf.cbor.gz similarity index 100% rename from runtime/interpreter/testdata/comp_v2_96d7e06eaf4b3fcf.cbor.gz rename to interpreter/testdata/comp_v2_96d7e06eaf4b3fcf.cbor.gz diff --git a/runtime/interpreter/testdata/comp_v3_99dc360eee32dcec.cbor.gz b/interpreter/testdata/comp_v3_99dc360eee32dcec.cbor.gz similarity index 100% rename from runtime/interpreter/testdata/comp_v3_99dc360eee32dcec.cbor.gz rename to interpreter/testdata/comp_v3_99dc360eee32dcec.cbor.gz diff --git a/runtime/interpreter/testdata/comp_v3_b52a33b7e56868f6.cbor.gz b/interpreter/testdata/comp_v3_b52a33b7e56868f6.cbor.gz similarity index 100% rename from runtime/interpreter/testdata/comp_v3_b52a33b7e56868f6.cbor.gz rename to interpreter/testdata/comp_v3_b52a33b7e56868f6.cbor.gz diff --git a/runtime/interpreter/testdata/comp_v3_d99d7e6b4dad41e1.cbor.gz b/interpreter/testdata/comp_v3_d99d7e6b4dad41e1.cbor.gz similarity index 100% rename from runtime/interpreter/testdata/comp_v3_d99d7e6b4dad41e1.cbor.gz rename to interpreter/testdata/comp_v3_d99d7e6b4dad41e1.cbor.gz diff --git a/runtime/interpreter/testdata/link_v3_2392f05c3b72f235.cbor.gz b/interpreter/testdata/link_v3_2392f05c3b72f235.cbor.gz similarity index 100% rename from runtime/interpreter/testdata/link_v3_2392f05c3b72f235.cbor.gz rename to interpreter/testdata/link_v3_2392f05c3b72f235.cbor.gz diff --git a/runtime/interpreter/testdata/link_v3_3a791fe1b8243e73.cbor.gz b/interpreter/testdata/link_v3_3a791fe1b8243e73.cbor.gz similarity index 100% rename from runtime/interpreter/testdata/link_v3_3a791fe1b8243e73.cbor.gz rename to interpreter/testdata/link_v3_3a791fe1b8243e73.cbor.gz diff --git a/runtime/interpreter/uint64atreevalue.go b/interpreter/uint64atreevalue.go similarity index 97% rename from runtime/interpreter/uint64atreevalue.go rename to interpreter/uint64atreevalue.go index 904fa09623..167ae15cff 100644 --- a/runtime/interpreter/uint64atreevalue.go +++ b/interpreter/uint64atreevalue.go @@ -23,7 +23,7 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) type Uint64AtreeValue uint64 diff --git a/runtime/interpreter/value.go b/interpreter/value.go similarity index 99% rename from runtime/interpreter/value.go rename to interpreter/value.go index 410dfeb47e..bf698515c5 100644 --- a/runtime/interpreter/value.go +++ b/interpreter/value.go @@ -23,8 +23,8 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) type Unsigned interface { diff --git a/runtime/interpreter/value_account.go b/interpreter/value_account.go similarity index 97% rename from runtime/interpreter/value_account.go rename to interpreter/value_account.go index 63c5383960..998c8e98fd 100644 --- a/runtime/interpreter/value_account.go +++ b/interpreter/value_account.go @@ -21,8 +21,8 @@ package interpreter import ( "fmt" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) // Account diff --git a/runtime/interpreter/value_account_accountcapabilities.go b/interpreter/value_account_accountcapabilities.go similarity index 96% rename from runtime/interpreter/value_account_accountcapabilities.go rename to interpreter/value_account_accountcapabilities.go index 0e55715774..81922f9ab7 100644 --- a/runtime/interpreter/value_account_accountcapabilities.go +++ b/interpreter/value_account_accountcapabilities.go @@ -21,8 +21,8 @@ package interpreter import ( "fmt" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) // Account.AccountCapabilities diff --git a/runtime/interpreter/value_account_capabilities.go b/interpreter/value_account_capabilities.go similarity index 97% rename from runtime/interpreter/value_account_capabilities.go rename to interpreter/value_account_capabilities.go index 99f3909114..a6ab1f55fe 100644 --- a/runtime/interpreter/value_account_capabilities.go +++ b/interpreter/value_account_capabilities.go @@ -21,8 +21,8 @@ package interpreter import ( "fmt" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) // Account.Capabilities diff --git a/runtime/interpreter/value_account_contracts.go b/interpreter/value_account_contracts.go similarity index 97% rename from runtime/interpreter/value_account_contracts.go rename to interpreter/value_account_contracts.go index f13112f18d..83ae25552a 100644 --- a/runtime/interpreter/value_account_contracts.go +++ b/interpreter/value_account_contracts.go @@ -21,8 +21,8 @@ package interpreter import ( "fmt" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) // Account.Contracts diff --git a/runtime/interpreter/value_account_inbox.go b/interpreter/value_account_inbox.go similarity index 95% rename from runtime/interpreter/value_account_inbox.go rename to interpreter/value_account_inbox.go index 05800b64a8..9681ddb331 100644 --- a/runtime/interpreter/value_account_inbox.go +++ b/interpreter/value_account_inbox.go @@ -21,8 +21,8 @@ package interpreter import ( "fmt" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) // Account.Inbox diff --git a/runtime/interpreter/value_account_storage.go b/interpreter/value_account_storage.go similarity index 98% rename from runtime/interpreter/value_account_storage.go rename to interpreter/value_account_storage.go index c9c12ce462..0531b5f67a 100644 --- a/runtime/interpreter/value_account_storage.go +++ b/interpreter/value_account_storage.go @@ -21,8 +21,8 @@ package interpreter import ( "fmt" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) // Account.Storage diff --git a/runtime/interpreter/value_account_storagecapabilities.go b/interpreter/value_account_storagecapabilities.go similarity index 96% rename from runtime/interpreter/value_account_storagecapabilities.go rename to interpreter/value_account_storagecapabilities.go index ba779cd5ad..a75b549903 100644 --- a/runtime/interpreter/value_account_storagecapabilities.go +++ b/interpreter/value_account_storagecapabilities.go @@ -21,8 +21,8 @@ package interpreter import ( "fmt" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) // Account.StorageCapabilities diff --git a/runtime/interpreter/value_accountcapabilitycontroller.go b/interpreter/value_accountcapabilitycontroller.go similarity index 98% rename from runtime/interpreter/value_accountcapabilitycontroller.go rename to interpreter/value_accountcapabilitycontroller.go index 79cfcf0c30..c2036e271a 100644 --- a/runtime/interpreter/value_accountcapabilitycontroller.go +++ b/interpreter/value_accountcapabilitycontroller.go @@ -21,10 +21,10 @@ package interpreter import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // AccountCapabilityControllerValue diff --git a/runtime/interpreter/value_accountkey.go b/interpreter/value_accountkey.go similarity index 97% rename from runtime/interpreter/value_accountkey.go rename to interpreter/value_accountkey.go index 015bb2f0d4..1cd540c81f 100644 --- a/runtime/interpreter/value_accountkey.go +++ b/interpreter/value_accountkey.go @@ -19,7 +19,7 @@ package interpreter import ( - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) var accountKeyTypeID = sema.AccountKeyType.ID() diff --git a/runtime/interpreter/value_address.go b/interpreter/value_address.go similarity index 97% rename from runtime/interpreter/value_address.go rename to interpreter/value_address.go index 2d81b6d26d..56ec54163c 100644 --- a/runtime/interpreter/value_address.go +++ b/interpreter/value_address.go @@ -23,10 +23,10 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // AddressValue diff --git a/runtime/interpreter/value_array.go b/interpreter/value_array.go similarity index 99% rename from runtime/interpreter/value_array.go rename to interpreter/value_array.go index ded71cf279..b032b9625c 100644 --- a/runtime/interpreter/value_array.go +++ b/interpreter/value_array.go @@ -24,10 +24,10 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // ArrayValue diff --git a/runtime/interpreter/value_authaccount_keys.go b/interpreter/value_authaccount_keys.go similarity index 96% rename from runtime/interpreter/value_authaccount_keys.go rename to interpreter/value_authaccount_keys.go index 964cf063be..ef7e47ab0b 100644 --- a/runtime/interpreter/value_authaccount_keys.go +++ b/interpreter/value_authaccount_keys.go @@ -21,8 +21,8 @@ package interpreter import ( "fmt" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) // Account.Keys diff --git a/runtime/interpreter/value_block.go b/interpreter/value_block.go similarity index 95% rename from runtime/interpreter/value_block.go rename to interpreter/value_block.go index 0d717b89e0..5016771a27 100644 --- a/runtime/interpreter/value_block.go +++ b/interpreter/value_block.go @@ -21,8 +21,8 @@ package interpreter import ( "fmt" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) // Block diff --git a/runtime/interpreter/value_bool.go b/interpreter/value_bool.go similarity index 96% rename from runtime/interpreter/value_bool.go rename to interpreter/value_bool.go index 5dabcc336a..31222efcc9 100644 --- a/runtime/interpreter/value_bool.go +++ b/interpreter/value_bool.go @@ -21,10 +21,10 @@ package interpreter import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // BoolValue diff --git a/runtime/interpreter/value_capability.go b/interpreter/value_capability.go similarity index 97% rename from runtime/interpreter/value_capability.go rename to interpreter/value_capability.go index f6ea49e481..8d766c6c48 100644 --- a/runtime/interpreter/value_capability.go +++ b/interpreter/value_capability.go @@ -21,10 +21,10 @@ package interpreter import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) const InvalidCapabilityID UInt64Value = 0 diff --git a/runtime/interpreter/value_character.go b/interpreter/value_character.go similarity index 97% rename from runtime/interpreter/value_character.go rename to interpreter/value_character.go index 012f2b1adf..66e57da154 100644 --- a/runtime/interpreter/value_character.go +++ b/interpreter/value_character.go @@ -23,10 +23,10 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // CharacterValue diff --git a/runtime/interpreter/value_composite.go b/interpreter/value_composite.go similarity index 99% rename from runtime/interpreter/value_composite.go rename to interpreter/value_composite.go index 031e6ba722..d11311d543 100644 --- a/runtime/interpreter/value_composite.go +++ b/interpreter/value_composite.go @@ -25,12 +25,12 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/common/orderedmap" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/common/orderedmap" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // CompositeValue diff --git a/runtime/interpreter/value_deployedcontract.go b/interpreter/value_deployedcontract.go similarity index 97% rename from runtime/interpreter/value_deployedcontract.go rename to interpreter/value_deployedcontract.go index fcfc0a91db..ca98aac95f 100644 --- a/runtime/interpreter/value_deployedcontract.go +++ b/interpreter/value_deployedcontract.go @@ -19,8 +19,8 @@ package interpreter import ( - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) // DeployedContractValue diff --git a/runtime/interpreter/value_deployment_result.go b/interpreter/value_deployment_result.go similarity index 93% rename from runtime/interpreter/value_deployment_result.go rename to interpreter/value_deployment_result.go index e7adffe538..826b1c1672 100644 --- a/runtime/interpreter/value_deployment_result.go +++ b/interpreter/value_deployment_result.go @@ -19,8 +19,8 @@ package interpreter import ( - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) // DeploymentResult diff --git a/runtime/interpreter/value_dictionary.go b/interpreter/value_dictionary.go similarity index 99% rename from runtime/interpreter/value_dictionary.go rename to interpreter/value_dictionary.go index e9fc030001..b7b804c465 100644 --- a/runtime/interpreter/value_dictionary.go +++ b/interpreter/value_dictionary.go @@ -24,10 +24,10 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // DictionaryValue diff --git a/runtime/interpreter/value_ephemeral_reference.go b/interpreter/value_ephemeral_reference.go similarity index 98% rename from runtime/interpreter/value_ephemeral_reference.go rename to interpreter/value_ephemeral_reference.go index dbc069bb6f..94e505cc1b 100644 --- a/runtime/interpreter/value_ephemeral_reference.go +++ b/interpreter/value_ephemeral_reference.go @@ -21,9 +21,9 @@ package interpreter import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/sema" ) // EphemeralReferenceValue diff --git a/runtime/interpreter/value_fix64.go b/interpreter/value_fix64.go similarity index 98% rename from runtime/interpreter/value_fix64.go rename to interpreter/value_fix64.go index 7a33163b6d..8d975bb11c 100644 --- a/runtime/interpreter/value_fix64.go +++ b/interpreter/value_fix64.go @@ -27,11 +27,11 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // Fix64Value diff --git a/runtime/interpreter/value_function.go b/interpreter/value_function.go similarity index 98% rename from runtime/interpreter/value_function.go rename to interpreter/value_function.go index 18f061f67b..f5d8b99f45 100644 --- a/runtime/interpreter/value_function.go +++ b/interpreter/value_function.go @@ -21,10 +21,10 @@ package interpreter import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/sema" ) // FunctionValue diff --git a/runtime/interpreter/value_function_test.go b/interpreter/value_function_test.go similarity index 93% rename from runtime/interpreter/value_function_test.go rename to interpreter/value_function_test.go index f4b36d1c4b..0cf1fd6464 100644 --- a/runtime/interpreter/value_function_test.go +++ b/interpreter/value_function_test.go @@ -23,11 +23,11 @@ import ( "github.com/stretchr/testify/assert" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/tests/utils" - . "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + . "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) func TestFunctionStaticType(t *testing.T) { diff --git a/runtime/interpreter/value_int.go b/interpreter/value_int.go similarity index 98% rename from runtime/interpreter/value_int.go rename to interpreter/value_int.go index 89acb45d1c..a9e6ef2c51 100644 --- a/runtime/interpreter/value_int.go +++ b/interpreter/value_int.go @@ -25,11 +25,11 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // Int diff --git a/runtime/interpreter/value_int128.go b/interpreter/value_int128.go similarity index 98% rename from runtime/interpreter/value_int128.go rename to interpreter/value_int128.go index 32f210a50f..b95c3b70f9 100644 --- a/runtime/interpreter/value_int128.go +++ b/interpreter/value_int128.go @@ -23,11 +23,11 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // Int128Value diff --git a/runtime/interpreter/value_int16.go b/interpreter/value_int16.go similarity index 98% rename from runtime/interpreter/value_int16.go rename to interpreter/value_int16.go index 60e321df8c..393093b153 100644 --- a/runtime/interpreter/value_int16.go +++ b/interpreter/value_int16.go @@ -25,11 +25,11 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // Int16Value diff --git a/runtime/interpreter/value_int256.go b/interpreter/value_int256.go similarity index 98% rename from runtime/interpreter/value_int256.go rename to interpreter/value_int256.go index 83d92fe6eb..c766978af7 100644 --- a/runtime/interpreter/value_int256.go +++ b/interpreter/value_int256.go @@ -23,11 +23,11 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // Int256Value diff --git a/runtime/interpreter/value_int32.go b/interpreter/value_int32.go similarity index 98% rename from runtime/interpreter/value_int32.go rename to interpreter/value_int32.go index 769af4e6c5..e5847fc477 100644 --- a/runtime/interpreter/value_int32.go +++ b/interpreter/value_int32.go @@ -25,11 +25,11 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // Int32Value diff --git a/runtime/interpreter/value_int64.go b/interpreter/value_int64.go similarity index 98% rename from runtime/interpreter/value_int64.go rename to interpreter/value_int64.go index 127dc010bf..5f331e95aa 100644 --- a/runtime/interpreter/value_int64.go +++ b/interpreter/value_int64.go @@ -24,11 +24,11 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // Int64Value diff --git a/runtime/interpreter/value_int8.go b/interpreter/value_int8.go similarity index 98% rename from runtime/interpreter/value_int8.go rename to interpreter/value_int8.go index 4d67a3bcc3..12cc547687 100644 --- a/runtime/interpreter/value_int8.go +++ b/interpreter/value_int8.go @@ -24,11 +24,11 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // Int8Value diff --git a/runtime/interpreter/value_link.go b/interpreter/value_link.go similarity index 99% rename from runtime/interpreter/value_link.go rename to interpreter/value_link.go index a5e053d3bb..0d7cd306e6 100644 --- a/runtime/interpreter/value_link.go +++ b/interpreter/value_link.go @@ -23,7 +23,7 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) // TODO: remove once migrated diff --git a/runtime/interpreter/value_nil.go b/interpreter/value_nil.go similarity index 96% rename from runtime/interpreter/value_nil.go rename to interpreter/value_nil.go index 49fb308b81..8bd6459658 100644 --- a/runtime/interpreter/value_nil.go +++ b/interpreter/value_nil.go @@ -21,10 +21,10 @@ package interpreter import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // NilValue diff --git a/runtime/interpreter/value_number.go b/interpreter/value_number.go similarity index 97% rename from runtime/interpreter/value_number.go rename to interpreter/value_number.go index 65586171b9..f0374dcf57 100644 --- a/runtime/interpreter/value_number.go +++ b/interpreter/value_number.go @@ -21,9 +21,9 @@ package interpreter import ( "math/big" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/sema" ) // NumberValue diff --git a/runtime/interpreter/value_optional.go b/interpreter/value_optional.go similarity index 100% rename from runtime/interpreter/value_optional.go rename to interpreter/value_optional.go diff --git a/runtime/interpreter/value_path.go b/interpreter/value_path.go similarity index 97% rename from runtime/interpreter/value_path.go rename to interpreter/value_path.go index 11807d7727..54c6503c8a 100644 --- a/runtime/interpreter/value_path.go +++ b/interpreter/value_path.go @@ -21,10 +21,10 @@ package interpreter import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // PathValue diff --git a/runtime/interpreter/value_pathcapability.go b/interpreter/value_pathcapability.go similarity index 98% rename from runtime/interpreter/value_pathcapability.go rename to interpreter/value_pathcapability.go index c578707147..d12e460f8c 100644 --- a/runtime/interpreter/value_pathcapability.go +++ b/interpreter/value_pathcapability.go @@ -23,9 +23,9 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/sema" ) // TODO: remove once migrated diff --git a/runtime/interpreter/value_placeholder.go b/interpreter/value_placeholder.go similarity index 100% rename from runtime/interpreter/value_placeholder.go rename to interpreter/value_placeholder.go diff --git a/runtime/interpreter/value_publickey.go b/interpreter/value_publickey.go similarity index 95% rename from runtime/interpreter/value_publickey.go rename to interpreter/value_publickey.go index da1ed1d40d..744ac2a886 100644 --- a/runtime/interpreter/value_publickey.go +++ b/interpreter/value_publickey.go @@ -19,8 +19,8 @@ package interpreter import ( - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) // PublicKeyValidationHandlerFunc is a function that validates a given public key. diff --git a/runtime/interpreter/value_published.go b/interpreter/value_published.go similarity index 99% rename from runtime/interpreter/value_published.go rename to interpreter/value_published.go index 46ef81f6b8..39821a32c4 100644 --- a/runtime/interpreter/value_published.go +++ b/interpreter/value_published.go @@ -23,7 +23,7 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) // PublishedValue diff --git a/runtime/interpreter/value_range.go b/interpreter/value_range.go similarity index 97% rename from runtime/interpreter/value_range.go rename to interpreter/value_range.go index 01da9f200b..baf96bd31f 100644 --- a/runtime/interpreter/value_range.go +++ b/interpreter/value_range.go @@ -21,10 +21,10 @@ package interpreter import ( "fmt" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/common/orderedmap" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/common/orderedmap" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/sema" ) // NewInclusiveRangeValue constructs an InclusiveRange value with the provided start, end with default value of step. diff --git a/runtime/interpreter/value_reference.go b/interpreter/value_reference.go similarity index 97% rename from runtime/interpreter/value_reference.go rename to interpreter/value_reference.go index 7eaff2753c..58a9ac6feb 100644 --- a/runtime/interpreter/value_reference.go +++ b/interpreter/value_reference.go @@ -21,7 +21,7 @@ package interpreter import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) type ReferenceValue interface { diff --git a/runtime/interpreter/value_some.go b/interpreter/value_some.go similarity index 98% rename from runtime/interpreter/value_some.go rename to interpreter/value_some.go index 00afeac9ca..f33f524b81 100644 --- a/runtime/interpreter/value_some.go +++ b/interpreter/value_some.go @@ -21,9 +21,9 @@ package interpreter import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/sema" ) // SomeValue diff --git a/runtime/interpreter/value_storage_reference.go b/interpreter/value_storage_reference.go similarity index 98% rename from runtime/interpreter/value_storage_reference.go rename to interpreter/value_storage_reference.go index 705afc0122..741fd4ae18 100644 --- a/runtime/interpreter/value_storage_reference.go +++ b/interpreter/value_storage_reference.go @@ -21,10 +21,10 @@ package interpreter import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // StorageReferenceValue diff --git a/runtime/interpreter/value_storagecapabilitycontroller.go b/interpreter/value_storagecapabilitycontroller.go similarity index 98% rename from runtime/interpreter/value_storagecapabilitycontroller.go rename to interpreter/value_storagecapabilitycontroller.go index 210b0a50a2..55ef98359c 100644 --- a/runtime/interpreter/value_storagecapabilitycontroller.go +++ b/interpreter/value_storagecapabilitycontroller.go @@ -21,10 +21,10 @@ package interpreter import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) type CapabilityControllerValue interface { diff --git a/runtime/interpreter/value_string.go b/interpreter/value_string.go similarity index 99% rename from runtime/interpreter/value_string.go rename to interpreter/value_string.go index ef29dd1849..df4e4cc3b6 100644 --- a/runtime/interpreter/value_string.go +++ b/interpreter/value_string.go @@ -29,11 +29,11 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // StringValue diff --git a/runtime/interpreter/value_test.go b/interpreter/value_test.go similarity index 99% rename from runtime/interpreter/value_test.go rename to interpreter/value_test.go index f0e26f1f11..1bfc7d3cc5 100644 --- a/runtime/interpreter/value_test.go +++ b/interpreter/value_test.go @@ -32,12 +32,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - . "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - checkerUtils "github.com/onflow/cadence/runtime/tests/checker" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/common" + . "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + checkerUtils "github.com/onflow/cadence/tests/checker" + "github.com/onflow/cadence/tests/utils" ) func newTestCompositeValue(inter *Interpreter, owner common.Address) *CompositeValue { @@ -3484,7 +3484,7 @@ func TestHashable(t *testing.T) { // https://github.com/golang/go/issues/45218 Mode: packages.NeedImports | packages.NeedTypes, }, - "github.com/onflow/cadence/runtime/interpreter", + "github.com/onflow/cadence/interpreter", ) require.NoError(t, err) diff --git a/runtime/interpreter/value_type.go b/interpreter/value_type.go similarity index 97% rename from runtime/interpreter/value_type.go rename to interpreter/value_type.go index f6c8a5995e..ed41180734 100644 --- a/runtime/interpreter/value_type.go +++ b/interpreter/value_type.go @@ -23,10 +23,10 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // TypeValue diff --git a/runtime/interpreter/value_ufix64.go b/interpreter/value_ufix64.go similarity index 98% rename from runtime/interpreter/value_ufix64.go rename to interpreter/value_ufix64.go index ee3bbc2b0f..53dd967167 100644 --- a/runtime/interpreter/value_ufix64.go +++ b/interpreter/value_ufix64.go @@ -27,11 +27,11 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // UFix64Value diff --git a/runtime/interpreter/value_uint.go b/interpreter/value_uint.go similarity index 98% rename from runtime/interpreter/value_uint.go rename to interpreter/value_uint.go index c898903089..aec0c661e3 100644 --- a/runtime/interpreter/value_uint.go +++ b/interpreter/value_uint.go @@ -24,11 +24,11 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // UIntValue diff --git a/runtime/interpreter/value_uint128.go b/interpreter/value_uint128.go similarity index 98% rename from runtime/interpreter/value_uint128.go rename to interpreter/value_uint128.go index ef3c78f0dc..e0d7cb0e92 100644 --- a/runtime/interpreter/value_uint128.go +++ b/interpreter/value_uint128.go @@ -23,11 +23,11 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // UInt128Value diff --git a/runtime/interpreter/value_uint16.go b/interpreter/value_uint16.go similarity index 98% rename from runtime/interpreter/value_uint16.go rename to interpreter/value_uint16.go index 65665422b9..c12bd1d2a9 100644 --- a/runtime/interpreter/value_uint16.go +++ b/interpreter/value_uint16.go @@ -25,11 +25,11 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // UInt16Value diff --git a/runtime/interpreter/value_uint256.go b/interpreter/value_uint256.go similarity index 98% rename from runtime/interpreter/value_uint256.go rename to interpreter/value_uint256.go index 749975863c..975454387a 100644 --- a/runtime/interpreter/value_uint256.go +++ b/interpreter/value_uint256.go @@ -23,11 +23,11 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // UInt256Value diff --git a/runtime/interpreter/value_uint32.go b/interpreter/value_uint32.go similarity index 98% rename from runtime/interpreter/value_uint32.go rename to interpreter/value_uint32.go index b466c43bfd..83c7efb59f 100644 --- a/runtime/interpreter/value_uint32.go +++ b/interpreter/value_uint32.go @@ -25,11 +25,11 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // UInt32Value diff --git a/runtime/interpreter/value_uint64.go b/interpreter/value_uint64.go similarity index 98% rename from runtime/interpreter/value_uint64.go rename to interpreter/value_uint64.go index 03b9e940b6..5c11cca04b 100644 --- a/runtime/interpreter/value_uint64.go +++ b/interpreter/value_uint64.go @@ -27,11 +27,11 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // UInt64Value diff --git a/runtime/interpreter/value_uint8.go b/interpreter/value_uint8.go similarity index 98% rename from runtime/interpreter/value_uint8.go rename to interpreter/value_uint8.go index 11a2b2b91f..d2289f2ef1 100644 --- a/runtime/interpreter/value_uint8.go +++ b/interpreter/value_uint8.go @@ -25,11 +25,11 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // UInt8Value diff --git a/runtime/interpreter/value_void.go b/interpreter/value_void.go similarity index 95% rename from runtime/interpreter/value_void.go rename to interpreter/value_void.go index ccead58cea..9ad8e54222 100644 --- a/runtime/interpreter/value_void.go +++ b/interpreter/value_void.go @@ -21,9 +21,9 @@ package interpreter import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // VoidValue diff --git a/runtime/interpreter/value_word128.go b/interpreter/value_word128.go similarity index 98% rename from runtime/interpreter/value_word128.go rename to interpreter/value_word128.go index 08cf13a8e1..d845055941 100644 --- a/runtime/interpreter/value_word128.go +++ b/interpreter/value_word128.go @@ -23,11 +23,11 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // Word128Value diff --git a/runtime/interpreter/value_word16.go b/interpreter/value_word16.go similarity index 98% rename from runtime/interpreter/value_word16.go rename to interpreter/value_word16.go index 4fb79db32c..98d50f5264 100644 --- a/runtime/interpreter/value_word16.go +++ b/interpreter/value_word16.go @@ -24,11 +24,11 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // Word16Value diff --git a/runtime/interpreter/value_word256.go b/interpreter/value_word256.go similarity index 98% rename from runtime/interpreter/value_word256.go rename to interpreter/value_word256.go index 86e564d747..49924b6240 100644 --- a/runtime/interpreter/value_word256.go +++ b/interpreter/value_word256.go @@ -23,11 +23,11 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // Word256Value diff --git a/runtime/interpreter/value_word32.go b/interpreter/value_word32.go similarity index 98% rename from runtime/interpreter/value_word32.go rename to interpreter/value_word32.go index 5e07c1d2b0..13d92e5add 100644 --- a/runtime/interpreter/value_word32.go +++ b/interpreter/value_word32.go @@ -24,11 +24,11 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // Word32Value diff --git a/runtime/interpreter/value_word64.go b/interpreter/value_word64.go similarity index 98% rename from runtime/interpreter/value_word64.go rename to interpreter/value_word64.go index 98ed0294ea..b79cec602b 100644 --- a/runtime/interpreter/value_word64.go +++ b/interpreter/value_word64.go @@ -26,11 +26,11 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // Word64Value diff --git a/runtime/interpreter/value_word8.go b/interpreter/value_word8.go similarity index 98% rename from runtime/interpreter/value_word8.go rename to interpreter/value_word8.go index 4f55fdfdd7..8fffdf9c7d 100644 --- a/runtime/interpreter/value_word8.go +++ b/interpreter/value_word8.go @@ -23,11 +23,11 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) // Word8Value diff --git a/runtime/interpreter/valuedeclaration.go b/interpreter/valuedeclaration.go similarity index 100% rename from runtime/interpreter/valuedeclaration.go rename to interpreter/valuedeclaration.go diff --git a/runtime/interpreter/variable.go b/interpreter/variable.go similarity index 97% rename from runtime/interpreter/variable.go rename to interpreter/variable.go index bf94d82a1d..f368621d0c 100644 --- a/runtime/interpreter/variable.go +++ b/interpreter/variable.go @@ -19,8 +19,8 @@ package interpreter import ( - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" ) type Variable interface { diff --git a/runtime/interpreter/variable_activations.go b/interpreter/variable_activations.go similarity index 95% rename from runtime/interpreter/variable_activations.go rename to interpreter/variable_activations.go index 45ce2ecd6c..cc64e742e3 100644 --- a/runtime/interpreter/variable_activations.go +++ b/interpreter/variable_activations.go @@ -18,7 +18,7 @@ package interpreter -import "github.com/onflow/cadence/runtime/activations" +import "github.com/onflow/cadence/activations" type VariableActivations = activations.Activations[Variable] diff --git a/runtime/interpreter/visitor.go b/interpreter/visitor.go similarity index 100% rename from runtime/interpreter/visitor.go rename to interpreter/visitor.go diff --git a/runtime/interpreter/walk.go b/interpreter/walk.go similarity index 100% rename from runtime/interpreter/walk.go rename to interpreter/walk.go diff --git a/npm-packages/cadence-parser/package.json b/npm-packages/cadence-parser/package.json index 7cbff25e53..fc893be423 100644 --- a/npm-packages/cadence-parser/package.json +++ b/npm-packages/cadence-parser/package.json @@ -18,7 +18,7 @@ } }, "scripts": { - "build": "npm run build:types && npm run build:esm && npm run build:cjs && GOARCH=wasm GOOS=js go build -o ./dist/cadence-parser.wasm ../../runtime/cmd/parse", + "build": "npm run build:types && npm run build:esm && npm run build:cjs && GOARCH=wasm GOOS=js go build -o ./dist/cadence-parser.wasm ../../cmd/parse", "build:types": "tsc --emitDeclarationOnly --module system --outDir dist/types", "build:esm": "esbuild src/index.ts --bundle --sourcemap --format=esm --outfile=dist/esm/index.mjs", "build:cjs": "tsc --module commonjs --target es6 --outDir dist/cjs --declaration false", diff --git a/runtime/old_parser/benchmark_test.go b/old_parser/benchmark_test.go similarity index 99% rename from runtime/old_parser/benchmark_test.go rename to old_parser/benchmark_test.go index 3f7129a5ba..a8de6d6934 100644 --- a/runtime/old_parser/benchmark_test.go +++ b/old_parser/benchmark_test.go @@ -26,7 +26,7 @@ import ( "strings" "testing" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) func BenchmarkParseDeploy(b *testing.B) { diff --git a/runtime/old_parser/comment.go b/old_parser/comment.go similarity index 96% rename from runtime/old_parser/comment.go rename to old_parser/comment.go index 766abdd135..5737484fe6 100644 --- a/runtime/old_parser/comment.go +++ b/old_parser/comment.go @@ -19,7 +19,7 @@ package old_parser import ( - "github.com/onflow/cadence/runtime/parser/lexer" + "github.com/onflow/cadence/parser/lexer" ) func (p *parser) parseBlockComment() (endToken lexer.Token, ok bool) { diff --git a/runtime/old_parser/declaration.go b/old_parser/declaration.go similarity index 99% rename from runtime/old_parser/declaration.go rename to old_parser/declaration.go index 05f92e5d7d..ac34e98799 100644 --- a/runtime/old_parser/declaration.go +++ b/old_parser/declaration.go @@ -23,10 +23,10 @@ import ( "strconv" "strings" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/parser/lexer" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/parser/lexer" ) func parseDeclarations(p *parser, endTokenType lexer.TokenType) (declarations []ast.Declaration, err error) { diff --git a/runtime/old_parser/declaration_test.go b/old_parser/declaration_test.go similarity index 99% rename from runtime/old_parser/declaration_test.go rename to old_parser/declaration_test.go index ba2b374f95..f41fd0c978 100644 --- a/runtime/old_parser/declaration_test.go +++ b/old_parser/declaration_test.go @@ -25,9 +25,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/tests/utils" ) func TestParseVariableDeclaration(t *testing.T) { diff --git a/runtime/old_parser/docstring.go b/old_parser/docstring.go similarity index 100% rename from runtime/old_parser/docstring.go rename to old_parser/docstring.go diff --git a/runtime/old_parser/docstring_test.go b/old_parser/docstring_test.go similarity index 100% rename from runtime/old_parser/docstring_test.go rename to old_parser/docstring_test.go diff --git a/runtime/old_parser/errors.go b/old_parser/errors.go similarity index 97% rename from runtime/old_parser/errors.go rename to old_parser/errors.go index 9c0d1deb6a..6418a60842 100644 --- a/runtime/old_parser/errors.go +++ b/old_parser/errors.go @@ -22,10 +22,10 @@ import ( "fmt" "strings" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/pretty" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/pretty" ) // Error diff --git a/runtime/old_parser/expression.go b/old_parser/expression.go similarity index 99% rename from runtime/old_parser/expression.go rename to old_parser/expression.go index b4fd4c2a12..8c7dd451db 100644 --- a/runtime/old_parser/expression.go +++ b/old_parser/expression.go @@ -23,10 +23,10 @@ import ( "strings" "unicode/utf8" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/parser/lexer" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/parser/lexer" ) const exprBindingPowerGap = 10 diff --git a/runtime/old_parser/expression_test.go b/old_parser/expression_test.go similarity index 99% rename from runtime/old_parser/expression_test.go rename to old_parser/expression_test.go index f1fb98ea73..c90f4702cf 100644 --- a/runtime/old_parser/expression_test.go +++ b/old_parser/expression_test.go @@ -30,11 +30,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/parser/lexer" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/parser/lexer" + "github.com/onflow/cadence/tests/utils" ) func TestParseSimpleInfixExpression(t *testing.T) { diff --git a/runtime/old_parser/function.go b/old_parser/function.go similarity index 98% rename from runtime/old_parser/function.go rename to old_parser/function.go index 7d0054faaf..6f5fed796b 100644 --- a/runtime/old_parser/function.go +++ b/old_parser/function.go @@ -19,8 +19,8 @@ package old_parser import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/parser/lexer" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/parser/lexer" ) func parseParameterList(p *parser) (*ast.ParameterList, error) { diff --git a/runtime/old_parser/invalidnumberliteralkind.go b/old_parser/invalidnumberliteralkind.go similarity index 97% rename from runtime/old_parser/invalidnumberliteralkind.go rename to old_parser/invalidnumberliteralkind.go index 0016f892b3..8fe425d922 100644 --- a/runtime/old_parser/invalidnumberliteralkind.go +++ b/old_parser/invalidnumberliteralkind.go @@ -19,7 +19,7 @@ package old_parser import ( - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) //go:generate go run golang.org/x/tools/cmd/stringer -type=InvalidNumberLiteralKind diff --git a/runtime/old_parser/invalidnumberliteralkind_string.go b/old_parser/invalidnumberliteralkind_string.go similarity index 100% rename from runtime/old_parser/invalidnumberliteralkind_string.go rename to old_parser/invalidnumberliteralkind_string.go diff --git a/runtime/old_parser/keyword.go b/old_parser/keyword.go similarity index 100% rename from runtime/old_parser/keyword.go rename to old_parser/keyword.go diff --git a/runtime/old_parser/lexer/lexer.go b/old_parser/lexer/lexer.go similarity index 98% rename from runtime/old_parser/lexer/lexer.go rename to old_parser/lexer/lexer.go index cf0a2e0e44..7a5b7fcaf1 100644 --- a/runtime/old_parser/lexer/lexer.go +++ b/old_parser/lexer/lexer.go @@ -23,9 +23,9 @@ import ( "sync" "unicode/utf8" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" ) // tokenLimit is a sensible limit for how many tokens may be emitted diff --git a/runtime/old_parser/lexer/lexer_test.go b/old_parser/lexer/lexer_test.go similarity index 99% rename from runtime/old_parser/lexer/lexer_test.go rename to old_parser/lexer/lexer_test.go index 3102656402..1e48fed700 100644 --- a/runtime/old_parser/lexer/lexer_test.go +++ b/old_parser/lexer/lexer_test.go @@ -27,8 +27,8 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/goleak" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/tests/utils" ) func TestMain(m *testing.M) { diff --git a/runtime/old_parser/lexer/state.go b/old_parser/lexer/state.go similarity index 99% rename from runtime/old_parser/lexer/state.go rename to old_parser/lexer/state.go index 9848a1be34..2431f04f9b 100644 --- a/runtime/old_parser/lexer/state.go +++ b/old_parser/lexer/state.go @@ -21,7 +21,7 @@ package lexer import ( "fmt" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) const keywordAs = "as" diff --git a/runtime/old_parser/lexer/token.go b/old_parser/lexer/token.go similarity index 95% rename from runtime/old_parser/lexer/token.go rename to old_parser/lexer/token.go index cfda861bdf..ccd5d25d9a 100644 --- a/runtime/old_parser/lexer/token.go +++ b/old_parser/lexer/token.go @@ -19,7 +19,7 @@ package lexer import ( - "github.com/onflow/cadence/runtime/ast" + "github.com/onflow/cadence/ast" ) type Token struct { diff --git a/runtime/old_parser/lexer/tokenstream.go b/old_parser/lexer/tokenstream.go similarity index 100% rename from runtime/old_parser/lexer/tokenstream.go rename to old_parser/lexer/tokenstream.go diff --git a/runtime/old_parser/lexer/tokentype.go b/old_parser/lexer/tokentype.go similarity index 99% rename from runtime/old_parser/lexer/tokentype.go rename to old_parser/lexer/tokentype.go index 25e32c9ea2..beef215117 100644 --- a/runtime/old_parser/lexer/tokentype.go +++ b/old_parser/lexer/tokentype.go @@ -19,7 +19,7 @@ package lexer import ( - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) type TokenType uint8 diff --git a/runtime/old_parser/parser.go b/old_parser/parser.go similarity index 98% rename from runtime/old_parser/parser.go rename to old_parser/parser.go index c4114f7f5f..34e19a400c 100644 --- a/runtime/old_parser/parser.go +++ b/old_parser/parser.go @@ -23,10 +23,10 @@ import ( "os" "strings" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/parser/lexer" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/parser/lexer" ) // expressionDepthLimit is the limit of how deeply nested an expression can get diff --git a/runtime/old_parser/parser_test.go b/old_parser/parser_test.go similarity index 98% rename from runtime/old_parser/parser_test.go rename to old_parser/parser_test.go index 433f6b8311..156ae7c286 100644 --- a/runtime/old_parser/parser_test.go +++ b/old_parser/parser_test.go @@ -29,11 +29,11 @@ import ( "go.uber.org/goleak" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/parser/lexer" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/parser/lexer" + "github.com/onflow/cadence/tests/utils" ) func TestMain(m *testing.M) { diff --git a/runtime/old_parser/statement.go b/old_parser/statement.go similarity index 99% rename from runtime/old_parser/statement.go rename to old_parser/statement.go index 80a0ef5d37..634f2e1b17 100644 --- a/runtime/old_parser/statement.go +++ b/old_parser/statement.go @@ -19,9 +19,9 @@ package old_parser import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/parser/lexer" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/parser/lexer" ) func parseStatements(p *parser, isEndToken func(token lexer.Token) bool) (statements []ast.Statement, err error) { diff --git a/runtime/old_parser/statement_test.go b/old_parser/statement_test.go similarity index 99% rename from runtime/old_parser/statement_test.go rename to old_parser/statement_test.go index ad4843bb4b..e22d1c2b94 100644 --- a/runtime/old_parser/statement_test.go +++ b/old_parser/statement_test.go @@ -25,8 +25,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/tests/utils" ) func TestParseReplInput(t *testing.T) { diff --git a/runtime/old_parser/transaction.go b/old_parser/transaction.go similarity index 97% rename from runtime/old_parser/transaction.go rename to old_parser/transaction.go index a4e460f945..f564edc27b 100644 --- a/runtime/old_parser/transaction.go +++ b/old_parser/transaction.go @@ -19,9 +19,9 @@ package old_parser import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/parser/lexer" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/parser/lexer" ) // parseTransactionDeclaration parses a transaction declaration. diff --git a/runtime/old_parser/type.go b/old_parser/type.go similarity index 99% rename from runtime/old_parser/type.go rename to old_parser/type.go index 3723445708..359af4787d 100644 --- a/runtime/old_parser/type.go +++ b/old_parser/type.go @@ -19,9 +19,9 @@ package old_parser import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/parser/lexer" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/parser/lexer" ) const ( diff --git a/runtime/old_parser/type_test.go b/old_parser/type_test.go similarity index 99% rename from runtime/old_parser/type_test.go rename to old_parser/type_test.go index 5b656fca3e..814a51b813 100644 --- a/runtime/old_parser/type_test.go +++ b/old_parser/type_test.go @@ -25,9 +25,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/tests/utils" ) func TestParseNominalType(t *testing.T) { diff --git a/runtime/parser/benchmark_test.go b/parser/benchmark_test.go similarity index 99% rename from runtime/parser/benchmark_test.go rename to parser/benchmark_test.go index 1828ca6886..66541dd645 100644 --- a/runtime/parser/benchmark_test.go +++ b/parser/benchmark_test.go @@ -26,7 +26,7 @@ import ( "strings" "testing" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) func BenchmarkParseDeploy(b *testing.B) { diff --git a/runtime/parser/comment.go b/parser/comment.go similarity index 96% rename from runtime/parser/comment.go rename to parser/comment.go index 1ca171889e..60f92ea12e 100644 --- a/runtime/parser/comment.go +++ b/parser/comment.go @@ -19,7 +19,7 @@ package parser import ( - "github.com/onflow/cadence/runtime/parser/lexer" + "github.com/onflow/cadence/parser/lexer" ) func (p *parser) parseBlockComment() (endToken lexer.Token, ok bool) { diff --git a/runtime/parser/declaration.go b/parser/declaration.go similarity index 99% rename from runtime/parser/declaration.go rename to parser/declaration.go index 2c9775ae18..511bb9ecd7 100644 --- a/runtime/parser/declaration.go +++ b/parser/declaration.go @@ -24,10 +24,10 @@ import ( "strconv" "strings" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/parser/lexer" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/parser/lexer" ) func parseDeclarations(p *parser, endTokenType lexer.TokenType) (declarations []ast.Declaration, err error) { diff --git a/runtime/parser/declaration_test.go b/parser/declaration_test.go similarity index 99% rename from runtime/parser/declaration_test.go rename to parser/declaration_test.go index 46af2369a4..2f27396cbd 100644 --- a/runtime/parser/declaration_test.go +++ b/parser/declaration_test.go @@ -27,9 +27,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/tests/utils" ) func TestParseVariableDeclaration(t *testing.T) { diff --git a/runtime/parser/docstring.go b/parser/docstring.go similarity index 100% rename from runtime/parser/docstring.go rename to parser/docstring.go diff --git a/runtime/parser/docstring_test.go b/parser/docstring_test.go similarity index 100% rename from runtime/parser/docstring_test.go rename to parser/docstring_test.go diff --git a/runtime/parser/errors.go b/parser/errors.go similarity index 97% rename from runtime/parser/errors.go rename to parser/errors.go index 5d9ce97cc0..1561507194 100644 --- a/runtime/parser/errors.go +++ b/parser/errors.go @@ -22,10 +22,10 @@ import ( "fmt" "strings" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/pretty" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/pretty" ) // Error diff --git a/runtime/parser/expression.go b/parser/expression.go similarity index 99% rename from runtime/parser/expression.go rename to parser/expression.go index 41f44df7a7..fef98c5f68 100644 --- a/runtime/parser/expression.go +++ b/parser/expression.go @@ -23,10 +23,10 @@ import ( "strings" "unicode/utf8" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/parser/lexer" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/parser/lexer" ) const exprBindingPowerGap = 10 diff --git a/runtime/parser/expression_test.go b/parser/expression_test.go similarity index 99% rename from runtime/parser/expression_test.go rename to parser/expression_test.go index e162d35187..7acb0ac4eb 100644 --- a/runtime/parser/expression_test.go +++ b/parser/expression_test.go @@ -30,11 +30,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/parser/lexer" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/parser/lexer" + "github.com/onflow/cadence/tests/utils" ) func TestParseSimpleInfixExpression(t *testing.T) { diff --git a/runtime/parser/function.go b/parser/function.go similarity index 98% rename from runtime/parser/function.go rename to parser/function.go index a6028be802..1d2ea047b6 100644 --- a/runtime/parser/function.go +++ b/parser/function.go @@ -19,8 +19,8 @@ package parser import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/parser/lexer" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/parser/lexer" ) func parsePurityAnnotation(p *parser) ast.FunctionPurity { diff --git a/runtime/parser/invalidnumberliteralkind.go b/parser/invalidnumberliteralkind.go similarity index 97% rename from runtime/parser/invalidnumberliteralkind.go rename to parser/invalidnumberliteralkind.go index de7199bb1e..3d23bdd610 100644 --- a/runtime/parser/invalidnumberliteralkind.go +++ b/parser/invalidnumberliteralkind.go @@ -19,7 +19,7 @@ package parser import ( - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) //go:generate go run golang.org/x/tools/cmd/stringer -type=InvalidNumberLiteralKind diff --git a/runtime/parser/invalidnumberliteralkind_string.go b/parser/invalidnumberliteralkind_string.go similarity index 100% rename from runtime/parser/invalidnumberliteralkind_string.go rename to parser/invalidnumberliteralkind_string.go diff --git a/runtime/parser/keyword.go b/parser/keyword.go similarity index 100% rename from runtime/parser/keyword.go rename to parser/keyword.go diff --git a/runtime/parser/lexer/lexer.go b/parser/lexer/lexer.go similarity index 98% rename from runtime/parser/lexer/lexer.go rename to parser/lexer/lexer.go index 8c13ee6eac..2a59bc9b52 100644 --- a/runtime/parser/lexer/lexer.go +++ b/parser/lexer/lexer.go @@ -23,9 +23,9 @@ import ( "sync" "unicode/utf8" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" ) // tokenLimit is a sensible limit for how many tokens may be emitted diff --git a/runtime/parser/lexer/lexer_test.go b/parser/lexer/lexer_test.go similarity index 99% rename from runtime/parser/lexer/lexer_test.go rename to parser/lexer/lexer_test.go index 80f5cf3dd6..d6562fdebd 100644 --- a/runtime/parser/lexer/lexer_test.go +++ b/parser/lexer/lexer_test.go @@ -27,8 +27,8 @@ import ( "github.com/stretchr/testify/require" "go.uber.org/goleak" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/tests/utils" ) func TestMain(m *testing.M) { diff --git a/runtime/parser/lexer/state.go b/parser/lexer/state.go similarity index 99% rename from runtime/parser/lexer/state.go rename to parser/lexer/state.go index 4b252d6f09..8bafc0e476 100644 --- a/runtime/parser/lexer/state.go +++ b/parser/lexer/state.go @@ -21,7 +21,7 @@ package lexer import ( "fmt" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) const keywordAs = "as" diff --git a/runtime/parser/lexer/token.go b/parser/lexer/token.go similarity index 95% rename from runtime/parser/lexer/token.go rename to parser/lexer/token.go index cfda861bdf..ccd5d25d9a 100644 --- a/runtime/parser/lexer/token.go +++ b/parser/lexer/token.go @@ -19,7 +19,7 @@ package lexer import ( - "github.com/onflow/cadence/runtime/ast" + "github.com/onflow/cadence/ast" ) type Token struct { diff --git a/runtime/parser/lexer/tokenstream.go b/parser/lexer/tokenstream.go similarity index 100% rename from runtime/parser/lexer/tokenstream.go rename to parser/lexer/tokenstream.go diff --git a/runtime/parser/lexer/tokentype.go b/parser/lexer/tokentype.go similarity index 99% rename from runtime/parser/lexer/tokentype.go rename to parser/lexer/tokentype.go index 0a15c19b6f..4310f312de 100644 --- a/runtime/parser/lexer/tokentype.go +++ b/parser/lexer/tokentype.go @@ -19,7 +19,7 @@ package lexer import ( - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) type TokenType uint8 diff --git a/runtime/parser/parser.go b/parser/parser.go similarity index 99% rename from runtime/parser/parser.go rename to parser/parser.go index 8af423723b..741e98c78b 100644 --- a/runtime/parser/parser.go +++ b/parser/parser.go @@ -23,10 +23,10 @@ import ( "os" "strings" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/parser/lexer" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/parser/lexer" ) // expressionDepthLimit is the limit of how deeply nested an expression can get diff --git a/runtime/parser/parser_test.go b/parser/parser_test.go similarity index 98% rename from runtime/parser/parser_test.go rename to parser/parser_test.go index 5cd8112115..93bc5f4918 100644 --- a/runtime/parser/parser_test.go +++ b/parser/parser_test.go @@ -29,11 +29,11 @@ import ( "go.uber.org/goleak" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/parser/lexer" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/parser/lexer" + "github.com/onflow/cadence/tests/utils" ) func TestMain(m *testing.M) { diff --git a/runtime/parser/statement.go b/parser/statement.go similarity index 99% rename from runtime/parser/statement.go rename to parser/statement.go index 3f84bfccc8..d7b8b5fdc7 100644 --- a/runtime/parser/statement.go +++ b/parser/statement.go @@ -19,9 +19,9 @@ package parser import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/parser/lexer" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/parser/lexer" ) func parseStatements(p *parser, isEndToken func(token lexer.Token) bool) (statements []ast.Statement, err error) { diff --git a/runtime/parser/statement_test.go b/parser/statement_test.go similarity index 99% rename from runtime/parser/statement_test.go rename to parser/statement_test.go index 551760b676..8e3b6762cb 100644 --- a/runtime/parser/statement_test.go +++ b/parser/statement_test.go @@ -26,8 +26,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/tests/utils" ) func TestParseReplInput(t *testing.T) { diff --git a/runtime/parser/transaction.go b/parser/transaction.go similarity index 97% rename from runtime/parser/transaction.go rename to parser/transaction.go index ba31b1060d..fe7ea9e889 100644 --- a/runtime/parser/transaction.go +++ b/parser/transaction.go @@ -19,9 +19,9 @@ package parser import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/parser/lexer" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/parser/lexer" ) // parseTransactionDeclaration parses a transaction declaration. diff --git a/runtime/parser/type.go b/parser/type.go similarity index 99% rename from runtime/parser/type.go rename to parser/type.go index 5a86be1fb6..30953813ff 100644 --- a/runtime/parser/type.go +++ b/parser/type.go @@ -19,9 +19,9 @@ package parser import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/parser/lexer" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/parser/lexer" ) const ( diff --git a/runtime/parser/type_test.go b/parser/type_test.go similarity index 99% rename from runtime/parser/type_test.go rename to parser/type_test.go index 0f8d5fb129..5a741dc03d 100644 --- a/runtime/parser/type_test.go +++ b/parser/type_test.go @@ -25,9 +25,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/tests/utils" ) func TestParseNominalType(t *testing.T) { diff --git a/runtime/pretty/print.go b/pretty/print.go similarity index 98% rename from runtime/pretty/print.go rename to pretty/print.go index dac7e07281..73d475a1fb 100644 --- a/runtime/pretty/print.go +++ b/pretty/print.go @@ -28,9 +28,9 @@ import ( "github.com/logrusorgru/aurora/v4" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" ) type Writer interface { diff --git a/runtime/pretty/print_test.go b/pretty/print_test.go similarity index 96% rename from runtime/pretty/print_test.go rename to pretty/print_test.go index c680f3281f..36d577a06d 100644 --- a/runtime/pretty/print_test.go +++ b/pretty/print_test.go @@ -24,8 +24,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) type testError struct { diff --git a/runtime/account_test.go b/runtime/account_test.go index 9e2e693489..ad8540f6e2 100644 --- a/runtime/account_test.go +++ b/runtime/account_test.go @@ -28,17 +28,17 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" "github.com/onflow/cadence/encoding/json" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - "github.com/onflow/cadence/runtime/tests/checker" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - "github.com/onflow/cadence/runtime/tests/utils" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + "github.com/onflow/cadence/tests/checker" + . "github.com/onflow/cadence/tests/runtime_utils" + "github.com/onflow/cadence/tests/utils" + . "github.com/onflow/cadence/tests/utils" ) func TestRuntimeAccountKeyConstructor(t *testing.T) { diff --git a/runtime/attachments_test.go b/runtime/attachments_test.go index 259b5f1cb9..b63c3e1913 100644 --- a/runtime/attachments_test.go +++ b/runtime/attachments_test.go @@ -25,11 +25,11 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - . "github.com/onflow/cadence/runtime/tests/utils" + . "github.com/onflow/cadence/tests/runtime_utils" + . "github.com/onflow/cadence/tests/utils" ) func TestRuntimeAccountAttachmentSaveAndLoad(t *testing.T) { diff --git a/runtime/capabilities_test.go b/runtime/capabilities_test.go index 8bd208b792..ade86c8d24 100644 --- a/runtime/capabilities_test.go +++ b/runtime/capabilities_test.go @@ -24,11 +24,11 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - . "github.com/onflow/cadence/runtime/tests/utils" + . "github.com/onflow/cadence/tests/runtime_utils" + . "github.com/onflow/cadence/tests/utils" ) func TestRuntimeCapability_borrowAndCheck(t *testing.T) { diff --git a/runtime/capabilitycontrollers_test.go b/runtime/capabilitycontrollers_test.go index a3c62c155d..fbb0d924cc 100644 --- a/runtime/capabilitycontrollers_test.go +++ b/runtime/capabilitycontrollers_test.go @@ -27,13 +27,13 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + . "github.com/onflow/cadence/tests/runtime_utils" + . "github.com/onflow/cadence/tests/utils" ) func TestRuntimeCapabilityControllers(t *testing.T) { diff --git a/runtime/config.go b/runtime/config.go index 3e3a273ff1..8f652fd894 100644 --- a/runtime/config.go +++ b/runtime/config.go @@ -19,7 +19,7 @@ package runtime import ( - "github.com/onflow/cadence/runtime/interpreter" + "github.com/onflow/cadence/interpreter" ) // Config is a constant/read-only configuration of an environment. diff --git a/runtime/context.go b/runtime/context.go index 4df6e0cf62..8cf8a0c0a8 100644 --- a/runtime/context.go +++ b/runtime/context.go @@ -19,7 +19,7 @@ package runtime import ( - "github.com/onflow/cadence/runtime/ast" + "github.com/onflow/cadence/ast" ) type Context struct { diff --git a/runtime/contract_function_executor.go b/runtime/contract_function_executor.go index 6d443b0ad6..e7f3cc7e24 100644 --- a/runtime/contract_function_executor.go +++ b/runtime/contract_function_executor.go @@ -22,10 +22,10 @@ import ( "sync" "github.com/onflow/cadence" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) type interpreterContractFunctionExecutor struct { diff --git a/runtime/contract_test.go b/runtime/contract_test.go index 9351480bd8..5cc9579322 100644 --- a/runtime/contract_test.go +++ b/runtime/contract_test.go @@ -27,15 +27,15 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - "github.com/onflow/cadence/runtime/tests/checker" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + "github.com/onflow/cadence/tests/checker" + . "github.com/onflow/cadence/tests/runtime_utils" + . "github.com/onflow/cadence/tests/utils" ) func TestRuntimeContract(t *testing.T) { diff --git a/runtime/contract_update_test.go b/runtime/contract_update_test.go index 0474b76592..c032eb7124 100644 --- a/runtime/contract_update_test.go +++ b/runtime/contract_update_test.go @@ -24,13 +24,13 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" "github.com/onflow/cadence/encoding/json" + "github.com/onflow/cadence/interpreter" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/stdlib" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/stdlib" + . "github.com/onflow/cadence/tests/runtime_utils" + . "github.com/onflow/cadence/tests/utils" ) func TestRuntimeContractUpdateWithDependencies(t *testing.T) { diff --git a/runtime/contract_update_validation_test.go b/runtime/contract_update_validation_test.go index 71709f9b13..f4e77b8c85 100644 --- a/runtime/contract_update_validation_test.go +++ b/runtime/contract_update_validation_test.go @@ -27,14 +27,14 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + . "github.com/onflow/cadence/tests/runtime_utils" + . "github.com/onflow/cadence/tests/utils" ) func newContractDeployTransaction(function, name, code string) string { diff --git a/runtime/convertTypes.go b/runtime/convertTypes.go index 8315bf2ee6..e8777439d5 100644 --- a/runtime/convertTypes.go +++ b/runtime/convertTypes.go @@ -22,10 +22,10 @@ import ( "fmt" "github.com/onflow/cadence" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) // ExportType converts a runtime type to its corresponding Go representation. diff --git a/runtime/convertTypes_test.go b/runtime/convertTypes_test.go index fe26743584..fea1f8a697 100644 --- a/runtime/convertTypes_test.go +++ b/runtime/convertTypes_test.go @@ -24,11 +24,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/onflow/cadence" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/utils" ) func TestRuntimeExportRecursiveType(t *testing.T) { diff --git a/runtime/convertValues.go b/runtime/convertValues.go index 4ba412995e..99ddbf18c3 100644 --- a/runtime/convertValues.go +++ b/runtime/convertValues.go @@ -23,11 +23,11 @@ import ( _ "unsafe" "github.com/onflow/cadence" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" ) // exportValue converts a runtime value to its native Go representation. diff --git a/runtime/convertValues_test.go b/runtime/convertValues_test.go index 770fff2f16..3c6f3bd8a3 100644 --- a/runtime/convertValues_test.go +++ b/runtime/convertValues_test.go @@ -28,16 +28,16 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" "github.com/onflow/cadence/encoding/json" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/parser" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + . "github.com/onflow/cadence/tests/runtime_utils" + . "github.com/onflow/cadence/tests/utils" ) func TestRuntimeExportValue(t *testing.T) { diff --git a/runtime/coverage.go b/runtime/coverage.go index 9349942546..940d950303 100644 --- a/runtime/coverage.go +++ b/runtime/coverage.go @@ -24,8 +24,8 @@ import ( "fmt" "sort" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) // LocationCoverage records coverage information for a location. diff --git a/runtime/coverage_test.go b/runtime/coverage_test.go index 05fed6e3aa..2c244b4c4d 100644 --- a/runtime/coverage_test.go +++ b/runtime/coverage_test.go @@ -27,12 +27,12 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/parser" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/stdlib" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/stdlib" + . "github.com/onflow/cadence/tests/runtime_utils" + "github.com/onflow/cadence/tests/utils" ) func TestRuntimeNewLocationCoverage(t *testing.T) { diff --git a/runtime/crypto_test.go b/runtime/crypto_test.go index 6cf6e1cec7..7d49f4b810 100644 --- a/runtime/crypto_test.go +++ b/runtime/crypto_test.go @@ -28,12 +28,12 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" "github.com/onflow/cadence/encoding/json" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + . "github.com/onflow/cadence/tests/runtime_utils" ) func TestRuntimeCrypto_verify(t *testing.T) { diff --git a/runtime/debugger_test.go b/runtime/debugger_test.go index 62a44a5659..7d5d5f8907 100644 --- a/runtime/debugger_test.go +++ b/runtime/debugger_test.go @@ -24,11 +24,11 @@ import ( "github.com/stretchr/testify/require" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" + . "github.com/onflow/cadence/tests/runtime_utils" ) func TestRuntimeDebugger(t *testing.T) { diff --git a/runtime/deployedcontract_test.go b/runtime/deployedcontract_test.go index 47acbe0d36..b73b16f71d 100644 --- a/runtime/deployedcontract_test.go +++ b/runtime/deployedcontract_test.go @@ -24,10 +24,10 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - "github.com/onflow/cadence/runtime/tests/utils" + . "github.com/onflow/cadence/tests/runtime_utils" + "github.com/onflow/cadence/tests/utils" ) func TestRuntimeDeployedContracts(t *testing.T) { diff --git a/runtime/deployment_test.go b/runtime/deployment_test.go index 68678dface..74e29cad60 100644 --- a/runtime/deployment_test.go +++ b/runtime/deployment_test.go @@ -29,13 +29,13 @@ import ( "golang.org/x/crypto/sha3" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + . "github.com/onflow/cadence/tests/runtime_utils" + . "github.com/onflow/cadence/tests/utils" ) func TestRuntimeTransactionWithContractDeployment(t *testing.T) { diff --git a/runtime/empty.go b/runtime/empty.go index 86b5b0abce..da93644534 100644 --- a/runtime/empty.go +++ b/runtime/empty.go @@ -25,10 +25,10 @@ import ( "go.opentelemetry.io/otel/attribute" "github.com/onflow/cadence" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) // EmptyRuntimeInterface is an empty implementation of runtime.Interface. diff --git a/runtime/entitlements_test.go b/runtime/entitlements_test.go index 52e592683e..8d295e5578 100644 --- a/runtime/entitlements_test.go +++ b/runtime/entitlements_test.go @@ -24,13 +24,13 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/checker" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/checker" + . "github.com/onflow/cadence/tests/runtime_utils" + . "github.com/onflow/cadence/tests/utils" ) func TestRuntimeAccountEntitlementSaveAndLoadSuccess(t *testing.T) { diff --git a/runtime/environment.go b/runtime/environment.go index 825e09a8a0..d45fc07274 100644 --- a/runtime/environment.go +++ b/runtime/environment.go @@ -24,16 +24,16 @@ import ( "go.opentelemetry.io/otel/attribute" "github.com/onflow/cadence" - "github.com/onflow/cadence/runtime/activations" - "github.com/onflow/cadence/runtime/old_parser" - - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/activations" + "github.com/onflow/cadence/old_parser" + + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/parser" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" ) type Environment interface { diff --git a/runtime/error_test.go b/runtime/error_test.go index 182ea91417..a27aecbcf2 100644 --- a/runtime/error_test.go +++ b/runtime/error_test.go @@ -26,12 +26,12 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + . "github.com/onflow/cadence/tests/runtime_utils" ) func TestRuntimeError(t *testing.T) { diff --git a/runtime/errors.go b/runtime/errors.go index df00e11ff8..316b76acec 100644 --- a/runtime/errors.go +++ b/runtime/errors.go @@ -22,11 +22,11 @@ import ( "fmt" "strings" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/pretty" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/pretty" + "github.com/onflow/cadence/sema" ) // Error is the containing type for all errors produced by the runtime. diff --git a/runtime/events.go b/runtime/events.go index 9d0deaa6dc..a0e4d0bd59 100644 --- a/runtime/events.go +++ b/runtime/events.go @@ -20,9 +20,9 @@ package runtime import ( "github.com/onflow/cadence" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) func emitEventValue( diff --git a/runtime/ft_test.go b/runtime/ft_test.go index 8282108b2b..5d7d78b5e6 100644 --- a/runtime/ft_test.go +++ b/runtime/ft_test.go @@ -25,14 +25,14 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" "github.com/onflow/cadence/encoding/json" + "github.com/onflow/cadence/interpreter" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/sema" + . "github.com/onflow/cadence/tests/runtime_utils" + "github.com/onflow/cadence/tests/utils" ) const modifiedFungibleTokenContractInterface = ` diff --git a/runtime/import_test.go b/runtime/import_test.go index 9b4de3be58..14a47febe0 100644 --- a/runtime/import_test.go +++ b/runtime/import_test.go @@ -26,13 +26,13 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" "github.com/onflow/cadence/encoding/json" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/checker" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/checker" + . "github.com/onflow/cadence/tests/runtime_utils" + . "github.com/onflow/cadence/tests/utils" ) func TestRuntimeCyclicImport(t *testing.T) { diff --git a/runtime/imported_values_memory_metering_test.go b/runtime/imported_values_memory_metering_test.go index d26059e51a..c3e7a882a8 100644 --- a/runtime/imported_values_memory_metering_test.go +++ b/runtime/imported_values_memory_metering_test.go @@ -26,11 +26,11 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" "github.com/onflow/cadence/encoding/json" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - "github.com/onflow/cadence/runtime/tests/utils" + . "github.com/onflow/cadence/tests/runtime_utils" + "github.com/onflow/cadence/tests/utils" ) func testUseMemory(meter map[common.MemoryKind]uint64) func(common.MemoryUsage) error { diff --git a/runtime/inbox_test.go b/runtime/inbox_test.go index fa11bdcdd7..00380e23e4 100644 --- a/runtime/inbox_test.go +++ b/runtime/inbox_test.go @@ -27,10 +27,10 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" "github.com/onflow/cadence/encoding/json" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" + . "github.com/onflow/cadence/tests/runtime_utils" ) func TestRuntimeAccountInboxPublishUnpublish(t *testing.T) { diff --git a/runtime/interface.go b/runtime/interface.go index 9f20ba8f31..410ee057d2 100644 --- a/runtime/interface.go +++ b/runtime/interface.go @@ -25,10 +25,10 @@ import ( "go.opentelemetry.io/otel/attribute" "github.com/onflow/cadence" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) type Interface interface { diff --git a/runtime/literal.go b/runtime/literal.go index ad1ad9b3a4..a345fc4f2e 100644 --- a/runtime/literal.go +++ b/runtime/literal.go @@ -22,12 +22,12 @@ import ( "math/big" "github.com/onflow/cadence" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" "github.com/onflow/cadence/fixedpoint" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/parser" + "github.com/onflow/cadence/sema" ) var InvalidLiteralError = parser.NewSyntaxError( diff --git a/runtime/literal_test.go b/runtime/literal_test.go index c0b727b9a8..e35033b250 100644 --- a/runtime/literal_test.go +++ b/runtime/literal_test.go @@ -26,11 +26,11 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/sema" + . "github.com/onflow/cadence/tests/runtime_utils" + . "github.com/onflow/cadence/tests/utils" ) func TestRuntimeParseLiteral(t *testing.T) { diff --git a/runtime/predeclaredvalues_test.go b/runtime/predeclaredvalues_test.go index 14d1914790..58757a8bb7 100644 --- a/runtime/predeclaredvalues_test.go +++ b/runtime/predeclaredvalues_test.go @@ -27,15 +27,15 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/common/orderedmap" + "github.com/onflow/cadence/interpreter" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/common/orderedmap" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - "github.com/onflow/cadence/runtime/tests/checker" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + "github.com/onflow/cadence/tests/checker" + . "github.com/onflow/cadence/tests/runtime_utils" + . "github.com/onflow/cadence/tests/utils" ) func TestRuntimePredeclaredValues(t *testing.T) { diff --git a/runtime/program_params_validation_test.go b/runtime/program_params_validation_test.go index a091d58183..f2ec7c4882 100644 --- a/runtime/program_params_validation_test.go +++ b/runtime/program_params_validation_test.go @@ -26,13 +26,13 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" "github.com/onflow/cadence/encoding/json" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/checker" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/checker" + . "github.com/onflow/cadence/tests/runtime_utils" + . "github.com/onflow/cadence/tests/utils" ) func TestRuntimeScriptParameterTypeValidation(t *testing.T) { diff --git a/runtime/repl.go b/runtime/repl.go index c0dd41a687..0e4678fcc1 100644 --- a/runtime/repl.go +++ b/runtime/repl.go @@ -25,16 +25,16 @@ import ( "sort" "github.com/onflow/cadence" - "github.com/onflow/cadence/runtime/activations" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/cmd" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/parser/lexer" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/activations" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/cmd" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/parser" + "github.com/onflow/cadence/parser/lexer" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" ) type REPL struct { diff --git a/runtime/resource_duplicate_test.go b/runtime/resource_duplicate_test.go index b06bd7af1d..5f5f12c666 100644 --- a/runtime/resource_duplicate_test.go +++ b/runtime/resource_duplicate_test.go @@ -24,13 +24,13 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" "github.com/onflow/cadence/encoding/json" + "github.com/onflow/cadence/interpreter" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/sema" + . "github.com/onflow/cadence/tests/runtime_utils" + . "github.com/onflow/cadence/tests/utils" ) func TestRuntimeResourceDuplicationWithContractTransferInTransaction(t *testing.T) { diff --git a/runtime/resourcedictionary_test.go b/runtime/resourcedictionary_test.go index 5d4f50f281..088d4e977f 100644 --- a/runtime/resourcedictionary_test.go +++ b/runtime/resourcedictionary_test.go @@ -27,10 +27,10 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - "github.com/onflow/cadence/runtime/tests/utils" + . "github.com/onflow/cadence/tests/runtime_utils" + "github.com/onflow/cadence/tests/utils" ) const resourceDictionaryContract = ` diff --git a/runtime/rlp_test.go b/runtime/rlp_test.go index 6784b84c35..17582dceee 100644 --- a/runtime/rlp_test.go +++ b/runtime/rlp_test.go @@ -25,11 +25,11 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" "github.com/onflow/cadence/encoding/json" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - . "github.com/onflow/cadence/runtime/tests/utils" + . "github.com/onflow/cadence/tests/runtime_utils" + . "github.com/onflow/cadence/tests/utils" ) func TestRuntimeRLPDecodeString(t *testing.T) { diff --git a/runtime/runtime.go b/runtime/runtime.go index 25dc1704e9..1bb4254d84 100644 --- a/runtime/runtime.go +++ b/runtime/runtime.go @@ -23,12 +23,12 @@ import ( "time" "github.com/onflow/cadence" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" ) type Script struct { diff --git a/runtime/runtime_memory_metering_test.go b/runtime/runtime_memory_metering_test.go index eddbbb0529..f7e91fd7bf 100644 --- a/runtime/runtime_memory_metering_test.go +++ b/runtime/runtime_memory_metering_test.go @@ -27,12 +27,12 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" "github.com/onflow/cadence/encoding/json" + "github.com/onflow/cadence/errors" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - . "github.com/onflow/cadence/runtime/tests/utils" + . "github.com/onflow/cadence/tests/runtime_utils" + . "github.com/onflow/cadence/tests/utils" ) type testMemoryGauge struct { diff --git a/runtime/runtime_test.go b/runtime/runtime_test.go index d3f13fa003..ee8b3c30ac 100644 --- a/runtime/runtime_test.go +++ b/runtime/runtime_test.go @@ -34,18 +34,18 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" "github.com/onflow/cadence/encoding/json" + runtimeErrors "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/parser" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - runtimeErrors "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - "github.com/onflow/cadence/runtime/tests/checker" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + "github.com/onflow/cadence/tests/checker" + . "github.com/onflow/cadence/tests/runtime_utils" + . "github.com/onflow/cadence/tests/utils" ) func TestRuntimeImport(t *testing.T) { diff --git a/runtime/script_executor.go b/runtime/script_executor.go index 61212a30da..ca07c4cb00 100644 --- a/runtime/script_executor.go +++ b/runtime/script_executor.go @@ -22,8 +22,8 @@ import ( "sync" "github.com/onflow/cadence" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) type interpreterScriptExecutorPreparation struct { diff --git a/runtime/sharedstate_test.go b/runtime/sharedstate_test.go index 243543432a..660c439b1c 100644 --- a/runtime/sharedstate_test.go +++ b/runtime/sharedstate_test.go @@ -25,11 +25,11 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - . "github.com/onflow/cadence/runtime/tests/utils" + . "github.com/onflow/cadence/tests/runtime_utils" + . "github.com/onflow/cadence/tests/utils" ) func TestRuntimeSharedState(t *testing.T) { diff --git a/runtime/storage.go b/runtime/storage.go index a76c5f0417..7b9a567285 100644 --- a/runtime/storage.go +++ b/runtime/storage.go @@ -26,10 +26,10 @@ import ( "github.com/fxamacker/cbor/v2" "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/common/orderedmap" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/common/orderedmap" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" ) const StorageDomainContract = "contract" diff --git a/runtime/storage_test.go b/runtime/storage_test.go index 449a21d46e..ac7a96430e 100644 --- a/runtime/storage_test.go +++ b/runtime/storage_test.go @@ -31,13 +31,13 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/common/orderedmap" "github.com/onflow/cadence/encoding/json" + "github.com/onflow/cadence/interpreter" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/common/orderedmap" - "github.com/onflow/cadence/runtime/interpreter" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - . "github.com/onflow/cadence/runtime/tests/utils" + . "github.com/onflow/cadence/tests/runtime_utils" + . "github.com/onflow/cadence/tests/utils" ) func withWritesToStorage( diff --git a/runtime/transaction_executor.go b/runtime/transaction_executor.go index 5ac6ee08a1..a8d3f30a90 100644 --- a/runtime/transaction_executor.go +++ b/runtime/transaction_executor.go @@ -22,9 +22,9 @@ import ( "sync" "github.com/onflow/cadence" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) type interpreterTransactionExecutorPreparation struct { diff --git a/runtime/type_test.go b/runtime/type_test.go index cfabeafec1..2ae870e408 100644 --- a/runtime/type_test.go +++ b/runtime/type_test.go @@ -25,9 +25,9 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" + . "github.com/onflow/cadence/tests/runtime_utils" ) func TestRuntimeTypeStorage(t *testing.T) { diff --git a/runtime/types.go b/runtime/types.go index fce7de6778..b5b86b69cf 100644 --- a/runtime/types.go +++ b/runtime/types.go @@ -19,10 +19,10 @@ package runtime import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" ) type ResolvedLocation = sema.ResolvedLocation diff --git a/runtime/validation_test.go b/runtime/validation_test.go index bb38c9d5c7..980654b941 100644 --- a/runtime/validation_test.go +++ b/runtime/validation_test.go @@ -24,12 +24,12 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence" + "github.com/onflow/cadence/common" "github.com/onflow/cadence/encoding/json" + "github.com/onflow/cadence/interpreter" . "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - . "github.com/onflow/cadence/runtime/tests/runtime_utils" - . "github.com/onflow/cadence/runtime/tests/utils" + . "github.com/onflow/cadence/tests/runtime_utils" + . "github.com/onflow/cadence/tests/utils" ) // TestRuntimeArgumentImportMissingType tests if errors produced while validating diff --git a/runtime/value.go b/runtime/value.go index 3f8b541315..9337049b0f 100644 --- a/runtime/value.go +++ b/runtime/value.go @@ -19,9 +19,9 @@ package runtime import ( - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) // An exportableValue is a Cadence value emitted by the runtime. diff --git a/runtime/sema/access.go b/sema/access.go similarity index 98% rename from runtime/sema/access.go rename to sema/access.go index 9def8f908b..58517c7ed7 100644 --- a/runtime/sema/access.go +++ b/sema/access.go @@ -24,10 +24,10 @@ import ( "golang.org/x/exp/slices" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/common/orderedmap" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/common/orderedmap" + "github.com/onflow/cadence/errors" ) type Access interface { diff --git a/runtime/sema/access_test.go b/sema/access_test.go similarity index 99% rename from runtime/sema/access_test.go rename to sema/access_test.go index bcee74e122..a5472f468c 100644 --- a/runtime/sema/access_test.go +++ b/sema/access_test.go @@ -23,8 +23,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) func TestPrimitiveAccess_QualifiedKeyword(t *testing.T) { diff --git a/runtime/sema/accesscheckmode.go b/sema/accesscheckmode.go similarity index 96% rename from runtime/sema/accesscheckmode.go rename to sema/accesscheckmode.go index 1c8b2ff47e..99dad5cf8d 100644 --- a/runtime/sema/accesscheckmode.go +++ b/sema/accesscheckmode.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/errors" ) //go:generate go run golang.org/x/tools/cmd/stringer -type=AccessCheckMode diff --git a/runtime/sema/accesscheckmode_string.go b/sema/accesscheckmode_string.go similarity index 100% rename from runtime/sema/accesscheckmode_string.go rename to sema/accesscheckmode_string.go diff --git a/runtime/sema/account.cdc b/sema/account.cdc similarity index 100% rename from runtime/sema/account.cdc rename to sema/account.cdc diff --git a/runtime/sema/account.gen.go b/sema/account.gen.go similarity index 99% rename from runtime/sema/account.gen.go rename to sema/account.gen.go index 89d05b2917..4062f66350 100644 --- a/runtime/sema/account.gen.go +++ b/sema/account.gen.go @@ -20,8 +20,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) const AccountTypeAddressFieldName = "address" diff --git a/runtime/sema/account.go b/sema/account.go similarity index 97% rename from runtime/sema/account.go rename to sema/account.go index 0e08584423..f76fabeb07 100644 --- a/runtime/sema/account.go +++ b/sema/account.go @@ -21,8 +21,8 @@ package sema import ( "fmt" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) //go:generate go run ./gen account.cdc account.gen.go diff --git a/runtime/sema/account_capability_controller.cdc b/sema/account_capability_controller.cdc similarity index 100% rename from runtime/sema/account_capability_controller.cdc rename to sema/account_capability_controller.cdc diff --git a/runtime/sema/account_capability_controller.gen.go b/sema/account_capability_controller.gen.go similarity index 99% rename from runtime/sema/account_capability_controller.gen.go rename to sema/account_capability_controller.gen.go index 894c436b54..ef81dc8f8d 100644 --- a/runtime/sema/account_capability_controller.gen.go +++ b/sema/account_capability_controller.gen.go @@ -19,7 +19,7 @@ package sema -import "github.com/onflow/cadence/runtime/ast" +import "github.com/onflow/cadence/ast" const AccountCapabilityControllerTypeCapabilityFieldName = "capability" diff --git a/runtime/sema/account_capability_controller.go b/sema/account_capability_controller.go similarity index 100% rename from runtime/sema/account_capability_controller.go rename to sema/account_capability_controller.go diff --git a/runtime/sema/any_type.go b/sema/any_type.go similarity index 100% rename from runtime/sema/any_type.go rename to sema/any_type.go diff --git a/runtime/sema/anyattachment_types.go b/sema/anyattachment_types.go similarity index 100% rename from runtime/sema/anyattachment_types.go rename to sema/anyattachment_types.go diff --git a/runtime/sema/anyresource_type.go b/sema/anyresource_type.go similarity index 100% rename from runtime/sema/anyresource_type.go rename to sema/anyresource_type.go diff --git a/runtime/sema/anystruct_type.go b/sema/anystruct_type.go similarity index 100% rename from runtime/sema/anystruct_type.go rename to sema/anystruct_type.go diff --git a/runtime/sema/before_extractor.go b/sema/before_extractor.go similarity index 97% rename from runtime/sema/before_extractor.go rename to sema/before_extractor.go index e7e0ab0c75..b99842f5fc 100644 --- a/runtime/sema/before_extractor.go +++ b/sema/before_extractor.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) type BeforeExtractor struct { diff --git a/runtime/sema/before_extractor_test.go b/sema/before_extractor_test.go similarity index 96% rename from runtime/sema/before_extractor_test.go rename to sema/before_extractor_test.go index b82b748b19..5d016a58e3 100644 --- a/runtime/sema/before_extractor_test.go +++ b/sema/before_extractor_test.go @@ -24,8 +24,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/parser" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/parser" ) func TestBeforeExtractor(t *testing.T) { diff --git a/runtime/sema/binaryoperationkind.go b/sema/binaryoperationkind.go similarity index 95% rename from runtime/sema/binaryoperationkind.go rename to sema/binaryoperationkind.go index 796f9aba1a..033b4c5d42 100644 --- a/runtime/sema/binaryoperationkind.go +++ b/sema/binaryoperationkind.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/errors" ) //go:generate go run golang.org/x/tools/cmd/stringer -type=BinaryOperationKind diff --git a/runtime/sema/binaryoperationkind_string.go b/sema/binaryoperationkind_string.go similarity index 100% rename from runtime/sema/binaryoperationkind_string.go rename to sema/binaryoperationkind_string.go diff --git a/runtime/sema/block.cdc b/sema/block.cdc similarity index 100% rename from runtime/sema/block.cdc rename to sema/block.cdc diff --git a/runtime/sema/block.gen.go b/sema/block.gen.go similarity index 98% rename from runtime/sema/block.gen.go rename to sema/block.gen.go index 8f059af05d..551ec1e21a 100644 --- a/runtime/sema/block.gen.go +++ b/sema/block.gen.go @@ -19,7 +19,7 @@ package sema -import "github.com/onflow/cadence/runtime/ast" +import "github.com/onflow/cadence/ast" const BlockTypeHeightFieldName = "height" diff --git a/runtime/sema/block.go b/sema/block.go similarity index 100% rename from runtime/sema/block.go rename to sema/block.go diff --git a/runtime/sema/bool_type.go b/sema/bool_type.go similarity index 100% rename from runtime/sema/bool_type.go rename to sema/bool_type.go diff --git a/runtime/sema/character.cdc b/sema/character.cdc similarity index 100% rename from runtime/sema/character.cdc rename to sema/character.cdc diff --git a/runtime/sema/character.gen.go b/sema/character.gen.go similarity index 97% rename from runtime/sema/character.gen.go rename to sema/character.gen.go index 3938f01bb8..b0b10694f2 100644 --- a/runtime/sema/character.gen.go +++ b/sema/character.gen.go @@ -19,7 +19,7 @@ package sema -import "github.com/onflow/cadence/runtime/ast" +import "github.com/onflow/cadence/ast" const CharacterTypeUtf8FieldName = "utf8" diff --git a/runtime/sema/character.go b/sema/character.go similarity index 100% rename from runtime/sema/character.go rename to sema/character.go diff --git a/runtime/sema/check_array_expression.go b/sema/check_array_expression.go similarity index 98% rename from runtime/sema/check_array_expression.go rename to sema/check_array_expression.go index fa1b5c544c..c38212bbc8 100644 --- a/runtime/sema/check_array_expression.go +++ b/sema/check_array_expression.go @@ -18,7 +18,7 @@ package sema -import "github.com/onflow/cadence/runtime/ast" +import "github.com/onflow/cadence/ast" func (checker *Checker) VisitArrayExpression(arrayExpression *ast.ArrayExpression) Type { diff --git a/runtime/sema/check_assignment.go b/sema/check_assignment.go similarity index 99% rename from runtime/sema/check_assignment.go rename to sema/check_assignment.go index 3a6d3e4eea..75f3b7618a 100644 --- a/runtime/sema/check_assignment.go +++ b/sema/check_assignment.go @@ -19,9 +19,9 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" ) func (checker *Checker) VisitAssignmentStatement(assignment *ast.AssignmentStatement) (_ struct{}) { diff --git a/runtime/sema/check_attach_expression.go b/sema/check_attach_expression.go similarity index 97% rename from runtime/sema/check_attach_expression.go rename to sema/check_attach_expression.go index c8bebb7d33..392f5caec5 100644 --- a/runtime/sema/check_attach_expression.go +++ b/sema/check_attach_expression.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) func (checker *Checker) VisitAttachExpression(expression *ast.AttachExpression) Type { diff --git a/runtime/sema/check_binary_expression.go b/sema/check_binary_expression.go similarity index 98% rename from runtime/sema/check_binary_expression.go rename to sema/check_binary_expression.go index 2980478306..2b44aaa972 100644 --- a/runtime/sema/check_binary_expression.go +++ b/sema/check_binary_expression.go @@ -19,9 +19,9 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" ) func (checker *Checker) VisitBinaryExpression(expression *ast.BinaryExpression) Type { diff --git a/runtime/sema/check_block.go b/sema/check_block.go similarity index 98% rename from runtime/sema/check_block.go rename to sema/check_block.go index a260b40858..294620edd1 100644 --- a/runtime/sema/check_block.go +++ b/sema/check_block.go @@ -18,7 +18,7 @@ package sema -import "github.com/onflow/cadence/runtime/ast" +import "github.com/onflow/cadence/ast" func (checker *Checker) checkBlock(block *ast.Block) { checker.enterValueScope() diff --git a/runtime/sema/check_casting_expression.go b/sema/check_casting_expression.go similarity index 98% rename from runtime/sema/check_casting_expression.go rename to sema/check_casting_expression.go index 71097cbccb..b6ba20694c 100644 --- a/runtime/sema/check_casting_expression.go +++ b/sema/check_casting_expression.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/errors" ) func (checker *Checker) VisitCastingExpression(expression *ast.CastingExpression) Type { diff --git a/runtime/sema/check_composite_declaration.go b/sema/check_composite_declaration.go similarity index 99% rename from runtime/sema/check_composite_declaration.go rename to sema/check_composite_declaration.go index 5bc46ecd5e..fdcfc70531 100644 --- a/runtime/sema/check_composite_declaration.go +++ b/sema/check_composite_declaration.go @@ -19,10 +19,10 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/common/orderedmap" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/common/orderedmap" + "github.com/onflow/cadence/errors" ) func (checker *Checker) VisitCompositeDeclaration(declaration *ast.CompositeDeclaration) (_ struct{}) { diff --git a/runtime/sema/check_conditional.go b/sema/check_conditional.go similarity index 97% rename from runtime/sema/check_conditional.go rename to sema/check_conditional.go index 9c4da9cd52..1a92b423e0 100644 --- a/runtime/sema/check_conditional.go +++ b/sema/check_conditional.go @@ -19,9 +19,9 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common/persistent" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common/persistent" + "github.com/onflow/cadence/errors" ) func (checker *Checker) VisitIfStatement(statement *ast.IfStatement) (_ struct{}) { diff --git a/runtime/sema/check_conditions.go b/sema/check_conditions.go similarity index 98% rename from runtime/sema/check_conditions.go rename to sema/check_conditions.go index e9ca18163b..676d6fce03 100644 --- a/runtime/sema/check_conditions.go +++ b/sema/check_conditions.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/errors" ) func (checker *Checker) visitConditions(conditions []ast.Condition) { diff --git a/runtime/sema/check_create_expression.go b/sema/check_create_expression.go similarity index 96% rename from runtime/sema/check_create_expression.go rename to sema/check_create_expression.go index 2704232c75..50b6b40631 100644 --- a/runtime/sema/check_create_expression.go +++ b/sema/check_create_expression.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) func (checker *Checker) VisitCreateExpression(expression *ast.CreateExpression) Type { diff --git a/runtime/sema/check_destroy_expression.go b/sema/check_destroy_expression.go similarity index 97% rename from runtime/sema/check_destroy_expression.go rename to sema/check_destroy_expression.go index 0bc2b6dfdc..3e1d95501a 100644 --- a/runtime/sema/check_destroy_expression.go +++ b/sema/check_destroy_expression.go @@ -19,7 +19,7 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" + "github.com/onflow/cadence/ast" ) func (checker *Checker) VisitDestroyExpression(expression *ast.DestroyExpression) (resultType Type) { diff --git a/runtime/sema/check_dictionary_expression.go b/sema/check_dictionary_expression.go similarity index 98% rename from runtime/sema/check_dictionary_expression.go rename to sema/check_dictionary_expression.go index 77f2c5fd78..b21c87275f 100644 --- a/runtime/sema/check_dictionary_expression.go +++ b/sema/check_dictionary_expression.go @@ -19,7 +19,7 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" + "github.com/onflow/cadence/ast" ) func (checker *Checker) VisitDictionaryExpression(expression *ast.DictionaryExpression) Type { diff --git a/runtime/sema/check_emit_statement.go b/sema/check_emit_statement.go similarity index 96% rename from runtime/sema/check_emit_statement.go rename to sema/check_emit_statement.go index f50a8af4c7..4e0f9d8bdd 100644 --- a/runtime/sema/check_emit_statement.go +++ b/sema/check_emit_statement.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) func (checker *Checker) VisitEmitStatement(statement *ast.EmitStatement) (_ struct{}) { diff --git a/runtime/sema/check_event_declaration.go b/sema/check_event_declaration.go similarity index 96% rename from runtime/sema/check_event_declaration.go rename to sema/check_event_declaration.go index d568fa568f..1dc12a1ec1 100644 --- a/runtime/sema/check_event_declaration.go +++ b/sema/check_event_declaration.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) // checkEventParameters checks that the event initializer's parameters are valid, diff --git a/runtime/sema/check_event_declaration_test.go b/sema/check_event_declaration_test.go similarity index 96% rename from runtime/sema/check_event_declaration_test.go rename to sema/check_event_declaration_test.go index ba1b489f1e..cbb36e37bc 100644 --- a/runtime/sema/check_event_declaration_test.go +++ b/sema/check_event_declaration_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) func TestIsValidEventParameterType(t *testing.T) { diff --git a/runtime/sema/check_expression.go b/sema/check_expression.go similarity index 99% rename from runtime/sema/check_expression.go rename to sema/check_expression.go index 233127c3af..683c6bcfe6 100644 --- a/runtime/sema/check_expression.go +++ b/sema/check_expression.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) func (checker *Checker) VisitIdentifierExpression(expression *ast.IdentifierExpression) Type { diff --git a/runtime/sema/check_for.go b/sema/check_for.go similarity index 98% rename from runtime/sema/check_for.go rename to sema/check_for.go index dfc04057e4..f67bbfe82f 100644 --- a/runtime/sema/check_for.go +++ b/sema/check_for.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) func (checker *Checker) VisitForStatement(statement *ast.ForStatement) (_ struct{}) { diff --git a/runtime/sema/check_force_expression.go b/sema/check_force_expression.go similarity index 97% rename from runtime/sema/check_force_expression.go rename to sema/check_force_expression.go index d8e7dc14b5..7ecc3c9ab7 100644 --- a/runtime/sema/check_force_expression.go +++ b/sema/check_force_expression.go @@ -19,7 +19,7 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" + "github.com/onflow/cadence/ast" ) func (checker *Checker) VisitForceExpression(expression *ast.ForceExpression) Type { diff --git a/runtime/sema/check_function.go b/sema/check_function.go similarity index 99% rename from runtime/sema/check_function.go rename to sema/check_function.go index dc24c119da..c0bbe8a179 100644 --- a/runtime/sema/check_function.go +++ b/sema/check_function.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) func PurityFromAnnotation(purity ast.FunctionPurity) FunctionPurity { diff --git a/runtime/sema/check_import_declaration.go b/sema/check_import_declaration.go similarity index 99% rename from runtime/sema/check_import_declaration.go rename to sema/check_import_declaration.go index 5a3df7bc5e..0dc96d8d4e 100644 --- a/runtime/sema/check_import_declaration.go +++ b/sema/check_import_declaration.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) // Import declarations are handled in two phases: diff --git a/runtime/sema/check_interface_declaration.go b/sema/check_interface_declaration.go similarity index 99% rename from runtime/sema/check_interface_declaration.go rename to sema/check_interface_declaration.go index bfef6c7420..30c076dd64 100644 --- a/runtime/sema/check_interface_declaration.go +++ b/sema/check_interface_declaration.go @@ -19,10 +19,10 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/common/orderedmap" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/common/orderedmap" + "github.com/onflow/cadence/errors" ) // VisitInterfaceDeclaration checks the given interface declaration. diff --git a/runtime/sema/check_invocation_expression.go b/sema/check_invocation_expression.go similarity index 99% rename from runtime/sema/check_invocation_expression.go rename to sema/check_invocation_expression.go index dc8a2ac634..49f714f24c 100644 --- a/runtime/sema/check_invocation_expression.go +++ b/sema/check_invocation_expression.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) func (checker *Checker) VisitInvocationExpression(invocationExpression *ast.InvocationExpression) Type { diff --git a/runtime/sema/check_member_expression.go b/sema/check_member_expression.go similarity index 99% rename from runtime/sema/check_member_expression.go rename to sema/check_member_expression.go index 8ecf12d7fd..83572db4fd 100644 --- a/runtime/sema/check_member_expression.go +++ b/sema/check_member_expression.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) // NOTE: only called if the member expression is *not* an assignment diff --git a/runtime/sema/check_path_expression.go b/sema/check_path_expression.go similarity index 94% rename from runtime/sema/check_path_expression.go rename to sema/check_path_expression.go index 5accc8ef43..1e2b8c6102 100644 --- a/runtime/sema/check_path_expression.go +++ b/sema/check_path_expression.go @@ -21,9 +21,9 @@ package sema import ( "regexp" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" ) func (checker *Checker) VisitPathExpression(expression *ast.PathExpression) Type { diff --git a/runtime/sema/check_path_expression_test.go b/sema/check_path_expression_test.go similarity index 100% rename from runtime/sema/check_path_expression_test.go rename to sema/check_path_expression_test.go diff --git a/runtime/sema/check_pragma.go b/sema/check_pragma.go similarity index 98% rename from runtime/sema/check_pragma.go rename to sema/check_pragma.go index 2da88147c4..84ab3168cc 100644 --- a/runtime/sema/check_pragma.go +++ b/sema/check_pragma.go @@ -18,7 +18,7 @@ package sema -import "github.com/onflow/cadence/runtime/ast" +import "github.com/onflow/cadence/ast" // VisitPragmaDeclaration checks that the pragma declaration is valid. // It is valid if the root expression is an identifier or invocation. diff --git a/runtime/sema/check_reference_expression.go b/sema/check_reference_expression.go similarity index 99% rename from runtime/sema/check_reference_expression.go rename to sema/check_reference_expression.go index cda7c8cf60..54da73e058 100644 --- a/runtime/sema/check_reference_expression.go +++ b/sema/check_reference_expression.go @@ -19,7 +19,7 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" + "github.com/onflow/cadence/ast" ) // VisitReferenceExpression checks a reference expression diff --git a/runtime/sema/check_remove_statement.go b/sema/check_remove_statement.go similarity index 96% rename from runtime/sema/check_remove_statement.go rename to sema/check_remove_statement.go index 1e3ff17890..6ac905ea74 100644 --- a/runtime/sema/check_remove_statement.go +++ b/sema/check_remove_statement.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) func (checker *Checker) VisitRemoveStatement(statement *ast.RemoveStatement) (_ struct{}) { diff --git a/runtime/sema/check_return_statement.go b/sema/check_return_statement.go similarity index 98% rename from runtime/sema/check_return_statement.go rename to sema/check_return_statement.go index 43799f4e58..b83fe2adc4 100644 --- a/runtime/sema/check_return_statement.go +++ b/sema/check_return_statement.go @@ -18,7 +18,7 @@ package sema -import "github.com/onflow/cadence/runtime/ast" +import "github.com/onflow/cadence/ast" func (checker *Checker) VisitReturnStatement(statement *ast.ReturnStatement) (_ struct{}) { functionActivation := checker.functionActivations.Current() diff --git a/runtime/sema/check_swap.go b/sema/check_swap.go similarity index 97% rename from runtime/sema/check_swap.go rename to sema/check_swap.go index 69af616680..3745ef0a7e 100644 --- a/runtime/sema/check_swap.go +++ b/sema/check_swap.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) func (checker *Checker) VisitSwapStatement(swap *ast.SwapStatement) (_ struct{}) { diff --git a/runtime/sema/check_switch.go b/sema/check_switch.go similarity index 99% rename from runtime/sema/check_switch.go rename to sema/check_switch.go index 84d6670f25..5cfd1cedc6 100644 --- a/runtime/sema/check_switch.go +++ b/sema/check_switch.go @@ -19,7 +19,7 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" + "github.com/onflow/cadence/ast" ) func (checker *Checker) VisitSwitchStatement(statement *ast.SwitchStatement) (_ struct{}) { diff --git a/runtime/sema/check_transaction_declaration.go b/sema/check_transaction_declaration.go similarity index 97% rename from runtime/sema/check_transaction_declaration.go rename to sema/check_transaction_declaration.go index d12b23bdd0..14ef088880 100644 --- a/runtime/sema/check_transaction_declaration.go +++ b/sema/check_transaction_declaration.go @@ -19,10 +19,10 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/common/orderedmap" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/common/orderedmap" + "github.com/onflow/cadence/errors" ) func (checker *Checker) VisitTransactionDeclaration(declaration *ast.TransactionDeclaration) (_ struct{}) { diff --git a/runtime/sema/check_unary_expression.go b/sema/check_unary_expression.go similarity index 97% rename from runtime/sema/check_unary_expression.go rename to sema/check_unary_expression.go index cf1b01af69..31013d7cfa 100644 --- a/runtime/sema/check_unary_expression.go +++ b/sema/check_unary_expression.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) func (checker *Checker) VisitUnaryExpression(expression *ast.UnaryExpression) Type { diff --git a/runtime/sema/check_variable_declaration.go b/sema/check_variable_declaration.go similarity index 99% rename from runtime/sema/check_variable_declaration.go rename to sema/check_variable_declaration.go index b451416262..e7b1c1cf47 100644 --- a/runtime/sema/check_variable_declaration.go +++ b/sema/check_variable_declaration.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/errors" ) func (checker *Checker) VisitVariableDeclaration(declaration *ast.VariableDeclaration) (_ struct{}) { diff --git a/runtime/sema/check_while.go b/sema/check_while.go similarity index 96% rename from runtime/sema/check_while.go rename to sema/check_while.go index f874e6b267..082eed425a 100644 --- a/runtime/sema/check_while.go +++ b/sema/check_while.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) func (checker *Checker) VisitWhileStatement(statement *ast.WhileStatement) (_ struct{}) { diff --git a/runtime/sema/checker.go b/sema/checker.go similarity index 99% rename from runtime/sema/checker.go rename to sema/checker.go index 51d5204b44..d94b2b64de 100644 --- a/runtime/sema/checker.go +++ b/sema/checker.go @@ -25,11 +25,11 @@ import ( "github.com/rivo/uniseg" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/common/persistent" + "github.com/onflow/cadence/errors" "github.com/onflow/cadence/fixedpoint" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/common/persistent" - "github.com/onflow/cadence/runtime/errors" ) const ArgumentLabelNotRequired = "_" diff --git a/runtime/sema/checker_test.go b/sema/checker_test.go similarity index 99% rename from runtime/sema/checker_test.go rename to sema/checker_test.go index 5824f4010d..6fd7f649ff 100644 --- a/runtime/sema/checker_test.go +++ b/sema/checker_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) func TestOptionalSubtyping(t *testing.T) { diff --git a/runtime/sema/config.go b/sema/config.go similarity index 100% rename from runtime/sema/config.go rename to sema/config.go diff --git a/runtime/sema/containerkind.go b/sema/containerkind.go similarity index 100% rename from runtime/sema/containerkind.go rename to sema/containerkind.go diff --git a/runtime/sema/containerkind_string.go b/sema/containerkind_string.go similarity index 100% rename from runtime/sema/containerkind_string.go rename to sema/containerkind_string.go diff --git a/runtime/sema/crypto_algorithm_types.go b/sema/crypto_algorithm_types.go similarity index 99% rename from runtime/sema/crypto_algorithm_types.go rename to sema/crypto_algorithm_types.go index 1d34e85542..d5d0d1849b 100644 --- a/runtime/sema/crypto_algorithm_types.go +++ b/sema/crypto_algorithm_types.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" ) //go:generate go run golang.org/x/tools/cmd/stringer -type=SignatureAlgorithm diff --git a/runtime/sema/crypto_algorithm_types_test.go b/sema/crypto_algorithm_types_test.go similarity index 100% rename from runtime/sema/crypto_algorithm_types_test.go rename to sema/crypto_algorithm_types_test.go diff --git a/runtime/sema/declarations.go b/sema/declarations.go similarity index 93% rename from runtime/sema/declarations.go rename to sema/declarations.go index 1bd85266db..3983f9e7f4 100644 --- a/runtime/sema/declarations.go +++ b/sema/declarations.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) type ValueDeclaration interface { diff --git a/runtime/sema/deployedcontract.cdc b/sema/deployedcontract.cdc similarity index 100% rename from runtime/sema/deployedcontract.cdc rename to sema/deployedcontract.cdc diff --git a/runtime/sema/deployedcontract.gen.go b/sema/deployedcontract.gen.go similarity index 98% rename from runtime/sema/deployedcontract.gen.go rename to sema/deployedcontract.gen.go index 7574a6588b..595b19dfb4 100644 --- a/runtime/sema/deployedcontract.gen.go +++ b/sema/deployedcontract.gen.go @@ -19,7 +19,7 @@ package sema -import "github.com/onflow/cadence/runtime/ast" +import "github.com/onflow/cadence/ast" const DeployedContractTypeAddressFieldName = "address" diff --git a/runtime/sema/deployedcontract.go b/sema/deployedcontract.go similarity index 100% rename from runtime/sema/deployedcontract.go rename to sema/deployedcontract.go diff --git a/runtime/sema/deployment_result.cdc b/sema/deployment_result.cdc similarity index 100% rename from runtime/sema/deployment_result.cdc rename to sema/deployment_result.cdc diff --git a/runtime/sema/deployment_result.gen.go b/sema/deployment_result.gen.go similarity index 95% rename from runtime/sema/deployment_result.gen.go rename to sema/deployment_result.gen.go index b3784a7108..67822d994a 100644 --- a/runtime/sema/deployment_result.gen.go +++ b/sema/deployment_result.gen.go @@ -20,8 +20,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) const DeploymentResultTypeDeployedContractFieldName = "deployedContract" diff --git a/runtime/sema/deployment_result.go b/sema/deployment_result.go similarity index 100% rename from runtime/sema/deployment_result.go rename to sema/deployment_result.go diff --git a/runtime/sema/elaboration.go b/sema/elaboration.go similarity index 99% rename from runtime/sema/elaboration.go rename to sema/elaboration.go index b6b025eef0..6b79e7c923 100644 --- a/runtime/sema/elaboration.go +++ b/sema/elaboration.go @@ -21,9 +21,9 @@ package sema import ( "sync" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/common/bimap" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/common/bimap" ) type MemberAccessInfo struct { diff --git a/runtime/sema/entitlements.cdc b/sema/entitlements.cdc similarity index 100% rename from runtime/sema/entitlements.cdc rename to sema/entitlements.cdc diff --git a/runtime/sema/entitlements.gen.go b/sema/entitlements.gen.go similarity index 100% rename from runtime/sema/entitlements.gen.go rename to sema/entitlements.gen.go diff --git a/runtime/sema/entitlements.go b/sema/entitlements.go similarity index 100% rename from runtime/sema/entitlements.go rename to sema/entitlements.go diff --git a/runtime/sema/entitlementset.go b/sema/entitlementset.go similarity index 99% rename from runtime/sema/entitlementset.go rename to sema/entitlementset.go index 5871021ef1..c2f0b8c489 100644 --- a/runtime/sema/entitlementset.go +++ b/sema/entitlementset.go @@ -22,7 +22,7 @@ import ( "sort" "strings" - "github.com/onflow/cadence/runtime/common/orderedmap" + "github.com/onflow/cadence/common/orderedmap" ) func disjunctionKey(disjunction *EntitlementOrderedSet) string { diff --git a/runtime/sema/entitlementset_test.go b/sema/entitlementset_test.go similarity index 99% rename from runtime/sema/entitlementset_test.go rename to sema/entitlementset_test.go index 9ca36405cf..fb4b79081e 100644 --- a/runtime/sema/entitlementset_test.go +++ b/sema/entitlementset_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/onflow/cadence/runtime/common/orderedmap" + "github.com/onflow/cadence/common/orderedmap" ) func TestEntitlementSet_Add(t *testing.T) { diff --git a/runtime/sema/entrypoint.go b/sema/entrypoint.go similarity index 98% rename from runtime/sema/entrypoint.go rename to sema/entrypoint.go index 362bfba470..5799e0bfc3 100644 --- a/runtime/sema/entrypoint.go +++ b/sema/entrypoint.go @@ -19,7 +19,7 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" + "github.com/onflow/cadence/ast" ) const FunctionEntryPointName = "main" diff --git a/runtime/sema/errors.go b/sema/errors.go similarity index 99% rename from runtime/sema/errors.go rename to sema/errors.go index 25461d4f39..3686d9f185 100644 --- a/runtime/sema/errors.go +++ b/sema/errors.go @@ -26,11 +26,11 @@ import ( "github.com/texttheater/golang-levenshtein/levenshtein" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/common/orderedmap" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/pretty" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/common/orderedmap" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/pretty" ) func ErrorMessageExpectedActualTypes( diff --git a/runtime/sema/errors_test.go b/sema/errors_test.go similarity index 98% rename from runtime/sema/errors_test.go rename to sema/errors_test.go index d30d99e9a0..16be2371e7 100644 --- a/runtime/sema/errors_test.go +++ b/sema/errors_test.go @@ -25,7 +25,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/onflow/cadence/runtime/parser" + "github.com/onflow/cadence/parser" ) func TestErrorMessageExpectedActualTypes(t *testing.T) { diff --git a/runtime/sema/function_activations.go b/sema/function_activations.go similarity index 100% rename from runtime/sema/function_activations.go rename to sema/function_activations.go diff --git a/runtime/sema/function_invocations.go b/sema/function_invocations.go similarity index 94% rename from runtime/sema/function_invocations.go rename to sema/function_invocations.go index 1336344c82..6fed362b7c 100644 --- a/runtime/sema/function_invocations.go +++ b/sema/function_invocations.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common/intervalst" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common/intervalst" ) type FunctionInvocation struct { diff --git a/runtime/sema/gen/golden_test.go b/sema/gen/golden_test.go similarity index 59% rename from runtime/sema/gen/golden_test.go rename to sema/gen/golden_test.go index 298004b3c4..bcb116fa0f 100644 --- a/runtime/sema/gen/golden_test.go +++ b/sema/gen/golden_test.go @@ -23,27 +23,27 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - _ "github.com/onflow/cadence/runtime/sema/gen/testdata/comparable" - _ "github.com/onflow/cadence/runtime/sema/gen/testdata/composite_type_pragma" - "github.com/onflow/cadence/runtime/sema/gen/testdata/constructor" - "github.com/onflow/cadence/runtime/sema/gen/testdata/contract" - _ "github.com/onflow/cadence/runtime/sema/gen/testdata/contract" - _ "github.com/onflow/cadence/runtime/sema/gen/testdata/docstrings" - _ "github.com/onflow/cadence/runtime/sema/gen/testdata/entitlement" - _ "github.com/onflow/cadence/runtime/sema/gen/testdata/equatable" - _ "github.com/onflow/cadence/runtime/sema/gen/testdata/exportable" - _ "github.com/onflow/cadence/runtime/sema/gen/testdata/fields" - _ "github.com/onflow/cadence/runtime/sema/gen/testdata/functions" - _ "github.com/onflow/cadence/runtime/sema/gen/testdata/importable" - _ "github.com/onflow/cadence/runtime/sema/gen/testdata/member_accessible" - _ "github.com/onflow/cadence/runtime/sema/gen/testdata/nested" - _ "github.com/onflow/cadence/runtime/sema/gen/testdata/simple_resource" - _ "github.com/onflow/cadence/runtime/sema/gen/testdata/simple_struct" - _ "github.com/onflow/cadence/runtime/sema/gen/testdata/storable" - "github.com/onflow/cadence/runtime/stdlib" - "github.com/onflow/cadence/runtime/tests/checker" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" + _ "github.com/onflow/cadence/sema/gen/testdata/comparable" + _ "github.com/onflow/cadence/sema/gen/testdata/composite_type_pragma" + "github.com/onflow/cadence/sema/gen/testdata/constructor" + "github.com/onflow/cadence/sema/gen/testdata/contract" + _ "github.com/onflow/cadence/sema/gen/testdata/contract" + _ "github.com/onflow/cadence/sema/gen/testdata/docstrings" + _ "github.com/onflow/cadence/sema/gen/testdata/entitlement" + _ "github.com/onflow/cadence/sema/gen/testdata/equatable" + _ "github.com/onflow/cadence/sema/gen/testdata/exportable" + _ "github.com/onflow/cadence/sema/gen/testdata/fields" + _ "github.com/onflow/cadence/sema/gen/testdata/functions" + _ "github.com/onflow/cadence/sema/gen/testdata/importable" + _ "github.com/onflow/cadence/sema/gen/testdata/member_accessible" + _ "github.com/onflow/cadence/sema/gen/testdata/nested" + _ "github.com/onflow/cadence/sema/gen/testdata/simple_resource" + _ "github.com/onflow/cadence/sema/gen/testdata/simple_struct" + _ "github.com/onflow/cadence/sema/gen/testdata/storable" + "github.com/onflow/cadence/stdlib" + "github.com/onflow/cadence/tests/checker" ) func TestConstructor(t *testing.T) { diff --git a/runtime/sema/gen/main.go b/sema/gen/main.go similarity index 99% rename from runtime/sema/gen/main.go rename to sema/gen/main.go index d06e081257..f524af2894 100644 --- a/runtime/sema/gen/main.go +++ b/sema/gen/main.go @@ -33,16 +33,16 @@ import ( "github.com/dave/dst" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/pretty" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/parser" + "github.com/onflow/cadence/pretty" + "github.com/onflow/cadence/sema" ) -const semaPath = "github.com/onflow/cadence/runtime/sema" -const astPath = "github.com/onflow/cadence/runtime/ast" +const semaPath = "github.com/onflow/cadence/sema" +const astPath = "github.com/onflow/cadence/ast" var packagePathFlag = flag.String("p", semaPath, "package path") @@ -1506,7 +1506,7 @@ func goBoolLit(b bool) dst.Expr { func compositeKindExpr(compositeKind common.CompositeKind) *dst.Ident { return &dst.Ident{ - Path: "github.com/onflow/cadence/runtime/common", + Path: "github.com/onflow/cadence/common", Name: compositeKind.String(), } } diff --git a/runtime/sema/gen/main_test.go b/sema/gen/main_test.go similarity index 95% rename from runtime/sema/gen/main_test.go rename to sema/gen/main_test.go index 8e391a07a6..d1ce9c277f 100644 --- a/runtime/sema/gen/main_test.go +++ b/sema/gen/main_test.go @@ -51,7 +51,7 @@ func TestFiles(t *testing.T) { inputPath := filepath.Join(dirPath, "test.cdc") - gen(inputPath, outFile, "github.com/onflow/cadence/runtime/sema/gen/"+dirPath) + gen(inputPath, outFile, "github.com/onflow/cadence/sema/gen/"+dirPath) goldenPath := filepath.Join(dirPath, "test.golden.go") want, err := os.ReadFile(goldenPath) diff --git a/runtime/sema/gen/testdata/comparable/helper.go b/sema/gen/testdata/comparable/helper.go similarity index 93% rename from runtime/sema/gen/testdata/comparable/helper.go rename to sema/gen/testdata/comparable/helper.go index 0051a97d30..874526d7c6 100644 --- a/runtime/sema/gen/testdata/comparable/helper.go +++ b/sema/gen/testdata/comparable/helper.go @@ -18,6 +18,6 @@ package comparable -import "github.com/onflow/cadence/runtime/sema" +import "github.com/onflow/cadence/sema" var TestTypeTag sema.TypeTag diff --git a/runtime/sema/gen/testdata/comparable/test.cdc b/sema/gen/testdata/comparable/test.cdc similarity index 100% rename from runtime/sema/gen/testdata/comparable/test.cdc rename to sema/gen/testdata/comparable/test.cdc diff --git a/runtime/sema/gen/testdata/comparable/test.golden.go b/sema/gen/testdata/comparable/test.golden.go similarity index 95% rename from runtime/sema/gen/testdata/comparable/test.golden.go rename to sema/gen/testdata/comparable/test.golden.go index dbdf47ffaa..09149100e4 100644 --- a/runtime/sema/gen/testdata/comparable/test.golden.go +++ b/sema/gen/testdata/comparable/test.golden.go @@ -19,7 +19,7 @@ package comparable -import "github.com/onflow/cadence/runtime/sema" +import "github.com/onflow/cadence/sema" const TestTypeName = "Test" diff --git a/runtime/sema/gen/testdata/composite_type_pragma/test.cdc b/sema/gen/testdata/composite_type_pragma/test.cdc similarity index 100% rename from runtime/sema/gen/testdata/composite_type_pragma/test.cdc rename to sema/gen/testdata/composite_type_pragma/test.cdc diff --git a/runtime/sema/gen/testdata/composite_type_pragma/test.golden.go b/sema/gen/testdata/composite_type_pragma/test.golden.go similarity index 92% rename from runtime/sema/gen/testdata/composite_type_pragma/test.golden.go rename to sema/gen/testdata/composite_type_pragma/test.golden.go index 3188c90e8b..b6f671ebeb 100644 --- a/runtime/sema/gen/testdata/composite_type_pragma/test.golden.go +++ b/sema/gen/testdata/composite_type_pragma/test.golden.go @@ -20,8 +20,8 @@ package composite_type_pragma import ( - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) const TestTypeName = "Test" diff --git a/runtime/sema/gen/testdata/constructor/test.cdc b/sema/gen/testdata/constructor/test.cdc similarity index 100% rename from runtime/sema/gen/testdata/constructor/test.cdc rename to sema/gen/testdata/constructor/test.cdc diff --git a/runtime/sema/gen/testdata/constructor/test.golden.go b/sema/gen/testdata/constructor/test.golden.go similarity index 94% rename from runtime/sema/gen/testdata/constructor/test.golden.go rename to sema/gen/testdata/constructor/test.golden.go index 724875e182..6a6d1153fe 100644 --- a/runtime/sema/gen/testdata/constructor/test.golden.go +++ b/sema/gen/testdata/constructor/test.golden.go @@ -20,8 +20,8 @@ package constructor import ( - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) var FooTypeConstructorType = &sema.FunctionType{ diff --git a/runtime/sema/gen/testdata/contract/test.cdc b/sema/gen/testdata/contract/test.cdc similarity index 100% rename from runtime/sema/gen/testdata/contract/test.cdc rename to sema/gen/testdata/contract/test.cdc diff --git a/runtime/sema/gen/testdata/contract/test.golden.go b/sema/gen/testdata/contract/test.golden.go similarity index 94% rename from runtime/sema/gen/testdata/contract/test.golden.go rename to sema/gen/testdata/contract/test.golden.go index 03994b48cb..84eaa2f66a 100644 --- a/runtime/sema/gen/testdata/contract/test.golden.go +++ b/sema/gen/testdata/contract/test.golden.go @@ -20,9 +20,9 @@ package contract import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) var Test_FooTypeConstructorType = &sema.FunctionType{ diff --git a/runtime/sema/gen/testdata/docstrings/helper.go b/sema/gen/testdata/docstrings/helper.go similarity index 93% rename from runtime/sema/gen/testdata/docstrings/helper.go rename to sema/gen/testdata/docstrings/helper.go index 81cec52907..66f38f86d4 100644 --- a/runtime/sema/gen/testdata/docstrings/helper.go +++ b/sema/gen/testdata/docstrings/helper.go @@ -18,6 +18,6 @@ package docstrings -import "github.com/onflow/cadence/runtime/sema" +import "github.com/onflow/cadence/sema" var DocstringsTypeTag sema.TypeTag diff --git a/runtime/sema/gen/testdata/docstrings/test.cdc b/sema/gen/testdata/docstrings/test.cdc similarity index 100% rename from runtime/sema/gen/testdata/docstrings/test.cdc rename to sema/gen/testdata/docstrings/test.cdc diff --git a/runtime/sema/gen/testdata/docstrings/test.golden.go b/sema/gen/testdata/docstrings/test.golden.go similarity index 98% rename from runtime/sema/gen/testdata/docstrings/test.golden.go rename to sema/gen/testdata/docstrings/test.golden.go index 9ba25de09b..30ec06e695 100644 --- a/runtime/sema/gen/testdata/docstrings/test.golden.go +++ b/sema/gen/testdata/docstrings/test.golden.go @@ -20,8 +20,8 @@ package docstrings import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/sema" ) const DocstringsTypeOwoFieldName = "owo" diff --git a/runtime/sema/gen/testdata/entitlement/test.cdc b/sema/gen/testdata/entitlement/test.cdc similarity index 100% rename from runtime/sema/gen/testdata/entitlement/test.cdc rename to sema/gen/testdata/entitlement/test.cdc diff --git a/runtime/sema/gen/testdata/entitlement/test.golden.go b/sema/gen/testdata/entitlement/test.golden.go similarity index 97% rename from runtime/sema/gen/testdata/entitlement/test.golden.go rename to sema/gen/testdata/entitlement/test.golden.go index 0b82fc1e2e..465d42e0cf 100644 --- a/runtime/sema/gen/testdata/entitlement/test.golden.go +++ b/sema/gen/testdata/entitlement/test.golden.go @@ -19,7 +19,7 @@ package entitlement -import "github.com/onflow/cadence/runtime/sema" +import "github.com/onflow/cadence/sema" var FooType = &sema.EntitlementType{ Identifier: "Foo", diff --git a/runtime/sema/gen/testdata/equatable/helper.go b/sema/gen/testdata/equatable/helper.go similarity index 93% rename from runtime/sema/gen/testdata/equatable/helper.go rename to sema/gen/testdata/equatable/helper.go index 324b4d7f7a..71c322f1d1 100644 --- a/runtime/sema/gen/testdata/equatable/helper.go +++ b/sema/gen/testdata/equatable/helper.go @@ -18,6 +18,6 @@ package equatable -import "github.com/onflow/cadence/runtime/sema" +import "github.com/onflow/cadence/sema" var TestTypeTag sema.TypeTag diff --git a/runtime/sema/gen/testdata/equatable/test.cdc b/sema/gen/testdata/equatable/test.cdc similarity index 100% rename from runtime/sema/gen/testdata/equatable/test.cdc rename to sema/gen/testdata/equatable/test.cdc diff --git a/runtime/sema/gen/testdata/equatable/test.golden.go b/sema/gen/testdata/equatable/test.golden.go similarity index 95% rename from runtime/sema/gen/testdata/equatable/test.golden.go rename to sema/gen/testdata/equatable/test.golden.go index cd7da729a4..5ea1fb5796 100644 --- a/runtime/sema/gen/testdata/equatable/test.golden.go +++ b/sema/gen/testdata/equatable/test.golden.go @@ -19,7 +19,7 @@ package equatable -import "github.com/onflow/cadence/runtime/sema" +import "github.com/onflow/cadence/sema" const TestTypeName = "Test" diff --git a/runtime/sema/gen/testdata/exportable/helper.go b/sema/gen/testdata/exportable/helper.go similarity index 93% rename from runtime/sema/gen/testdata/exportable/helper.go rename to sema/gen/testdata/exportable/helper.go index 992c0d97df..16cdde712b 100644 --- a/runtime/sema/gen/testdata/exportable/helper.go +++ b/sema/gen/testdata/exportable/helper.go @@ -18,6 +18,6 @@ package exportable -import "github.com/onflow/cadence/runtime/sema" +import "github.com/onflow/cadence/sema" var TestTypeTag sema.TypeTag diff --git a/runtime/sema/gen/testdata/exportable/test.cdc b/sema/gen/testdata/exportable/test.cdc similarity index 100% rename from runtime/sema/gen/testdata/exportable/test.cdc rename to sema/gen/testdata/exportable/test.cdc diff --git a/runtime/sema/gen/testdata/exportable/test.golden.go b/sema/gen/testdata/exportable/test.golden.go similarity index 95% rename from runtime/sema/gen/testdata/exportable/test.golden.go rename to sema/gen/testdata/exportable/test.golden.go index 60f7c0da47..1f2caaed07 100644 --- a/runtime/sema/gen/testdata/exportable/test.golden.go +++ b/sema/gen/testdata/exportable/test.golden.go @@ -19,7 +19,7 @@ package exportable -import "github.com/onflow/cadence/runtime/sema" +import "github.com/onflow/cadence/sema" const TestTypeName = "Test" diff --git a/runtime/sema/gen/testdata/fields/helper.go b/sema/gen/testdata/fields/helper.go similarity index 94% rename from runtime/sema/gen/testdata/fields/helper.go rename to sema/gen/testdata/fields/helper.go index 999ab93580..55405b9ce3 100644 --- a/runtime/sema/gen/testdata/fields/helper.go +++ b/sema/gen/testdata/fields/helper.go @@ -18,7 +18,7 @@ package fields -import "github.com/onflow/cadence/runtime/sema" +import "github.com/onflow/cadence/sema" var TestTypeTag sema.TypeTag var FooType = &sema.CapabilityType{} diff --git a/runtime/sema/gen/testdata/fields/test.cdc b/sema/gen/testdata/fields/test.cdc similarity index 100% rename from runtime/sema/gen/testdata/fields/test.cdc rename to sema/gen/testdata/fields/test.cdc diff --git a/runtime/sema/gen/testdata/fields/test.golden.go b/sema/gen/testdata/fields/test.golden.go similarity index 98% rename from runtime/sema/gen/testdata/fields/test.golden.go rename to sema/gen/testdata/fields/test.golden.go index 8902339801..2670efaacc 100644 --- a/runtime/sema/gen/testdata/fields/test.golden.go +++ b/sema/gen/testdata/fields/test.golden.go @@ -20,8 +20,8 @@ package fields import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/sema" ) const TestTypeTestIntFieldName = "testInt" diff --git a/runtime/sema/gen/testdata/functions/helper.go b/sema/gen/testdata/functions/helper.go similarity index 93% rename from runtime/sema/gen/testdata/functions/helper.go rename to sema/gen/testdata/functions/helper.go index b7804656e2..34dbf0152a 100644 --- a/runtime/sema/gen/testdata/functions/helper.go +++ b/sema/gen/testdata/functions/helper.go @@ -18,6 +18,6 @@ package functions -import "github.com/onflow/cadence/runtime/sema" +import "github.com/onflow/cadence/sema" var TestTypeTag sema.TypeTag diff --git a/runtime/sema/gen/testdata/functions/test.cdc b/sema/gen/testdata/functions/test.cdc similarity index 100% rename from runtime/sema/gen/testdata/functions/test.cdc rename to sema/gen/testdata/functions/test.cdc diff --git a/runtime/sema/gen/testdata/functions/test.golden.go b/sema/gen/testdata/functions/test.golden.go similarity index 98% rename from runtime/sema/gen/testdata/functions/test.golden.go rename to sema/gen/testdata/functions/test.golden.go index ed97a62f6f..5bfe20dd92 100644 --- a/runtime/sema/gen/testdata/functions/test.golden.go +++ b/sema/gen/testdata/functions/test.golden.go @@ -20,8 +20,8 @@ package functions import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/sema" ) const TestTypeNothingFunctionName = "nothing" diff --git a/runtime/sema/gen/testdata/importable/helper.go b/sema/gen/testdata/importable/helper.go similarity index 93% rename from runtime/sema/gen/testdata/importable/helper.go rename to sema/gen/testdata/importable/helper.go index cd13b57d0a..74d93890b4 100644 --- a/runtime/sema/gen/testdata/importable/helper.go +++ b/sema/gen/testdata/importable/helper.go @@ -18,6 +18,6 @@ package importable -import "github.com/onflow/cadence/runtime/sema" +import "github.com/onflow/cadence/sema" var TestTypeTag sema.TypeTag diff --git a/runtime/sema/gen/testdata/importable/test.cdc b/sema/gen/testdata/importable/test.cdc similarity index 100% rename from runtime/sema/gen/testdata/importable/test.cdc rename to sema/gen/testdata/importable/test.cdc diff --git a/runtime/sema/gen/testdata/importable/test.golden.go b/sema/gen/testdata/importable/test.golden.go similarity index 95% rename from runtime/sema/gen/testdata/importable/test.golden.go rename to sema/gen/testdata/importable/test.golden.go index f3b73527c3..8b86a8c046 100644 --- a/runtime/sema/gen/testdata/importable/test.golden.go +++ b/sema/gen/testdata/importable/test.golden.go @@ -19,7 +19,7 @@ package importable -import "github.com/onflow/cadence/runtime/sema" +import "github.com/onflow/cadence/sema" const TestTypeName = "Test" diff --git a/runtime/sema/gen/testdata/member_accessible/helper.go b/sema/gen/testdata/member_accessible/helper.go similarity index 93% rename from runtime/sema/gen/testdata/member_accessible/helper.go rename to sema/gen/testdata/member_accessible/helper.go index 7c8486cdb8..8f82648a20 100644 --- a/runtime/sema/gen/testdata/member_accessible/helper.go +++ b/sema/gen/testdata/member_accessible/helper.go @@ -18,6 +18,6 @@ package member_accessible -import "github.com/onflow/cadence/runtime/sema" +import "github.com/onflow/cadence/sema" var TestTypeTag sema.TypeTag diff --git a/runtime/sema/gen/testdata/member_accessible/test.cdc b/sema/gen/testdata/member_accessible/test.cdc similarity index 100% rename from runtime/sema/gen/testdata/member_accessible/test.cdc rename to sema/gen/testdata/member_accessible/test.cdc diff --git a/runtime/sema/gen/testdata/member_accessible/test.golden.go b/sema/gen/testdata/member_accessible/test.golden.go similarity index 95% rename from runtime/sema/gen/testdata/member_accessible/test.golden.go rename to sema/gen/testdata/member_accessible/test.golden.go index 15cee9f5cf..4a0b23f120 100644 --- a/runtime/sema/gen/testdata/member_accessible/test.golden.go +++ b/sema/gen/testdata/member_accessible/test.golden.go @@ -19,7 +19,7 @@ package member_accessible -import "github.com/onflow/cadence/runtime/sema" +import "github.com/onflow/cadence/sema" const TestTypeName = "Test" diff --git a/runtime/sema/gen/testdata/nested/test.cdc b/sema/gen/testdata/nested/test.cdc similarity index 100% rename from runtime/sema/gen/testdata/nested/test.cdc rename to sema/gen/testdata/nested/test.cdc diff --git a/runtime/sema/gen/testdata/nested/test.golden.go b/sema/gen/testdata/nested/test.golden.go similarity index 95% rename from runtime/sema/gen/testdata/nested/test.golden.go rename to sema/gen/testdata/nested/test.golden.go index 5b43f3d347..48b4705a30 100644 --- a/runtime/sema/gen/testdata/nested/test.golden.go +++ b/sema/gen/testdata/nested/test.golden.go @@ -20,9 +20,9 @@ package nested import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) const FooTypeFooFunctionName = "foo" diff --git a/runtime/sema/gen/testdata/primitive/helper.go b/sema/gen/testdata/primitive/helper.go similarity index 93% rename from runtime/sema/gen/testdata/primitive/helper.go rename to sema/gen/testdata/primitive/helper.go index cb064c8164..e917cfbc68 100644 --- a/runtime/sema/gen/testdata/primitive/helper.go +++ b/sema/gen/testdata/primitive/helper.go @@ -18,6 +18,6 @@ package primitive -import "github.com/onflow/cadence/runtime/sema" +import "github.com/onflow/cadence/sema" var TestTypeTag sema.TypeTag diff --git a/runtime/sema/gen/testdata/primitive/test.cdc b/sema/gen/testdata/primitive/test.cdc similarity index 100% rename from runtime/sema/gen/testdata/primitive/test.cdc rename to sema/gen/testdata/primitive/test.cdc diff --git a/runtime/sema/gen/testdata/primitive/test.golden.go b/sema/gen/testdata/primitive/test.golden.go similarity index 95% rename from runtime/sema/gen/testdata/primitive/test.golden.go rename to sema/gen/testdata/primitive/test.golden.go index 1d24d81299..4c351e25c6 100644 --- a/runtime/sema/gen/testdata/primitive/test.golden.go +++ b/sema/gen/testdata/primitive/test.golden.go @@ -19,7 +19,7 @@ package primitive -import "github.com/onflow/cadence/runtime/sema" +import "github.com/onflow/cadence/sema" const TestTypeName = "Test" diff --git a/runtime/sema/gen/testdata/simple_resource/helper.go b/sema/gen/testdata/simple_resource/helper.go similarity index 93% rename from runtime/sema/gen/testdata/simple_resource/helper.go rename to sema/gen/testdata/simple_resource/helper.go index a86804e5d1..8bdf83b494 100644 --- a/runtime/sema/gen/testdata/simple_resource/helper.go +++ b/sema/gen/testdata/simple_resource/helper.go @@ -18,6 +18,6 @@ package simple_resource -import "github.com/onflow/cadence/runtime/sema" +import "github.com/onflow/cadence/sema" var TestTypeTag sema.TypeTag diff --git a/runtime/sema/gen/testdata/simple_resource/test.cdc b/sema/gen/testdata/simple_resource/test.cdc similarity index 100% rename from runtime/sema/gen/testdata/simple_resource/test.cdc rename to sema/gen/testdata/simple_resource/test.cdc diff --git a/runtime/sema/gen/testdata/simple_resource/test.golden.go b/sema/gen/testdata/simple_resource/test.golden.go similarity index 95% rename from runtime/sema/gen/testdata/simple_resource/test.golden.go rename to sema/gen/testdata/simple_resource/test.golden.go index 551f26428f..73670f9393 100644 --- a/runtime/sema/gen/testdata/simple_resource/test.golden.go +++ b/sema/gen/testdata/simple_resource/test.golden.go @@ -19,7 +19,7 @@ package simple_resource -import "github.com/onflow/cadence/runtime/sema" +import "github.com/onflow/cadence/sema" const TestTypeName = "Test" diff --git a/runtime/sema/gen/testdata/simple_struct/helper.go b/sema/gen/testdata/simple_struct/helper.go similarity index 93% rename from runtime/sema/gen/testdata/simple_struct/helper.go rename to sema/gen/testdata/simple_struct/helper.go index efead53986..af179e2d9f 100644 --- a/runtime/sema/gen/testdata/simple_struct/helper.go +++ b/sema/gen/testdata/simple_struct/helper.go @@ -18,6 +18,6 @@ package simple_struct -import "github.com/onflow/cadence/runtime/sema" +import "github.com/onflow/cadence/sema" var TestTypeTag sema.TypeTag diff --git a/runtime/sema/gen/testdata/simple_struct/test.cdc b/sema/gen/testdata/simple_struct/test.cdc similarity index 100% rename from runtime/sema/gen/testdata/simple_struct/test.cdc rename to sema/gen/testdata/simple_struct/test.cdc diff --git a/runtime/sema/gen/testdata/simple_struct/test.golden.go b/sema/gen/testdata/simple_struct/test.golden.go similarity index 95% rename from runtime/sema/gen/testdata/simple_struct/test.golden.go rename to sema/gen/testdata/simple_struct/test.golden.go index 5631f80ade..cfa99e660f 100644 --- a/runtime/sema/gen/testdata/simple_struct/test.golden.go +++ b/sema/gen/testdata/simple_struct/test.golden.go @@ -19,7 +19,7 @@ package simple_struct -import "github.com/onflow/cadence/runtime/sema" +import "github.com/onflow/cadence/sema" const TestTypeName = "Test" diff --git a/runtime/sema/gen/testdata/storable/helper.go b/sema/gen/testdata/storable/helper.go similarity index 93% rename from runtime/sema/gen/testdata/storable/helper.go rename to sema/gen/testdata/storable/helper.go index 72235b3b8f..d43b215003 100644 --- a/runtime/sema/gen/testdata/storable/helper.go +++ b/sema/gen/testdata/storable/helper.go @@ -18,6 +18,6 @@ package storable -import "github.com/onflow/cadence/runtime/sema" +import "github.com/onflow/cadence/sema" var TestTypeTag sema.TypeTag diff --git a/runtime/sema/gen/testdata/storable/test.cdc b/sema/gen/testdata/storable/test.cdc similarity index 100% rename from runtime/sema/gen/testdata/storable/test.cdc rename to sema/gen/testdata/storable/test.cdc diff --git a/runtime/sema/gen/testdata/storable/test.golden.go b/sema/gen/testdata/storable/test.golden.go similarity index 95% rename from runtime/sema/gen/testdata/storable/test.golden.go rename to sema/gen/testdata/storable/test.golden.go index a7602e4047..48b34b3096 100644 --- a/runtime/sema/gen/testdata/storable/test.golden.go +++ b/sema/gen/testdata/storable/test.golden.go @@ -19,7 +19,7 @@ package storable -import "github.com/onflow/cadence/runtime/sema" +import "github.com/onflow/cadence/sema" const TestTypeName = "Test" diff --git a/runtime/sema/hashable_struct.cdc b/sema/hashable_struct.cdc similarity index 100% rename from runtime/sema/hashable_struct.cdc rename to sema/hashable_struct.cdc diff --git a/runtime/sema/hashable_struct.gen.go b/sema/hashable_struct.gen.go similarity index 100% rename from runtime/sema/hashable_struct.gen.go rename to sema/hashable_struct.gen.go diff --git a/runtime/sema/hashable_struct.go b/sema/hashable_struct.go similarity index 100% rename from runtime/sema/hashable_struct.go rename to sema/hashable_struct.go diff --git a/runtime/sema/hashalgorithm_string.go b/sema/hashalgorithm_string.go similarity index 100% rename from runtime/sema/hashalgorithm_string.go rename to sema/hashalgorithm_string.go diff --git a/runtime/sema/import.go b/sema/import.go similarity index 98% rename from runtime/sema/import.go rename to sema/import.go index d43d478fc6..4c555a2786 100644 --- a/runtime/sema/import.go +++ b/sema/import.go @@ -19,7 +19,7 @@ package sema import ( - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) // Import diff --git a/runtime/sema/initialization_info.go b/sema/initialization_info.go similarity index 96% rename from runtime/sema/initialization_info.go rename to sema/initialization_info.go index 06002ce980..1a2d130510 100644 --- a/runtime/sema/initialization_info.go +++ b/sema/initialization_info.go @@ -19,7 +19,7 @@ package sema import ( - "github.com/onflow/cadence/runtime/common/persistent" + "github.com/onflow/cadence/common/persistent" ) type InitializationInfo struct { diff --git a/runtime/sema/interfaceset.go b/sema/interfaceset.go similarity index 97% rename from runtime/sema/interfaceset.go rename to sema/interfaceset.go index 2013659151..2639d99465 100644 --- a/runtime/sema/interfaceset.go +++ b/sema/interfaceset.go @@ -19,7 +19,7 @@ package sema import ( - "github.com/onflow/cadence/runtime/common/orderedmap" + "github.com/onflow/cadence/common/orderedmap" ) // InterfaceSet diff --git a/runtime/sema/invalid_type.go b/sema/invalid_type.go similarity index 100% rename from runtime/sema/invalid_type.go rename to sema/invalid_type.go diff --git a/runtime/sema/member_accesses.go b/sema/member_accesses.go similarity index 94% rename from runtime/sema/member_accesses.go rename to sema/member_accesses.go index 07fc6d378e..6b0e39b0b7 100644 --- a/runtime/sema/member_accesses.go +++ b/sema/member_accesses.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common/intervalst" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common/intervalst" ) type MemberAccess struct { diff --git a/runtime/sema/meta_type.go b/sema/meta_type.go similarity index 100% rename from runtime/sema/meta_type.go rename to sema/meta_type.go diff --git a/runtime/sema/never_type.go b/sema/never_type.go similarity index 100% rename from runtime/sema/never_type.go rename to sema/never_type.go diff --git a/runtime/sema/occurrences.go b/sema/occurrences.go similarity index 95% rename from runtime/sema/occurrences.go rename to sema/occurrences.go index f1d3a134e2..bedd89e4f1 100644 --- a/runtime/sema/occurrences.go +++ b/sema/occurrences.go @@ -21,9 +21,9 @@ package sema import ( "fmt" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/common/intervalst" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/common/intervalst" ) type Position struct { diff --git a/runtime/sema/orderdmaps.go b/sema/orderdmaps.go similarity index 90% rename from runtime/sema/orderdmaps.go rename to sema/orderdmaps.go index cc4ac852e9..7e9f4ec9b0 100644 --- a/runtime/sema/orderdmaps.go +++ b/sema/orderdmaps.go @@ -19,9 +19,9 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/common/orderedmap" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/common/orderedmap" ) type StringTypeOrderedMap = orderedmap.OrderedMap[string, Type] diff --git a/runtime/sema/path_type.go b/sema/path_type.go similarity index 100% rename from runtime/sema/path_type.go rename to sema/path_type.go diff --git a/runtime/sema/positioninfo.go b/sema/positioninfo.go similarity index 98% rename from runtime/sema/positioninfo.go rename to sema/positioninfo.go index 8c4b19dc5e..45aa58b619 100644 --- a/runtime/sema/positioninfo.go +++ b/sema/positioninfo.go @@ -21,8 +21,8 @@ package sema import ( "math" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) type PositionInfo struct { diff --git a/runtime/sema/post_conditions_rewrite.go b/sema/post_conditions_rewrite.go similarity index 95% rename from runtime/sema/post_conditions_rewrite.go rename to sema/post_conditions_rewrite.go index 87d21f27e7..4cdeb7d921 100644 --- a/runtime/sema/post_conditions_rewrite.go +++ b/sema/post_conditions_rewrite.go @@ -19,7 +19,7 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" + "github.com/onflow/cadence/ast" ) type PostConditionsRewrite struct { diff --git a/runtime/sema/ranges.go b/sema/ranges.go similarity index 91% rename from runtime/sema/ranges.go rename to sema/ranges.go index 232ccbf5b9..abd37c33d9 100644 --- a/runtime/sema/ranges.go +++ b/sema/ranges.go @@ -19,9 +19,9 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/common/intervalst" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/common/intervalst" ) type Range struct { diff --git a/runtime/sema/resolve.go b/sema/resolve.go similarity index 97% rename from runtime/sema/resolve.go rename to sema/resolve.go index 4c35f91500..bb953594f6 100644 --- a/runtime/sema/resolve.go +++ b/sema/resolve.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) type AddressContractNamesResolver func(address common.Address) ([]string, error) diff --git a/runtime/sema/resource_invalidation.go b/sema/resource_invalidation.go similarity index 95% rename from runtime/sema/resource_invalidation.go rename to sema/resource_invalidation.go index 48bcc697ff..422348841f 100644 --- a/runtime/sema/resource_invalidation.go +++ b/sema/resource_invalidation.go @@ -19,7 +19,7 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" + "github.com/onflow/cadence/ast" ) type ResourceInvalidation struct { diff --git a/runtime/sema/resourceinfo.go b/sema/resourceinfo.go similarity index 100% rename from runtime/sema/resourceinfo.go rename to sema/resourceinfo.go diff --git a/runtime/sema/resourceinvalidationkind.go b/sema/resourceinvalidationkind.go similarity index 98% rename from runtime/sema/resourceinvalidationkind.go rename to sema/resourceinvalidationkind.go index 40b0501ab3..d7186eadd6 100644 --- a/runtime/sema/resourceinvalidationkind.go +++ b/sema/resourceinvalidationkind.go @@ -19,7 +19,7 @@ package sema import ( - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) //go:generate go run golang.org/x/tools/cmd/stringer -type=ResourceInvalidationKind diff --git a/runtime/sema/resourceinvalidationkind_string.go b/sema/resourceinvalidationkind_string.go similarity index 100% rename from runtime/sema/resourceinvalidationkind_string.go rename to sema/resourceinvalidationkind_string.go diff --git a/runtime/sema/resources.go b/sema/resources.go similarity index 99% rename from runtime/sema/resources.go rename to sema/resources.go index 5d9ff04e8f..6305b323da 100644 --- a/runtime/sema/resources.go +++ b/sema/resources.go @@ -23,8 +23,8 @@ import ( "strings" "sync" - "github.com/onflow/cadence/runtime/common/orderedmap" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/common/orderedmap" + "github.com/onflow/cadence/errors" ) /* diff --git a/runtime/sema/resources_test.go b/sema/resources_test.go similarity index 99% rename from runtime/sema/resources_test.go rename to sema/resources_test.go index 68a7ea8e84..d688e02398 100644 --- a/runtime/sema/resources_test.go +++ b/sema/resources_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/onflow/cadence/runtime/ast" + "github.com/onflow/cadence/ast" ) func TestResources_MaybeRecordInvalidation(t *testing.T) { diff --git a/runtime/sema/return_info.go b/sema/return_info.go similarity index 98% rename from runtime/sema/return_info.go rename to sema/return_info.go index df76324836..1e2d0ffe84 100644 --- a/runtime/sema/return_info.go +++ b/sema/return_info.go @@ -19,7 +19,7 @@ package sema import ( - "github.com/onflow/cadence/runtime/common/persistent" + "github.com/onflow/cadence/common/persistent" ) // TODO: rename to e.g. ControlFlowInfo diff --git a/runtime/sema/runtime_type_constructors.go b/sema/runtime_type_constructors.go similarity index 100% rename from runtime/sema/runtime_type_constructors.go rename to sema/runtime_type_constructors.go diff --git a/runtime/sema/signaturealgorithm_string.go b/sema/signaturealgorithm_string.go similarity index 100% rename from runtime/sema/signaturealgorithm_string.go rename to sema/signaturealgorithm_string.go diff --git a/runtime/sema/simple_type.go b/sema/simple_type.go similarity index 98% rename from runtime/sema/simple_type.go rename to sema/simple_type.go index 7f2d7e362a..f05db593c5 100644 --- a/runtime/sema/simple_type.go +++ b/sema/simple_type.go @@ -21,8 +21,8 @@ package sema import ( "sync" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) type ValueIndexingInfo struct { diff --git a/runtime/sema/storable_type.go b/sema/storable_type.go similarity index 100% rename from runtime/sema/storable_type.go rename to sema/storable_type.go diff --git a/runtime/sema/storage_capability_controller.cdc b/sema/storage_capability_controller.cdc similarity index 100% rename from runtime/sema/storage_capability_controller.cdc rename to sema/storage_capability_controller.cdc diff --git a/runtime/sema/storage_capability_controller.gen.go b/sema/storage_capability_controller.gen.go similarity index 99% rename from runtime/sema/storage_capability_controller.gen.go rename to sema/storage_capability_controller.gen.go index 585b815dbf..b4f09f48e9 100644 --- a/runtime/sema/storage_capability_controller.gen.go +++ b/sema/storage_capability_controller.gen.go @@ -19,7 +19,7 @@ package sema -import "github.com/onflow/cadence/runtime/ast" +import "github.com/onflow/cadence/ast" const StorageCapabilityControllerTypeCapabilityFieldName = "capability" diff --git a/runtime/sema/storage_capability_controller.go b/sema/storage_capability_controller.go similarity index 100% rename from runtime/sema/storage_capability_controller.go rename to sema/storage_capability_controller.go diff --git a/runtime/sema/string_type.go b/sema/string_type.go similarity index 99% rename from runtime/sema/string_type.go rename to sema/string_type.go index 200c599f88..37a3707561 100644 --- a/runtime/sema/string_type.go +++ b/sema/string_type.go @@ -19,7 +19,7 @@ package sema import ( - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/errors" ) var StringTypeEncodeHexFunctionType = NewSimpleFunctionType( diff --git a/runtime/sema/type.go b/sema/type.go similarity index 99% rename from runtime/sema/type.go rename to sema/type.go index ee90726e7f..c8d65c6d9b 100644 --- a/runtime/sema/type.go +++ b/sema/type.go @@ -27,10 +27,10 @@ import ( "golang.org/x/exp/slices" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" "github.com/onflow/cadence/fixedpoint" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" ) const TypeIDSeparator = '.' diff --git a/runtime/sema/type_names.go b/sema/type_names.go similarity index 100% rename from runtime/sema/type_names.go rename to sema/type_names.go diff --git a/runtime/sema/type_tags.go b/sema/type_tags.go similarity index 99% rename from runtime/sema/type_tags.go rename to sema/type_tags.go index f82e46f884..339c8cd5be 100644 --- a/runtime/sema/type_tags.go +++ b/sema/type_tags.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/common/orderedmap" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/common/orderedmap" + "github.com/onflow/cadence/errors" ) // TypeTag is a bitmask representation for types. diff --git a/runtime/sema/type_test.go b/sema/type_test.go similarity index 99% rename from runtime/sema/type_test.go rename to sema/type_test.go index 0f0bcf40cf..1ede9831c9 100644 --- a/runtime/sema/type_test.go +++ b/sema/type_test.go @@ -25,9 +25,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/parser" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/parser" ) func TestConstantSizedType_String(t *testing.T) { diff --git a/runtime/sema/typeannotationstate.go b/sema/typeannotationstate.go similarity index 100% rename from runtime/sema/typeannotationstate.go rename to sema/typeannotationstate.go diff --git a/runtime/sema/typeannotationstate_string.go b/sema/typeannotationstate_string.go similarity index 100% rename from runtime/sema/typeannotationstate_string.go rename to sema/typeannotationstate_string.go diff --git a/runtime/sema/typecheckfunc.go b/sema/typecheckfunc.go similarity index 100% rename from runtime/sema/typecheckfunc.go rename to sema/typecheckfunc.go diff --git a/runtime/sema/variable.go b/sema/variable.go similarity index 95% rename from runtime/sema/variable.go rename to sema/variable.go index 08bc1e328d..08f3f5a378 100644 --- a/runtime/sema/variable.go +++ b/sema/variable.go @@ -19,8 +19,8 @@ package sema import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) type Variable struct { diff --git a/runtime/sema/variable_activations.go b/sema/variable_activations.go similarity index 98% rename from runtime/sema/variable_activations.go rename to sema/variable_activations.go index 1f17a81f0a..adbe5c8902 100644 --- a/runtime/sema/variable_activations.go +++ b/sema/variable_activations.go @@ -21,9 +21,9 @@ package sema import ( "sync" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" ) // An VariableActivation is a map of strings to variables. diff --git a/runtime/sema/variable_activations_test.go b/sema/variable_activations_test.go similarity index 100% rename from runtime/sema/variable_activations_test.go rename to sema/variable_activations_test.go diff --git a/runtime/sema/void_type.go b/sema/void_type.go similarity index 100% rename from runtime/sema/void_type.go rename to sema/void_type.go diff --git a/runtime/stdlib/account.go b/stdlib/account.go similarity index 99% rename from runtime/stdlib/account.go rename to stdlib/account.go index f7eb85b1b6..66907a6f93 100644 --- a/runtime/stdlib/account.go +++ b/stdlib/account.go @@ -27,13 +27,13 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/old_parser" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/old_parser" + "github.com/onflow/cadence/parser" + "github.com/onflow/cadence/sema" ) const accountFunctionDocString = ` diff --git a/runtime/stdlib/account_test.go b/stdlib/account_test.go similarity index 98% rename from runtime/stdlib/account_test.go rename to stdlib/account_test.go index 7fbf9bd20d..0fbd4f1164 100644 --- a/runtime/stdlib/account_test.go +++ b/stdlib/account_test.go @@ -24,8 +24,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/utils" ) func TestSemaCheckPathLiteralForInternalStorageDomains(t *testing.T) { diff --git a/runtime/stdlib/assert.go b/stdlib/assert.go similarity index 94% rename from runtime/stdlib/assert.go rename to stdlib/assert.go index f93ed0c294..cedcf1834c 100644 --- a/runtime/stdlib/assert.go +++ b/stdlib/assert.go @@ -21,9 +21,9 @@ package stdlib import ( "fmt" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) // AssertFunction diff --git a/runtime/stdlib/block.go b/stdlib/block.go similarity index 96% rename from runtime/stdlib/block.go rename to stdlib/block.go index cbe98ee234..8ced8ecdc7 100644 --- a/runtime/stdlib/block.go +++ b/stdlib/block.go @@ -22,10 +22,10 @@ import ( "time" "unsafe" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) const getCurrentBlockFunctionDocString = ` diff --git a/runtime/stdlib/bls.cdc b/stdlib/bls.cdc similarity index 100% rename from runtime/stdlib/bls.cdc rename to stdlib/bls.cdc diff --git a/runtime/stdlib/bls.gen.go b/stdlib/bls.gen.go similarity index 96% rename from runtime/stdlib/bls.gen.go rename to stdlib/bls.gen.go index 610b74fd56..639f200fd1 100644 --- a/runtime/stdlib/bls.gen.go +++ b/stdlib/bls.gen.go @@ -20,9 +20,9 @@ package stdlib import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) const BLSTypeAggregateSignaturesFunctionName = "aggregateSignatures" diff --git a/runtime/stdlib/bls.go b/stdlib/bls.go similarity index 96% rename from runtime/stdlib/bls.go rename to stdlib/bls.go index 8a9169da02..929c465641 100644 --- a/runtime/stdlib/bls.go +++ b/stdlib/bls.go @@ -21,10 +21,10 @@ package stdlib //go:generate go run ../sema/gen -p stdlib bls.cdc bls.gen.go import ( - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) type BLSPublicKeyAggregator interface { diff --git a/runtime/stdlib/builtin.go b/stdlib/builtin.go similarity index 94% rename from runtime/stdlib/builtin.go rename to stdlib/builtin.go index afc9662f24..1a6d4e65c0 100644 --- a/runtime/stdlib/builtin.go +++ b/stdlib/builtin.go @@ -19,9 +19,9 @@ package stdlib import ( - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) type StandardLibraryHandler interface { diff --git a/runtime/stdlib/builtin_test.go b/stdlib/builtin_test.go similarity index 95% rename from runtime/stdlib/builtin_test.go rename to stdlib/builtin_test.go index 3c92b1e385..676603eaa5 100644 --- a/runtime/stdlib/builtin_test.go +++ b/stdlib/builtin_test.go @@ -21,17 +21,17 @@ package stdlib import ( "testing" - "github.com/onflow/cadence/runtime/activations" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/tests/checker" + "github.com/onflow/cadence/activations" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/tests/checker" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/parser" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/utils" ) func newUnmeteredInMemoryStorage() interpreter.InMemoryStorage { diff --git a/runtime/stdlib/cadence_v0.42_to_v1_contract_upgrade_validation_test.go b/stdlib/cadence_v0.42_to_v1_contract_upgrade_validation_test.go similarity index 99% rename from runtime/stdlib/cadence_v0.42_to_v1_contract_upgrade_validation_test.go rename to stdlib/cadence_v0.42_to_v1_contract_upgrade_validation_test.go index 193168f278..0fa29ad911 100644 --- a/runtime/stdlib/cadence_v0.42_to_v1_contract_upgrade_validation_test.go +++ b/stdlib/cadence_v0.42_to_v1_contract_upgrade_validation_test.go @@ -25,16 +25,16 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/old_parser" + "github.com/onflow/cadence/parser" "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/old_parser" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - "github.com/onflow/cadence/runtime/tests/runtime_utils" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + "github.com/onflow/cadence/tests/runtime_utils" + "github.com/onflow/cadence/tests/utils" ) func testContractUpdate(t *testing.T, oldCode string, newCode string) error { diff --git a/runtime/stdlib/cadence_v0.42_to_v1_contract_upgrade_validator.go b/stdlib/cadence_v0.42_to_v1_contract_upgrade_validator.go similarity index 99% rename from runtime/stdlib/cadence_v0.42_to_v1_contract_upgrade_validator.go rename to stdlib/cadence_v0.42_to_v1_contract_upgrade_validator.go index c5b5a7a8d1..7b13c6491b 100644 --- a/runtime/stdlib/cadence_v0.42_to_v1_contract_upgrade_validator.go +++ b/stdlib/cadence_v0.42_to_v1_contract_upgrade_validator.go @@ -21,12 +21,12 @@ package stdlib import ( "fmt" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/common/orderedmap" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/common/orderedmap" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) type CadenceV042ToV1ContractUpdateValidator struct { diff --git a/runtime/stdlib/contract_update_validation.go b/stdlib/contract_update_validation.go similarity index 99% rename from runtime/stdlib/contract_update_validation.go rename to stdlib/contract_update_validation.go index 011b45d274..71e958f84e 100644 --- a/runtime/stdlib/contract_update_validation.go +++ b/stdlib/contract_update_validation.go @@ -22,10 +22,10 @@ import ( "fmt" "sort" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/common/orderedmap" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/common/orderedmap" + "github.com/onflow/cadence/errors" ) const typeRemovalPragmaName = "removedType" diff --git a/runtime/stdlib/contracts/crypto.cdc b/stdlib/contracts/crypto.cdc similarity index 100% rename from runtime/stdlib/contracts/crypto.cdc rename to stdlib/contracts/crypto.cdc diff --git a/runtime/stdlib/contracts/crypto.go b/stdlib/contracts/crypto.go similarity index 100% rename from runtime/stdlib/contracts/crypto.go rename to stdlib/contracts/crypto.go diff --git a/runtime/stdlib/contracts/crypto_test.cdc b/stdlib/contracts/crypto_test.cdc similarity index 100% rename from runtime/stdlib/contracts/crypto_test.cdc rename to stdlib/contracts/crypto_test.cdc diff --git a/runtime/stdlib/contracts/flow.json b/stdlib/contracts/flow.json similarity index 100% rename from runtime/stdlib/contracts/flow.json rename to stdlib/contracts/flow.json diff --git a/runtime/stdlib/contracts/test.cdc b/stdlib/contracts/test.cdc similarity index 100% rename from runtime/stdlib/contracts/test.cdc rename to stdlib/contracts/test.cdc diff --git a/runtime/stdlib/contracts/test.go b/stdlib/contracts/test.go similarity index 100% rename from runtime/stdlib/contracts/test.go rename to stdlib/contracts/test.go diff --git a/runtime/stdlib/crypto.go b/stdlib/crypto.go similarity index 93% rename from runtime/stdlib/crypto.go rename to stdlib/crypto.go index 585018540d..77897d43a5 100644 --- a/runtime/stdlib/crypto.go +++ b/stdlib/crypto.go @@ -21,14 +21,14 @@ package stdlib import ( "sync" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/stdlib/contracts" - - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/parser" + "github.com/onflow/cadence/stdlib/contracts" + + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) const CryptoCheckerLocation = common.IdentifierLocation("Crypto") diff --git a/runtime/stdlib/crypto_test.go b/stdlib/crypto_test.go similarity index 95% rename from runtime/stdlib/crypto_test.go rename to stdlib/crypto_test.go index ff2dca5cf4..d68d9b69ff 100644 --- a/runtime/stdlib/crypto_test.go +++ b/stdlib/crypto_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCryptoContract(t *testing.T) { diff --git a/runtime/stdlib/flow.go b/stdlib/flow.go similarity index 98% rename from runtime/stdlib/flow.go rename to stdlib/flow.go index c89779a382..21f3c576f3 100644 --- a/runtime/stdlib/flow.go +++ b/stdlib/flow.go @@ -22,9 +22,9 @@ import ( "encoding/json" "strings" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/sema" ) // Flow location diff --git a/runtime/stdlib/flow_test.go b/stdlib/flow_test.go similarity index 97% rename from runtime/stdlib/flow_test.go rename to stdlib/flow_test.go index 7075178e89..28baa11137 100644 --- a/runtime/stdlib/flow_test.go +++ b/stdlib/flow_test.go @@ -23,12 +23,12 @@ import ( "strings" "testing" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestFlowEventTypeIDs(t *testing.T) { diff --git a/runtime/stdlib/functions.go b/stdlib/functions.go similarity index 91% rename from runtime/stdlib/functions.go rename to stdlib/functions.go index c9e1f5295d..42083a4bf6 100644 --- a/runtime/stdlib/functions.go +++ b/stdlib/functions.go @@ -19,9 +19,9 @@ package stdlib import ( - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) // NewStandardLibraryStaticFunction should only be used for creating static functions. diff --git a/runtime/stdlib/hashalgorithm.go b/stdlib/hashalgorithm.go similarity index 96% rename from runtime/stdlib/hashalgorithm.go rename to stdlib/hashalgorithm.go index 57679df65e..935d83997e 100644 --- a/runtime/stdlib/hashalgorithm.go +++ b/stdlib/hashalgorithm.go @@ -19,10 +19,10 @@ package stdlib import ( - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) var hashAlgorithmStaticType interpreter.StaticType = interpreter.ConvertSemaCompositeTypeToStaticCompositeType( diff --git a/runtime/stdlib/log.go b/stdlib/log.go similarity index 93% rename from runtime/stdlib/log.go rename to stdlib/log.go index 50294e8091..ab8ef243a8 100644 --- a/runtime/stdlib/log.go +++ b/stdlib/log.go @@ -19,9 +19,9 @@ package stdlib import ( - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) var LogFunctionType = sema.NewSimpleFunctionType( diff --git a/runtime/stdlib/panic.go b/stdlib/panic.go similarity index 92% rename from runtime/stdlib/panic.go rename to stdlib/panic.go index 7ad7aa2168..054fe5cdd0 100644 --- a/runtime/stdlib/panic.go +++ b/stdlib/panic.go @@ -21,9 +21,9 @@ package stdlib import ( "fmt" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) type PanicError struct { diff --git a/runtime/stdlib/publickey.go b/stdlib/publickey.go similarity index 98% rename from runtime/stdlib/publickey.go rename to stdlib/publickey.go index eeb5c3e827..6cd6830f67 100644 --- a/runtime/stdlib/publickey.go +++ b/stdlib/publickey.go @@ -19,10 +19,10 @@ package stdlib import ( - "github.com/onflow/cadence/runtime/common/orderedmap" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common/orderedmap" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) const publicKeyConstructorFunctionDocString = ` diff --git a/runtime/stdlib/random.go b/stdlib/random.go similarity index 98% rename from runtime/stdlib/random.go rename to stdlib/random.go index 6375384c7e..582c6aecf3 100644 --- a/runtime/stdlib/random.go +++ b/stdlib/random.go @@ -23,11 +23,11 @@ import ( "fmt" "math/big" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) const revertibleRandomFunctionDocString = ` diff --git a/runtime/stdlib/random_test.go b/stdlib/random_test.go similarity index 96% rename from runtime/stdlib/random_test.go rename to stdlib/random_test.go index efa6078e9d..da9ab77b72 100644 --- a/runtime/stdlib/random_test.go +++ b/stdlib/random_test.go @@ -26,8 +26,8 @@ import ( "github.com/onflow/crypto/random" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) type testCryptRandomGenerator struct{} diff --git a/runtime/stdlib/range.go b/stdlib/range.go similarity index 95% rename from runtime/stdlib/range.go rename to stdlib/range.go index 37a65435dc..d1f5d355de 100644 --- a/runtime/stdlib/range.go +++ b/stdlib/range.go @@ -21,11 +21,11 @@ package stdlib import ( "fmt" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) // InclusiveRangeConstructorFunction diff --git a/runtime/stdlib/rlp.cdc b/stdlib/rlp.cdc similarity index 100% rename from runtime/stdlib/rlp.cdc rename to stdlib/rlp.cdc diff --git a/runtime/stdlib/rlp.gen.go b/stdlib/rlp.gen.go similarity index 96% rename from runtime/stdlib/rlp.gen.go rename to stdlib/rlp.gen.go index f14f28b159..854a3268ad 100644 --- a/runtime/stdlib/rlp.gen.go +++ b/stdlib/rlp.gen.go @@ -20,9 +20,9 @@ package stdlib import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) const RLPTypeDecodeStringFunctionName = "decodeString" diff --git a/runtime/stdlib/rlp.go b/stdlib/rlp.go similarity index 96% rename from runtime/stdlib/rlp.go rename to stdlib/rlp.go index 5157a7ee42..e15f989627 100644 --- a/runtime/stdlib/rlp.go +++ b/stdlib/rlp.go @@ -23,10 +23,10 @@ package stdlib import ( "fmt" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/stdlib/rlp" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/stdlib/rlp" ) type RLPDecodeStringError struct { diff --git a/runtime/stdlib/rlp/rlp.go b/stdlib/rlp/rlp.go similarity index 100% rename from runtime/stdlib/rlp/rlp.go rename to stdlib/rlp/rlp.go diff --git a/runtime/stdlib/rlp/rlp_test.go b/stdlib/rlp/rlp_test.go similarity index 99% rename from runtime/stdlib/rlp/rlp_test.go rename to stdlib/rlp/rlp_test.go index fbc90556ad..f707026356 100644 --- a/runtime/stdlib/rlp/rlp_test.go +++ b/stdlib/rlp/rlp_test.go @@ -23,8 +23,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/stdlib/rlp" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/stdlib/rlp" + . "github.com/onflow/cadence/tests/utils" ) func TestRLPReadSize(t *testing.T) { diff --git a/runtime/stdlib/signaturealgorithm.go b/stdlib/signaturealgorithm.go similarity index 92% rename from runtime/stdlib/signaturealgorithm.go rename to stdlib/signaturealgorithm.go index 23426a1ad1..a0758b5301 100644 --- a/runtime/stdlib/signaturealgorithm.go +++ b/stdlib/signaturealgorithm.go @@ -19,9 +19,9 @@ package stdlib import ( - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) var signatureAlgorithmStaticType interpreter.StaticType = interpreter.ConvertSemaCompositeTypeToStaticCompositeType( diff --git a/runtime/stdlib/test-framework.go b/stdlib/test-framework.go similarity index 95% rename from runtime/stdlib/test-framework.go rename to stdlib/test-framework.go index 07e88a766d..86e1a3fad8 100644 --- a/runtime/stdlib/test-framework.go +++ b/stdlib/test-framework.go @@ -20,8 +20,8 @@ package stdlib import ( - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" ) // TestFramework & Blockchain are the interfaces to be implemented by diff --git a/runtime/stdlib/test.go b/stdlib/test.go similarity index 98% rename from runtime/stdlib/test.go rename to stdlib/test.go index eb65c13985..1a00e839ed 100644 --- a/runtime/stdlib/test.go +++ b/stdlib/test.go @@ -22,11 +22,11 @@ import ( "fmt" "sync" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) // This is the Cadence standard library for writing tests. diff --git a/runtime/stdlib/test_contract.go b/stdlib/test_contract.go similarity index 99% rename from runtime/stdlib/test_contract.go rename to stdlib/test_contract.go index 5c9bf04bbc..cc5bdb5492 100644 --- a/runtime/stdlib/test_contract.go +++ b/stdlib/test_contract.go @@ -22,13 +22,13 @@ import ( "fmt" "strings" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib/contracts" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/parser" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib/contracts" ) type TestContractType struct { diff --git a/runtime/stdlib/test_emulatorbackend.go b/stdlib/test_emulatorbackend.go similarity index 99% rename from runtime/stdlib/test_emulatorbackend.go rename to stdlib/test_emulatorbackend.go index 4a6199fb80..511621ba5d 100644 --- a/runtime/stdlib/test_emulatorbackend.go +++ b/stdlib/test_emulatorbackend.go @@ -22,10 +22,10 @@ package stdlib import ( "fmt" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) // 'EmulatorBackend' struct. diff --git a/runtime/stdlib/test_test.go b/stdlib/test_test.go similarity index 99% rename from runtime/stdlib/test_test.go rename to stdlib/test_test.go index c34232df05..19912f763c 100644 --- a/runtime/stdlib/test_test.go +++ b/stdlib/test_test.go @@ -27,15 +27,15 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/activations" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - cdcErrors "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/checker" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/activations" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + cdcErrors "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/parser" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/checker" + "github.com/onflow/cadence/tests/utils" ) func newTestContractInterpreter(t *testing.T, code string) (*interpreter.Interpreter, error) { diff --git a/runtime/stdlib/type-comparator.go b/stdlib/type-comparator.go similarity index 98% rename from runtime/stdlib/type-comparator.go rename to stdlib/type-comparator.go index 53cf16e746..2898a7e16c 100644 --- a/runtime/stdlib/type-comparator.go +++ b/stdlib/type-comparator.go @@ -19,8 +19,8 @@ package stdlib import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" ) var _ ast.TypeEqualityChecker = &TypeComparator{} diff --git a/runtime/stdlib/types.go b/stdlib/types.go similarity index 89% rename from runtime/stdlib/types.go rename to stdlib/types.go index 7687e240b8..3aa39ba71a 100644 --- a/runtime/stdlib/types.go +++ b/stdlib/types.go @@ -19,9 +19,9 @@ package stdlib import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) type StandardLibraryType struct { diff --git a/runtime/stdlib/value.go b/stdlib/value.go similarity index 90% rename from runtime/stdlib/value.go rename to stdlib/value.go index 507dbbbe97..07a742397c 100644 --- a/runtime/stdlib/value.go +++ b/stdlib/value.go @@ -19,10 +19,10 @@ package stdlib import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) type StandardLibraryValue struct { diff --git a/runtime/tests/checker/access_test.go b/tests/checker/access_test.go similarity index 99% rename from runtime/tests/checker/access_test.go rename to tests/checker/access_test.go index 12205133e3..13e2eb3de6 100644 --- a/runtime/tests/checker/access_test.go +++ b/tests/checker/access_test.go @@ -25,9 +25,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) func expectSuccess(t *testing.T, err error) { diff --git a/runtime/tests/checker/account_test.go b/tests/checker/account_test.go similarity index 99% rename from runtime/tests/checker/account_test.go rename to tests/checker/account_test.go index 870e9f6731..1fc36ef465 100644 --- a/runtime/tests/checker/account_test.go +++ b/tests/checker/account_test.go @@ -25,9 +25,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/utils" ) func TestCheckAccountStorageSave(t *testing.T) { diff --git a/runtime/tests/checker/any_test.go b/tests/checker/any_test.go similarity index 97% rename from runtime/tests/checker/any_test.go rename to tests/checker/any_test.go index e7d44fac46..fda0cd08b6 100644 --- a/runtime/tests/checker/any_test.go +++ b/tests/checker/any_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckAnyStruct(t *testing.T) { diff --git a/runtime/tests/checker/arrays_dictionaries_test.go b/tests/checker/arrays_dictionaries_test.go similarity index 99% rename from runtime/tests/checker/arrays_dictionaries_test.go rename to tests/checker/arrays_dictionaries_test.go index ce98e677f7..dea57fc1a6 100644 --- a/runtime/tests/checker/arrays_dictionaries_test.go +++ b/tests/checker/arrays_dictionaries_test.go @@ -28,8 +28,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) func TestCheckDictionary(t *testing.T) { diff --git a/runtime/tests/checker/assert_test.go b/tests/checker/assert_test.go similarity index 93% rename from runtime/tests/checker/assert_test.go rename to tests/checker/assert_test.go index 664ff49ced..ea9591bcd9 100644 --- a/runtime/tests/checker/assert_test.go +++ b/tests/checker/assert_test.go @@ -23,9 +23,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" ) func TestCheckAssertWithoutMessage(t *testing.T) { diff --git a/runtime/tests/checker/assignment_test.go b/tests/checker/assignment_test.go similarity index 99% rename from runtime/tests/checker/assignment_test.go rename to tests/checker/assignment_test.go index c26f4556a0..6342ae4174 100644 --- a/runtime/tests/checker/assignment_test.go +++ b/tests/checker/assignment_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckInvalidUnknownDeclarationAssignment(t *testing.T) { diff --git a/runtime/tests/checker/attachments_test.go b/tests/checker/attachments_test.go similarity index 99% rename from runtime/tests/checker/attachments_test.go rename to tests/checker/attachments_test.go index 766e075e1d..c35be0f06a 100644 --- a/runtime/tests/checker/attachments_test.go +++ b/tests/checker/attachments_test.go @@ -25,7 +25,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckAttachmentBasic(t *testing.T) { diff --git a/runtime/tests/checker/boolean_test.go b/tests/checker/boolean_test.go similarity index 96% rename from runtime/tests/checker/boolean_test.go rename to tests/checker/boolean_test.go index a6118fc174..a6e5224581 100644 --- a/runtime/tests/checker/boolean_test.go +++ b/tests/checker/boolean_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckBoolean(t *testing.T) { diff --git a/runtime/tests/checker/builtinfunctions_test.go b/tests/checker/builtinfunctions_test.go similarity index 98% rename from runtime/tests/checker/builtinfunctions_test.go rename to tests/checker/builtinfunctions_test.go index c2ca8e39c6..be7a0ba1d1 100644 --- a/runtime/tests/checker/builtinfunctions_test.go +++ b/tests/checker/builtinfunctions_test.go @@ -25,9 +25,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" ) func TestCheckToString(t *testing.T) { diff --git a/runtime/tests/checker/capability_controller_test.go b/tests/checker/capability_controller_test.go similarity index 96% rename from runtime/tests/checker/capability_controller_test.go rename to tests/checker/capability_controller_test.go index 69418f7cdb..98cd7ec076 100644 --- a/runtime/tests/checker/capability_controller_test.go +++ b/tests/checker/capability_controller_test.go @@ -23,9 +23,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" ) func TestCheckStorageCapabilityController(t *testing.T) { diff --git a/runtime/tests/checker/capability_test.go b/tests/checker/capability_test.go similarity index 99% rename from runtime/tests/checker/capability_test.go rename to tests/checker/capability_test.go index a8899d567d..3a9ffc013e 100644 --- a/runtime/tests/checker/capability_test.go +++ b/tests/checker/capability_test.go @@ -22,8 +22,8 @@ import ( "fmt" "testing" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/utils" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/runtime/tests/checker/casting_test.go b/tests/checker/casting_test.go similarity index 99% rename from runtime/tests/checker/casting_test.go rename to tests/checker/casting_test.go index dfdea7f7f7..d8f901c874 100644 --- a/runtime/tests/checker/casting_test.go +++ b/tests/checker/casting_test.go @@ -25,7 +25,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckCastingIntLiteralToIntegerType(t *testing.T) { diff --git a/runtime/tests/checker/character_test.go b/tests/checker/character_test.go similarity index 97% rename from runtime/tests/checker/character_test.go rename to tests/checker/character_test.go index 66bf35eb30..816ae93159 100644 --- a/runtime/tests/checker/character_test.go +++ b/tests/checker/character_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckCharacterLiteral(t *testing.T) { diff --git a/runtime/tests/checker/composite_test.go b/tests/checker/composite_test.go similarity index 99% rename from runtime/tests/checker/composite_test.go rename to tests/checker/composite_test.go index fe4d0c5e5a..241a6ce50b 100644 --- a/runtime/tests/checker/composite_test.go +++ b/tests/checker/composite_test.go @@ -25,10 +25,10 @@ import ( "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/parser" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/parser" + "github.com/onflow/cadence/sema" ) func TestCheckInvalidCompositeRedeclaringType(t *testing.T) { diff --git a/runtime/tests/checker/conditional_test.go b/tests/checker/conditional_test.go similarity index 98% rename from runtime/tests/checker/conditional_test.go rename to tests/checker/conditional_test.go index 86e918a018..733c3fade3 100644 --- a/runtime/tests/checker/conditional_test.go +++ b/tests/checker/conditional_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckConditionalExpressionTest(t *testing.T) { diff --git a/runtime/tests/checker/conditions_test.go b/tests/checker/conditions_test.go similarity index 99% rename from runtime/tests/checker/conditions_test.go rename to tests/checker/conditions_test.go index 04dbff6706..4c240510c9 100644 --- a/runtime/tests/checker/conditions_test.go +++ b/tests/checker/conditions_test.go @@ -24,8 +24,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/sema" ) func TestCheckFunctionTestConditions(t *testing.T) { diff --git a/runtime/tests/checker/conformance_test.go b/tests/checker/conformance_test.go similarity index 98% rename from runtime/tests/checker/conformance_test.go rename to tests/checker/conformance_test.go index 74a395ec33..8bb29b7548 100644 --- a/runtime/tests/checker/conformance_test.go +++ b/tests/checker/conformance_test.go @@ -24,9 +24,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/sema" ) func TestCheckEventNonTypeRequirementConformance(t *testing.T) { diff --git a/runtime/tests/checker/contract_test.go b/tests/checker/contract_test.go similarity index 99% rename from runtime/tests/checker/contract_test.go rename to tests/checker/contract_test.go index 0a2edbcb0d..9bb97a50d0 100644 --- a/runtime/tests/checker/contract_test.go +++ b/tests/checker/contract_test.go @@ -25,8 +25,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) func TestCheckInvalidContractAccountField(t *testing.T) { diff --git a/runtime/tests/checker/crypto_test.go b/tests/checker/crypto_test.go similarity index 98% rename from runtime/tests/checker/crypto_test.go rename to tests/checker/crypto_test.go index 1e3764c060..191183d7a4 100644 --- a/runtime/tests/checker/crypto_test.go +++ b/tests/checker/crypto_test.go @@ -24,9 +24,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" ) func TestCheckHashAlgorithmCases(t *testing.T) { diff --git a/runtime/tests/checker/declaration_test.go b/tests/checker/declaration_test.go similarity index 99% rename from runtime/tests/checker/declaration_test.go rename to tests/checker/declaration_test.go index 6cc48e17f1..6d7cfd6fdc 100644 --- a/runtime/tests/checker/declaration_test.go +++ b/tests/checker/declaration_test.go @@ -25,8 +25,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) func TestCheckConstantAndVariableDeclarations(t *testing.T) { diff --git a/runtime/tests/checker/dictionary_test.go b/tests/checker/dictionary_test.go similarity index 97% rename from runtime/tests/checker/dictionary_test.go rename to tests/checker/dictionary_test.go index 086315d76c..abb66fe3b8 100644 --- a/runtime/tests/checker/dictionary_test.go +++ b/tests/checker/dictionary_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckIncompleteDictionaryType(t *testing.T) { diff --git a/runtime/tests/checker/dynamic_casting_test.go b/tests/checker/dynamic_casting_test.go similarity index 99% rename from runtime/tests/checker/dynamic_casting_test.go rename to tests/checker/dynamic_casting_test.go index 14d0cd9f4c..ce7f2e38d7 100644 --- a/runtime/tests/checker/dynamic_casting_test.go +++ b/tests/checker/dynamic_casting_test.go @@ -25,10 +25,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/utils" ) var dynamicCastingOperations = []ast.Operation{ diff --git a/runtime/tests/checker/entitlements_test.go b/tests/checker/entitlements_test.go similarity index 99% rename from runtime/tests/checker/entitlements_test.go rename to tests/checker/entitlements_test.go index fb2a5f18dd..b546de5713 100644 --- a/runtime/tests/checker/entitlements_test.go +++ b/tests/checker/entitlements_test.go @@ -25,8 +25,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/sema" ) func TestCheckBasicEntitlementDeclaration(t *testing.T) { diff --git a/runtime/tests/checker/entrypoint_test.go b/tests/checker/entrypoint_test.go similarity index 99% rename from runtime/tests/checker/entrypoint_test.go rename to tests/checker/entrypoint_test.go index 08f76c8f19..4bbba80238 100644 --- a/runtime/tests/checker/entrypoint_test.go +++ b/tests/checker/entrypoint_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckEntryPointParameters(t *testing.T) { diff --git a/runtime/tests/checker/enum_test.go b/tests/checker/enum_test.go similarity index 98% rename from runtime/tests/checker/enum_test.go rename to tests/checker/enum_test.go index fd1ee6b896..671177fd5f 100644 --- a/runtime/tests/checker/enum_test.go +++ b/tests/checker/enum_test.go @@ -25,8 +25,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) func TestCheckInvalidNonEnumCompositeEnumCases(t *testing.T) { diff --git a/runtime/tests/checker/errors_test.go b/tests/checker/errors_test.go similarity index 96% rename from runtime/tests/checker/errors_test.go rename to tests/checker/errors_test.go index 968a42a91d..33da8bc032 100644 --- a/runtime/tests/checker/errors_test.go +++ b/tests/checker/errors_test.go @@ -24,10 +24,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/utils" ) func TestCheckErrorShortCircuiting(t *testing.T) { diff --git a/runtime/tests/checker/events_test.go b/tests/checker/events_test.go similarity index 99% rename from runtime/tests/checker/events_test.go rename to tests/checker/events_test.go index d4e34f3e99..bf140bb749 100644 --- a/runtime/tests/checker/events_test.go +++ b/tests/checker/events_test.go @@ -24,14 +24,14 @@ import ( "github.com/stretchr/testify/assert" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/tests/utils" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckEventDeclaration(t *testing.T) { diff --git a/runtime/tests/checker/external_mutation_test.go b/tests/checker/external_mutation_test.go similarity index 99% rename from runtime/tests/checker/external_mutation_test.go rename to tests/checker/external_mutation_test.go index 201dfd9f94..bd56e9b039 100644 --- a/runtime/tests/checker/external_mutation_test.go +++ b/tests/checker/external_mutation_test.go @@ -25,9 +25,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) func TestCheckArrayUpdateIndexAccess(t *testing.T) { diff --git a/runtime/tests/checker/fixedpoint_test.go b/tests/checker/fixedpoint_test.go similarity index 99% rename from runtime/tests/checker/fixedpoint_test.go rename to tests/checker/fixedpoint_test.go index 99b0ed5cf0..2e7d514785 100644 --- a/runtime/tests/checker/fixedpoint_test.go +++ b/tests/checker/fixedpoint_test.go @@ -27,8 +27,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/sema" ) func TestCheckFixedPointLiteralTypeConversionInVariableDeclaration(t *testing.T) { diff --git a/runtime/tests/checker/for_test.go b/tests/checker/for_test.go similarity index 98% rename from runtime/tests/checker/for_test.go rename to tests/checker/for_test.go index 0806412ada..d2b6a231d5 100644 --- a/runtime/tests/checker/for_test.go +++ b/tests/checker/for_test.go @@ -25,9 +25,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" ) func TestCheckForVariableSized(t *testing.T) { diff --git a/runtime/tests/checker/force_test.go b/tests/checker/force_test.go similarity index 98% rename from runtime/tests/checker/force_test.go rename to tests/checker/force_test.go index fa562cd9b1..2317ebc1fc 100644 --- a/runtime/tests/checker/force_test.go +++ b/tests/checker/force_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckForce(t *testing.T) { diff --git a/runtime/tests/checker/function_expression_test.go b/tests/checker/function_expression_test.go similarity index 96% rename from runtime/tests/checker/function_expression_test.go rename to tests/checker/function_expression_test.go index 285746c532..14f65c0e91 100644 --- a/runtime/tests/checker/function_expression_test.go +++ b/tests/checker/function_expression_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckInvalidFunctionExpressionReturnValue(t *testing.T) { diff --git a/runtime/tests/checker/function_test.go b/tests/checker/function_test.go similarity index 98% rename from runtime/tests/checker/function_test.go rename to tests/checker/function_test.go index cc9acd69bc..88edcf9306 100644 --- a/runtime/tests/checker/function_test.go +++ b/tests/checker/function_test.go @@ -24,10 +24,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/parser" + "github.com/onflow/cadence/sema" ) func TestCheckReferenceInFunction(t *testing.T) { diff --git a/runtime/tests/checker/genericfunction_test.go b/tests/checker/genericfunction_test.go similarity index 99% rename from runtime/tests/checker/genericfunction_test.go rename to tests/checker/genericfunction_test.go index ce52b291da..0d8dc3e805 100644 --- a/runtime/tests/checker/genericfunction_test.go +++ b/tests/checker/genericfunction_test.go @@ -25,11 +25,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/parser" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" ) func parseAndCheckWithTestValue(t *testing.T, code string, ty sema.Type) (*sema.Checker, error) { diff --git a/runtime/tests/checker/hashable_struct_test.go b/tests/checker/hashable_struct_test.go similarity index 97% rename from runtime/tests/checker/hashable_struct_test.go rename to tests/checker/hashable_struct_test.go index 4d5d69e999..4ae190201e 100644 --- a/runtime/tests/checker/hashable_struct_test.go +++ b/tests/checker/hashable_struct_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckHashableStruct(t *testing.T) { diff --git a/runtime/tests/checker/if_test.go b/tests/checker/if_test.go similarity index 98% rename from runtime/tests/checker/if_test.go rename to tests/checker/if_test.go index a231e71fbb..5681f8f111 100644 --- a/runtime/tests/checker/if_test.go +++ b/tests/checker/if_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckIfStatementTest(t *testing.T) { diff --git a/runtime/tests/checker/import_test.go b/tests/checker/import_test.go similarity index 98% rename from runtime/tests/checker/import_test.go rename to tests/checker/import_test.go index de971dd7c3..bc586139c6 100644 --- a/runtime/tests/checker/import_test.go +++ b/tests/checker/import_test.go @@ -25,12 +25,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/parser" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/utils" ) func TestCheckInvalidImport(t *testing.T) { diff --git a/runtime/tests/checker/indexing_test.go b/tests/checker/indexing_test.go similarity index 98% rename from runtime/tests/checker/indexing_test.go rename to tests/checker/indexing_test.go index e2501629e2..1e9bef01e1 100644 --- a/runtime/tests/checker/indexing_test.go +++ b/tests/checker/indexing_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckArrayIndexingWithInteger(t *testing.T) { diff --git a/runtime/tests/checker/initialization_test.go b/tests/checker/initialization_test.go similarity index 99% rename from runtime/tests/checker/initialization_test.go rename to tests/checker/initialization_test.go index e660f7ef86..48242a9b6c 100644 --- a/runtime/tests/checker/initialization_test.go +++ b/tests/checker/initialization_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) // TODO: test multiple initializers once overloading is supported diff --git a/runtime/tests/checker/integer_test.go b/tests/checker/integer_test.go similarity index 99% rename from runtime/tests/checker/integer_test.go rename to tests/checker/integer_test.go index ea5063a93f..798b168393 100644 --- a/runtime/tests/checker/integer_test.go +++ b/tests/checker/integer_test.go @@ -26,8 +26,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) var allIntegerTypesAndAddressType = common.Concat( diff --git a/runtime/tests/checker/interface_test.go b/tests/checker/interface_test.go similarity index 99% rename from runtime/tests/checker/interface_test.go rename to tests/checker/interface_test.go index 36d99a24e6..d0943d0fb0 100644 --- a/runtime/tests/checker/interface_test.go +++ b/tests/checker/interface_test.go @@ -25,13 +25,13 @@ import ( "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/parser" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - "github.com/onflow/cadence/runtime/tests/examples" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/parser" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + "github.com/onflow/cadence/tests/examples" + . "github.com/onflow/cadence/tests/utils" ) func constructorArguments(compositeKind common.CompositeKind) string { diff --git a/runtime/tests/checker/intersection_test.go b/tests/checker/intersection_test.go similarity index 99% rename from runtime/tests/checker/intersection_test.go rename to tests/checker/intersection_test.go index df007b5b4d..ee3b8bf94e 100644 --- a/runtime/tests/checker/intersection_test.go +++ b/tests/checker/intersection_test.go @@ -25,7 +25,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckIntersectionType(t *testing.T) { diff --git a/runtime/tests/checker/invalid_test.go b/tests/checker/invalid_test.go similarity index 98% rename from runtime/tests/checker/invalid_test.go rename to tests/checker/invalid_test.go index 42fd6953f8..b5f058e34c 100644 --- a/runtime/tests/checker/invalid_test.go +++ b/tests/checker/invalid_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckSpuriousIdentifierAssignmentInvalidValueTypeMismatch(t *testing.T) { diff --git a/runtime/tests/checker/invocation_test.go b/tests/checker/invocation_test.go similarity index 98% rename from runtime/tests/checker/invocation_test.go rename to tests/checker/invocation_test.go index b55d20d668..ded43f11ae 100644 --- a/runtime/tests/checker/invocation_test.go +++ b/tests/checker/invocation_test.go @@ -24,11 +24,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "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/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + "github.com/onflow/cadence/tests/utils" ) func TestCheckInvalidFunctionCallWithTooFewArguments(t *testing.T) { diff --git a/runtime/tests/checker/member_test.go b/tests/checker/member_test.go similarity index 99% rename from runtime/tests/checker/member_test.go rename to tests/checker/member_test.go index b3a0ab4464..c2778c7c18 100644 --- a/runtime/tests/checker/member_test.go +++ b/tests/checker/member_test.go @@ -25,8 +25,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) func TestCheckOptionalChainingNonOptionalFieldRead(t *testing.T) { diff --git a/runtime/tests/checker/metatype_test.go b/tests/checker/metatype_test.go similarity index 99% rename from runtime/tests/checker/metatype_test.go rename to tests/checker/metatype_test.go index b660a60e64..cb9c5c1b7c 100644 --- a/runtime/tests/checker/metatype_test.go +++ b/tests/checker/metatype_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckMetaType(t *testing.T) { diff --git a/runtime/tests/checker/move_test.go b/tests/checker/move_test.go similarity index 98% rename from runtime/tests/checker/move_test.go rename to tests/checker/move_test.go index 29aa214ce4..848fc6c6e7 100644 --- a/runtime/tests/checker/move_test.go +++ b/tests/checker/move_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckInvalidMoves(t *testing.T) { diff --git a/runtime/tests/checker/nesting_test.go b/tests/checker/nesting_test.go similarity index 98% rename from runtime/tests/checker/nesting_test.go rename to tests/checker/nesting_test.go index fda0d70f50..40ec6ab6e9 100644 --- a/runtime/tests/checker/nesting_test.go +++ b/tests/checker/nesting_test.go @@ -25,10 +25,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/stdlib" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) func TestCheckCompositeDeclarationNesting(t *testing.T) { diff --git a/runtime/tests/checker/never_test.go b/tests/checker/never_test.go similarity index 99% rename from runtime/tests/checker/never_test.go rename to tests/checker/never_test.go index bdc417e902..59c62020cc 100644 --- a/runtime/tests/checker/never_test.go +++ b/tests/checker/never_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckNever(t *testing.T) { diff --git a/runtime/tests/checker/nft_test.go b/tests/checker/nft_test.go similarity index 100% rename from runtime/tests/checker/nft_test.go rename to tests/checker/nft_test.go diff --git a/runtime/tests/checker/nil_coalescing_test.go b/tests/checker/nil_coalescing_test.go similarity index 99% rename from runtime/tests/checker/nil_coalescing_test.go rename to tests/checker/nil_coalescing_test.go index 4abd505de8..78a79677c0 100644 --- a/runtime/tests/checker/nil_coalescing_test.go +++ b/tests/checker/nil_coalescing_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckNilCoalescingNilIntToOptional(t *testing.T) { diff --git a/runtime/tests/checker/occurrences_test.go b/tests/checker/occurrences_test.go similarity index 98% rename from runtime/tests/checker/occurrences_test.go rename to tests/checker/occurrences_test.go index f01f96ebd3..462bb1e770 100644 --- a/runtime/tests/checker/occurrences_test.go +++ b/tests/checker/occurrences_test.go @@ -24,9 +24,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" + . "github.com/onflow/cadence/tests/utils" ) // TODO: implement occurrences for type references diff --git a/runtime/tests/checker/operations_test.go b/tests/checker/operations_test.go similarity index 99% rename from runtime/tests/checker/operations_test.go rename to tests/checker/operations_test.go index d9255bbcc9..3a198b4004 100644 --- a/runtime/tests/checker/operations_test.go +++ b/tests/checker/operations_test.go @@ -26,10 +26,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" ) func TestCheckInvalidUnaryBooleanNegationOfInteger(t *testing.T) { diff --git a/runtime/tests/checker/optional_test.go b/tests/checker/optional_test.go similarity index 99% rename from runtime/tests/checker/optional_test.go rename to tests/checker/optional_test.go index db377c8120..e502aa9f26 100644 --- a/runtime/tests/checker/optional_test.go +++ b/tests/checker/optional_test.go @@ -25,8 +25,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) func TestCheckOptional(t *testing.T) { diff --git a/runtime/tests/checker/overloading_test.go b/tests/checker/overloading_test.go similarity index 95% rename from runtime/tests/checker/overloading_test.go rename to tests/checker/overloading_test.go index 70b0ebe481..d78bc4ba9b 100644 --- a/runtime/tests/checker/overloading_test.go +++ b/tests/checker/overloading_test.go @@ -24,8 +24,8 @@ import ( "github.com/stretchr/testify/assert" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) func TestCheckInvalidCompositeInitializerOverloading(t *testing.T) { diff --git a/runtime/tests/checker/path_test.go b/tests/checker/path_test.go similarity index 97% rename from runtime/tests/checker/path_test.go rename to tests/checker/path_test.go index 197daeb008..c21e313830 100644 --- a/runtime/tests/checker/path_test.go +++ b/tests/checker/path_test.go @@ -25,8 +25,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) func TestCheckPath(t *testing.T) { diff --git a/runtime/tests/checker/pragma_test.go b/tests/checker/pragma_test.go similarity index 99% rename from runtime/tests/checker/pragma_test.go rename to tests/checker/pragma_test.go index 00200cb652..087ea1926a 100644 --- a/runtime/tests/checker/pragma_test.go +++ b/tests/checker/pragma_test.go @@ -25,7 +25,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckPragmaExpression(t *testing.T) { diff --git a/runtime/tests/checker/predeclaredvalues_test.go b/tests/checker/predeclaredvalues_test.go similarity index 91% rename from runtime/tests/checker/predeclaredvalues_test.go rename to tests/checker/predeclaredvalues_test.go index bd1691f16a..1ebcfb7d14 100644 --- a/runtime/tests/checker/predeclaredvalues_test.go +++ b/tests/checker/predeclaredvalues_test.go @@ -23,9 +23,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" ) func TestCheckPredeclaredValues(t *testing.T) { diff --git a/runtime/tests/checker/purity_test.go b/tests/checker/purity_test.go similarity index 99% rename from runtime/tests/checker/purity_test.go rename to tests/checker/purity_test.go index 4dee42f36a..16914158f5 100644 --- a/runtime/tests/checker/purity_test.go +++ b/tests/checker/purity_test.go @@ -24,8 +24,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/sema" ) func TestCheckPuritySubtyping(t *testing.T) { diff --git a/runtime/tests/checker/range_test.go b/tests/checker/range_test.go similarity index 98% rename from runtime/tests/checker/range_test.go rename to tests/checker/range_test.go index 59d346d7e8..d72c798855 100644 --- a/runtime/tests/checker/range_test.go +++ b/tests/checker/range_test.go @@ -25,9 +25,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/utils" ) func TestCheckRange(t *testing.T) { diff --git a/runtime/tests/checker/range_value_test.go b/tests/checker/range_value_test.go similarity index 98% rename from runtime/tests/checker/range_value_test.go rename to tests/checker/range_value_test.go index b80be3b453..f93fd5a9c9 100644 --- a/runtime/tests/checker/range_value_test.go +++ b/tests/checker/range_value_test.go @@ -25,9 +25,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" ) type inclusiveRangeConstructionTest struct { diff --git a/runtime/tests/checker/reference_test.go b/tests/checker/reference_test.go similarity index 99% rename from runtime/tests/checker/reference_test.go rename to tests/checker/reference_test.go index 0207c42da2..ef4b92f33b 100644 --- a/runtime/tests/checker/reference_test.go +++ b/tests/checker/reference_test.go @@ -25,10 +25,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/utils" ) func TestCheckReference(t *testing.T) { diff --git a/runtime/tests/checker/resources_test.go b/tests/checker/resources_test.go similarity index 99% rename from runtime/tests/checker/resources_test.go rename to tests/checker/resources_test.go index 2ea26b6790..050a117a56 100644 --- a/runtime/tests/checker/resources_test.go +++ b/tests/checker/resources_test.go @@ -25,11 +25,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/sema" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/sema" + . "github.com/onflow/cadence/tests/utils" ) func TestCheckFailableCastingWithResourceAnnotation(t *testing.T) { diff --git a/runtime/tests/checker/return_test.go b/tests/checker/return_test.go similarity index 98% rename from runtime/tests/checker/return_test.go rename to tests/checker/return_test.go index 61607904e4..32b5cf4593 100644 --- a/runtime/tests/checker/return_test.go +++ b/tests/checker/return_test.go @@ -25,9 +25,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" ) func TestCheckInvalidReturnValue(t *testing.T) { diff --git a/runtime/tests/checker/rlp_test.go b/tests/checker/rlp_test.go similarity index 95% rename from runtime/tests/checker/rlp_test.go rename to tests/checker/rlp_test.go index 0790fb577e..2f77cb0708 100644 --- a/runtime/tests/checker/rlp_test.go +++ b/tests/checker/rlp_test.go @@ -23,9 +23,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" ) func TestCheckRLPDecodeString(t *testing.T) { diff --git a/runtime/tests/checker/runtimetype_test.go b/tests/checker/runtimetype_test.go similarity index 99% rename from runtime/tests/checker/runtimetype_test.go rename to tests/checker/runtimetype_test.go index 10ec8aaf1a..7ee3c911e3 100644 --- a/runtime/tests/checker/runtimetype_test.go +++ b/tests/checker/runtimetype_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckOptionalTypeConstructor(t *testing.T) { diff --git a/runtime/tests/checker/storable_test.go b/tests/checker/storable_test.go similarity index 98% rename from runtime/tests/checker/storable_test.go rename to tests/checker/storable_test.go index d7a283217c..5aac22ecfe 100644 --- a/runtime/tests/checker/storable_test.go +++ b/tests/checker/storable_test.go @@ -25,10 +25,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" ) func TestCheckStorable(t *testing.T) { diff --git a/runtime/tests/checker/string_test.go b/tests/checker/string_test.go similarity index 99% rename from runtime/tests/checker/string_test.go rename to tests/checker/string_test.go index d857185350..cc82a8ec00 100644 --- a/runtime/tests/checker/string_test.go +++ b/tests/checker/string_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckCharacter(t *testing.T) { diff --git a/runtime/tests/checker/swap_test.go b/tests/checker/swap_test.go similarity index 99% rename from runtime/tests/checker/swap_test.go rename to tests/checker/swap_test.go index 0bf6a73215..28e708aceb 100644 --- a/runtime/tests/checker/swap_test.go +++ b/tests/checker/swap_test.go @@ -25,7 +25,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckInvalidUnknownDeclarationSwap(t *testing.T) { diff --git a/runtime/tests/checker/switch_test.go b/tests/checker/switch_test.go similarity index 99% rename from runtime/tests/checker/switch_test.go rename to tests/checker/switch_test.go index 7300beecf0..0f34d0a506 100644 --- a/runtime/tests/checker/switch_test.go +++ b/tests/checker/switch_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckSwitchStatementTest(t *testing.T) { diff --git a/runtime/tests/checker/transactions_test.go b/tests/checker/transactions_test.go similarity index 99% rename from runtime/tests/checker/transactions_test.go rename to tests/checker/transactions_test.go index 7bd8642e05..2dfde9d8c8 100644 --- a/runtime/tests/checker/transactions_test.go +++ b/tests/checker/transactions_test.go @@ -24,7 +24,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckTransactions(t *testing.T) { diff --git a/runtime/tests/checker/type_inference_test.go b/tests/checker/type_inference_test.go similarity index 99% rename from runtime/tests/checker/type_inference_test.go rename to tests/checker/type_inference_test.go index 99bc14702c..6aa900a98e 100644 --- a/runtime/tests/checker/type_inference_test.go +++ b/tests/checker/type_inference_test.go @@ -24,8 +24,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) func TestCheckArrayElementTypeInference(t *testing.T) { diff --git a/runtime/tests/checker/typeargument_test.go b/tests/checker/typeargument_test.go similarity index 99% rename from runtime/tests/checker/typeargument_test.go rename to tests/checker/typeargument_test.go index c76d58eade..5c03e2794a 100644 --- a/runtime/tests/checker/typeargument_test.go +++ b/tests/checker/typeargument_test.go @@ -24,9 +24,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" ) func TestCheckTypeArguments(t *testing.T) { diff --git a/runtime/tests/checker/utils.go b/tests/checker/utils.go similarity index 95% rename from runtime/tests/checker/utils.go rename to tests/checker/utils.go index 9849a13d66..f0c1e91442 100644 --- a/runtime/tests/checker/utils.go +++ b/tests/checker/utils.go @@ -29,11 +29,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/pretty" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/parser" + "github.com/onflow/cadence/pretty" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/utils" ) func ParseAndCheck(t testing.TB, code string) (*sema.Checker, error) { diff --git a/runtime/tests/checker/utils_test.go b/tests/checker/utils_test.go similarity index 92% rename from runtime/tests/checker/utils_test.go rename to tests/checker/utils_test.go index d6ce4398d8..5aa262f30d 100644 --- a/runtime/tests/checker/utils_test.go +++ b/tests/checker/utils_test.go @@ -21,9 +21,9 @@ package checker import ( "testing" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" ) func ParseAndCheckWithPanic(t *testing.T, code string) (*sema.Checker, error) { diff --git a/runtime/tests/checker/while_test.go b/tests/checker/while_test.go similarity index 98% rename from runtime/tests/checker/while_test.go rename to tests/checker/while_test.go index cf3864ce6f..a6eaa55230 100644 --- a/runtime/tests/checker/while_test.go +++ b/tests/checker/while_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/assert" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func TestCheckInvalidWhileTest(t *testing.T) { diff --git a/runtime/tests/errors_test.go b/tests/errors_test.go similarity index 91% rename from runtime/tests/errors_test.go rename to tests/errors_test.go index 3fd9a588c7..9fafcbf8fc 100644 --- a/runtime/tests/errors_test.go +++ b/tests/errors_test.go @@ -29,9 +29,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/parser" "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/parser" ) // TestErrorInterfaceConformance checks whether all the error structs implement @@ -43,7 +43,7 @@ func TestErrorInterfaceConformance(t *testing.T) { &packages.Config{ Mode: packages.NeedImports | packages.NeedTypes, }, - "github.com/onflow/cadence/runtime/errors", + "github.com/onflow/cadence/errors", ) require.NoError(t, err) @@ -92,13 +92,13 @@ func TestErrorInterfaceConformance(t *testing.T) { Mode: packages.NeedImports | packages.NeedTypes, }, "github.com/onflow/cadence/runtime", - "github.com/onflow/cadence/runtime/interpreter", - "github.com/onflow/cadence/runtime/sema", - "github.com/onflow/cadence/runtime/parser", - "github.com/onflow/cadence/runtime/stdlib", + "github.com/onflow/cadence/interpreter", + "github.com/onflow/cadence/sema", + "github.com/onflow/cadence/parser", + "github.com/onflow/cadence/stdlib", // Currently, doesnt support: - //"github.com/onflow/cadence/runtime/compiler/wasm", + //"github.com/onflow/cadence/compiler/wasm", ) require.NoError(t, err) diff --git a/runtime/tests/examples/examples.go b/tests/examples/examples.go similarity index 100% rename from runtime/tests/examples/examples.go rename to tests/examples/examples.go diff --git a/runtime/tests/fuzz/crashers_test.go b/tests/fuzz/crashers_test.go similarity index 100% rename from runtime/tests/fuzz/crashers_test.go rename to tests/fuzz/crashers_test.go diff --git a/runtime/tests/interpreter/account_test.go b/tests/interpreter/account_test.go similarity index 99% rename from runtime/tests/interpreter/account_test.go rename to tests/interpreter/account_test.go index 800618c04c..9ef518efb9 100644 --- a/runtime/tests/interpreter/account_test.go +++ b/tests/interpreter/account_test.go @@ -24,17 +24,17 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/activations" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/activations" + "github.com/onflow/cadence/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + . "github.com/onflow/cadence/tests/utils" ) type storageKey struct { diff --git a/runtime/tests/interpreter/arithmetic_test.go b/tests/interpreter/arithmetic_test.go similarity index 99% rename from runtime/tests/interpreter/arithmetic_test.go rename to tests/interpreter/arithmetic_test.go index c863831c59..4c56b41345 100644 --- a/runtime/tests/interpreter/arithmetic_test.go +++ b/tests/interpreter/arithmetic_test.go @@ -26,10 +26,10 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + . "github.com/onflow/cadence/tests/utils" ) var integerTestValues = map[string]interpreter.NumberValue{ diff --git a/runtime/tests/interpreter/array_test.go b/tests/interpreter/array_test.go similarity index 98% rename from runtime/tests/interpreter/array_test.go rename to tests/interpreter/array_test.go index 2617403b0f..2438db97d2 100644 --- a/runtime/tests/interpreter/array_test.go +++ b/tests/interpreter/array_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/interpreter" + "github.com/onflow/cadence/interpreter" ) func TestInterpretArrayFunctionEntitlements(t *testing.T) { diff --git a/runtime/tests/interpreter/attachments_test.go b/tests/interpreter/attachments_test.go similarity index 99% rename from runtime/tests/interpreter/attachments_test.go rename to tests/interpreter/attachments_test.go index 55381635d7..fb2fe3657f 100644 --- a/runtime/tests/interpreter/attachments_test.go +++ b/tests/interpreter/attachments_test.go @@ -21,15 +21,14 @@ package interpreter_test import ( "testing" - "github.com/onflow/cadence/runtime/activations" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/activations" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + . "github.com/onflow/cadence/tests/utils" "github.com/stretchr/testify/require" - - . "github.com/onflow/cadence/runtime/tests/utils" ) func TestInterpretAttachmentStruct(t *testing.T) { diff --git a/runtime/tests/interpreter/bitwise_test.go b/tests/interpreter/bitwise_test.go similarity index 97% rename from runtime/tests/interpreter/bitwise_test.go rename to tests/interpreter/bitwise_test.go index 8c71f7fda5..b0e9e9cd74 100644 --- a/runtime/tests/interpreter/bitwise_test.go +++ b/tests/interpreter/bitwise_test.go @@ -22,9 +22,9 @@ import ( "fmt" "testing" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + . "github.com/onflow/cadence/tests/utils" ) var bitwiseTestValueFunctions = map[string]func(int) interpreter.NumberValue{ diff --git a/runtime/tests/interpreter/builtinfunctions_test.go b/tests/interpreter/builtinfunctions_test.go similarity index 99% rename from runtime/tests/interpreter/builtinfunctions_test.go rename to tests/interpreter/builtinfunctions_test.go index 00baa3364b..b527af6900 100644 --- a/runtime/tests/interpreter/builtinfunctions_test.go +++ b/tests/interpreter/builtinfunctions_test.go @@ -26,10 +26,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + . "github.com/onflow/cadence/tests/utils" ) func TestInterpretToString(t *testing.T) { diff --git a/runtime/tests/interpreter/character_test.go b/tests/interpreter/character_test.go similarity index 93% rename from runtime/tests/interpreter/character_test.go rename to tests/interpreter/character_test.go index 08eed89630..298fb1c604 100644 --- a/runtime/tests/interpreter/character_test.go +++ b/tests/interpreter/character_test.go @@ -24,9 +24,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + . "github.com/onflow/cadence/tests/utils" ) func TestInterpretCharacterUtf8Field(t *testing.T) { diff --git a/runtime/tests/interpreter/composite_value_test.go b/tests/interpreter/composite_value_test.go similarity index 94% rename from runtime/tests/interpreter/composite_value_test.go rename to tests/interpreter/composite_value_test.go index 4a4bc949db..cacf0c145d 100644 --- a/runtime/tests/interpreter/composite_value_test.go +++ b/tests/interpreter/composite_value_test.go @@ -22,15 +22,14 @@ import ( "fmt" "testing" - "github.com/onflow/cadence/runtime/activations" - "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/activations" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + . "github.com/onflow/cadence/tests/utils" ) func TestInterpretCompositeValue(t *testing.T) { diff --git a/runtime/tests/interpreter/condition_test.go b/tests/interpreter/condition_test.go similarity index 98% rename from runtime/tests/interpreter/condition_test.go rename to tests/interpreter/condition_test.go index 0d17d9d275..34d56d2f14 100644 --- a/runtime/tests/interpreter/condition_test.go +++ b/tests/interpreter/condition_test.go @@ -22,18 +22,17 @@ import ( "fmt" "testing" - "github.com/onflow/cadence/runtime/activations" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - "github.com/onflow/cadence/runtime/tests/checker" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/activations" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + "github.com/onflow/cadence/tests/checker" + . "github.com/onflow/cadence/tests/utils" ) func TestInterpretFunctionPreTestCondition(t *testing.T) { diff --git a/runtime/tests/interpreter/container_mutation_test.go b/tests/interpreter/container_mutation_test.go similarity index 99% rename from runtime/tests/interpreter/container_mutation_test.go rename to tests/interpreter/container_mutation_test.go index cb3d6d42c1..10a37e6a30 100644 --- a/runtime/tests/interpreter/container_mutation_test.go +++ b/tests/interpreter/container_mutation_test.go @@ -21,17 +21,15 @@ package interpreter_test import ( "testing" - "github.com/onflow/cadence/runtime/activations" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - . "github.com/onflow/cadence/runtime/tests/utils" - - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/activations" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + . "github.com/onflow/cadence/tests/utils" ) func TestInterpetArrayMutation(t *testing.T) { diff --git a/runtime/tests/interpreter/contract_test.go b/tests/interpreter/contract_test.go similarity index 97% rename from runtime/tests/interpreter/contract_test.go rename to tests/interpreter/contract_test.go index f22f3ae89d..e4f9e8b30f 100644 --- a/runtime/tests/interpreter/contract_test.go +++ b/tests/interpreter/contract_test.go @@ -23,8 +23,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/interpreter" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/interpreter" + . "github.com/onflow/cadence/tests/utils" ) func TestInterpretContractUseBeforeInitializationComplete(t *testing.T) { diff --git a/runtime/tests/interpreter/declaration_test.go b/tests/interpreter/declaration_test.go similarity index 96% rename from runtime/tests/interpreter/declaration_test.go rename to tests/interpreter/declaration_test.go index 3bc3cac4c4..9ab5181e05 100644 --- a/runtime/tests/interpreter/declaration_test.go +++ b/tests/interpreter/declaration_test.go @@ -24,8 +24,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) func TestInterpretForwardReferenceCall(t *testing.T) { diff --git a/runtime/tests/interpreter/dictionary_test.go b/tests/interpreter/dictionary_test.go similarity index 100% rename from runtime/tests/interpreter/dictionary_test.go rename to tests/interpreter/dictionary_test.go diff --git a/runtime/tests/interpreter/dynamic_casting_test.go b/tests/interpreter/dynamic_casting_test.go similarity index 99% rename from runtime/tests/interpreter/dynamic_casting_test.go rename to tests/interpreter/dynamic_casting_test.go index 2a3a96292f..03b532b119 100644 --- a/runtime/tests/interpreter/dynamic_casting_test.go +++ b/tests/interpreter/dynamic_casting_test.go @@ -22,18 +22,17 @@ import ( "fmt" "testing" - "github.com/onflow/cadence/runtime/activations" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/activations" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + . "github.com/onflow/cadence/tests/utils" ) // dynamic casting operation -> returns optional diff --git a/runtime/tests/interpreter/entitlements_test.go b/tests/interpreter/entitlements_test.go similarity index 99% rename from runtime/tests/interpreter/entitlements_test.go rename to tests/interpreter/entitlements_test.go index a7a88d0aba..14106837ff 100644 --- a/runtime/tests/interpreter/entitlements_test.go +++ b/tests/interpreter/entitlements_test.go @@ -24,11 +24,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" - . "github.com/onflow/cadence/runtime/tests/utils" + . "github.com/onflow/cadence/tests/utils" ) func TestInterpretEntitledReferenceRuntimeTypes(t *testing.T) { diff --git a/runtime/tests/interpreter/enum_test.go b/tests/interpreter/enum_test.go similarity index 97% rename from runtime/tests/interpreter/enum_test.go rename to tests/interpreter/enum_test.go index 09e1bbc9bf..54e563c784 100644 --- a/runtime/tests/interpreter/enum_test.go +++ b/tests/interpreter/enum_test.go @@ -24,10 +24,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - . "github.com/onflow/cadence/runtime/tests/utils" + . "github.com/onflow/cadence/tests/utils" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" ) func TestInterpretEnum(t *testing.T) { diff --git a/runtime/tests/interpreter/equality_test.go b/tests/interpreter/equality_test.go similarity index 96% rename from runtime/tests/interpreter/equality_test.go rename to tests/interpreter/equality_test.go index a76a49152a..dee8dc54c9 100644 --- a/runtime/tests/interpreter/equality_test.go +++ b/tests/interpreter/equality_test.go @@ -22,18 +22,16 @@ import ( "fmt" "testing" - "github.com/onflow/cadence/runtime/activations" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - . "github.com/onflow/cadence/runtime/tests/utils" - - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/activations" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + . "github.com/onflow/cadence/tests/utils" ) func TestInterpretEquality(t *testing.T) { diff --git a/runtime/tests/interpreter/fixedpoint_test.go b/tests/interpreter/fixedpoint_test.go similarity index 99% rename from runtime/tests/interpreter/fixedpoint_test.go rename to tests/interpreter/fixedpoint_test.go index 86ff3b70ba..0fe9d9258b 100644 --- a/runtime/tests/interpreter/fixedpoint_test.go +++ b/tests/interpreter/fixedpoint_test.go @@ -27,9 +27,9 @@ import ( "github.com/stretchr/testify/require" "github.com/onflow/cadence/fixedpoint" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + . "github.com/onflow/cadence/tests/utils" ) func TestInterpretNegativeZeroFixedPoint(t *testing.T) { diff --git a/runtime/tests/interpreter/for_test.go b/tests/interpreter/for_test.go similarity index 98% rename from runtime/tests/interpreter/for_test.go rename to tests/interpreter/for_test.go index 2ee6c3145c..370546ffdf 100644 --- a/runtime/tests/interpreter/for_test.go +++ b/tests/interpreter/for_test.go @@ -25,13 +25,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/activations" - "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/onflow/cadence/runtime/interpreter" + "github.com/onflow/cadence/activations" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + . "github.com/onflow/cadence/tests/utils" ) func TestInterpretForStatement(t *testing.T) { diff --git a/runtime/tests/interpreter/function_test.go b/tests/interpreter/function_test.go similarity index 97% rename from runtime/tests/interpreter/function_test.go rename to tests/interpreter/function_test.go index 3530b0a5d9..f2e4675e4e 100644 --- a/runtime/tests/interpreter/function_test.go +++ b/tests/interpreter/function_test.go @@ -24,11 +24,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/checker" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/checker" + "github.com/onflow/cadence/tests/utils" ) func TestInterpretResultVariable(t *testing.T) { diff --git a/runtime/tests/interpreter/if_test.go b/tests/interpreter/if_test.go similarity index 97% rename from runtime/tests/interpreter/if_test.go rename to tests/interpreter/if_test.go index e689067ccb..cc7efb83c2 100644 --- a/runtime/tests/interpreter/if_test.go +++ b/tests/interpreter/if_test.go @@ -24,11 +24,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - . "github.com/onflow/cadence/runtime/tests/utils" + . "github.com/onflow/cadence/tests/utils" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/checker" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/checker" ) func TestInterpretIfStatement(t *testing.T) { diff --git a/runtime/tests/interpreter/import_test.go b/tests/interpreter/import_test.go similarity index 96% rename from runtime/tests/interpreter/import_test.go rename to tests/interpreter/import_test.go index b7cfc4681e..45204a23c8 100644 --- a/runtime/tests/interpreter/import_test.go +++ b/tests/interpreter/import_test.go @@ -24,14 +24,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common/orderedmap" - . "github.com/onflow/cadence/runtime/tests/utils" - - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/checker" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/common/orderedmap" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/checker" + . "github.com/onflow/cadence/tests/utils" ) func TestInterpretVirtualImport(t *testing.T) { diff --git a/runtime/tests/interpreter/indexing_test.go b/tests/interpreter/indexing_test.go similarity index 97% rename from runtime/tests/interpreter/indexing_test.go rename to tests/interpreter/indexing_test.go index a28ed6cd85..819478859b 100644 --- a/runtime/tests/interpreter/indexing_test.go +++ b/tests/interpreter/indexing_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/interpreter" + "github.com/onflow/cadence/interpreter" ) // TestInterpretIndexingExpressionTransfer tests if the indexing value diff --git a/runtime/tests/interpreter/integers_test.go b/tests/interpreter/integers_test.go similarity index 99% rename from runtime/tests/interpreter/integers_test.go rename to tests/interpreter/integers_test.go index 497e4c4a1a..9da93b1745 100644 --- a/runtime/tests/interpreter/integers_test.go +++ b/tests/interpreter/integers_test.go @@ -28,10 +28,10 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - . "github.com/onflow/cadence/runtime/tests/utils" + . "github.com/onflow/cadence/tests/utils" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) var testIntegerTypesAndValues = map[string]interpreter.Value{ diff --git a/runtime/tests/interpreter/interface_test.go b/tests/interpreter/interface_test.go similarity index 98% rename from runtime/tests/interpreter/interface_test.go rename to tests/interpreter/interface_test.go index 0ae027b08f..b61c422ba5 100644 --- a/runtime/tests/interpreter/interface_test.go +++ b/tests/interpreter/interface_test.go @@ -24,12 +24,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/activations" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/activations" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + "github.com/onflow/cadence/tests/utils" ) func TestInterpretInterfaceDefaultImplementation(t *testing.T) { diff --git a/runtime/tests/interpreter/interpreter_test.go b/tests/interpreter/interpreter_test.go similarity index 99% rename from runtime/tests/interpreter/interpreter_test.go rename to tests/interpreter/interpreter_test.go index fcfccba68c..29d4f11823 100644 --- a/runtime/tests/interpreter/interpreter_test.go +++ b/tests/interpreter/interpreter_test.go @@ -29,18 +29,18 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/onflow/cadence/activations" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/common/orderedmap" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/parser" + "github.com/onflow/cadence/pretty" "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/activations" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/common/orderedmap" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/pretty" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - "github.com/onflow/cadence/runtime/tests/checker" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + "github.com/onflow/cadence/tests/checker" + . "github.com/onflow/cadence/tests/utils" ) type ParseCheckAndInterpretOptions struct { diff --git a/runtime/tests/interpreter/invocation_test.go b/tests/interpreter/invocation_test.go similarity index 93% rename from runtime/tests/interpreter/invocation_test.go rename to tests/interpreter/invocation_test.go index 42abb81046..4e9164f36f 100644 --- a/runtime/tests/interpreter/invocation_test.go +++ b/tests/interpreter/invocation_test.go @@ -23,12 +23,12 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/activations" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/activations" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + . "github.com/onflow/cadence/tests/utils" ) func TestInterpretFunctionInvocationCheckArgumentTypes(t *testing.T) { diff --git a/runtime/tests/interpreter/member_test.go b/tests/interpreter/member_test.go similarity index 99% rename from runtime/tests/interpreter/member_test.go rename to tests/interpreter/member_test.go index d5b1abac58..29d14e5b82 100644 --- a/runtime/tests/interpreter/member_test.go +++ b/tests/interpreter/member_test.go @@ -24,9 +24,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/tests/checker" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/tests/checker" + . "github.com/onflow/cadence/tests/utils" ) func TestInterpretMemberAccessType(t *testing.T) { diff --git a/runtime/tests/interpreter/memory_metering_test.go b/tests/interpreter/memory_metering_test.go similarity index 99% rename from runtime/tests/interpreter/memory_metering_test.go rename to tests/interpreter/memory_metering_test.go index 43a2f77887..5de97ddfe5 100644 --- a/runtime/tests/interpreter/memory_metering_test.go +++ b/tests/interpreter/memory_metering_test.go @@ -22,18 +22,18 @@ import ( "fmt" "testing" - "github.com/onflow/cadence/runtime/activations" + "github.com/onflow/cadence/activations" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - "github.com/onflow/cadence/runtime/tests/checker" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + "github.com/onflow/cadence/tests/checker" + "github.com/onflow/cadence/tests/utils" ) type assumeValidPublicKeyValidator struct{} diff --git a/runtime/tests/interpreter/metatype_test.go b/tests/interpreter/metatype_test.go similarity index 99% rename from runtime/tests/interpreter/metatype_test.go rename to tests/interpreter/metatype_test.go index ac86360133..ad96c6b1d9 100644 --- a/runtime/tests/interpreter/metatype_test.go +++ b/tests/interpreter/metatype_test.go @@ -22,16 +22,15 @@ import ( "errors" "testing" - "github.com/onflow/cadence/runtime/activations" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/activations" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + . "github.com/onflow/cadence/tests/utils" ) func TestInterpretMetaTypeEquality(t *testing.T) { diff --git a/runtime/tests/interpreter/metering_test.go b/tests/interpreter/metering_test.go similarity index 98% rename from runtime/tests/interpreter/metering_test.go rename to tests/interpreter/metering_test.go index ec60e46b97..243afdba05 100644 --- a/runtime/tests/interpreter/metering_test.go +++ b/tests/interpreter/metering_test.go @@ -24,12 +24,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/checker" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/checker" + "github.com/onflow/cadence/tests/utils" ) func TestInterpretStatementHandler(t *testing.T) { diff --git a/runtime/tests/interpreter/nesting_test.go b/tests/interpreter/nesting_test.go similarity index 96% rename from runtime/tests/interpreter/nesting_test.go rename to tests/interpreter/nesting_test.go index c82353b34d..f8f88861cd 100644 --- a/runtime/tests/interpreter/nesting_test.go +++ b/tests/interpreter/nesting_test.go @@ -23,7 +23,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/interpreter" + "github.com/onflow/cadence/interpreter" ) func TestInterpretContractWithNestedDeclaration(t *testing.T) { diff --git a/runtime/tests/interpreter/path_test.go b/tests/interpreter/path_test.go similarity index 94% rename from runtime/tests/interpreter/path_test.go rename to tests/interpreter/path_test.go index b67379821a..015ef66643 100644 --- a/runtime/tests/interpreter/path_test.go +++ b/tests/interpreter/path_test.go @@ -24,10 +24,10 @@ import ( "github.com/stretchr/testify/assert" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + . "github.com/onflow/cadence/tests/utils" ) func TestInterpretPath(t *testing.T) { diff --git a/runtime/tests/interpreter/pathcapability_test.go b/tests/interpreter/pathcapability_test.go similarity index 93% rename from runtime/tests/interpreter/pathcapability_test.go rename to tests/interpreter/pathcapability_test.go index 751ade8d41..9685fa6160 100644 --- a/runtime/tests/interpreter/pathcapability_test.go +++ b/tests/interpreter/pathcapability_test.go @@ -23,11 +23,11 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/activations" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/activations" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" ) func TestInterpretPathCapability(t *testing.T) { diff --git a/runtime/tests/interpreter/range_value_test.go b/tests/interpreter/range_value_test.go similarity index 97% rename from runtime/tests/interpreter/range_value_test.go rename to tests/interpreter/range_value_test.go index 4396be49ac..ba3b714129 100644 --- a/runtime/tests/interpreter/range_value_test.go +++ b/tests/interpreter/range_value_test.go @@ -25,13 +25,13 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/activations" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - "github.com/onflow/cadence/runtime/tests/utils" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/activations" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + "github.com/onflow/cadence/tests/utils" + . "github.com/onflow/cadence/tests/utils" ) type containsTestCase struct { diff --git a/runtime/tests/interpreter/reference_test.go b/tests/interpreter/reference_test.go similarity index 99% rename from runtime/tests/interpreter/reference_test.go rename to tests/interpreter/reference_test.go index 9f9cbef60f..808ff46c83 100644 --- a/runtime/tests/interpreter/reference_test.go +++ b/tests/interpreter/reference_test.go @@ -25,11 +25,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/checker" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/checker" + . "github.com/onflow/cadence/tests/utils" ) func TestInterpretResourceReferenceInstanceOf(t *testing.T) { diff --git a/runtime/tests/interpreter/resources_test.go b/tests/interpreter/resources_test.go similarity index 99% rename from runtime/tests/interpreter/resources_test.go rename to tests/interpreter/resources_test.go index 964855685f..8afacd870b 100644 --- a/runtime/tests/interpreter/resources_test.go +++ b/tests/interpreter/resources_test.go @@ -24,11 +24,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/checker" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/checker" + . "github.com/onflow/cadence/tests/utils" - "github.com/onflow/cadence/runtime/interpreter" + "github.com/onflow/cadence/interpreter" ) func TestInterpretOptionalResourceBindingWithSecondValue(t *testing.T) { diff --git a/runtime/tests/interpreter/runtimetype_test.go b/tests/interpreter/runtimetype_test.go similarity index 98% rename from runtime/tests/interpreter/runtimetype_test.go rename to tests/interpreter/runtimetype_test.go index 59e01554b9..c1ea4ea109 100644 --- a/runtime/tests/interpreter/runtimetype_test.go +++ b/tests/interpreter/runtimetype_test.go @@ -21,10 +21,10 @@ package interpreter_test import ( "testing" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/utils" "github.com/stretchr/testify/assert" ) diff --git a/runtime/tests/interpreter/string_test.go b/tests/interpreter/string_test.go similarity index 99% rename from runtime/tests/interpreter/string_test.go rename to tests/interpreter/string_test.go index 9735a19f3a..410d2f478c 100644 --- a/runtime/tests/interpreter/string_test.go +++ b/tests/interpreter/string_test.go @@ -24,9 +24,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + . "github.com/onflow/cadence/tests/utils" ) func TestInterpretRecursiveValueString(t *testing.T) { diff --git a/runtime/tests/interpreter/switch_test.go b/tests/interpreter/switch_test.go similarity index 97% rename from runtime/tests/interpreter/switch_test.go rename to tests/interpreter/switch_test.go index b4b4b96afe..3d0dda4b90 100644 --- a/runtime/tests/interpreter/switch_test.go +++ b/tests/interpreter/switch_test.go @@ -24,11 +24,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - . "github.com/onflow/cadence/runtime/tests/utils" + . "github.com/onflow/cadence/tests/utils" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/checker" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/checker" ) func TestInterpretSwitchStatement(t *testing.T) { diff --git a/runtime/tests/interpreter/transactions_test.go b/tests/interpreter/transactions_test.go similarity index 96% rename from runtime/tests/interpreter/transactions_test.go rename to tests/interpreter/transactions_test.go index df36fdcfd0..71680a184d 100644 --- a/runtime/tests/interpreter/transactions_test.go +++ b/tests/interpreter/transactions_test.go @@ -24,14 +24,13 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - "github.com/onflow/cadence/runtime/tests/checker" - . "github.com/onflow/cadence/runtime/tests/utils" - - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/interpreter" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + "github.com/onflow/cadence/tests/checker" + . "github.com/onflow/cadence/tests/utils" ) func TestInterpretTransactions(t *testing.T) { diff --git a/runtime/tests/interpreter/transfer_test.go b/tests/interpreter/transfer_test.go similarity index 93% rename from runtime/tests/interpreter/transfer_test.go rename to tests/interpreter/transfer_test.go index 50c8a98cf5..c40a4f0ee3 100644 --- a/runtime/tests/interpreter/transfer_test.go +++ b/tests/interpreter/transfer_test.go @@ -21,15 +21,14 @@ package interpreter_test import ( "testing" - "github.com/onflow/cadence/runtime/activations" - "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/activations" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" + . "github.com/onflow/cadence/tests/utils" ) func TestInterpretTransferCheck(t *testing.T) { diff --git a/runtime/tests/interpreter/uuid_test.go b/tests/interpreter/uuid_test.go similarity index 92% rename from runtime/tests/interpreter/uuid_test.go rename to tests/interpreter/uuid_test.go index efb16aabee..3e56037a5c 100644 --- a/runtime/tests/interpreter/uuid_test.go +++ b/tests/interpreter/uuid_test.go @@ -24,12 +24,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/checker" - . "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/checker" + . "github.com/onflow/cadence/tests/utils" ) func TestInterpretResourceUUID(t *testing.T) { diff --git a/runtime/tests/interpreter/values_test.go b/tests/interpreter/values_test.go similarity index 99% rename from runtime/tests/interpreter/values_test.go rename to tests/interpreter/values_test.go index 0144838fc7..e725b5a30c 100644 --- a/runtime/tests/interpreter/values_test.go +++ b/tests/interpreter/values_test.go @@ -32,11 +32,11 @@ import ( "github.com/onflow/atree" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/utils" ) // TODO: make these program args? diff --git a/runtime/tests/interpreter/while_test.go b/tests/interpreter/while_test.go similarity index 96% rename from runtime/tests/interpreter/while_test.go rename to tests/interpreter/while_test.go index c4e7b6ac76..10bcf69db6 100644 --- a/runtime/tests/interpreter/while_test.go +++ b/tests/interpreter/while_test.go @@ -23,9 +23,9 @@ import ( "github.com/stretchr/testify/require" - . "github.com/onflow/cadence/runtime/tests/utils" + . "github.com/onflow/cadence/tests/utils" - "github.com/onflow/cadence/runtime/interpreter" + "github.com/onflow/cadence/interpreter" ) func TestInterpretWhileStatement(t *testing.T) { diff --git a/runtime/tests/runtime_utils/interpreter.go b/tests/runtime_utils/interpreter.go similarity index 92% rename from runtime/tests/runtime_utils/interpreter.go rename to tests/runtime_utils/interpreter.go index 1068a2242f..e7458be09b 100644 --- a/runtime/tests/runtime_utils/interpreter.go +++ b/tests/runtime_utils/interpreter.go @@ -23,8 +23,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/tests/utils" ) func NewTestInterpreter(tb testing.TB) *interpreter.Interpreter { diff --git a/runtime/tests/runtime_utils/location.go b/tests/runtime_utils/location.go similarity index 95% rename from runtime/tests/runtime_utils/location.go rename to tests/runtime_utils/location.go index cc04a398f9..8ae9b3614e 100644 --- a/runtime/tests/runtime_utils/location.go +++ b/tests/runtime_utils/location.go @@ -25,10 +25,10 @@ import ( "github.com/stretchr/testify/require" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func NewLocationGenerator[T ~[32]byte]() func() T { diff --git a/runtime/tests/runtime_utils/testinterface.go b/tests/runtime_utils/testinterface.go similarity index 98% rename from runtime/tests/runtime_utils/testinterface.go rename to tests/runtime_utils/testinterface.go index e387075c54..afb24d97ca 100644 --- a/runtime/tests/runtime_utils/testinterface.go +++ b/tests/runtime_utils/testinterface.go @@ -28,13 +28,13 @@ import ( "go.opentelemetry.io/otel/attribute" "github.com/onflow/cadence" + "github.com/onflow/cadence/ast" "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" ) type TestRuntimeInterface struct { diff --git a/runtime/tests/runtime_utils/testledger.go b/tests/runtime_utils/testledger.go similarity index 100% rename from runtime/tests/runtime_utils/testledger.go rename to tests/runtime_utils/testledger.go diff --git a/runtime/tests/runtime_utils/testruntime.go b/tests/runtime_utils/testruntime.go similarity index 100% rename from runtime/tests/runtime_utils/testruntime.go rename to tests/runtime_utils/testruntime.go diff --git a/runtime/tests/utils/occurrence_matcher.go b/tests/utils/occurrence_matcher.go similarity index 95% rename from runtime/tests/utils/occurrence_matcher.go rename to tests/utils/occurrence_matcher.go index 3d93ca8781..830af59c65 100644 --- a/runtime/tests/utils/occurrence_matcher.go +++ b/tests/utils/occurrence_matcher.go @@ -19,8 +19,8 @@ package utils import ( - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) type OccurrenceMatcher struct { diff --git a/runtime/tests/utils/utils.go b/tests/utils/utils.go similarity index 97% rename from runtime/tests/utils/utils.go rename to tests/utils/utils.go index fec7938dd6..1c6d840712 100644 --- a/runtime/tests/utils/utils.go +++ b/tests/utils/utils.go @@ -29,11 +29,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) func init() { diff --git a/tools/analysis/analysis.go b/tools/analysis/analysis.go index 4c5513a95a..5f8be88377 100644 --- a/tools/analysis/analysis.go +++ b/tools/analysis/analysis.go @@ -19,7 +19,7 @@ package analysis import ( - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) func Load(config *Config, locations ...common.Location) (Programs, error) { diff --git a/tools/analysis/analysis_test.go b/tools/analysis/analysis_test.go index d1321debf5..c1eb69fa25 100644 --- a/tools/analysis/analysis_test.go +++ b/tools/analysis/analysis_test.go @@ -25,11 +25,11 @@ import ( "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/checker" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/parser" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/checker" "github.com/onflow/cadence/tools/analysis" ) diff --git a/tools/analysis/config.go b/tools/analysis/config.go index 3bf637f9f3..c545e669bb 100644 --- a/tools/analysis/config.go +++ b/tools/analysis/config.go @@ -22,9 +22,9 @@ import ( "fmt" "sort" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) // A Config specifies details about how programs should be loaded. diff --git a/tools/analysis/diagnostic.go b/tools/analysis/diagnostic.go index 11e0ff44e0..46e875e1f3 100644 --- a/tools/analysis/diagnostic.go +++ b/tools/analysis/diagnostic.go @@ -19,9 +19,9 @@ package analysis import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" ) type SuggestedFix = errors.SuggestedFix[ast.TextEdit] diff --git a/tools/analysis/error.go b/tools/analysis/error.go index a1ecf2c603..e8cf1b7a11 100644 --- a/tools/analysis/error.go +++ b/tools/analysis/error.go @@ -21,8 +21,8 @@ package analysis import ( "golang.org/x/xerrors" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" ) type ParsingCheckingError struct { diff --git a/tools/analysis/inspector.go b/tools/analysis/inspector.go index 547d47b777..e2561662db 100644 --- a/tools/analysis/inspector.go +++ b/tools/analysis/inspector.go @@ -19,7 +19,7 @@ package analysis import ( - "github.com/onflow/cadence/runtime/ast" + "github.com/onflow/cadence/ast" ) var InspectorAnalyzer = &Analyzer{ diff --git a/tools/analysis/program.go b/tools/analysis/program.go index 789c279af1..56c60b7a61 100644 --- a/tools/analysis/program.go +++ b/tools/analysis/program.go @@ -21,9 +21,9 @@ package analysis import ( "sync" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" ) type Program struct { diff --git a/tools/analysis/programs.go b/tools/analysis/programs.go index 08ae11ae49..83b03f36d6 100644 --- a/tools/analysis/programs.go +++ b/tools/analysis/programs.go @@ -19,11 +19,11 @@ package analysis import ( - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/parser" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/stdlib" ) type Programs map[common.Location]*Program diff --git a/tools/ast-explorer/main.go b/tools/ast-explorer/main.go index cd83dbc648..f4271a997f 100644 --- a/tools/ast-explorer/main.go +++ b/tools/ast-explorer/main.go @@ -26,8 +26,8 @@ import ( "net" "net/http" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/parser" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/parser" ) type Request struct { diff --git a/tools/compare-parsing/main.go b/tools/compare-parsing/main.go index 7300522659..5d8d7adf03 100644 --- a/tools/compare-parsing/main.go +++ b/tools/compare-parsing/main.go @@ -19,7 +19,7 @@ package main // Parses all programs in a CSV file with header location,code -// using am old and new runtime/cmd/parse program. +// using am old and new `cmd/parse` program. // // It reports already broken programs, programs that are broken with the new parser, // and when parses of the old and new parser differ diff --git a/tools/compatibility-check/contracts_checker.go b/tools/compatibility-check/contracts_checker.go index db66be90ea..4964e4edbc 100644 --- a/tools/compatibility-check/contracts_checker.go +++ b/tools/compatibility-check/contracts_checker.go @@ -27,10 +27,10 @@ import ( "encoding/csv" - "github.com/onflow/cadence/runtime/ast" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/parser" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/ast" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/parser" + "github.com/onflow/cadence/sema" "github.com/onflow/cadence/tools/analysis" ) diff --git a/tools/compatibility-check/go.mod b/tools/compatibility-check/go.mod index 00ce331115..b784d39da9 100644 --- a/tools/compatibility-check/go.mod +++ b/tools/compatibility-check/go.mod @@ -3,30 +3,37 @@ module github.com/onflow/cadence/tools/compatibility_check go 1.22 require ( - github.com/onflow/cadence v0.31.2-0.20230207221811-9eb6e7fe4121 + github.com/onflow/cadence v1.0.1-0.20241017195911-152088fcbb15 github.com/rs/zerolog v1.26.1 - github.com/stretchr/testify v1.7.3 + github.com/stretchr/testify v1.9.0 ) require ( - github.com/bits-and-blooms/bitset v1.2.2 // indirect + github.com/SaveTheRbtz/mph v0.1.1-0.20240117162131-4166ec7869bc // indirect + github.com/bits-and-blooms/bitset v1.5.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/fxamacker/cbor/v2 v2.4.1-0.20220515183430-ad2eae63303f // indirect + github.com/fxamacker/cbor/v2 v2.4.1-0.20230228173756-c0c9f774e40c // indirect github.com/fxamacker/circlehash v0.3.0 // indirect - github.com/klauspost/cpuid/v2 v2.0.14 // indirect + github.com/k0kubun/pp v3.0.1+incompatible // indirect + github.com/klauspost/cpuid/v2 v2.2.0 // indirect github.com/kr/pretty v0.3.1 // indirect + github.com/kr/text v0.2.0 // indirect github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381 // indirect - github.com/onflow/atree v0.4.0 // indirect + github.com/logrusorgru/aurora/v4 v4.0.0 // indirect + github.com/mattn/go-colorable v0.1.13 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/onflow/atree v0.8.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/rivo/uniseg v0.2.1-0.20211004051800-57c86be7915a // indirect + github.com/rivo/uniseg v0.4.4 // indirect + github.com/rogpeppe/go-internal v1.9.0 // indirect github.com/texttheater/golang-levenshtein/levenshtein v0.0.0-20200805054039-cae8b0eaed6c // indirect github.com/turbolent/prettier v0.0.0-20220320183459-661cc755135d // indirect github.com/x448/float16 v0.8.4 // indirect github.com/zeebo/blake3 v0.2.3 // indirect go.opentelemetry.io/otel v1.8.0 // indirect golang.org/x/crypto v0.1.0 // indirect - golang.org/x/exp v0.0.0-20221126150942-6ab00d035af9 // indirect - golang.org/x/sys v0.1.0 // indirect + golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc // indirect + golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.4.0 // indirect golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/tools/compatibility-check/go.sum b/tools/compatibility-check/go.sum index 765ad9dce2..7b7106c856 100644 --- a/tools/compatibility-check/go.sum +++ b/tools/compatibility-check/go.sum @@ -1,5 +1,9 @@ +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= github.com/bits-and-blooms/bitset v1.2.2 h1:J5gbX05GpMdBjCvQ9MteIg2KKDExr7DrgK+Yc15FvIk= github.com/bits-and-blooms/bitset v1.2.2/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= +github.com/bits-and-blooms/bitset v1.5.0 h1:NpE8frKRLGHIcEzkR+gZhiioW1+WbYV6fKwD6ZIpQT8= +github.com/bits-and-blooms/bitset v1.5.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -7,14 +11,20 @@ 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/fxamacker/cbor/v2 v2.4.1-0.20220515183430-ad2eae63303f h1:dxTR4AaxCwuQv9LAVTAC2r1szlS+epeuPT5ClLKT6ZY= github.com/fxamacker/cbor/v2 v2.4.1-0.20220515183430-ad2eae63303f/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo= +github.com/fxamacker/cbor/v2 v2.4.1-0.20230228173756-c0c9f774e40c h1:5tm/Wbs9d9r+qZaUFXk59CWDD0+77PBqDREffYkyi5c= +github.com/fxamacker/cbor/v2 v2.4.1-0.20230228173756-c0c9f774e40c/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrtAnWBwBCVo= github.com/fxamacker/circlehash v0.3.0 h1:XKdvTtIJV9t7DDUtsf0RIpC1OcxZtPbmgIH7ekx28WA= github.com/fxamacker/circlehash v0.3.0/go.mod h1:3aq3OfVvsWtkWMb6A1owjOQFA+TLsD5FgJflnaQwtMM= github.com/go-test/deep v1.0.5 h1:AKODKU3pDH1RzZzm6YZu77YWtEAq6uh1rLIAQlay2qc= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/k0kubun/pp v3.0.1+incompatible h1:3tqvf7QgUnZ5tXO6pNAZlrvHgl6DvifjDrd9g2S9Z40= +github.com/k0kubun/pp v3.0.1+incompatible/go.mod h1:GWse8YhT0p8pT4ir3ZgBbfZild3tgzSScAn6HmfYukg= github.com/klauspost/cpuid/v2 v2.0.12/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= github.com/klauspost/cpuid/v2 v2.0.14 h1:QRqdp6bb9M9S5yyKeYteXKuoKE4p0tGlra81fKOpWH8= github.com/klauspost/cpuid/v2 v2.0.14/go.mod h1:g2LTdtYhdyuGPqyWyv7qRAmj1WBqxuObKfj5c0PQa7c= +github.com/klauspost/cpuid/v2 v2.2.0 h1:4ZexSFt8agMNzNisrsilL6RClWDC5YJnLHNIfTy4iuc= +github.com/klauspost/cpuid/v2 v2.2.0/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -22,16 +32,29 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/leanovate/gopter v0.2.9 h1:fQjYxZaynp97ozCzfOyOuAGOU4aU/z37zf/tOujFk7c= github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381 h1:bqDmpDG49ZRnB5PcgP0RXtQvnMSgIF14M7CBd2shtXs= github.com/logrusorgru/aurora v0.0.0-20200102142835-e9ef32dff381/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4= +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/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/onflow/atree v0.4.0 h1:+TbNisavAkukAKhgQ4plWnvR9o5+SkwPIsi3jaeAqKs= github.com/onflow/atree v0.4.0/go.mod h1:7Qe1xaW0YewvouLXrugzMFUYXNoRQ8MT/UsVAWx1Ndo= +github.com/onflow/atree v0.8.0 h1:qg5c6J1gVDNObughpEeWm8oxqhPGdEyGrda121GM4u0= +github.com/onflow/atree v0.8.0/go.mod h1:yccR+LR7xc1Jdic0mrjocbHvUD7lnVvg8/Ct1AA5zBo= github.com/onflow/cadence v0.31.2-0.20230207221811-9eb6e7fe4121 h1:pOJOFoX1fEwoXyzhU9Q8VtGUlZUnMCj4LcuOJdBnLgk= github.com/onflow/cadence v0.31.2-0.20230207221811-9eb6e7fe4121/go.mod h1:hhktaaXlJmxnfLgH2HG0cftcUWScdfjO/CTZkzaom/g= +github.com/onflow/cadence v1.0.1-0.20241017195911-152088fcbb15 h1:qZSN0Y90zNyjzW6uN+XRKgF5BEb8JBJ7TziOSIC8td4= +github.com/onflow/cadence v1.0.1-0.20241017195911-152088fcbb15/go.mod h1:fJxxOAp1wnWDfOHT8GOc1ypsU0RR5E3z51AhG8Yf5jg= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rivo/uniseg v0.2.1-0.20211004051800-57c86be7915a h1:s7GrsqeorVkFR1vGmQ6WVL9nup0eyQCC+YVUeSQLH/Q= github.com/rivo/uniseg v0.2.1-0.20211004051800-57c86be7915a/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= +github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= +github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= @@ -43,6 +66,8 @@ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSS github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.3 h1:dAm0YRdRQlWojc3CrCRgPBzG5f941d0zvAKu7qY4e+I= github.com/stretchr/testify v1.7.3/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/texttheater/golang-levenshtein/levenshtein v0.0.0-20200805054039-cae8b0eaed6c h1:HelZ2kAFadG0La9d+4htN4HzQ68Bm2iM9qKMSMES6xg= github.com/texttheater/golang-levenshtein/levenshtein v0.0.0-20200805054039-cae8b0eaed6c/go.mod h1:JlzghshsemAMDGZLytTFY8C1JQxQPhnatWqNwUXjggo= github.com/turbolent/prettier v0.0.0-20220320183459-661cc755135d h1:5JInRQbk5UBX8JfUvKh2oYTLMVwj3p6n+wapDDm7hko= @@ -66,6 +91,8 @@ golang.org/x/crypto v0.1.0 h1:MDRAIl0xIo9Io2xV565hzXHw3zVseKrJKodhohM5CjU= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/exp v0.0.0-20221126150942-6ab00d035af9 h1:yZNXmy+j/JpX19vZkVktWqAo7Gny4PBWYYK3zskGpx4= golang.org/x/exp v0.0.0-20221126150942-6ab00d035af9/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc= +golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc h1:ao2WRsKSzW6KuUY9IWPwWahcHCgR0s52IfwutMfEbdM= +golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I= @@ -80,8 +107,13 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0 h1:kunALQeHf1/185U1i0GOB/fy1IPRDDpuoOOqRReG57U= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -96,6 +128,7 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/tools/pretty/main.go b/tools/pretty/main.go index 29cb6d32b8..bcdd831d8d 100644 --- a/tools/pretty/main.go +++ b/tools/pretty/main.go @@ -29,7 +29,7 @@ import ( "github.com/turbolent/prettier" - "github.com/onflow/cadence/runtime/parser" + "github.com/onflow/cadence/parser" ) func pretty(code string, maxLineWidth int) string { diff --git a/tools/storage-explorer/addresses.go b/tools/storage-explorer/addresses.go index 8a291d7a75..6fb06cdc47 100644 --- a/tools/storage-explorer/addresses.go +++ b/tools/storage-explorer/addresses.go @@ -24,7 +24,7 @@ import ( "github.com/onflow/flow-go/cmd/util/ledger/util/registers" - "github.com/onflow/cadence/runtime/common" + "github.com/onflow/cadence/common" ) func addressesJSON(registersByAccount *registers.ByAccount) ([]byte, error) { diff --git a/tools/storage-explorer/main.go b/tools/storage-explorer/main.go index 966de763b7..62f55539ae 100644 --- a/tools/storage-explorer/main.go +++ b/tools/storage-explorer/main.go @@ -35,10 +35,10 @@ import ( "github.com/onflow/flow-go/model/flow" "github.com/rs/zerolog" + "github.com/onflow/cadence/common" jsoncdc "github.com/onflow/cadence/encoding/json" + "github.com/onflow/cadence/interpreter" "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" ) func main() { diff --git a/tools/storage-explorer/storagemaps.go b/tools/storage-explorer/storagemaps.go index ba0ca4ed91..e173291865 100644 --- a/tools/storage-explorer/storagemaps.go +++ b/tools/storage-explorer/storagemaps.go @@ -24,10 +24,10 @@ import ( "github.com/onflow/atree" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/interpreter" "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/stdlib" + "github.com/onflow/cadence/stdlib" ) type KnownStorageMap struct { diff --git a/tools/storage-explorer/type.go b/tools/storage-explorer/type.go index 24a7a93416..7d1b413078 100644 --- a/tools/storage-explorer/type.go +++ b/tools/storage-explorer/type.go @@ -21,9 +21,9 @@ package main import ( "github.com/onflow/cadence" jsoncdc "github.com/onflow/cadence/encoding/json" + "github.com/onflow/cadence/interpreter" "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) func prepareType(value interpreter.Value, inter *interpreter.Interpreter) (result any, description string) { diff --git a/tools/storage-explorer/value.go b/tools/storage-explorer/value.go index 9355456417..a7545ae5d3 100644 --- a/tools/storage-explorer/value.go +++ b/tools/storage-explorer/value.go @@ -23,9 +23,9 @@ import ( "sort" jsoncdc "github.com/onflow/cadence/encoding/json" + "github.com/onflow/cadence/interpreter" "github.com/onflow/cadence/runtime" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/sema" ) type Value interface { diff --git a/types.go b/types.go index acbf1b36ee..a4bd8fd7ea 100644 --- a/types.go +++ b/types.go @@ -24,10 +24,10 @@ import ( "strings" "sync" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) type Type interface { diff --git a/types_test.go b/types_test.go index 382a2f5371..27f0edd4c9 100644 --- a/types_test.go +++ b/types_test.go @@ -24,9 +24,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/utils" ) func TestType_ID(t *testing.T) { diff --git a/values.go b/values.go index 085507b326..d3799c0a88 100644 --- a/values.go +++ b/values.go @@ -25,12 +25,12 @@ import ( "unicode/utf8" "unsafe" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/errors" "github.com/onflow/cadence/fixedpoint" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/errors" - "github.com/onflow/cadence/runtime/format" - "github.com/onflow/cadence/runtime/interpreter" - "github.com/onflow/cadence/runtime/sema" + "github.com/onflow/cadence/format" + "github.com/onflow/cadence/interpreter" + "github.com/onflow/cadence/sema" ) // Value diff --git a/values_test.go b/values_test.go index 35437dd51c..d70200a911 100644 --- a/values_test.go +++ b/values_test.go @@ -27,9 +27,9 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/onflow/cadence/runtime/common" - "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/cadence/runtime/tests/utils" + "github.com/onflow/cadence/common" + "github.com/onflow/cadence/sema" + "github.com/onflow/cadence/tests/utils" ) type valueTestCase struct { diff --git a/vm/vm.go b/vm/vm.go index 510a5dcfb9..74f2cf0542 100644 --- a/vm/vm.go +++ b/vm/vm.go @@ -29,7 +29,7 @@ import ( "github.com/bytecodealliance/wasmtime-go/v7" - "github.com/onflow/cadence/runtime/interpreter" + "github.com/onflow/cadence/interpreter" ) type VM interface {