diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 9929240d55..c778cde165 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -39,18 +39,12 @@ jobs:
go-version: ${{ env.GO_VERSION }}
cache: true
- - name: Install Flow CLI
- run: sh -ci "$(curl -fsSL https://raw.githubusercontent.com/onflow/flow-cli/master/install.sh)"
-
- name: Build
run: make -j8 build
- name: Test
run: make ci
- - name: Cadence Testing Framework
- run: cd stdlib/contracts && flow test --cover --covercode="contracts" crypto_test.cdc
-
- name: Upload coverage report
uses: codecov/codecov-action@v2
with:
diff --git a/.github/workflows/compat.yaml b/.github/workflows/compat.yaml
new file mode 100644
index 0000000000..ec22c71cf0
--- /dev/null
+++ b/.github/workflows/compat.yaml
@@ -0,0 +1,24 @@
+name: Source Compatibility Suite
+on:
+ schedule:
+ - cron: '0 12 * * *'
+ workflow_dispatch:
+ inputs:
+
+jobs:
+ source-compat:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Clone
+ uses: actions/checkout@v4
+ - name: Setup Python
+ uses: actions/setup-python@v5
+ with:
+ python-version: '3.12'
+ cache: 'pip'
+ - name: Install dependencies
+ working-directory: compat
+ run: pip3 install -r requirements.txt
+ - name: Run
+ working-directory: compat
+ run: "python3 main.py"
diff --git a/.github/workflows/compat.yaml.disabled b/.github/workflows/compat.yaml.disabled
deleted file mode 100644
index 779ab60b88..0000000000
--- a/.github/workflows/compat.yaml.disabled
+++ /dev/null
@@ -1,34 +0,0 @@
-name: Source Compatibility Suite
-on:
- schedule:
- - cron: '0 12 * * *'
- workflow_dispatch:
- inputs:
- goTestRef:
-
-
-jobs:
- source-compat:
- runs-on: ubuntu-20.04
- steps:
- - uses: actions/checkout@v2
- with:
- fetch-depth: 0
- - uses: actions/setup-go@v2
- with:
- go-version: '1.18.x'
- - uses: actions/setup-python@v2
- with:
- python-version: '3.x'
- - uses: actions/cache@v1
- with:
- path: ~/go/pkg/mod
- key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- restore-keys: |
- ${{ runner.os }}-go-
- - name: Install dependencies
- working-directory: compat
- run: pip3 install -r requirements.txt
- - name: Check
- working-directory: compat
- run: "python3 main.py --format=pretty --check --go-test --go-test-ref=${{ github.event.inputs.goTestRef }}"
diff --git a/.github/workflows/compatibility-check-template.yml b/.github/workflows/compatibility-check-template.yml
index fc6845f3a5..3a6b1c1130 100644
--- a/.github/workflows/compatibility-check-template.yml
+++ b/.github/workflows/compatibility-check-template.yml
@@ -88,7 +88,7 @@ jobs:
run: |
GOPROXY=direct go mod edit -replace github.com/onflow/cadence=github.com/${{ inputs.repo }}@${{ inputs.current-branch }}
go mod tidy
- go run ./cmd/check_contracts/main.go ../../tmp/contracts.csv ../../tmp/output-new.txt
+ go run ./cmd/check_contracts/main.go flow-${{ inputs.chain }} ../../tmp/contracts.csv ../../tmp/output-new.txt
# Check contracts using base branch
@@ -97,7 +97,7 @@ jobs:
run: |
GOPROXY=direct go mod edit -replace github.com/onflow/cadence=github.com/${{ inputs.repo }}@`git rev-parse origin/${{ inputs.base-branch }}`
go mod tidy
- go run ./cmd/check_contracts/main.go ../../tmp/contracts.csv ../../tmp/output-old.txt
+ go run ./cmd/check_contracts/main.go flow-${{ inputs.chain }} ../../tmp/contracts.csv ../../tmp/output-old.txt
# Upload checking results for later use
diff --git a/Makefile b/Makefile
index e0914ca4e1..16b7bd328f 100644
--- a/Makefile
+++ b/Makefile
@@ -45,7 +45,7 @@ build: build-tools ./cmd/parse/parse ./cmd/parse/parse.wasm ./cmd/check/check ./
go build -o $@ ./cmd/main
.PHONY: build-tools
-build-tools: build-analysis build-get-contracts
+build-tools: build-analysis build-get-contracts build-compatibility-check
.PHONY: build-analysis
build-analysis:
@@ -55,19 +55,32 @@ build-analysis:
build-get-contracts:
(cd ./tools/get-contracts && go build .)
+.PHONY: build-compatibility-check
+build-compatibility-check:
+ (cd ./tools/compatibility-check && go build .)
+
.PHONY: ci
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 ./tests/interpreter/... -runSmokeTests=true -validateAtree=false
+ go test -count=5 ./interpreter/... -runSmokeTests=true -validateAtree=false
# remove coverage of empty functions from report
sed -i -e 's/^.* 0 0$$//' coverage.txt
.PHONY: test
-test:
- # test all packages
- go test -parallel 8 ./...
+test: test-all-packages test-tools
+
+.PHONY: test-all-packages
+test-all-packages:
+ (go test -parallel 8 ./...)
+
+.PHONY: test-tools
+test-tools:
+ (cd ./tools/analysis && go test -parallel 8 ./)
+ (cd ./tools/compatibility-check && go test -parallel 8 ./)
+ (cd ./tools/constructorcheck && go test -parallel 8 ./)
+ (cd ./tools/maprange && go test -parallel 8 ./)
.PHONY: lint-github-actions
lint-github-actions: build-linter
diff --git a/ast/inspector_test.go b/ast/inspector_test.go
index 17979ef95f..5b1ee8c0c8 100644
--- a/ast/inspector_test.go
+++ b/ast/inspector_test.go
@@ -25,7 +25,6 @@ import (
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/parser"
- "github.com/onflow/cadence/tests/examples"
)
// TestInspector_Elements compares Inspector against Inspect.
@@ -33,9 +32,30 @@ func TestInspector_Elements(t *testing.T) {
t.Parallel()
+ const code = `
+ access(all) contract interface FungibleToken {
+
+ access(all) resource interface Provider {
+ access(all) fun withdraw(amount: Int): @Vault
+ }
+
+ access(all) resource interface Receiver {
+ access(all) fun deposit(vault: @Vault)
+ }
+
+ access(all) resource interface Vault: Provider, Receiver {
+ access(all) balance: Int
+ }
+
+ access(all) fun absorb(vault: @Vault)
+
+ access(all) fun sprout(balance: Int): @Vault
+ }
+ `
+
program, err := parser.ParseProgram(
nil,
- []byte(examples.FungibleTokenContractInterface),
+ []byte(code),
parser.Config{},
)
require.NoError(t, err)
diff --git a/cmd/cmd.go b/cmd/cmd.go
index a267e30a27..b7f11e59d3 100644
--- a/cmd/cmd.go
+++ b/cmd/cmd.go
@@ -97,13 +97,6 @@ func DefaultCheckerConfig(
importedLocation common.Location,
_ ast.Range,
) (sema.Import, error) {
- if importedLocation == stdlib.CryptoCheckerLocation {
- cryptoChecker := stdlib.CryptoChecker()
- return sema.ElaborationImport{
- Elaboration: cryptoChecker.Elaboration,
- }, nil
- }
-
stringLocation, ok := importedLocation.(common.StringLocation)
if !ok {
return nil, &sema.CheckerError{
@@ -126,7 +119,6 @@ func DefaultCheckerConfig(
Elaboration: importedChecker.Elaboration,
}, nil
},
- AttachmentsEnabled: true,
}
}
diff --git a/cmd/info/main.go b/cmd/info/main.go
index 5f737ba99c..7ca71664cc 100644
--- a/cmd/info/main.go
+++ b/cmd/info/main.go
@@ -31,7 +31,7 @@ import (
"github.com/onflow/cadence/parser"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
- "github.com/onflow/cadence/tests/checker"
+ "github.com/onflow/cadence/test_utils/sema_utils"
)
type command struct {
@@ -80,7 +80,7 @@ var commands = map[string]command{
func dumpBuiltinTypes() {
- allBaseSemaTypes := checker.AllBaseSemaTypes()
+ allBaseSemaTypes := sema_utils.AllBaseSemaTypes()
types := make([]sema.Type, 0, len(allBaseSemaTypes))
@@ -239,7 +239,7 @@ func dumpBuiltinValues() {
ty sema.Type
}
- allBaseSemaValueTypes := checker.AllBaseSemaValueTypes()
+ allBaseSemaValueTypes := sema_utils.AllBaseSemaValueTypes()
standardLibraryValues := stdlib.DefaultScriptStandardLibraryValues(nil)
valueTypes := make([]valueType, 0, len(allBaseSemaValueTypes)+len(standardLibraryValues))
diff --git a/compat/main.py b/compat/main.py
index 1da0c95d21..e767937bba 100644
--- a/compat/main.py
+++ b/compat/main.py
@@ -1,43 +1,23 @@
from __future__ import annotations
-import dataclasses
-import html
-import json
import logging
import os
-import re
import shlex
import shutil
+import stat
import subprocess
-import sys
-import textwrap
-from collections import defaultdict
from contextlib import contextmanager
from dataclasses import dataclass, field
-from enum import Enum, unique
from pathlib import Path
-from typing import List, Optional, Collection, Dict, IO, Any
-from typing_extensions import Protocol, Literal
+from typing import List, Optional, Collection, Dict
import click as click
import coloredlogs
-import tabulate
import yaml
-from click.utils import LazyFile
from dacite import from_dict
SUITE_PATH = Path("suite").resolve()
-CMD_PATH = Path("../runtime/cmd").resolve()
-PARSER_PATH = Path("parse").resolve()
-CHECKER_PATH = Path("check").resolve()
-
-ansi_escape_pattern = re.compile(r'\x1b[^m]*m')
-
-
-class Openable(Protocol):
- def open(self) -> IO:
- pass
-
+CLI_PATH = SUITE_PATH / "flow-cli" / "cmd" / "flow"
@contextmanager
def cwd(path):
@@ -48,131 +28,79 @@ def cwd(path):
finally:
os.chdir(oldpwd)
+def cadence_replacement(cadence_version: Optional[str]) -> str:
+ if cadence_version:
+ return f'github.com/onflow/cadence@{cadence_version}'
+ # default: point to local cadence repo
+ return shlex.quote(Path.cwd().parent.absolute().resolve().as_posix())
+
+def flowgo_replacement(flowgo_version: Optional[str]) -> str:
+ if flowgo_version:
+ return f'github.com/onflow/flow-go@{flowgo_version}'
+ # default: use the newest version of flow-go available
+ return 'github.com/onflow/flow-go@latest'
+
+def build_cli(
+ cadence_version: Optional[str],
+ flowgo_version: Optional[str]
+):
+ logger.info("Building CLI ...")
+
+ with cwd(SUITE_PATH):
+ working_dir = SUITE_PATH / "flow-cli"
+ Git.clone("https://github.com/onflow/flow-cli.git", "master", working_dir)
+ with cwd(working_dir):
+ Go.replace_dependencies(
+ cadence_version=cadence_version,
+ flowgo_version=flowgo_version
+ )
+ logger.info("Compiling CLI binary")
+ subprocess.run(
+ ["make", "binary"],
+ check=True
+ )
-@dataclass
-class File:
- path: str
- prepare: Optional[str]
- member_account_access: List[str] = field(default_factory=list)
-
- def rewrite(self, path: Path):
- if not isinstance(self.prepare, str):
- return
-
- logger.info(f"Preparing {path}")
-
- source: str
- with path.open(mode="r") as f:
- source = f.read()
-
- def replace(pattern, replacement):
- nonlocal source
- source = re.sub(pattern, replacement, source)
-
- variables = {"replace": replace}
- with cwd(str(path.parent.absolute())):
- exec(self.prepare, variables)
-
- with path.open(mode="w") as f:
- f.write(source)
-
- @classmethod
- def parse(cls, path: Path, use_json: bool, bench: bool) -> (bool, Optional):
- return cls._run(PARSER_PATH, "Parsing", path, use_json, bench)
-
- def check(self, path: Path, use_json: bool, bench: bool) -> (bool, Optional):
- extra_args = [
- f"-memberAccountAccess=S.{path}:S.{(path.parent / Path(other_path)).resolve()}"
- for other_path in self.member_account_access
- ]
- return self._run(CHECKER_PATH, "Checking", path, use_json, bench, extra_args)
-
- @staticmethod
- def _run(
- tool_path: Path,
- verb: str,
- path: Path,
- use_json: bool,
- bench: bool,
- extra_args: List[str] = None
- ) -> (bool, Optional):
- logger.info(f"{verb} {path}")
- json_args = ["-json"] if use_json else []
- bench_args = ["-bench"] if bench else []
- args = json_args + bench_args + (extra_args or [])
-
- completed_process = subprocess.run(
- [tool_path, *args, path],
- cwd=str(path.parent),
- capture_output=use_json
- )
- result = None
- if use_json:
- result = json.loads(completed_process.stdout)
-
- if completed_process.returncode != 0:
- logger.error(f"{verb} failed: {path}")
- return False, result
-
- return True, result
-
+ logger.info("Built CLI")
@dataclass
class GoTest:
path: str
command: str
- def run(self, working_dir: Path, prepare: bool, go_test_ref: Optional[str]) -> bool:
- if go_test_ref:
- replacement = f'github.com/onflow/cadence@{go_test_ref}'
- else:
- replacement = shlex.quote(str(Path.cwd().parent.absolute()))
+ def run(
+ self,
+ working_dir: Path,
+ prepare: bool,
+ cadence_version: Optional[str],
+ flowgo_version: Optional[str]
+ ) -> bool:
with cwd(working_dir / self.path):
if prepare:
- subprocess.run([
- "go", "mod", "edit", "-replace", f'github.com/onflow/cadence={replacement}',
- ])
- subprocess.run([
- "go", "get", "-t", ".",
- ])
-
- result = subprocess.run(shlex.split(self.command))
- return result.returncode == 0
-
-
-@dataclass
-class BenchmarkResult:
- iterations: int
- time: int
-
-
-@dataclass
-class ParseResult:
- error: Optional[Any] = field(default=None)
- bench: Optional[BenchmarkResult] = field(default=None)
-
- @classmethod
- def from_dict(cls, data: Dict):
- return from_dict(data_class=cls, data=data)
+ Go.replace_dependencies(cadence_version, flowgo_version)
+ result = subprocess.run(self.command, shell=True)
+ return result.returncode == 0
@dataclass
-class CheckResult:
- error: Optional[Any] = field(default=None)
- bench: Optional[BenchmarkResult] = field(default=None)
-
- @classmethod
- def from_dict(cls, data: Dict):
- return from_dict(data_class=cls, data=data)
+class CadenceTest:
+ path: str
+ command: str
+ def run(
+ self,
+ working_dir: Path,
+ prepare: bool,
+ cadence_version: Optional[str],
+ flowgo_version: Optional[str]
+ ) -> bool:
-@dataclass
-class Result:
- path: str
- parse_result: ParseResult
- check_result: Optional[CheckResult] = field(default=None)
+ env = os.environ.copy()
+ env["PATH"] = f"{shlex.quote(str(CLI_PATH))}:{env['PATH']}"
+ with cwd(working_dir / self.path):
+ result = subprocess.run(self.command, shell=True, env=env)
+ return result.returncode == 0
def load_index(path: Path) -> List[str]:
logger.info(f"Loading suite index from {path} ...")
@@ -184,8 +112,8 @@ class Description:
description: str
url: str
branch: str
- files: List[File] = field(default_factory=list)
go_tests: List[GoTest] = field(default_factory=list)
+ cadence_tests: List[CadenceTest] = field(default_factory=list)
@staticmethod
def load(name: str) -> Description:
@@ -198,473 +126,105 @@ def load(name: str) -> Description:
def from_dict(cls, data: Dict):
return from_dict(data_class=cls, data=data)
- def _clone(self, working_dir: Path):
- if working_dir.exists():
- shutil.rmtree(working_dir)
-
- logger.info(f"Cloning {self.url} ({self.branch})")
-
- Git.clone(self.url, self.branch, working_dir)
-
def run(
self,
name: str,
prepare: bool,
- use_json: bool,
- bench: bool,
- check: bool,
go_test: bool,
- go_test_ref: Optional[str],
- ) -> (bool, List[Result]):
+ cadence_test: bool,
+ cadence_version: Optional[str],
+ flowgo_version: Optional[str],
+ ) -> (bool):
+
+ logger.info(f"Running tests for {name} ...")
working_dir = SUITE_PATH / name
if prepare:
- self._clone(working_dir)
-
- results: List[Result] = []
- check_succeeded = True
- if check:
- check_succeeded, results = self.check(working_dir, prepare=prepare, use_json=use_json, bench=bench)
+ Git.clone(self.url, self.branch, working_dir)
go_tests_succeeded = True
if go_test:
for test in self.go_tests:
- if not test.run(working_dir, prepare=prepare, go_test_ref=go_test_ref):
+ if not test.run(
+ working_dir,
+ prepare=prepare,
+ cadence_version=cadence_version,
+ flowgo_version=flowgo_version
+ ):
go_tests_succeeded = False
- succeeded = check_succeeded and go_tests_succeeded
+ cadence_tests_succeeded = True
+ if cadence_test:
+ for test in self.cadence_tests:
+ if not test.run(
+ working_dir,
+ prepare=prepare,
+ cadence_version=cadence_version,
+ flowgo_version=flowgo_version
+ ):
+ cadence_tests_succeeded = False
- return succeeded, results
+ return go_tests_succeeded and cadence_tests_succeeded
- def check(self, working_dir: Path, prepare: bool, use_json: bool, bench: bool) -> (bool, List[Result]):
+class Go:
- run_succeeded = True
-
- results: List[Result] = []
-
- for file in self.files:
- path = working_dir.joinpath(file.path)
+ @staticmethod
+ def mod_replace(original: str, replacement: str):
+ subprocess.run(
+ ["go", "mod", "edit", "-replace", f'{original}={replacement}'],
+ check=True
+ )
- if prepare:
- file.rewrite(path)
+ @staticmethod
+ def mod_tidy():
+ subprocess.run(
+ ["go", "mod", "tidy"],
+ check=True
+ )
- parse_succeeded, parse_results = \
- File.parse(path, use_json=use_json, bench=bench)
- result = Result(
- path=str(path),
- parse_result=ParseResult.from_dict(parse_results[0]) if parse_results else None
- )
- if not parse_succeeded:
- run_succeeded = False
- if use_json:
- results.append(result)
- continue
+ @staticmethod
+ def replace_dependencies(
+ cadence_version: Optional[str],
+ flowgo_version: Optional[str]
+ ):
+ logger.info("Editing dependencies")
+ Go.mod_replace("github.com/onflow/cadence", cadence_replacement(cadence_version))
+ Go.mod_replace("github.com/onflow/flow-go", flowgo_replacement(flowgo_version))
+ Go.mod_tidy()
- check_succeeded, check_results = \
- file.check(path, use_json=use_json, bench=bench)
- if check_results:
- result.check_result = CheckResult.from_dict(check_results[0])
- if use_json:
- results.append(result)
- if not check_succeeded:
- run_succeeded = False
- continue
+class Git:
- return run_succeeded, results
+ @staticmethod
+ def clone(url: str, branch: str, working_dir: Path):
+ if working_dir.exists():
+ Git._clean(working_dir)
+ logger.info(f"Cloning {url} ({branch})")
-class Git:
+ subprocess.run(
+ ["git", "clone", "--depth", "1", "--branch", branch, url, working_dir],
+ check=True
+ )
@staticmethod
- def clone(url: str, branch: str, working_dir: Path):
- subprocess.run([
- "git", "clone", "--depth", "1", "--branch",
- branch, url, working_dir
- ])
+ def _clean(working_dir: Path):
+ for root, dirs, files in os.walk(working_dir):
+ for dir in dirs:
+ os.chmod(os.path.join(root, dir), stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
+ for file in files:
+ os.chmod(os.path.join(root, file), stat.S_IRUSR | stat.S_IWUSR)
+ shutil.rmtree(working_dir)
@staticmethod
def get_head_ref() -> str:
completed_process = subprocess.run(
["git", "rev-parse", "--abbrev-ref", "HEAD"],
capture_output=True,
+ check=True
)
- if completed_process.returncode != 0:
- raise Exception('failed to get current Git ref')
return completed_process.stdout.decode("utf-8").strip()
- @staticmethod
- def checkout(ref: str):
- completed_process = subprocess.run(["git", "checkout", ref])
- if completed_process.returncode != 0:
- raise Exception(f'failed to checkout ref {ref}')
-
-
-def build(name):
- logger.info(f"Building {name}")
- subprocess.run(["go", "build", CMD_PATH / name])
-
-
-class EnhancedJSONEncoder(json.JSONEncoder):
- def default(self, o):
- if dataclasses.is_dataclass(o):
- return dataclasses.asdict(o)
- if isinstance(o, Enum):
- return o.value
- return super().default(o)
-
-
-def indent(text: str) -> str:
- return textwrap.indent(text, " ")
-
-
-def format_markdown_details(details: str) -> str:
- stripped = ansi_escape_pattern.sub('', details)
- escaped = html.escape(stripped).replace("\n", "
")
- return f"Details
{escaped}
"
-
-
-@dataclass
-class Comparisons:
- parse_error_comparisons: Dict[str, ErrorComparison]
- parse_bench_comparisons: Optional[Dict[str, BenchComparison]]
- check_error_comparisons: Dict[str, ErrorComparison]
- check_bench_comparisons: Optional[Dict[str, BenchComparison]]
-
- @classmethod
- def from_results(cls,
- other_results: List[Result],
- current_results: List[Result],
- bench: bool,
- delta_threshold: float
- ) -> Comparisons:
-
- parse_error_comparisons: Dict[str, ErrorComparison] = {}
- check_error_comparisons: Dict[str, ErrorComparison] = {}
-
- parse_bench_comparisons: Optional[Dict[str, BenchComparison]] = None
- check_bench_comparisons: Optional[Dict[str, BenchComparison]] = None
- if bench:
- parse_bench_comparisons: Dict[str, BenchComparison] = {}
- check_bench_comparisons: Dict[str, BenchComparison] = {}
-
- other_results.sort(key=lambda result: result.path)
- current_results.sort(key=lambda result: result.path)
-
- for other_result, current_result in zip(other_results, current_results):
- path = other_result.path
- assert current_result.path == path
-
- parse_error_comparisons[path] = ErrorComparison(
- other_result.parse_result.error,
- current_result.parse_result.error
- )
- check_error_comparisons[path] = ErrorComparison(
- other_result.check_result.error,
- current_result.check_result.error
- )
-
- if bench:
- if other_result.parse_result.bench and current_result.parse_result.bench:
- parse_bench_comparisons[path] = BenchComparison(
- other_result.parse_result.bench,
- current_result.parse_result.bench,
- delta_threshold=delta_threshold
- )
-
- if other_result.check_result.bench and current_result.check_result.bench:
- check_bench_comparisons[path] = BenchComparison(
- other_result.check_result.bench,
- current_result.check_result.bench,
- delta_threshold=delta_threshold
- )
-
- return Comparisons(
- parse_error_comparisons,
- parse_bench_comparisons,
- check_error_comparisons,
- check_bench_comparisons
- )
-
- def write(self, output: IO, format: Format):
-
- result: Optional[str] = None
- if format in ("pretty", "markdown"):
-
- output.write("\n## Parser Errors\n\n")
- self._write_error_comparisons(self.parse_error_comparisons, output, format)
- if self.parse_bench_comparisons:
- output.write("\n## Parser Benchmarks\n\n")
- self._write_bench_comparisons(self.parse_bench_comparisons, output, format)
-
- output.write("\n## Checker Errors\n\n")
- self._write_error_comparisons(self.check_error_comparisons, output, format)
- if self.check_bench_comparisons:
- output.write("\n## Checker Benchmarks\n\n")
- self._write_bench_comparisons(self.check_bench_comparisons, output, format)
-
- if format == "json":
- result = json_serialize(self)
-
- if result:
- output.write(result)
-
- @staticmethod
- def _write_error_comparisons(comparisons: Dict[str, ErrorComparison], output: IO, format: Format):
-
- def write_table(data, headers):
- output.write(tabulate.tabulate(data, headers, tablefmt="pipe"))
- output.write("\n\n")
-
- groups = defaultdict(list)
-
- for path, comparison in comparisons.items():
- relative_path = Path(path).relative_to(SUITE_PATH)
- groups[comparison.category].append((relative_path, comparison))
-
- for category in (
- ErrorCategory.REGRESSION,
- ErrorCategory.STILL_FAIL,
- ErrorCategory.CHANGE,
- ErrorCategory.IMPROVEMENT,
- ErrorCategory.STILL_SUCCESS,
- ):
-
- category_comparisons = groups.get(category, [])
-
- if not len(category_comparisons):
- continue
-
- if format == "pretty":
-
- if category == ErrorCategory.REGRESSION:
- output.write("😭 Regressions\n")
- output.write("-------------\n")
-
- for path, comparison in category_comparisons:
- output.write(f"- {path}:\n")
- output.write(indent(comparison.current))
- output.write("\n\n")
-
- elif category == ErrorCategory.STILL_FAIL:
- output.write("😢 Still failing\n")
- output.write("---------------\n")
-
- for path, comparison in category_comparisons:
- output.write(f"- {path}:\n")
- output.write(indent(comparison.current))
- output.write("\n\n")
-
- elif category == ErrorCategory.CHANGE:
- output.write("😕 Changed\n")
- output.write("---------\n")
-
- for path, comparison in category_comparisons:
- output.write(f"- {path}:\n")
- output.write(" Before:\n")
- output.write(indent(comparison.other))
- output.write("\n")
- output.write(" Now:\n")
- output.write(indent(comparison.current))
- output.write("\n\n")
-
- elif category == ErrorCategory.IMPROVEMENT:
- output.write("🎉 Improvements\n")
- output.write("--------------\n")
-
- for path, comparison in category_comparisons:
- output.write(f"- {path}\n")
-
- elif category == ErrorCategory.STILL_SUCCESS:
- output.write("🙂 Still succeeding\n")
- output.write("------------------\n")
-
- for path, comparison in category_comparisons:
- output.write(f"- {path}\n")
-
- output.write("\n")
-
- elif format == "markdown":
-
- if category == ErrorCategory.REGRESSION:
- data = []
- headers = ["😭 Regressions", "Details"]
- for path, comparison in category_comparisons:
- data.append([path, format_markdown_details(comparison.current)])
-
- write_table(data, headers)
-
- elif category == ErrorCategory.STILL_FAIL:
- data = []
- headers = ["😢 Still failing", "Details"]
- for path, comparison in category_comparisons:
- data.append([path, format_markdown_details(comparison.current)])
-
- write_table(data, headers)
-
- elif category == ErrorCategory.CHANGE:
- data = []
- headers = ["😕 Changed", "Before", "Now"]
- for path, comparison in category_comparisons:
- data.append([
- path,
- format_markdown_details(comparison.other),
- format_markdown_details(comparison.current)
- ])
-
- write_table(data, headers)
-
- elif category == ErrorCategory.IMPROVEMENT:
- data = []
- headers = ["🎉 Improvements"]
- for path, comparison in category_comparisons:
- data.append([path])
-
- write_table(data, headers)
-
- elif category == ErrorCategory.STILL_SUCCESS:
- data = []
- headers = ["🙂 Still succeeding"]
- for path, comparison in category_comparisons:
- data.append([path])
-
- write_table(data, headers)
-
- @classmethod
- def _write_bench_comparisons(cls, comparisons: Dict[str, BenchComparison], output: IO, format: Format):
-
- def write_table(data, headers):
- output.write(tabulate.tabulate(data, headers, tablefmt="pipe"))
- output.write("\n\n")
-
- groups = defaultdict(list)
-
- for path, comparison in comparisons.items():
- relative_path = Path(path).relative_to(SUITE_PATH)
- groups[comparison.category].append((relative_path, comparison))
-
- for category in (
- BenchCategory.REGRESSION,
- BenchCategory.IMPROVEMENT,
- BenchCategory.SAME,
- ):
-
- category_comparisons = groups.get(category, [])
-
- if not len(category_comparisons):
- continue
-
- title = ""
- if category == BenchCategory.REGRESSION:
- title = "😭 Regressions"
- elif category == BenchCategory.IMPROVEMENT:
- title = "🎉 Improvements"
- elif category == BenchCategory.SAME:
- title = "🙂 Same"
-
- data = []
- headers = [title, "OLD", "NEW", "DELTA", "RATIO"]
- for path, comparison in category_comparisons:
- data.append([
- path,
- cls._time_markdown(comparison.other.time),
- cls._time_markdown(comparison.current.time),
- cls._delta_markdown(comparison.delta),
- cls._ratio_markdown(comparison.ratio)
- ])
-
- write_table(data, headers)
-
- @staticmethod
- def _time_markdown(time: int) -> str:
- return f'{time / 1000000:.2f}'
-
- @staticmethod
- def _delta_markdown(delta: float) -> str:
- result = f'{delta:.2f}%'
- if result[0] != '-':
- result = '+' + result
- return result
-
- @staticmethod
- def _ratio_markdown(ratio: float) -> str:
- return f'**{ratio:.2f}x**'
-
-
-@unique
-class ErrorCategory(Enum):
- REGRESSION = "Regression"
- IMPROVEMENT = "Improvement"
- CHANGE = "Change"
- STILL_SUCCESS = "Still succeeding"
- STILL_FAIL = "Still failing"
-
-
-@dataclass
-class ErrorComparison:
- other: Optional[str]
- current: Optional[str]
- category: ErrorCategory = field(init=False)
-
- def __post_init__(self):
- self.category = self._category()
-
- def _category(self) -> ErrorCategory:
- if self.other != self.current:
- return ErrorCategory.CHANGE
- elif not self.other and self.current:
- return ErrorCategory.REGRESSION
- elif self.other and not self.current:
- return ErrorCategory.IMPROVEMENT
- elif self.other:
- return ErrorCategory.STILL_FAIL
- else:
- return ErrorCategory.STILL_SUCCESS
-
-
-@unique
-class BenchCategory(Enum):
- REGRESSION = "Regression"
- IMPROVEMENT = "Improvement"
- SAME = "Same"
-
-
-@dataclass
-class BenchComparison:
- other: BenchmarkResult
- current: BenchmarkResult
- delta_threshold: float
- ratio: float = field(init=False)
- delta: float = field(init=False)
- category: BenchCategory = field(init=False)
-
- def __post_init__(self):
- self.ratio = self.other.time / self.current.time
- self.delta = -(((self.current.time * 100) / self.other.time) - 100)
- self.category = self._category()
-
- def _category(self) -> BenchCategory:
- if abs(self.delta) > self.delta_threshold:
- if self.delta > 0:
- return BenchCategory.IMPROVEMENT
- if self.delta < 0:
- return BenchCategory.REGRESSION
-
- return BenchCategory.SAME
-
-
-Format = Literal["pretty", "json", "markdown"]
-
-
-def json_serialize(data) -> str:
- return json.dumps(data, indent=4, cls=EnhancedJSONEncoder)
-
-
-def build_all():
- for name in ("parse", "check"):
- build(name)
-
-
@click.command()
@click.option(
"--rerun",
@@ -673,170 +233,100 @@ def build_all():
help="Rerun without cloning and preparing the suites"
)
@click.option(
- "--format",
- type=click.Choice(["pretty", "json", "markdown"], case_sensitive=False),
- default="pretty",
- help="output format",
-)
-@click.option(
- "--bench/--no-bench",
- is_flag=True,
- default=False,
- help="Run benchmarks"
-)
-@click.option(
- "--check/--no-check",
+ "--go-test/--no-go-test",
is_flag=True,
default=True,
- help="Parse and check the suite files"
+ help="Run the suite Go tests"
)
@click.option(
- "--go-test/--no-go-test",
+ "--cadence-test/--no-cadence-test",
is_flag=True,
- default=False,
- help="Run the suite Go tests"
+ default=True,
+ help="Run the suite Cadence tests"
)
@click.option(
- "--go-test-ref",
+ "--cadence-version",
default=None,
- help="Git ref of Cadence for Go tests"
+ help="version of Cadence for Go tests"
)
@click.option(
- "--output",
+ "--flowgo-version",
default=None,
- type=click.File("w"),
- help="Write output to given path. Standard output by default"
-)
-@click.option(
- "--compare-ref",
- "other_ref",
- help="Compare with another Git ref (e.g. commit or branch)"
-)
-@click.option(
- "--delta-threshold",
- default=4,
- type=float,
- help="Delta threshold to consider a benchmark result a change"
+ help="version of flow-go for Go tests"
)
@click.argument(
"names",
nargs=-1,
)
def main(
- rerun: bool,
- format: Format,
- bench: bool,
- check: bool,
- go_test: bool,
- go_test_ref: Optional[str],
- output: Optional[LazyFile],
- other_ref: Optional[str],
- delta_threshold: float,
- names: Collection[str]
+ rerun: bool,
+ go_test: bool,
+ cadence_test: bool,
+ cadence_version: str,
+ flowgo_version: str,
+ names: Collection[str]
):
- if other_ref is None and format not in ("pretty", "json"):
- raise Exception(f"unsupported format: {format}")
-
- prepare = not rerun
- output: IO = output.open() if output else sys.stdout
+ logger.info(
+ f'Chosen versions: '
+ + f'cadence@{ cadence_version if cadence_version else "local version" }, '
+ + f'flow-go@{flowgo_version if flowgo_version else "latest"}'
+ )
- # Comparison of different runs is only possible when using JSON
+ prepare = not rerun
- use_json_for_run = format != "pretty" or (other_ref is not None)
+ if cadence_test and prepare:
+ build_cli(
+ cadence_version=cadence_version,
+ flowgo_version=flowgo_version,
+ )
# Run for the current checkout
- current_success, current_results = run(
+ current_success = run(
prepare=prepare,
- use_json=use_json_for_run,
- bench=bench,
- check=check,
go_test=go_test,
- go_test_ref=go_test_ref,
+ cadence_test=cadence_test,
+ cadence_version=cadence_version,
+ flowgo_version=flowgo_version,
names=names
)
- # Run for the other checkout, if any
-
- if other_ref:
- current_ref = Git.get_head_ref()
- try:
- Git.checkout(other_ref)
-
- _, other_results = run(
- # suite repositories were already cloned in the previous run
- prepare=False,
- use_json=use_json_for_run,
- bench=bench,
- check=check,
- go_test=go_test,
- names=names
- )
-
- comparisons = Comparisons.from_results(
- other_results,
- current_results,
- bench=bench,
- delta_threshold=delta_threshold,
- )
-
- comparisons.write(output, format)
-
- finally:
- Git.checkout(current_ref)
-
- else:
-
- if format == "json":
- results_json = json_serialize(current_results)
- output.write(results_json)
-
- output.close()
-
if not current_success:
exit(1)
def run(
- prepare: bool,
- use_json: bool,
- bench: bool,
- check: bool,
- go_test: bool,
- go_test_ref: Optional[str],
- names: Collection[str]
-) -> (bool, List[Result]):
-
- build_all()
+ prepare: bool,
+ go_test: bool,
+ cadence_test: bool,
+ cadence_version: str,
+ flowgo_version: str,
+ names: Collection[str]
+) -> (bool):
all_succeeded = True
if not names:
names = load_index(SUITE_PATH / "index.yaml")
- all_results: List[Result] = []
-
for name in names:
description = Description.load(name)
- run_succeeded, results = description.run(
+ run_succeeded = description.run(
name,
prepare=prepare,
- use_json=use_json,
- bench=bench,
- check=check,
go_test=go_test,
- go_test_ref=go_test_ref,
+ cadence_test=cadence_test,
+ cadence_version=cadence_version,
+ flowgo_version=flowgo_version,
)
if not run_succeeded:
all_succeeded = False
- all_results.extend(results)
-
- return all_succeeded, all_results
+ return all_succeeded
if __name__ == "__main__":
diff --git a/compat/requirements.txt b/compat/requirements.txt
index c83c2d82a8..f53480675e 100644
--- a/compat/requirements.txt
+++ b/compat/requirements.txt
@@ -1,6 +1,5 @@
click==7.1.2
coloredlogs==14.0
dacite==1.5.1
-PyYAML==5.4
+PyYAML>=6.0.1
typing-extensions==3.7.4.3
-tabulate==0.8.7
diff --git a/compat/suite/flow-core-contracts.yaml b/compat/suite/flow-core-contracts.yaml
index e7607d8573..eee8583a9d 100644
--- a/compat/suite/flow-core-contracts.yaml
+++ b/compat/suite/flow-core-contracts.yaml
@@ -1,139 +1,12 @@
description: Flow Core Contracts
maintainers:
-- bastian@dapperlabs.com
-- joshua.hannan@dapperlabs.com
+ - bastian.mueller@flowfoundation.org
+ - joshua.hannan@flowfoundation.org
url: https://github.com/onflow/flow-core-contracts.git
branch: master
go_tests:
- path: lib/go/test
command: make test
-files:
-- path: contracts/FlowToken.cdc
- # language=Python prefix="replace: Callable[[str, str], None]\n"
- prepare: |
- from pathlib import Path
-
- replace(
- 'import FungibleToken from 0xFUNGIBLETOKENADDRESS',
- f'import FungibleToken from "{Path("../../flow-ft/contracts/FungibleToken.cdc").resolve()}"'
- )
-
-- path: contracts/FlowFees.cdc
- # language=Python prefix="replace: Callable[[str, str], None]\n"
- prepare: |
- from pathlib import Path
-
- replace(
- 'import FungibleToken from 0xFUNGIBLETOKENADDRESS',
- f'import FungibleToken from "{Path("../../flow-ft/contracts/FungibleToken.cdc").resolve()}"'
- )
- replace(
- 'import FlowToken from 0xFLOWTOKENADDRESS',
- f'import FlowToken from "{Path("FlowToken.cdc").resolve()}"'
- )
-
-- path: contracts/FlowIDTableStaking.cdc
- # language=Python prefix="replace: Callable[[str, str], None]\n"
- prepare: |
- from pathlib import Path
-
- replace(
- 'import FungibleToken from 0xFUNGIBLETOKENADDRESS',
- f'import FungibleToken from "{Path("../../flow-ft/contracts/FungibleToken.cdc").resolve()}"'
- )
- replace(
- 'import FlowToken from 0xFLOWTOKENADDRESS',
- f'import FlowToken from "{Path("FlowToken.cdc").resolve()}"'
- )
-
-- path: contracts/FlowStorageFees.cdc
- # language=Python prefix="replace: Callable[[str, str], None]\n"
- prepare: |
- from pathlib import Path
-
- replace(
- 'import FungibleToken from 0xFUNGIBLETOKENADDRESS',
- f'import FungibleToken from "{Path("../../flow-ft/contracts/FungibleToken.cdc").resolve()}"'
- )
- replace(
- 'import FlowToken from 0xFLOWTOKENADDRESS',
- f'import FlowToken from "{Path("FlowToken.cdc").resolve()}"'
- )
-
-- path: contracts/FlowServiceAccount.cdc
- # language=Python prefix="replace: Callable[[str, str], None]\n"
- prepare: |
- from pathlib import Path
-
- replace(
- 'import FungibleToken from 0xFUNGIBLETOKENADDRESS',
- f'import FungibleToken from "{Path("../../flow-ft/contracts/FungibleToken.cdc").resolve()}"'
- )
- replace(
- 'import FlowToken from 0xFLOWTOKENADDRESS',
- f'import FlowToken from "{Path("FlowToken.cdc").resolve()}"'
- )
- replace(
- 'import FlowFees from 0xFLOWFEESADDRESS',
- f'import FlowFees from "{Path("FlowFees.cdc").resolve()}"'
- )
- replace(
- 'import FlowStorageFees from 0xFLOWSTORAGEFEESADDRESS',
- f'import FlowStorageFees from "{Path("FlowStorageFees.cdc").resolve()}"'
- )
-
-- path: contracts/StakingProxy.cdc
-
-- path: contracts/LockedTokens.cdc
- # language=Python prefix="replace: Callable[[str, str], None]\n"
- prepare: |
- from pathlib import Path
-
- replace(
- 'import FlowToken from 0xFLOWTOKENADDRESS',
- f'import FlowToken from "{Path("FlowToken.cdc").resolve()}"'
- )
- replace(
- 'import FungibleToken from 0xFUNGIBLETOKENADDRESS',
- f'import FungibleToken from "{Path("../../flow-ft/contracts/FungibleToken.cdc").resolve()}"'
- )
- replace(
- 'import FlowIDTableStaking from 0xFLOWIDTABLESTAKINGADDRESS',
- f'import FlowIDTableStaking from "{Path("FlowIDTableStaking.cdc").resolve()}"'
- )
- replace(
- 'import FlowStorageFees from 0xFLOWSTORAGEFEESADDRESS',
- f'import FlowStorageFees from "{Path("FlowStorageFees.cdc").resolve()}"'
- )
- replace(
- 'import StakingProxy from 0xSTAKINGPROXYADDRESS',
- f'import StakingProxy from "{Path("StakingProxy.cdc").resolve()}"'
- )
-
-- path: contracts/FlowStakingCollection.cdc
- member_account_access:
- - 'LockedTokens.cdc'
- # language=Python prefix="replace: Callable[[str, str], None]\n"
- prepare: |
- from pathlib import Path
-
- replace(
- 'import FungibleToken from 0xFUNGIBLETOKENADDRESS',
- f'import FungibleToken from "{Path("../../flow-ft/contracts/FungibleToken.cdc").resolve()}"'
- )
- replace(
- 'import FlowToken from 0xFLOWTOKENADDRESS',
- f'import FlowToken from "{Path("FlowToken.cdc").resolve()}"'
- )
- replace(
- 'import FlowIDTableStaking from 0xFLOWIDTABLESTAKINGADDRESS',
- f'import FlowIDTableStaking from "{Path("FlowIDTableStaking.cdc").resolve()}"'
- )
- replace(
- 'import LockedTokens from 0xLOCKEDTOKENSADDRESS',
- f'import LockedTokens from "{Path("LockedTokens.cdc").resolve()}"'
- )
- replace(
- 'import FlowStorageFees from 0xFLOWSTORAGEFEESADDRESS',
- f'import FlowStorageFees from "{Path("FlowStorageFees.cdc").resolve()}"'
- )
+cadence_tests:
+- path: .
+ command: flow test tests/*.cdc
diff --git a/compat/suite/flow-ft.yaml b/compat/suite/flow-ft.yaml
index 1fd621a3d5..d0818d0b0b 100644
--- a/compat/suite/flow-ft.yaml
+++ b/compat/suite/flow-ft.yaml
@@ -1,88 +1,9 @@
description: Flow Fungible Token
maintainers:
-- bastian@dapperlabs.com
-- joshua.hannan@dapperlabs.com
+ - bastian.mueller@flowfoundation.org
+ - joshua.hannan@flowfoundation.org
url: https://github.com/onflow/flow-ft.git
branch: master
go_tests:
- path: lib/go/test
command: make test
-files:
-- path: contracts/FungibleToken.cdc
-- path: contracts/utilityContracts/TokenForwarding.cdc
- # language=Python prefix="replace: Callable[[str, str], None]\n"
- prepare: |
- from pathlib import Path
-
- replace(
- 'import FungibleToken from 0xFUNGIBLETOKENADDRESS',
- f'import FungibleToken from "{Path("../FungibleToken.cdc").resolve()}"'
- )
-
-- path: contracts/ExampleToken.cdc
- # language=Python prefix="replace: Callable[[str, str], None]\n"
- prepare: |
- from pathlib import Path
-
- replace(
- 'import FungibleToken from 0xFUNGIBLETOKENADDRESS',
- f'import FungibleToken from "{Path("FungibleToken.cdc").resolve()}"'
- )
-
-- path: transactions/transfer_tokens.cdc
- # language=Python prefix="replace: Callable[[str, str], None]\n"
- prepare: |
- from pathlib import Path
-
- replace(
- 'import FungibleToken from 0xFUNGIBLETOKENADDRESS',
- f'import FungibleToken from "{Path("../contracts/FungibleToken.cdc").resolve()}"'
- )
- replace(
- 'import ExampleToken from 0xTOKENADDRESS',
- f'import ExampleToken from "{Path("../contracts/ExampleToken.cdc").resolve()}"'
- )
-
-- path: transactions/setup_account.cdc
- # language=Python prefix="replace: Callable[[str, str], None]\n"
- prepare: |
- from pathlib import Path
-
- replace(
- 'import FungibleToken from 0xFUNGIBLETOKENADDRESS',
- f'import FungibleToken from "{Path("../contracts/FungibleToken.cdc").resolve()}"'
- )
- replace(
- 'import ExampleToken from 0xTOKENADDRESS',
- f'import ExampleToken from "{Path("../contracts/ExampleToken.cdc").resolve()}"'
- )
-
-- path: transactions/mint_tokens.cdc
- # language=Python prefix="replace: Callable[[str, str], None]\n"
- prepare: |
- from pathlib import Path
-
- replace(
- 'import FungibleToken from 0xFUNGIBLETOKENADDRESS',
- f'import FungibleToken from "{Path("../contracts/FungibleToken.cdc").resolve()}"'
- )
- replace(
- 'import ExampleToken from 0xTOKENADDRESS',
- f'import ExampleToken from "{Path("../contracts/ExampleToken.cdc").resolve()}"'
- )
-
-
-- path: transactions/burn_tokens.cdc
- # language=Python prefix="replace: Callable[[str, str], None]\n"
- prepare: |
- from pathlib import Path
-
- replace(
- 'import FungibleToken from 0xFUNGIBLETOKENADDRESS',
- f'import FungibleToken from "{Path("../contracts/FungibleToken.cdc").resolve()}"'
- )
- replace(
- 'import ExampleToken from 0xTOKENADDRESS',
- f'import ExampleToken from "{Path("../contracts/ExampleToken.cdc").resolve()}"'
- )
-
diff --git a/compat/suite/flow-nft.yaml b/compat/suite/flow-nft.yaml
index c6d93cc7bd..eb57fb60df 100644
--- a/compat/suite/flow-nft.yaml
+++ b/compat/suite/flow-nft.yaml
@@ -1,63 +1,9 @@
description: Flow Non-Fungible Token
maintainers:
-- bastian@dapperlabs.com
-- joshua.hannan@dapperlabs.com
+ - bastian.mueller@flowfoundation.org
+ - joshua.hannan@flowfoundation.org
url: https://github.com/onflow/flow-nft.git
branch: master
go_tests:
- path: lib/go/test
command: make test
-files:
-- path: contracts/NonFungibleToken.cdc
-- path: contracts/ExampleNFT.cdc
- # language=Python prefix="replace: Callable[[str, str], None]\n"
- prepare: |
- from pathlib import Path
-
- replace(
- 'import NonFungibleToken from 0x02',
- f'import NonFungibleToken from "{Path("NonFungibleToken.cdc").resolve()}"'
- )
-
-
-- path: transactions/mint_nft.cdc
- # language=Python prefix="replace: Callable[[str, str], None]\n"
- prepare: |
- from pathlib import Path
-
- replace(
- 'import NonFungibleToken from 0xNFTADDRESS',
- f'import NonFungibleToken from "{Path("../contracts/NonFungibleToken.cdc").resolve()}"'
- )
- replace(
- 'import ExampleNFT from 0xNFTCONTRACTADDRESS',
- f'import ExampleNFT from "{Path("../contracts/ExampleNFT.cdc").resolve()}"'
- )
-
-- path: transactions/setup_account.cdc
- # language=Python prefix="replace: Callable[[str, str], None]\n"
- prepare: |
- from pathlib import Path
-
- replace(
- 'import NonFungibleToken from 0xNFTADDRESS',
- f'import NonFungibleToken from "{Path("../contracts/NonFungibleToken.cdc").resolve()}"'
- )
- replace(
- 'import ExampleNFT from 0xNFTCONTRACTADDRESS',
- f'import ExampleNFT from "{Path("../contracts/ExampleNFT.cdc").resolve()}"'
- )
-
-- path: transactions/transfer_nft.cdc
- # language=Python prefix="replace: Callable[[str, str], None]\n"
- prepare: |
- from pathlib import Path
-
- replace(
- 'import NonFungibleToken from 0xNFTADDRESS',
- f'import NonFungibleToken from "{Path("../contracts/NonFungibleToken.cdc").resolve()}"'
- )
- replace(
- 'import ExampleNFT from 0xNFTCONTRACTADDRESS',
- f'import ExampleNFT from "{Path("../contracts/ExampleNFT.cdc").resolve()}"'
- )
\ No newline at end of file
diff --git a/compat/suite/green-goo-dao-flow-utils.yaml b/compat/suite/green-goo-dao-flow-utils.yaml
new file mode 100644
index 0000000000..82f2925875
--- /dev/null
+++ b/compat/suite/green-goo-dao-flow-utils.yaml
@@ -0,0 +1,8 @@
+description: Green Goo Dao flow-utils
+maintainers:
+ - bastian.mueller@flowfoundation.org
+url: https://github.com/turbolent/flow-utils.git
+branch: improvements
+cadence_tests:
+- path: .
+ command: npm i && ./run-tests.sh
diff --git a/compat/suite/nba-smart-contracts.yaml b/compat/suite/nba-smart-contracts.yaml
index f56ebbfcee..f0ec168994 100644
--- a/compat/suite/nba-smart-contracts.yaml
+++ b/compat/suite/nba-smart-contracts.yaml
@@ -1,90 +1,9 @@
description: NBA Top Shot
maintainers:
-- bastian@dapperlabs.com
-- joshua.hannan@dapperlabs.com
+ - bastian.mueller@flowfoundation.org
+ - joshua.hannan@flowfoundation.org
url: https://github.com/dapperlabs/nba-smart-contracts.git
branch: master
go_tests:
- path: lib/go/test
command: make test
-files:
-- path: contracts/TopShot.cdc
- # language=Python prefix="replace: Callable[[str, str], None]\n"
- prepare: |
- from pathlib import Path
-
- replace(
- 'import NonFungibleToken from 0xNFTADDRESS',
- f'import NonFungibleToken from "{Path("../../flow-nft/contracts/NonFungibleToken.cdc").resolve()}"'
- )
-
-- path: contracts/MarketTopShot.cdc
- # language=Python prefix="replace: Callable[[str, str], None]\n"
- prepare: |
- from pathlib import Path
-
- replace(
- 'import FungibleToken from 0xFUNGIBLETOKENADDRESS',
- f'import FungibleToken from "{Path("../../flow-ft/contracts/FungibleToken.cdc").resolve()}"'
- )
-
- replace(
- 'import NonFungibleToken from 0xNFTADDRESS',
- f'import NonFungibleToken from "{Path("../../flow-nft/contracts/NonFungibleToken.cdc").resolve()}"'
- )
-
- replace(
- 'import TopShot from 0xTOPSHOTADDRESS',
- f'import TopShot from "{Path("TopShot.cdc").resolve()}"'
- )
-
-- path: contracts/TopShotMarketV2.cdc
- # language=Python prefix="replace: Callable[[str, str], None]\n"
- prepare: |
- from pathlib import Path
-
- replace(
- 'import FungibleToken from 0xFUNGIBLETOKENADDRESS',
- f'import FungibleToken from "{Path("../../flow-ft/contracts/FungibleToken.cdc").resolve()}"'
- )
-
- replace(
- 'import NonFungibleToken from 0xNFTADDRESS',
- f'import NonFungibleToken from "{Path("../../flow-nft/contracts/NonFungibleToken.cdc").resolve()}"'
- )
-
- replace(
- 'import TopShot from 0xTOPSHOTADDRESS',
- f'import TopShot from "{Path("TopShot.cdc").resolve()}"'
- )
-
-- path: contracts/TopShotShardedCollection.cdc
- # language=Python prefix="replace: Callable[[str, str], None]\n"
- prepare: |
- from pathlib import Path
-
- replace(
- 'import NonFungibleToken from 0xNFTADDRESS',
- f'import NonFungibleToken from "{Path("../../flow-nft/contracts/NonFungibleToken.cdc").resolve()}"'
- )
-
- replace(
- 'import TopShot from 0xTOPSHOTADDRESS',
- f'import TopShot from "{Path("TopShot.cdc").resolve()}"'
- )
-
-- path: contracts/TopshotAdminReceiver.cdc
- # language=Python prefix="replace: Callable[[str, str], None]\n"
- prepare: |
- from pathlib import Path
-
- replace(
- 'import TopShotShardedCollection from 0xSHARDEDADDRESS',
- f'import TopShotShardedCollection from "{Path("TopShotShardedCollection.cdc").resolve()}"'
- )
-
- replace(
- 'import TopShot from 0xTOPSHOTADDRESS',
- f'import TopShot from "{Path("TopShot.cdc").resolve()}"'
- )
-
diff --git a/compiler/compiler_test.go b/compiler/compiler_test.go
index 17acf177d1..b9a0e2d866 100644
--- a/compiler/compiler_test.go
+++ b/compiler/compiler_test.go
@@ -24,12 +24,12 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/compiler/ir"
- "github.com/onflow/cadence/tests/checker"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCompilerSimple(t *testing.T) {
- checker, err := checker.ParseAndCheck(t, `
+ checker, err := ParseAndCheck(t, `
fun inc(a: Int): Int {
let mod = 1
return a + mod
diff --git a/runtime/runtime.monopic b/docs/architecture.monopic
similarity index 100%
rename from runtime/runtime.monopic
rename to docs/architecture.monopic
diff --git a/runtime/runtime.png b/docs/architecture.png
similarity index 100%
rename from runtime/runtime.png
rename to docs/architecture.png
diff --git a/runtime/runtime.svg b/docs/architecture.svg
similarity index 100%
rename from runtime/runtime.svg
rename to docs/architecture.svg
diff --git a/docs/cadence.ebnf b/docs/cadence.ebnf
index 25f86ec3e6..89057552c7 100644
--- a/docs/cadence.ebnf
+++ b/docs/cadence.ebnf
@@ -106,9 +106,7 @@ importDeclaration
access
: (* Not specified *)
- | Priv
- | Pub ( '(' Set ')' )?
- | Access '(' ( Self | Contract | Account | All ) ')'
+ | Access '(' ( Self | Contract | Account | All | identifier) ')'
;
compositeDeclaration
@@ -224,7 +222,7 @@ nominalType
;
functionType
- : Fun '('
+ : Fun '('
( typeAnnotation ( ',' typeAnnotation )* )?
')'
( ':' typeAnnotation )?
diff --git a/docs/development.md b/docs/development.md
index 4a166bba19..75a0db5eac 100644
--- a/docs/development.md
+++ b/docs/development.md
@@ -73,7 +73,7 @@ contains command-line tools that are useful when working on the implementation f
```
```
- $ echo 'pub fun main () { log("Hello, world!") }' > hello.cdc
+ $ echo 'access(all) fun main () { log("Hello, world!") }' > 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 ./tests/checker -cadence.checkConcurrently=10
+go test -race -v ./sema/... -cadence.checkConcurrently=10
```
This runs each check of a checker test 10 times, concurrently,
diff --git a/docs/go.md b/docs/go.md
new file mode 100644
index 0000000000..e799fd7ffd
--- /dev/null
+++ b/docs/go.md
@@ -0,0 +1,42 @@
+# Go
+
+## Patterns
+
+- To ensure interface cannot be implemented in other packages,
+ add a private function (first character must be lower-case) named "is" + type name,
+ which takes no arguments, returns nothing, and has an empty body.
+
+ For example:
+
+ ```go
+ type I interface {
+ isI()
+ }
+ ```
+
+ See https://go.dev/doc/faq#guarantee_satisfies_interface
+
+- To ensure a type implements an interface at compile-time,
+ use the "interface guard" pattern:
+ Introduce a global variable named `_`, type it as the interface,
+ and assign an empty value of the concrete type to it.
+
+ For example:
+
+ ```go
+ type T struct {
+ //...
+ }
+
+ var _ io.ReadWriter = (*T)(nil)
+
+ func (t *T) Read(p []byte) (n int, err error) {
+ // ...
+ ```
+
+ See
+ - https://go.dev/doc/faq#guarantee_satisfies_interface
+ - https://rednafi.com/go/interface_guards/
+ - https://github.com/uber-go/guide/blob/master/style.md#verify-interface-compliance
+ - https://medium.com/@matryer/golang-tip-compile-time-checks-to-ensure-your-type-satisfies-an-interface-c167afed3aae
+
diff --git a/docs/releasing.md b/docs/releasing.md
index 38321f7155..b6cdb8e15d 100644
--- a/docs/releasing.md
+++ b/docs/releasing.md
@@ -1,3 +1,13 @@
+# Versioning
+
+Versioning of Cadence releases follows the below strategy:
+- A language-breaking change (which is rare) would be a major version change.
+ - e.g: If the current version is `1.0.0` then the new version should be `v2.0.0`.
+- Any other changes that are not bug fixes, (feature additions, Go API changes, etc.) would be a minor version change.
+ - e.g: If the current version is `1.0.0` then the new version should be `v1.1.0`.
+- Bug fixes are patch versions.
+ - e.g: If the current version is `1.0.0` then the new version should be `v1.0.1`.
+
# Release Process
Assume releasing Cadence version `v0.21.2` from `master` branch.
diff --git a/encoding/ccf/ccf_test.go b/encoding/ccf/ccf_test.go
index db427edd67..c4513037ae 100644
--- a/encoding/ccf/ccf_test.go
+++ b/encoding/ccf/ccf_test.go
@@ -38,9 +38,9 @@ import (
"github.com/onflow/cadence/interpreter"
"github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/checker"
- "github.com/onflow/cadence/tests/runtime_utils"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
var deterministicEncMode, _ = ccf.EncOptions{
@@ -100,7 +100,7 @@ func TestEncodeOptional(t *testing.T) {
newStructType := func() *cadence.StructType {
return cadence.NewStructType(
- utils.TestLocation,
+ TestLocation,
"Foo",
[]cadence.Field{
{
@@ -122,7 +122,7 @@ func TestEncodeOptional(t *testing.T) {
newStructTypeWithOptionalAbstractField := func() *cadence.StructType {
return cadence.NewStructType(
- utils.TestLocation,
+ TestLocation,
"Foo",
[]cadence.Field{
{
@@ -807,7 +807,7 @@ func TestEncodeOptional(t *testing.T) {
val: func() cadence.Value {
structTypeWithOptionalAbstractField := newStructTypeWithOptionalAbstractField()
simpleStructType := cadence.NewStructType(
- utils.TestLocation,
+ TestLocation,
"FooStruct",
[]cadence.Field{
{
@@ -3576,7 +3576,7 @@ func TestEncodeArray(t *testing.T) {
name: "Resource Interface Array",
val: func() cadence.Value {
resourceInterfaceType := cadence.NewResourceInterfaceType(
- utils.TestLocation,
+ TestLocation,
"Bar",
nil,
nil,
@@ -3930,13 +3930,13 @@ func TestEncodeArray(t *testing.T) {
name: "Struct Interface Array",
val: func() cadence.Value {
structInterfaceType := cadence.NewStructInterfaceType(
- utils.TestLocation,
+ TestLocation,
"FooStructInterface",
nil,
nil,
)
structType := cadence.NewStructType(
- utils.TestLocation,
+ TestLocation,
"FooStruct",
[]cadence.Field{
{
@@ -4075,13 +4075,13 @@ func TestEncodeArray(t *testing.T) {
name: "Contract Interface Array",
val: func() cadence.Value {
contractInterfaceType := cadence.NewContractInterfaceType(
- utils.TestLocation,
+ TestLocation,
"FooContractInterface",
nil,
nil,
)
contractType := cadence.NewContractType(
- utils.TestLocation,
+ TestLocation,
"FooContract",
[]cadence.Field{
{
@@ -4949,7 +4949,7 @@ func TestEncodeSortedDictionary(t *testing.T) {
}
func exportFromScript(t *testing.T, code string) cadence.Value {
- checker, err := checker.ParseAndCheck(t, code)
+ checker, err := ParseAndCheck(t, code)
require.NoError(t, err)
var uuid uint64
@@ -5414,7 +5414,7 @@ func TestEncodeStruct(t *testing.T) {
name: "no field",
val: func() cadence.Value {
noFieldStructType := cadence.NewStructType(
- utils.TestLocation,
+ TestLocation,
"FooStruct",
[]cadence.Field{},
nil,
@@ -5473,7 +5473,7 @@ func TestEncodeStruct(t *testing.T) {
name: "Simple",
val: func() cadence.Value {
simpleStructType := cadence.NewStructType(
- utils.TestLocation,
+ TestLocation,
"FooStruct",
[]cadence.Field{
{
@@ -5824,7 +5824,7 @@ func TestEncodeEvent(t *testing.T) {
name: "Simple",
val: func() cadence.Value {
simpleEventType := cadence.NewEventType(
- utils.TestLocation,
+ TestLocation,
"FooEvent",
[]cadence.Field{
{
@@ -5928,7 +5928,7 @@ func TestEncodeEvent(t *testing.T) {
name: "abstract event",
val: func() cadence.Value {
abstractEventType := cadence.NewEventType(
- utils.TestLocation,
+ TestLocation,
"FooEvent",
[]cadence.Field{
{
@@ -5943,7 +5943,7 @@ func TestEncodeEvent(t *testing.T) {
nil,
)
simpleStructType := cadence.NewStructType(
- utils.TestLocation,
+ TestLocation,
"FooStruct",
[]cadence.Field{
{
@@ -6090,7 +6090,7 @@ func TestEncodeEvent(t *testing.T) {
val: func() cadence.Value {
fooResourceType := newFooResourceType()
resourceEventType := cadence.NewEventType(
- utils.TestLocation,
+ TestLocation,
"FooEvent",
[]cadence.Field{
{
@@ -6238,7 +6238,7 @@ func TestEncodeEvent(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
actualCBOR, err := ccf.EventsEncMode.Encode(tc.val)
require.NoError(t, err)
- utils.AssertEqualWithDiff(t, tc.expected, actualCBOR)
+ AssertEqualWithDiff(t, tc.expected, actualCBOR)
decodedVal, err := ccf.EventsDecMode.Decode(nil, actualCBOR)
require.NoError(t, err)
@@ -6259,7 +6259,7 @@ func TestEncodeContract(t *testing.T) {
name: "Simple",
val: func() cadence.Value {
simpleContractType := cadence.NewContractType(
- utils.TestLocation,
+ TestLocation,
"FooContract",
[]cadence.Field{
{
@@ -6363,7 +6363,7 @@ func TestEncodeContract(t *testing.T) {
name: "abstract contract",
val: func() cadence.Value {
simpleStructType := cadence.NewStructType(
- utils.TestLocation,
+ TestLocation,
"FooStruct",
[]cadence.Field{
{
@@ -6374,7 +6374,7 @@ func TestEncodeContract(t *testing.T) {
nil,
)
abstractContractType := cadence.NewContractType(
- utils.TestLocation,
+ TestLocation,
"FooContract",
[]cadence.Field{
{
@@ -6525,7 +6525,7 @@ func TestEncodeContract(t *testing.T) {
val: func() cadence.Value {
fooResourceType := newFooResourceType()
resourceContractType := cadence.NewContractType(
- utils.TestLocation,
+ TestLocation,
"FooContract",
[]cadence.Field{
{
@@ -6677,7 +6677,7 @@ func TestEncodeEnum(t *testing.T) {
name: "Simple",
val: func() cadence.Value {
simpleEnumType := cadence.NewEnumType(
- utils.TestLocation,
+ TestLocation,
"FooEnum",
nil,
[]cadence.Field{
@@ -6764,7 +6764,7 @@ func TestEncodeAttachment(t *testing.T) {
name: "no field",
val: func() cadence.Value {
attachmentType := cadence.NewAttachmentType(
- utils.TestLocation,
+ TestLocation,
"FooAttachment",
nil,
[]cadence.Field{},
@@ -6825,7 +6825,7 @@ func TestEncodeAttachment(t *testing.T) {
name: "simple",
val: func() cadence.Value {
attachmentType := cadence.NewAttachmentType(
- utils.TestLocation,
+ TestLocation,
"FooAttachment",
nil,
[]cadence.Field{
@@ -6906,7 +6906,7 @@ func TestEncodeAttachment(t *testing.T) {
name: "struct field",
val: func() cadence.Value {
structType := cadence.NewStructType(
- utils.TestLocation,
+ TestLocation,
"FooStruct",
[]cadence.Field{
{
@@ -6917,7 +6917,7 @@ func TestEncodeAttachment(t *testing.T) {
nil,
)
attachmentType := cadence.NewAttachmentType(
- utils.TestLocation,
+ TestLocation,
"FooAttachment",
nil,
[]cadence.Field{
@@ -7508,7 +7508,7 @@ func TestEncodeValueOfReferenceType(t *testing.T) {
newSimpleStructType := func() *cadence.StructType {
return cadence.NewStructType(
- utils.TestLocation,
+ TestLocation,
"Foo",
[]cadence.Field{
{
@@ -8840,7 +8840,7 @@ func TestEncodeType(t *testing.T) {
t,
cadence.TypeValue{
StaticType: cadence.NewStructType(
- utils.TestLocation,
+ TestLocation,
"S",
[]cadence.Field{},
[][]cadence.Parameter{},
@@ -8889,7 +8889,7 @@ func TestEncodeType(t *testing.T) {
val := cadence.TypeValue{
StaticType: cadence.NewStructType(
- utils.TestLocation,
+ TestLocation,
"S",
[]cadence.Field{
{Identifier: "foo", Type: cadence.IntType},
@@ -8993,7 +8993,7 @@ func TestEncodeType(t *testing.T) {
// Encode value without sorting of composite fields.
actualCBOR, err := ccf.Encode(val)
require.NoError(t, err)
- utils.AssertEqualWithDiff(t, expectedCBOR, actualCBOR)
+ AssertEqualWithDiff(t, expectedCBOR, actualCBOR)
// Decode value without enforcing sorting of composite fields.
decodedVal, err := ccf.Decode(nil, actualCBOR)
@@ -9012,7 +9012,7 @@ func TestEncodeType(t *testing.T) {
t,
cadence.TypeValue{
StaticType: cadence.NewStructType(
- utils.TestLocation,
+ TestLocation,
"S",
[]cadence.Field{
{Identifier: "foo", Type: cadence.IntType},
@@ -9113,7 +9113,7 @@ func TestEncodeType(t *testing.T) {
},
cadence.TypeValue{
StaticType: cadence.NewStructType(
- utils.TestLocation,
+ TestLocation,
"S",
[]cadence.Field{
{Identifier: "bar", Type: cadence.IntType},
@@ -9134,21 +9134,21 @@ func TestEncodeType(t *testing.T) {
t.Parallel()
fooTy := cadence.NewResourceType(
- utils.TestLocation,
+ TestLocation,
"Foo",
[]cadence.Field{},
[][]cadence.Parameter{},
)
fooTy2 := cadence.NewResourceType(
- utils.TestLocation,
+ TestLocation,
"Foo2",
[]cadence.Field{},
[][]cadence.Parameter{},
)
barTy := cadence.NewResourceType(
- utils.TestLocation,
+ TestLocation,
"Bar",
[]cadence.Field{
{
@@ -9274,7 +9274,7 @@ func TestEncodeType(t *testing.T) {
t,
cadence.TypeValue{
StaticType: cadence.NewResourceType(
- utils.TestLocation,
+ TestLocation,
"R",
[]cadence.Field{
{Identifier: "foo", Type: cadence.IntType},
@@ -9372,7 +9372,7 @@ func TestEncodeType(t *testing.T) {
t,
cadence.TypeValue{
StaticType: cadence.NewContractType(
- utils.TestLocation,
+ TestLocation,
"C",
[]cadence.Field{
{Identifier: "foo", Type: cadence.IntType},
@@ -9470,7 +9470,7 @@ func TestEncodeType(t *testing.T) {
t,
cadence.TypeValue{
StaticType: cadence.NewStructInterfaceType(
- utils.TestLocation,
+ TestLocation,
"S",
[]cadence.Field{
{Identifier: "foo", Type: cadence.IntType},
@@ -9568,7 +9568,7 @@ func TestEncodeType(t *testing.T) {
t,
cadence.TypeValue{
StaticType: cadence.NewResourceInterfaceType(
- utils.TestLocation,
+ TestLocation,
"R",
[]cadence.Field{
{Identifier: "foo", Type: cadence.IntType},
@@ -9666,7 +9666,7 @@ func TestEncodeType(t *testing.T) {
t,
cadence.TypeValue{
StaticType: cadence.NewContractInterfaceType(
- utils.TestLocation,
+ TestLocation,
"C",
[]cadence.Field{
{Identifier: "foo", Type: cadence.IntType},
@@ -9764,7 +9764,7 @@ func TestEncodeType(t *testing.T) {
t,
cadence.TypeValue{
StaticType: cadence.NewEventType(
- utils.TestLocation,
+ TestLocation,
"E",
[]cadence.Field{
{Identifier: "foo", Type: cadence.IntType},
@@ -9860,7 +9860,7 @@ func TestEncodeType(t *testing.T) {
t,
cadence.TypeValue{
StaticType: cadence.NewEnumType(
- utils.TestLocation,
+ TestLocation,
"E",
cadence.StringType,
[]cadence.Field{
@@ -9961,7 +9961,7 @@ func TestEncodeType(t *testing.T) {
t,
cadence.TypeValue{
StaticType: cadence.NewAttachmentType(
- utils.TestLocation,
+ TestLocation,
"A",
cadence.StringType,
[]cadence.Field{
@@ -10059,7 +10059,7 @@ func TestEncodeType(t *testing.T) {
t.Parallel()
baseType := cadence.NewResourceType(
- utils.TestLocation,
+ TestLocation,
"FooBase",
[]cadence.Field{
{Identifier: "bar", Type: cadence.StringType},
@@ -10071,7 +10071,7 @@ func TestEncodeType(t *testing.T) {
t,
cadence.TypeValue{
StaticType: cadence.NewAttachmentType(
- utils.TestLocation,
+ TestLocation,
"A",
baseType,
[]cadence.Field{
@@ -11050,7 +11050,7 @@ func TestEncodeCapability(t *testing.T) {
t.Parallel()
simpleStructType := cadence.NewStructType(
- utils.TestLocation,
+ TestLocation,
"FooStruct",
[]cadence.Field{
{
@@ -11722,7 +11722,7 @@ func TestExportRecursiveType(t *testing.T) {
},
}
ty := cadence.NewResourceType(
- utils.TestLocation,
+ TestLocation,
"Foo",
fields,
nil,
@@ -11815,7 +11815,7 @@ func TestExportTypeValueRecursiveType(t *testing.T) {
},
}
ty := cadence.NewResourceType(
- utils.TestLocation,
+ TestLocation,
"Foo",
fields,
[][]cadence.Parameter{},
@@ -12061,21 +12061,21 @@ func TestExportTypeValueRecursiveType(t *testing.T) {
t.Parallel()
fooTy := cadence.NewResourceType(
- utils.TestLocation,
+ TestLocation,
"Foo",
[]cadence.Field{},
[][]cadence.Parameter{},
)
fooTy2 := cadence.NewResourceType(
- utils.TestLocation,
+ TestLocation,
"Foo2",
[]cadence.Field{},
[][]cadence.Parameter{},
)
barTy := cadence.NewResourceType(
- utils.TestLocation,
+ TestLocation,
"Bar",
[]cadence.Field{
{
@@ -12729,7 +12729,7 @@ func testEncode(t *testing.T, val cadence.Value, expectedCBOR []byte) (actualCBO
actualCBOR, err := deterministicEncMode.Encode(val)
require.NoError(t, err)
- utils.AssertEqualWithDiff(t, expectedCBOR, actualCBOR)
+ AssertEqualWithDiff(t, expectedCBOR, actualCBOR)
return actualCBOR
}
@@ -12748,7 +12748,7 @@ func testDecode(t *testing.T, actualCBOR []byte, expectedVal cadence.Value) {
// TODO: make resource (illegal nesting)
func newResourceStructType() *cadence.StructType {
return cadence.NewStructType(
- utils.TestLocation,
+ TestLocation,
"FooStruct",
[]cadence.Field{
{
@@ -12766,7 +12766,7 @@ func newResourceStructType() *cadence.StructType {
func newFooResourceType() *cadence.ResourceType {
return cadence.NewResourceType(
- utils.TestLocation,
+ TestLocation,
"Foo",
[]cadence.Field{
{
@@ -12780,7 +12780,7 @@ func newFooResourceType() *cadence.ResourceType {
func newFoooResourceTypeWithAbstractField() *cadence.ResourceType {
return cadence.NewResourceType(
- utils.TestLocation,
+ TestLocation,
"Fooo",
[]cadence.Field{
{
@@ -13187,7 +13187,7 @@ func TestExportFunctionValue(t *testing.T) {
},
}
ty := cadence.NewResourceType(
- utils.TestLocation,
+ TestLocation,
"Foo",
fields,
nil,
@@ -14038,7 +14038,7 @@ func TestDeployedEvents(t *testing.T) {
// Encode Cadence value to CCF
actualCBOR, err := ccf.EventsEncMode.Encode(tc.event)
require.NoError(t, err)
- utils.AssertEqualWithDiff(t, tc.expectedCBOR, actualCBOR)
+ AssertEqualWithDiff(t, tc.expectedCBOR, actualCBOR)
// Decode CCF to Cadence value
decodedEvent, err := ccf.EventsDecMode.Decode(nil, actualCBOR)
@@ -15912,7 +15912,7 @@ func TestSortEntitlementSet(t *testing.T) {
// Encode value without sorting.
actualCBOR, err := ccf.Encode(val)
require.NoError(t, err)
- utils.AssertEqualWithDiff(t, expectedCBOR, actualCBOR)
+ AssertEqualWithDiff(t, expectedCBOR, actualCBOR)
// Decode value without enforcing sorting.
decodedVal, err := ccf.Decode(nil, actualCBOR)
@@ -16010,7 +16010,7 @@ func TestSortEntitlementSet(t *testing.T) {
// Encode value with sorted entitlement types.
actualCBOR, err := sortEntitlementTypesEncMode.Encode(val)
require.NoError(t, err)
- utils.AssertEqualWithDiff(t, expectedCBOR, actualCBOR)
+ AssertEqualWithDiff(t, expectedCBOR, actualCBOR)
// Decode value enforcing sorting of composite fields.
decodedVal, err := enforceSortedEntitlementTypesDecMode.Decode(nil, actualCBOR)
@@ -16079,7 +16079,7 @@ func TestSortEntitlementSet(t *testing.T) {
// Encode value without sorting.
actualCBOR, err := ccf.Encode(val)
require.NoError(t, err)
- utils.AssertEqualWithDiff(t, expectedCBOR, actualCBOR)
+ AssertEqualWithDiff(t, expectedCBOR, actualCBOR)
// Decode value without enforcing sorting.
decodedVal, err := ccf.Decode(nil, actualCBOR)
@@ -16156,7 +16156,7 @@ func TestSortEntitlementSet(t *testing.T) {
// Encode value with sorting.
actualCBOR, err := sortEntitlementTypesEncMode.Encode(val)
require.NoError(t, err)
- utils.AssertEqualWithDiff(t, expectedCBOR, actualCBOR)
+ AssertEqualWithDiff(t, expectedCBOR, actualCBOR)
// Decode value without enforcing sorting.
decodedVal, err := ccf.Decode(nil, actualCBOR)
@@ -16404,7 +16404,7 @@ func TestSortOptions(t *testing.T) {
// Encode value without sorting.
actualCBOR, err := ccf.Encode(val)
require.NoError(t, err)
- utils.AssertEqualWithDiff(t, expectedCBOR, actualCBOR)
+ AssertEqualWithDiff(t, expectedCBOR, actualCBOR)
// Decode value without enforcing sorting.
decodedVal, err := ccf.Decode(nil, actualCBOR)
@@ -16593,7 +16593,7 @@ func TestSortOptions(t *testing.T) {
// Encode value with sorted composite fields.
actualCBOR, err := sortFieldsEncMode.Encode(val)
require.NoError(t, err)
- utils.AssertEqualWithDiff(t, expectedCBOR, actualCBOR)
+ AssertEqualWithDiff(t, expectedCBOR, actualCBOR)
// Decode value enforcing sorting of composite fields.
decodedVal, err := enforceSortedFieldsDecMode.Decode(nil, actualCBOR)
@@ -16782,7 +16782,7 @@ func TestSortOptions(t *testing.T) {
// Encode value with sorted Intersection types.
actualCBOR, err := sortIntersectionTypesEncMode.Encode(val)
require.NoError(t, err)
- utils.AssertEqualWithDiff(t, expectedCBOR, actualCBOR)
+ AssertEqualWithDiff(t, expectedCBOR, actualCBOR)
// Decode value enforcing sorting of Intersection types.
decodedVal, err := enforceSortedIntersectionTypesDecMode.Decode(nil, actualCBOR)
@@ -16971,7 +16971,7 @@ func TestSortOptions(t *testing.T) {
// Encode value with sorted composite fields and Intersection types.
actualCBOR, err := deterministicEncMode.Encode(val)
require.NoError(t, err)
- utils.AssertEqualWithDiff(t, expectedCBOR, actualCBOR)
+ AssertEqualWithDiff(t, expectedCBOR, actualCBOR)
// Decode value enforcing sorting of composite fields and Intersection types.
decodedVal, err := deterministicDecMode.Decode(nil, actualCBOR)
@@ -17111,7 +17111,7 @@ func TestDecodeFunctionTypeBackwardCompatibility(t *testing.T) {
testDecode(t, data, val)
}
-func TestEncodeEventWithAttachement(t *testing.T) {
+func TestEncodeEventWithAttachment(t *testing.T) {
script := `
access(all) struct S {
access(all) let x: Int
@@ -17146,11 +17146,11 @@ func TestEncodeEventWithAttachement(t *testing.T) {
}
func exportEventFromScript(t *testing.T, script string) cadence.Event {
- rt := runtime_utils.NewTestInterpreterRuntime()
+ rt := NewTestInterpreterRuntime()
var events []cadence.Event
- inter := &runtime_utils.TestRuntimeInterface{
+ inter := &TestRuntimeInterface{
OnEmitEvent: func(event cadence.Event) error {
events = append(events, event)
return nil
diff --git a/encoding/ccf/ccf_type_id_test.go b/encoding/ccf/ccf_type_id_test.go
index 271623e4e4..2019a2bbfa 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/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func TestCCFTypeID(t *testing.T) {
@@ -117,7 +117,7 @@ func TestCadenceTypeByCCFTypeID(t *testing.T) {
func simpleStructType() *cadence.StructType {
return cadence.NewStructType(
- utils.TestLocation,
+ TestLocation,
"FooStruct",
[]cadence.Field{
{
@@ -131,7 +131,7 @@ func simpleStructType() *cadence.StructType {
func simpleStructType2() *cadence.StructType {
return cadence.NewStructType(
- utils.TestLocation,
+ TestLocation,
"FooStruct2",
[]cadence.Field{
{
diff --git a/encoding/ccf/consts.go b/encoding/ccf/consts.go
index f4d25b2d01..45124a131a 100644
--- a/encoding/ccf/consts.go
+++ b/encoding/ccf/consts.go
@@ -125,7 +125,7 @@ const (
CBORTagIntersectionTypeValue
CBORTagCapabilityTypeValue
CBORTagFunctionTypeValue
- CBORTagInclusiveRangeTypeValue // InclusiveRange is stored as a composite value.
+ CBORTagInclusiveRangeTypeValue
CBORTagEntitlementSetAuthorizationAccessTypeValue
CBORTagEntitlementMapAuthorizationAccessTypeValue
_
diff --git a/encoding/ccf/decode.go b/encoding/ccf/decode.go
index db5ab6d09f..186bd738d7 100644
--- a/encoding/ccf/decode.go
+++ b/encoding/ccf/decode.go
@@ -369,8 +369,7 @@ func (d *Decoder) decodeTypeAndValue(types *cadenceTypeByCCFTypeID) (cadence.Val
// / dict-value
// / composite-value
// / path-value
-// / path-capability-value
-// / id-capability-value
+// / capability-value
// / inclusiverange-value
// / function-value
// / type-value
@@ -1446,24 +1445,12 @@ func (d *Decoder) decodePath() (cadence.Value, error) {
// decodeCapability decodes encoded capability-value as
// language=CDDL
//
-// capability-value =
-//
-// id-capability-value
-// / path-capability-value
-//
-// id-capability-value = [
+// capability-value = [
//
// address: address-value,
// id: uint64-value
//
// ]
-//
-// path-capability-value = [
-//
-// address: address-value,
-// path: path-value
-//
-// ]
func (d *Decoder) decodeCapability(typ *cadence.CapabilityType, types *cadenceTypeByCCFTypeID) (cadence.Value, error) {
// typ can be different from runtime CapabilityType because borrow type can be nil.
// In this case, runtime type is encoded with the value (as tag content for tag CBORTagTypeAndValue).
diff --git a/encoding/ccf/decode_type.go b/encoding/ccf/decode_type.go
index 6d8eb3ba13..3fa743c6f9 100644
--- a/encoding/ccf/decode_type.go
+++ b/encoding/ccf/decode_type.go
@@ -361,14 +361,14 @@ func (d *Decoder) decodeCapabilityType(
//
// ; cbor-tag-entitlement-set-authorization-type
// #6.146([
-// kind: uint8,
-// entitlements: +[string]
+// kind: uint,
+// entitlements: [+ tstr],
// ])
//
// entitlement-map-authorization-type =
//
// ; cbor-tag-entitlement-map-authorization-type
-// #6.147(entitlement: string)
+// #6.147(tstr)
//
// authorization-type-value =
//
@@ -382,14 +382,14 @@ func (d *Decoder) decodeCapabilityType(
//
// ; cbor-tag-entitlement-set-authorization-type-value
// #6.195([
-// kind: uint8,
-// entitlements: +[string]
+// kind: uint,
+// entitlements: [+ tstr],
// ])
//
// entitlement-map-authorization-type-value =
//
// ; cbor-tag-entitlement-map-authorization-type-value
-// #6.196(entitlement: string)
+// #6.196(tstr)
func (d *Decoder) decodeAuthorization(isType bool) (cadence.Authorization, error) {
nt, err := d.dec.NextType()
if err != nil {
@@ -454,8 +454,8 @@ const entitlementSetAuthorizationArraySize = 2
//
// ; cbor-tag-entitlement-set-authorization-type
// #6.146([
-// kind: uint8,
-// entitlements: +[string]
+// kind: uint,
+// entitlements: [+ tstr],
// ])
func (d *Decoder) decodeEntitlementSetAuthorization() (cadence.Authorization, error) {
@@ -569,7 +569,7 @@ func (d *Decoder) decodeEntitlementMapAuthorization() (cadence.Authorization, er
//
// ; cbor-tag-reference-type-value
// #6.190([
-// authorized: authorization-type,
+// authorized: authorization-type-value,
// type: type-value,
// ])
//
@@ -610,16 +610,14 @@ func (d *Decoder) decodeReferenceType(
//
// ; cbor-tag-intersection-type
// #6.143([
-// type: inline-type / nil,
-// types: [* inline-type]
+// types: [+ inline-type]
// ])
//
// intersection-type-value =
//
// ; cbor-tag-intersection-type-value
// #6.191([
-// type: type-value / nil,
-// types: [* type-value]
+// types: [+ type-value]
// ])
//
// NOTE: decodeTypeFn is responsible for decoding inline-type or type-value.
diff --git a/encoding/ccf/decode_typedef.go b/encoding/ccf/decode_typedef.go
index 192260d52e..efbff6b4ef 100644
--- a/encoding/ccf/decode_typedef.go
+++ b/encoding/ccf/decode_typedef.go
@@ -330,7 +330,7 @@ func (d *Decoder) decodeTypeDef(
// fields: [
// * [
// field-name: tstr,
-// field-type: inline-type
+// field-type: inline-type,
// ]
// ]
//
diff --git a/encoding/ccf/encode.go b/encoding/ccf/encode.go
index 1c79c148b9..224eadf4fb 100644
--- a/encoding/ccf/encode.go
+++ b/encoding/ccf/encode.go
@@ -423,8 +423,7 @@ func (e *Encoder) encodeTypeDefs(types []cadence.Type, tids ccfTypeIDByCadenceTy
// / dict-value
// / composite-value
// / path-value
-// / path-capability-value
-// / id-capability-value
+// / capability-value
// / inclusiverange-value
// / function-value
// / type-value
@@ -1030,7 +1029,13 @@ func encodeAndSortKeyValuePairs(
// encodeInclusiveRange encodes cadence.InclusiveRange as
// language=CDDL
-// inclusiverange-value = [3*3 (key: value, value: value)]
+// inclusiverange-value = [
+//
+// start: value,
+// stop: value,
+// step: value,
+//
+// ]
func (e *Encoder) encodeInclusiveRange(v *cadence.InclusiveRange, tids ccfTypeIDByCadenceType) error {
staticElementType := v.InclusiveRangeType.ElementType
@@ -1240,7 +1245,7 @@ func (e *Encoder) encodePath(x cadence.Path) error {
// encodeCapability encodes cadence.Capability as
// language=CDDL
-// id-capability-value = [
+// capability-value = [
//
// address: address-value,
// id: uint64-value
@@ -1569,8 +1574,7 @@ func (e *Encoder) encodeReferenceTypeValue(typ *cadence.ReferenceType, visited c
//
// ; cbor-tag-intersection-type-value
// #6.191([
-// type: type-value / nil,
-// types: [* type-value]
+// types: [+ type-value]
// ])
func (e *Encoder) encodeIntersectionTypeValue(typ *cadence.IntersectionType, visited ccfTypeIDByCadenceType) error {
rawTagNum := []byte{0xd8, CBORTagIntersectionTypeValue}
diff --git a/encoding/ccf/encode_type.go b/encoding/ccf/encode_type.go
index d952fe6e93..509a6b4dd2 100644
--- a/encoding/ccf/encode_type.go
+++ b/encoding/ccf/encode_type.go
@@ -376,14 +376,14 @@ func (e *Encoder) encodeReferenceType(
//
// ; cbor-tag-entitlement-set-authorization-type
// #6.146([
-// kind: uint8,
-// entitlements: +[string]
+// kind: uint,
+// entitlements: [+ tstr],
// ])
//
// entitlement-map-authorization-type =
//
// ; cbor-tag-entitlement-map-authorization-type
-// #6.147(entitlement: string)
+// #6.147(tstr)
//
// authorization-type-value =
//
@@ -397,8 +397,8 @@ func (e *Encoder) encodeReferenceType(
//
// ; cbor-tag-entitlement-set-authorization-type-value
// #6.195([
-// kind: uint8,
-// entitlements: +[string]
+// kind: uint,
+// entitlements: [+ tstr],
// ])
//
// entitlement-map-authorization-type-value =
@@ -442,8 +442,8 @@ func (e *Encoder) encodeAuthorization(
//
// ; cbor-tag-entitlement-set-authorization-type
// #6.146([
-// kind: uint8,
-// entitlements: +[string]
+// kind: uint,
+// entitlements: [+ tstr],
// ])
//
// or
@@ -452,8 +452,8 @@ func (e *Encoder) encodeAuthorization(
//
// ; cbor-tag-entitlement-set-authorization-type-value
// #6.195([
-// kind: uint8,
-// entitlements: +[string]
+// kind: uint,
+// entitlements: [+ tstr],
// ])
func (e *Encoder) encodeEntitlementSetAuthorizationWithRawTag(
auth *cadence.EntitlementSetAuthorization,
@@ -604,8 +604,7 @@ func (e *Encoder) encodeReferenceTypeWithRawTag(
//
// ; cbor-tag-intersection-type
// #6.143([
-// type: inline-type / nil,
-// types: [* inline-type]
+// types: [+ inline-type]
// ])
func (e *Encoder) encodeIntersectionType(typ *cadence.IntersectionType, tids ccfTypeIDByCadenceType) error {
rawTagNum := []byte{0xd8, CBORTagIntersectionType}
diff --git a/encoding/json/encoding_test.go b/encoding/json/encoding_test.go
index 5a22360dd0..da52ff3cc8 100644
--- a/encoding/json/encoding_test.go
+++ b/encoding/json/encoding_test.go
@@ -28,14 +28,13 @@ import (
"github.com/stretchr/testify/assert"
"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/tests/checker"
-
- "github.com/onflow/cadence"
"github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
type encodeTest struct {
@@ -1123,7 +1122,7 @@ func TestEncodeDictionary(t *testing.T) {
}
func exportFromScript(t *testing.T, code string) cadence.Value {
- checker, err := checker.ParseAndCheck(t, code)
+ checker, err := ParseAndCheck(t, code)
require.NoError(t, err)
var uuid uint64 = 0
@@ -1337,7 +1336,7 @@ func TestEncodeStruct(t *testing.T) {
t.Parallel()
simpleStructType := cadence.NewStructType(
- utils.TestLocation,
+ TestLocation,
"FooStruct",
[]cadence.Field{
{
@@ -1390,7 +1389,7 @@ func TestEncodeStruct(t *testing.T) {
fooResourceType := newFooResourceType()
resourceStructType := cadence.NewStructType(
- utils.TestLocation,
+ TestLocation,
"FooStruct",
[]cadence.Field{
{
@@ -1499,7 +1498,7 @@ func TestEncodeEvent(t *testing.T) {
t.Parallel()
simpleEventType := cadence.NewEventType(
- utils.TestLocation,
+ TestLocation,
"FooEvent",
[]cadence.Field{
{
@@ -1552,7 +1551,7 @@ func TestEncodeEvent(t *testing.T) {
fooResourceType := newFooResourceType()
resourceEventType := cadence.NewEventType(
- utils.TestLocation,
+ TestLocation,
"FooEvent",
[]cadence.Field{
{
@@ -1625,7 +1624,7 @@ func TestEncodeContract(t *testing.T) {
t.Parallel()
simpleContractType := cadence.NewContractType(
- utils.TestLocation,
+ TestLocation,
"FooContract",
[]cadence.Field{
{
@@ -1678,7 +1677,7 @@ func TestEncodeContract(t *testing.T) {
fooResourceType := newFooResourceType()
resourceContractType := cadence.NewContractType(
- utils.TestLocation,
+ TestLocation,
"FooContract",
[]cadence.Field{
{
@@ -1916,7 +1915,7 @@ func TestEncodeType(t *testing.T) {
t,
cadence.TypeValue{
StaticType: cadence.NewStructType(
- utils.TestLocation,
+ TestLocation,
"S",
[]cadence.Field{
{Identifier: "foo", Type: cadence.IntType},
@@ -1977,7 +1976,7 @@ func TestEncodeType(t *testing.T) {
t,
cadence.TypeValue{
StaticType: cadence.NewResourceType(
- utils.TestLocation,
+ TestLocation,
"R",
[]cadence.Field{
{Identifier: "foo", Type: cadence.IntType},
@@ -2038,7 +2037,7 @@ func TestEncodeType(t *testing.T) {
t,
cadence.TypeValue{
StaticType: cadence.NewContractType(
- utils.TestLocation,
+ TestLocation,
"C",
[]cadence.Field{
{Identifier: "foo", Type: cadence.IntType},
@@ -2099,7 +2098,7 @@ func TestEncodeType(t *testing.T) {
t,
cadence.TypeValue{
StaticType: cadence.NewStructInterfaceType(
- utils.TestLocation,
+ TestLocation,
"S",
[]cadence.Field{
{Identifier: "foo", Type: cadence.IntType},
@@ -2160,7 +2159,7 @@ func TestEncodeType(t *testing.T) {
t,
cadence.TypeValue{
StaticType: cadence.NewResourceInterfaceType(
- utils.TestLocation,
+ TestLocation,
"R",
[]cadence.Field{
{Identifier: "foo", Type: cadence.IntType},
@@ -2221,7 +2220,7 @@ func TestEncodeType(t *testing.T) {
t,
cadence.TypeValue{
StaticType: cadence.NewContractInterfaceType(
- utils.TestLocation,
+ TestLocation,
"C",
[]cadence.Field{
{Identifier: "foo", Type: cadence.IntType},
@@ -2282,7 +2281,7 @@ func TestEncodeType(t *testing.T) {
t,
cadence.TypeValue{
StaticType: cadence.NewEventType(
- utils.TestLocation,
+ TestLocation,
"E",
[]cadence.Field{
{Identifier: "foo", Type: cadence.IntType},
@@ -2341,7 +2340,7 @@ func TestEncodeType(t *testing.T) {
t,
cadence.TypeValue{
StaticType: cadence.NewEnumType(
- utils.TestLocation,
+ TestLocation,
"E",
cadence.StringType,
[]cadence.Field{
@@ -3317,7 +3316,7 @@ func TestExportRecursiveType(t *testing.T) {
},
}
ty := cadence.NewResourceType(
- utils.TestLocation,
+ TestLocation,
"Foo",
fields,
nil,
@@ -3368,7 +3367,7 @@ func TestExportTypeValueRecursiveType(t *testing.T) {
},
}
ty := cadence.NewResourceType(
- utils.TestLocation,
+ TestLocation,
"Foo",
fields,
[][]cadence.Parameter{},
@@ -3415,14 +3414,14 @@ func TestExportTypeValueRecursiveType(t *testing.T) {
t.Parallel()
fooTy := cadence.NewResourceType(
- utils.TestLocation,
+ TestLocation,
"Foo",
[]cadence.Field{},
[][]cadence.Parameter{},
)
barTy := cadence.NewResourceType(
- utils.TestLocation,
+ TestLocation,
"Bar",
[]cadence.Field{
{
@@ -3638,7 +3637,7 @@ func testDecode(t *testing.T, actualJSON string, expectedVal cadence.Value, opti
func newFooResourceType() *cadence.ResourceType {
return cadence.NewResourceType(
- utils.TestLocation,
+ TestLocation,
"Foo",
[]cadence.Field{
{
diff --git a/fuzz.go b/fuzz.go
index 35774a3137..3b98f72655 100644
--- a/fuzz.go
+++ b/fuzz.go
@@ -23,7 +23,7 @@ import (
"github.com/onflow/cadence/parser"
"github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func Fuzz(data []byte) int {
@@ -40,7 +40,7 @@ func Fuzz(data []byte) int {
checker, err := sema.NewChecker(
program,
- utils.TestLocation,
+ TestLocation,
nil,
&sema.Config{
AccessCheckMode: sema.AccessCheckModeNotSpecifiedUnrestricted,
diff --git a/tests/fuzz/crashers_test.go b/fuzz/crashers_test.go
similarity index 96%
rename from tests/fuzz/crashers_test.go
rename to fuzz/crashers_test.go
index b52a889d73..9ac802ac36 100644
--- a/tests/fuzz/crashers_test.go
+++ b/fuzz/crashers_test.go
@@ -28,7 +28,7 @@ import (
"github.com/onflow/cadence"
)
-const crashersDir = "../../../crashers"
+const crashersDir = "crashers"
func TestCrashers(t *testing.T) {
diff --git a/tests/interpreter/account_test.go b/interpreter/account_test.go
similarity index 99%
rename from tests/interpreter/account_test.go
rename to interpreter/account_test.go
index 9ef518efb9..a003477a56 100644
--- a/tests/interpreter/account_test.go
+++ b/interpreter/account_test.go
@@ -34,7 +34,8 @@ import (
"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/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
)
type storageKey struct {
diff --git a/tests/interpreter/arithmetic_test.go b/interpreter/arithmetic_test.go
similarity index 99%
rename from tests/interpreter/arithmetic_test.go
rename to interpreter/arithmetic_test.go
index 4c56b41345..86d966ac92 100644
--- a/tests/interpreter/arithmetic_test.go
+++ b/interpreter/arithmetic_test.go
@@ -29,7 +29,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/interpreter"
"github.com/onflow/cadence/sema"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
)
var integerTestValues = map[string]interpreter.NumberValue{
diff --git a/tests/interpreter/array_test.go b/interpreter/array_test.go
similarity index 100%
rename from tests/interpreter/array_test.go
rename to interpreter/array_test.go
diff --git a/tests/interpreter/attachments_test.go b/interpreter/attachments_test.go
similarity index 98%
rename from tests/interpreter/attachments_test.go
rename to interpreter/attachments_test.go
index fb2fe3657f..384ee9f647 100644
--- a/tests/interpreter/attachments_test.go
+++ b/interpreter/attachments_test.go
@@ -26,7 +26,7 @@ import (
"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/test_utils/interpreter_utils"
"github.com/stretchr/testify/require"
)
@@ -1265,9 +1265,6 @@ func TestInterpretAttachmentDestructor(t *testing.T) {
return nil
},
},
- CheckerConfig: &sema.Config{
- AttachmentsEnabled: true,
- },
})
require.NoError(t, err)
@@ -1315,9 +1312,6 @@ func TestInterpretAttachmentDestructor(t *testing.T) {
return nil
},
},
- CheckerConfig: &sema.Config{
- AttachmentsEnabled: true,
- },
})
require.NoError(t, err)
@@ -1361,9 +1355,6 @@ func TestInterpretAttachmentDestructor(t *testing.T) {
return nil
},
},
- CheckerConfig: &sema.Config{
- AttachmentsEnabled: true,
- },
})
require.NoError(t, err)
@@ -1410,9 +1401,6 @@ func TestInterpretAttachmentDestructor(t *testing.T) {
return nil
},
},
- CheckerConfig: &sema.Config{
- AttachmentsEnabled: true,
- },
})
require.NoError(t, err)
@@ -1463,9 +1451,6 @@ func TestInterpretAttachmentDestructor(t *testing.T) {
return nil
},
},
- CheckerConfig: &sema.Config{
- AttachmentsEnabled: true,
- },
})
require.NoError(t, err)
@@ -1524,9 +1509,6 @@ func TestInterpretAttachmentDestructor(t *testing.T) {
return nil
},
},
- CheckerConfig: &sema.Config{
- AttachmentsEnabled: true,
- },
})
require.NoError(t, err)
@@ -1582,9 +1564,9 @@ func TestInterpretAttachmentResourceReferenceInvalidation(t *testing.T) {
access(all) fun returnSameRef(_ ref: &A): &A {
return ref
- }`, sema.Config{
- AttachmentsEnabled: true,
- })
+ }`,
+ sema.Config{},
+ )
_, err := inter.Invoke("test")
require.ErrorAs(t, err, &interpreter.InvalidatedResourceReferenceError{})
@@ -1611,9 +1593,9 @@ func TestInterpretAttachmentResourceReferenceInvalidation(t *testing.T) {
access(all) fun returnSameRef(_ ref: &A): &A {
return ref
- }`, sema.Config{
- AttachmentsEnabled: true,
- })
+ }`,
+ sema.Config{},
+ )
_, err := inter.Invoke("test")
require.ErrorAs(t, err, &interpreter.InvalidatedResourceReferenceError{})
@@ -1661,9 +1643,9 @@ func TestInterpretAttachmentResourceReferenceInvalidation(t *testing.T) {
access(all) fun returnSameRef(_ ref: &A): &A {
return ref
- }`, sema.Config{
- AttachmentsEnabled: true,
- })
+ }`,
+ sema.Config{},
+ )
_, err := inter.Invoke("test")
require.ErrorAs(t, err, &interpreter.InvalidatedResourceReferenceError{})
@@ -1706,9 +1688,9 @@ func TestInterpretAttachmentResourceReferenceInvalidation(t *testing.T) {
r2.setID(5)
authAccount.storage.save(<-r2, to: /storage/foo)
return ref!.id
- }`, sema.Config{
- AttachmentsEnabled: true,
- })
+ }`,
+ sema.Config{},
+ )
_, err := inter.Invoke("test")
require.ErrorAs(t, err, &interpreter.InvalidatedResourceReferenceError{})
@@ -1740,9 +1722,9 @@ func TestInterpretAttachmentResourceReferenceInvalidation(t *testing.T) {
access(all) fun returnSameRef(_ ref: &A): &A {
return ref
- }`, sema.Config{
- AttachmentsEnabled: true,
- })
+ }`,
+ sema.Config{},
+ )
_, err := inter.Invoke("test")
require.ErrorAs(t, err, &interpreter.InvalidatedResourceReferenceError{})
@@ -1784,9 +1766,9 @@ func TestInterpretAttachmentResourceReferenceInvalidation(t *testing.T) {
a.setID(5)
authAccount.storage.save(<-r2, to: /storage/foo)
return ref!.id
- }`, sema.Config{
- AttachmentsEnabled: true,
- })
+ }`,
+ sema.Config{},
+ )
_, err := inter.Invoke("test")
require.ErrorAs(t, err, &interpreter.InvalidatedResourceReferenceError{})
@@ -2524,7 +2506,6 @@ func TestInterpretBuiltinCompositeAttachment(t *testing.T) {
BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation {
return baseValueActivation
},
- AttachmentsEnabled: true,
},
Config: &interpreter.Config{
BaseActivationHandler: func(_ common.Location) *interpreter.VariableActivation {
diff --git a/tests/interpreter/bitwise_test.go b/interpreter/bitwise_test.go
similarity index 99%
rename from tests/interpreter/bitwise_test.go
rename to interpreter/bitwise_test.go
index b0e9e9cd74..a288e7e667 100644
--- a/tests/interpreter/bitwise_test.go
+++ b/interpreter/bitwise_test.go
@@ -24,7 +24,7 @@ import (
"github.com/onflow/cadence/interpreter"
"github.com/onflow/cadence/sema"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
)
var bitwiseTestValueFunctions = map[string]func(int) interpreter.NumberValue{
diff --git a/tests/interpreter/builtinfunctions_test.go b/interpreter/builtinfunctions_test.go
similarity index 99%
rename from tests/interpreter/builtinfunctions_test.go
rename to interpreter/builtinfunctions_test.go
index b527af6900..93402c80e5 100644
--- a/tests/interpreter/builtinfunctions_test.go
+++ b/interpreter/builtinfunctions_test.go
@@ -29,7 +29,8 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/interpreter"
"github.com/onflow/cadence/sema"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
)
func TestInterpretToString(t *testing.T) {
diff --git a/tests/interpreter/character_test.go b/interpreter/character_test.go
similarity index 97%
rename from tests/interpreter/character_test.go
rename to interpreter/character_test.go
index 298fb1c604..b079563f09 100644
--- a/tests/interpreter/character_test.go
+++ b/interpreter/character_test.go
@@ -26,7 +26,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/interpreter"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
)
func TestInterpretCharacterUtf8Field(t *testing.T) {
diff --git a/tests/interpreter/composite_value_test.go b/interpreter/composite_value_test.go
similarity index 97%
rename from tests/interpreter/composite_value_test.go
rename to interpreter/composite_value_test.go
index cacf0c145d..de85e30b22 100644
--- a/tests/interpreter/composite_value_test.go
+++ b/interpreter/composite_value_test.go
@@ -29,7 +29,8 @@ import (
"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/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
)
func TestInterpretCompositeValue(t *testing.T) {
diff --git a/tests/interpreter/condition_test.go b/interpreter/condition_test.go
similarity index 99%
rename from tests/interpreter/condition_test.go
rename to interpreter/condition_test.go
index 34d56d2f14..ef1df7b638 100644
--- a/tests/interpreter/condition_test.go
+++ b/interpreter/condition_test.go
@@ -31,8 +31,9 @@ import (
"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"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestInterpretFunctionPreTestCondition(t *testing.T) {
@@ -855,7 +856,7 @@ func TestInterpretInitializerWithInterfacePreCondition(t *testing.T) {
)
}
- checker, err := checker.ParseAndCheck(t,
+ checker, err := ParseAndCheck(t,
fmt.Sprintf(
`
access(all)
diff --git a/tests/interpreter/container_mutation_test.go b/interpreter/container_mutation_test.go
similarity index 99%
rename from tests/interpreter/container_mutation_test.go
rename to interpreter/container_mutation_test.go
index 10a37e6a30..5f67eab2b1 100644
--- a/tests/interpreter/container_mutation_test.go
+++ b/interpreter/container_mutation_test.go
@@ -29,10 +29,11 @@ import (
"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/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
)
-func TestInterpetArrayMutation(t *testing.T) {
+func TestInterpretArrayMutation(t *testing.T) {
t.Parallel()
diff --git a/tests/interpreter/contract_test.go b/interpreter/contract_test.go
similarity index 98%
rename from tests/interpreter/contract_test.go
rename to interpreter/contract_test.go
index e4f9e8b30f..6d437fdec1 100644
--- a/tests/interpreter/contract_test.go
+++ b/interpreter/contract_test.go
@@ -24,7 +24,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/interpreter"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func TestInterpretContractUseBeforeInitializationComplete(t *testing.T) {
diff --git a/interpreter/conversion_test.go b/interpreter/conversion_test.go
index a3eb0122a0..a798b10fb0 100644
--- a/interpreter/conversion_test.go
+++ b/interpreter/conversion_test.go
@@ -27,7 +27,7 @@ import (
"github.com/onflow/cadence/common"
. "github.com/onflow/cadence/interpreter"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func TestByteArrayValueToByteSlice(t *testing.T) {
diff --git a/tests/interpreter/declaration_test.go b/interpreter/declaration_test.go
similarity index 100%
rename from tests/interpreter/declaration_test.go
rename to interpreter/declaration_test.go
diff --git a/interpreter/deepcopyremove_test.go b/interpreter/deepcopyremove_test.go
index 5521332900..0f12a4b034 100644
--- a/interpreter/deepcopyremove_test.go
+++ b/interpreter/deepcopyremove_test.go
@@ -26,8 +26,8 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/common"
- . "github.com/onflow/cadence/interpreter"
- "github.com/onflow/cadence/tests/utils"
+ "github.com/onflow/cadence/interpreter"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func TestValueDeepCopyAndDeepRemove(t *testing.T) {
@@ -38,49 +38,49 @@ func TestValueDeepCopyAndDeepRemove(t *testing.T) {
storage := newUnmeteredInMemoryStorage()
- inter, err := NewInterpreter(
+ inter, err := interpreter.NewInterpreter(
nil,
- utils.TestLocation,
- &Config{
+ TestLocation,
+ &interpreter.Config{
Storage: storage,
},
)
require.NoError(t, err)
- dictionaryStaticType := &DictionaryStaticType{
- KeyType: PrimitiveStaticTypeString,
- ValueType: PrimitiveStaticTypeInt256,
+ dictionaryStaticType := &interpreter.DictionaryStaticType{
+ KeyType: interpreter.PrimitiveStaticTypeString,
+ ValueType: interpreter.PrimitiveStaticTypeInt256,
}
- dictValueKey := NewUnmeteredStringValue(
+ dictValueKey := interpreter.NewUnmeteredStringValue(
strings.Repeat("x", int(atree.MaxInlineMapKeySize()+1)),
)
- dictValueValue := NewUnmeteredInt256ValueFromInt64(1)
- dictValue := NewDictionaryValue(
+ dictValueValue := interpreter.NewUnmeteredInt256ValueFromInt64(1)
+ dictValue := interpreter.NewDictionaryValue(
inter,
- EmptyLocationRange,
+ interpreter.EmptyLocationRange,
dictionaryStaticType,
dictValueKey, dictValueValue,
)
- arrayValue := NewArrayValue(
+ arrayValue := interpreter.NewArrayValue(
inter,
- EmptyLocationRange,
- &VariableSizedStaticType{
+ interpreter.EmptyLocationRange,
+ &interpreter.VariableSizedStaticType{
Type: dictionaryStaticType,
},
common.ZeroAddress,
dictValue,
)
- optionalValue := NewUnmeteredSomeValueNonCopying(arrayValue)
+ optionalValue := interpreter.NewUnmeteredSomeValueNonCopying(arrayValue)
compositeValue := newTestCompositeValue(inter, address)
compositeValue.SetMember(
inter,
- EmptyLocationRange,
+ interpreter.EmptyLocationRange,
"value",
optionalValue,
)
@@ -99,7 +99,3 @@ func TestValueDeepCopyAndDeepRemove(t *testing.T) {
require.Equal(t, 1, count)
}
-
-func newUnmeteredInMemoryStorage() InMemoryStorage {
- return NewInMemoryStorage(nil)
-}
diff --git a/tests/interpreter/dictionary_test.go b/interpreter/dictionary_test.go
similarity index 100%
rename from tests/interpreter/dictionary_test.go
rename to interpreter/dictionary_test.go
diff --git a/tests/interpreter/dynamic_casting_test.go b/interpreter/dynamic_casting_test.go
similarity index 99%
rename from tests/interpreter/dynamic_casting_test.go
rename to interpreter/dynamic_casting_test.go
index 03b532b119..255a7b719e 100644
--- a/tests/interpreter/dynamic_casting_test.go
+++ b/interpreter/dynamic_casting_test.go
@@ -32,7 +32,8 @@ import (
"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/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
)
// dynamic casting operation -> returns optional
diff --git a/interpreter/encoding_test.go b/interpreter/encoding_test.go
index 5bcc19bc7e..2eb4047209 100644
--- a/interpreter/encoding_test.go
+++ b/interpreter/encoding_test.go
@@ -30,12 +30,11 @@ 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/sema"
-
- "github.com/onflow/cadence/common"
- "github.com/onflow/cadence/tests/utils"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
)
type encodeDecodeTest struct {
@@ -492,7 +491,7 @@ func TestEncodeDecodeComposite(t *testing.T) {
expected := NewCompositeValue(
inter,
EmptyLocationRange,
- utils.TestLocation,
+ TestLocation,
"TestStruct",
common.CompositeKindStructure,
nil,
@@ -530,7 +529,7 @@ func TestEncodeDecodeComposite(t *testing.T) {
expected := NewCompositeValue(
inter,
EmptyLocationRange,
- utils.TestLocation,
+ TestLocation,
"TestResource",
common.CompositeKindResource,
fields,
@@ -4256,7 +4255,7 @@ func TestEncodeDecodeStorageCapabilityControllerValue(t *testing.T) {
BorrowType: &ReferenceStaticType{
ReferencedType: NewCompositeStaticTypeComputeTypeID(
nil,
- utils.TestLocation,
+ TestLocation,
"SimpleStruct",
),
Authorization: UnauthorizedAccess,
@@ -4305,7 +4304,7 @@ func TestEncodeDecodeStorageCapabilityControllerValue(t *testing.T) {
value := &StorageCapabilityControllerValue{
TargetPath: publicPathValue,
BorrowType: &ReferenceStaticType{
- ReferencedType: NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "SimpleInterface"),
+ ReferencedType: NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "SimpleInterface"),
Authorization: UnauthorizedAccess,
},
CapabilityID: capabilityID,
@@ -4485,8 +4484,8 @@ func TestEncodeDecodeStorageCapabilityControllerValue(t *testing.T) {
BorrowType: &ReferenceStaticType{
ReferencedType: &IntersectionStaticType{
Types: []*InterfaceStaticType{
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "I1"),
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "I2"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "I1"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "I2"),
},
},
Authorization: UnauthorizedAccess,
@@ -4705,7 +4704,7 @@ func TestEncodeDecodeAccountCapabilityControllerValue(t *testing.T) {
BorrowType: &ReferenceStaticType{
ReferencedType: &IntersectionStaticType{
Types: []*InterfaceStaticType{
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "SimpleInterface"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "SimpleInterface"),
},
},
Authorization: UnauthorizedAccess,
diff --git a/tests/interpreter/entitlements_test.go b/interpreter/entitlements_test.go
similarity index 99%
rename from tests/interpreter/entitlements_test.go
rename to interpreter/entitlements_test.go
index 14106837ff..79d368de70 100644
--- a/tests/interpreter/entitlements_test.go
+++ b/interpreter/entitlements_test.go
@@ -28,7 +28,7 @@ import (
"github.com/onflow/cadence/interpreter"
"github.com/onflow/cadence/sema"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
)
func TestInterpretEntitledReferenceRuntimeTypes(t *testing.T) {
@@ -1441,9 +1441,9 @@ func TestInterpretEntitlementMappingFields(t *testing.T) {
let i = ref?.foo()
return i!
}
- `, sema.Config{
- AttachmentsEnabled: false,
- })
+ `,
+ sema.Config{},
+ )
value, err := inter.Invoke("test")
require.NoError(t, err)
@@ -2534,9 +2534,9 @@ func TestInterpretEntitledAttachments(t *testing.T) {
let ref = account.storage.borrow(from: /storage/foo)!
return ref[A]!
}
- `, sema.Config{
- AttachmentsEnabled: true,
- })
+ `,
+ sema.Config{},
+ )
value, err := inter.Invoke("test")
require.NoError(t, err)
@@ -2576,9 +2576,9 @@ func TestInterpretEntitledAttachments(t *testing.T) {
let ref = account.storage.borrow(from: /storage/foo)!
return ref[A]!.entitled()
}
- `, sema.Config{
- AttachmentsEnabled: true,
- })
+ `,
+ sema.Config{},
+ )
value, err := inter.Invoke("test")
require.NoError(t, err)
@@ -2618,9 +2618,9 @@ func TestInterpretEntitledAttachments(t *testing.T) {
let ref = account.storage.borrow(from: /storage/foo)!
return ref[A]!.entitled()
}
- `, sema.Config{
- AttachmentsEnabled: true,
- })
+ `,
+ sema.Config{},
+ )
value, err := inter.Invoke("test")
require.NoError(t, err)
diff --git a/tests/interpreter/enum_test.go b/interpreter/enum_test.go
similarity index 98%
rename from tests/interpreter/enum_test.go
rename to interpreter/enum_test.go
index 54e563c784..fa3e9a0c05 100644
--- a/tests/interpreter/enum_test.go
+++ b/interpreter/enum_test.go
@@ -24,10 +24,9 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- . "github.com/onflow/cadence/tests/utils"
-
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/interpreter"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
)
func TestInterpretEnum(t *testing.T) {
diff --git a/tests/interpreter/equality_test.go b/interpreter/equality_test.go
similarity index 98%
rename from tests/interpreter/equality_test.go
rename to interpreter/equality_test.go
index dee8dc54c9..68cfd10f04 100644
--- a/tests/interpreter/equality_test.go
+++ b/interpreter/equality_test.go
@@ -31,7 +31,8 @@ import (
"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/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
)
func TestInterpretEquality(t *testing.T) {
diff --git a/interpreter/errors_test.go b/interpreter/errors_test.go
index 568158cf58..4c120a0994 100644
--- a/interpreter/errors_test.go
+++ b/interpreter/errors_test.go
@@ -26,7 +26,7 @@ import (
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/common"
. "github.com/onflow/cadence/interpreter"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func TestOverwriteError_Error(t *testing.T) {
@@ -47,11 +47,11 @@ func TestErrorOutputIncludesLocationRage(t *testing.T) {
t.Parallel()
require.Equal(t,
Error{
- Location: utils.TestLocation,
+ Location: TestLocation,
Err: DereferenceError{
Cause: "the value being referenced has been destroyed or moved",
LocationRange: LocationRange{
- Location: utils.TestLocation,
+ Location: TestLocation,
HasPosition: ast.Range{
StartPos: ast.Position{Offset: 0, Column: 0, Line: 0},
EndPos: ast.Position{Offset: 0, Column: 0, Line: 0},
diff --git a/tests/interpreter/fixedpoint_test.go b/interpreter/fixedpoint_test.go
similarity index 99%
rename from tests/interpreter/fixedpoint_test.go
rename to interpreter/fixedpoint_test.go
index 0fe9d9258b..fa19591104 100644
--- a/tests/interpreter/fixedpoint_test.go
+++ b/interpreter/fixedpoint_test.go
@@ -29,7 +29,8 @@ import (
"github.com/onflow/cadence/fixedpoint"
"github.com/onflow/cadence/interpreter"
"github.com/onflow/cadence/sema"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
)
func TestInterpretNegativeZeroFixedPoint(t *testing.T) {
diff --git a/tests/interpreter/for_test.go b/interpreter/for_test.go
similarity index 99%
rename from tests/interpreter/for_test.go
rename to interpreter/for_test.go
index 370546ffdf..48246d29b0 100644
--- a/tests/interpreter/for_test.go
+++ b/interpreter/for_test.go
@@ -30,7 +30,8 @@ import (
"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/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
)
func TestInterpretForStatement(t *testing.T) {
diff --git a/tests/interpreter/function_test.go b/interpreter/function_test.go
similarity index 96%
rename from tests/interpreter/function_test.go
rename to interpreter/function_test.go
index f2e4675e4e..b16b77c642 100644
--- a/tests/interpreter/function_test.go
+++ b/interpreter/function_test.go
@@ -27,8 +27,8 @@ import (
"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"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestInterpretResultVariable(t *testing.T) {
@@ -60,7 +60,7 @@ func TestInterpretResultVariable(t *testing.T) {
require.IsType(t, &interpreter.CompositeValue{}, result)
resource := result.(*interpreter.CompositeValue)
assert.Equal(t, common.CompositeKindResource, resource.Kind)
- utils.AssertValuesEqual(
+ AssertValuesEqual(
t,
inter,
interpreter.UInt8Value(1),
@@ -98,7 +98,7 @@ func TestInterpretResultVariable(t *testing.T) {
resource := innerValue.(*interpreter.CompositeValue)
assert.Equal(t, common.CompositeKindResource, resource.Kind)
- utils.AssertValuesEqual(
+ AssertValuesEqual(
t,
inter,
interpreter.UInt8Value(1),
@@ -162,7 +162,7 @@ func TestInterpretResultVariable(t *testing.T) {
resource := innerValue.(*interpreter.CompositeValue)
assert.Equal(t, common.CompositeKindResource, resource.Kind)
- utils.AssertValuesEqual(
+ AssertValuesEqual(
t,
inter,
interpreter.UInt8Value(1),
@@ -221,7 +221,7 @@ func TestInterpretResultVariable(t *testing.T) {
)
require.NoError(t, err)
require.Len(t, checkerErrors, 1)
- checkerError := checker.RequireCheckerErrors(t, checkerErrors[0], 1)
+ checkerError := RequireCheckerErrors(t, checkerErrors[0], 1)
require.IsType(t, &sema.PurityError{}, checkerError[0])
_, err = inter.Invoke("main")
@@ -280,7 +280,7 @@ func TestInterpretResultVariable(t *testing.T) {
)
require.NoError(t, err)
require.Len(t, checkerErrors, 1)
- checkerError := checker.RequireCheckerErrors(t, checkerErrors[0], 1)
+ checkerError := RequireCheckerErrors(t, checkerErrors[0], 1)
require.IsType(t, &sema.PurityError{}, checkerError[0])
_, err = inter.Invoke("main")
@@ -316,7 +316,7 @@ func TestInterpretFunctionSubtyping(t *testing.T) {
result, err := inter.Invoke("main")
require.NoError(t, err)
- utils.AssertValuesEqual(
+ AssertValuesEqual(
t,
inter,
interpreter.NewUnmeteredSomeValueNonCopying(interpreter.UInt8Value(4)),
diff --git a/tests/interpreter/if_test.go b/interpreter/if_test.go
similarity index 97%
rename from tests/interpreter/if_test.go
rename to interpreter/if_test.go
index cc7efb83c2..ef92e2a576 100644
--- a/tests/interpreter/if_test.go
+++ b/interpreter/if_test.go
@@ -24,11 +24,10 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- . "github.com/onflow/cadence/tests/utils"
-
"github.com/onflow/cadence/interpreter"
"github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/checker"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestInterpretIfStatement(t *testing.T) {
@@ -83,7 +82,7 @@ func TestInterpretIfStatement(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 2)
+ errs := RequireCheckerErrors(t, err, 2)
assert.IsType(t, &sema.UnreachableStatementError{}, errs[0])
assert.IsType(t, &sema.UnreachableStatementError{}, errs[1])
diff --git a/tests/interpreter/import_test.go b/interpreter/import_test.go
similarity index 93%
rename from tests/interpreter/import_test.go
rename to interpreter/import_test.go
index 45204a23c8..b1599e2a09 100644
--- a/tests/interpreter/import_test.go
+++ b/interpreter/import_test.go
@@ -29,8 +29,9 @@ import (
"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"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestInterpretVirtualImport(t *testing.T) {
@@ -154,7 +155,7 @@ func TestInterpretImportMultipleProgramsFromLocation(t *testing.T) {
address := common.MustBytesToAddress([]byte{0x1})
- importedCheckerA, err := checker.ParseAndCheckWithOptions(t,
+ importedCheckerA, err := ParseAndCheckWithOptions(t,
`
// this function *SHOULD* be imported in the importing program
access(all) fun a(): Int {
@@ -166,7 +167,7 @@ func TestInterpretImportMultipleProgramsFromLocation(t *testing.T) {
return 11
}
`,
- checker.ParseAndCheckOptions{
+ ParseAndCheckOptions{
Location: common.AddressLocation{
Address: address,
Name: "a",
@@ -175,7 +176,7 @@ func TestInterpretImportMultipleProgramsFromLocation(t *testing.T) {
)
require.NoError(t, err)
- importedCheckerB, err := checker.ParseAndCheckWithOptions(t,
+ importedCheckerB, err := ParseAndCheckWithOptions(t,
`
// this function *SHOULD* be imported in the importing program
access(all) fun b(): Int {
@@ -187,7 +188,7 @@ func TestInterpretImportMultipleProgramsFromLocation(t *testing.T) {
return 22
}
`,
- checker.ParseAndCheckOptions{
+ ParseAndCheckOptions{
Location: common.AddressLocation{
Address: address,
Name: "b",
@@ -196,7 +197,7 @@ func TestInterpretImportMultipleProgramsFromLocation(t *testing.T) {
)
require.NoError(t, err)
- importingChecker, err := checker.ParseAndCheckWithOptions(t,
+ importingChecker, err := ParseAndCheckWithOptions(t,
`
import a, b from 0x1
@@ -204,7 +205,7 @@ func TestInterpretImportMultipleProgramsFromLocation(t *testing.T) {
return a() + b()
}
`,
- checker.ParseAndCheckOptions{
+ ParseAndCheckOptions{
Config: &sema.Config{
LocationHandler: func(identifiers []ast.Identifier, location common.Location) (result []sema.ResolvedLocation, err error) {
@@ -316,11 +317,11 @@ func TestInterpretResourceConstructionThroughIndirectImport(t *testing.T) {
address := common.MustBytesToAddress([]byte{0x1})
- importedChecker, err := checker.ParseAndCheckWithOptions(t,
+ importedChecker, err := ParseAndCheckWithOptions(t,
`
resource R {}
`,
- checker.ParseAndCheckOptions{
+ ParseAndCheckOptions{
Location: common.AddressLocation{
Address: address,
},
@@ -328,7 +329,7 @@ func TestInterpretResourceConstructionThroughIndirectImport(t *testing.T) {
)
require.NoError(t, err)
- importingChecker, err := checker.ParseAndCheckWithOptions(t,
+ importingChecker, err := ParseAndCheckWithOptions(t,
`
import R from 0x1
@@ -337,7 +338,7 @@ func TestInterpretResourceConstructionThroughIndirectImport(t *testing.T) {
destroy r
}
`,
- checker.ParseAndCheckOptions{
+ ParseAndCheckOptions{
Config: &sema.Config{
ImportHandler: func(checker *sema.Checker, importedLocation common.Location, _ ast.Range) (sema.Import, error) {
require.IsType(t, common.AddressLocation{}, importedLocation)
@@ -396,7 +397,7 @@ func TestInterpretResourceConstructionThroughIndirectImport(t *testing.T) {
require.ErrorAs(t, err, &resourceConstructionError)
assert.Equal(t,
- checker.RequireGlobalType(t, importedChecker.Elaboration, "R"),
+ RequireGlobalType(t, importedChecker.Elaboration, "R"),
resourceConstructionError.CompositeType,
)
}
diff --git a/tests/interpreter/indexing_test.go b/interpreter/indexing_test.go
similarity index 100%
rename from tests/interpreter/indexing_test.go
rename to interpreter/indexing_test.go
diff --git a/interpreter/inspect_test.go b/interpreter/inspect_test.go
index da6e78537e..e0ea1ff19f 100644
--- a/interpreter/inspect_test.go
+++ b/interpreter/inspect_test.go
@@ -23,7 +23,7 @@ import (
"github.com/onflow/cadence/common"
. "github.com/onflow/cadence/interpreter"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
)
func TestInspectValue(t *testing.T) {
diff --git a/tests/interpreter/integers_test.go b/interpreter/integers_test.go
similarity index 99%
rename from tests/interpreter/integers_test.go
rename to interpreter/integers_test.go
index 9da93b1745..86f1eb4f22 100644
--- a/tests/interpreter/integers_test.go
+++ b/interpreter/integers_test.go
@@ -28,10 +28,10 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- . "github.com/onflow/cadence/tests/utils"
-
"github.com/onflow/cadence/interpreter"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
)
var testIntegerTypesAndValues = map[string]interpreter.Value{
diff --git a/tests/interpreter/interface_test.go b/interpreter/interface_test.go
similarity index 99%
rename from tests/interpreter/interface_test.go
rename to interpreter/interface_test.go
index b61c422ba5..09580c8171 100644
--- a/tests/interpreter/interface_test.go
+++ b/interpreter/interface_test.go
@@ -29,7 +29,7 @@ import (
"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/test_utils/common_utils"
)
func TestInterpretInterfaceDefaultImplementation(t *testing.T) {
@@ -456,7 +456,7 @@ func TestInterpretInterfaceFunctionConditionsInheritance(t *testing.T) {
// Implementation should satisfy inherited conditions
_, err = inter.Invoke("main", interpreter.NewUnmeteredIntValueFromInt64(5))
- utils.RequireError(t, err)
+ RequireError(t, err)
assert.ErrorAs(t, err, &interpreter.ConditionError{})
})
@@ -496,7 +496,7 @@ func TestInterpretInterfaceFunctionConditionsInheritance(t *testing.T) {
// Implementation should satisfy inherited conditions
_, err = inter.Invoke("main", interpreter.NewUnmeteredIntValueFromInt64(5))
- utils.RequireError(t, err)
+ RequireError(t, err)
assert.ErrorAs(t, err, &interpreter.ConditionError{})
})
@@ -539,11 +539,11 @@ func TestInterpretInterfaceFunctionConditionsInheritance(t *testing.T) {
// Implementation should satisfy both inherited conditions
_, err = inter.Invoke("main", interpreter.NewUnmeteredIntValueFromInt64(5))
- utils.RequireError(t, err)
+ RequireError(t, err)
assert.ErrorAs(t, err, &interpreter.ConditionError{})
_, err = inter.Invoke("main", interpreter.NewUnmeteredIntValueFromInt64(25))
- utils.RequireError(t, err)
+ RequireError(t, err)
assert.ErrorAs(t, err, &interpreter.ConditionError{})
})
@@ -588,11 +588,11 @@ func TestInterpretInterfaceFunctionConditionsInheritance(t *testing.T) {
// Implementation should satisfy both inherited conditions
_, err = inter.Invoke("main", interpreter.NewUnmeteredIntValueFromInt64(5))
- utils.RequireError(t, err)
+ RequireError(t, err)
assert.ErrorAs(t, err, &interpreter.ConditionError{})
_, err = inter.Invoke("main", interpreter.NewUnmeteredIntValueFromInt64(25))
- utils.RequireError(t, err)
+ RequireError(t, err)
assert.ErrorAs(t, err, &interpreter.ConditionError{})
})
diff --git a/interpreter/interpreter_tracing_test.go b/interpreter/interpreter_tracing_test.go
index dfcfc16521..5f2a758fbc 100644
--- a/interpreter/interpreter_tracing_test.go
+++ b/interpreter/interpreter_tracing_test.go
@@ -28,7 +28,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/interpreter"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func setupInterpreterWithTracingCallBack(
@@ -38,7 +38,7 @@ func setupInterpreterWithTracingCallBack(
storage := newUnmeteredInMemoryStorage()
inter, err := interpreter.NewInterpreter(
nil,
- utils.TestLocation,
+ TestLocation,
&interpreter.Config{
OnRecordTrace: func(inter *interpreter.Interpreter,
operationName string,
diff --git a/tests/interpreter/invocation_test.go b/interpreter/invocation_test.go
similarity index 98%
rename from tests/interpreter/invocation_test.go
rename to interpreter/invocation_test.go
index 4e9164f36f..1d08c47f14 100644
--- a/tests/interpreter/invocation_test.go
+++ b/interpreter/invocation_test.go
@@ -28,7 +28,7 @@ import (
"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/test_utils/common_utils"
)
func TestInterpretFunctionInvocationCheckArgumentTypes(t *testing.T) {
diff --git a/tests/interpreter/member_test.go b/interpreter/member_test.go
similarity index 98%
rename from tests/interpreter/member_test.go
rename to interpreter/member_test.go
index 29d14e5b82..f73b4e8be6 100644
--- a/tests/interpreter/member_test.go
+++ b/interpreter/member_test.go
@@ -25,8 +25,8 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/interpreter"
- "github.com/onflow/cadence/tests/checker"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestInterpretMemberAccessType(t *testing.T) {
@@ -407,7 +407,7 @@ func TestInterpretMemberAccessType(t *testing.T) {
value, err := inter.Invoke("S")
require.NoError(t, err)
- sType := checker.RequireGlobalType(t, inter.Program.Elaboration, "S")
+ sType := RequireGlobalType(t, inter.Program.Elaboration, "S")
ref := interpreter.NewUnmeteredEphemeralReferenceValue(inter, interpreter.UnauthorizedAccess, value, sType, interpreter.EmptyLocationRange)
@@ -454,7 +454,7 @@ func TestInterpretMemberAccessType(t *testing.T) {
value, err := inter.Invoke("S2")
require.NoError(t, err)
- sType := checker.RequireGlobalType(t, inter.Program.Elaboration, "S")
+ sType := RequireGlobalType(t, inter.Program.Elaboration, "S")
ref := interpreter.NewUnmeteredEphemeralReferenceValue(inter, interpreter.UnauthorizedAccess, value, sType, interpreter.EmptyLocationRange)
@@ -496,7 +496,7 @@ func TestInterpretMemberAccessType(t *testing.T) {
value, err := inter.Invoke("S")
require.NoError(t, err)
- sType := checker.RequireGlobalType(t, inter.Program.Elaboration, "S")
+ sType := RequireGlobalType(t, inter.Program.Elaboration, "S")
ref := interpreter.NewUnmeteredEphemeralReferenceValue(inter, interpreter.UnauthorizedAccess, value, sType, interpreter.EmptyLocationRange)
@@ -541,7 +541,7 @@ func TestInterpretMemberAccessType(t *testing.T) {
value, err := inter.Invoke("S2")
require.NoError(t, err)
- sType := checker.RequireGlobalType(t, inter.Program.Elaboration, "S")
+ sType := RequireGlobalType(t, inter.Program.Elaboration, "S")
ref := interpreter.NewUnmeteredEphemeralReferenceValue(inter, interpreter.UnauthorizedAccess, value, sType, interpreter.EmptyLocationRange)
diff --git a/tests/interpreter/memory_metering_test.go b/interpreter/memory_metering_test.go
similarity index 99%
rename from tests/interpreter/memory_metering_test.go
rename to interpreter/memory_metering_test.go
index 5de97ddfe5..725ea93037 100644
--- a/tests/interpreter/memory_metering_test.go
+++ b/interpreter/memory_metering_test.go
@@ -23,6 +23,7 @@ import (
"testing"
"github.com/onflow/cadence/activations"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -32,8 +33,7 @@ import (
"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"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
type assumeValidPublicKeyValidator struct{}
@@ -8147,12 +8147,12 @@ func TestInterpretASTMetering(t *testing.T) {
#pragma
`
- importedChecker, err := checker.ParseAndCheckWithOptions(t,
+ importedChecker, err := ParseAndCheckWithOptions(t,
`
let Foo = 1
`,
- checker.ParseAndCheckOptions{
- Location: utils.ImportedLocation,
+ ParseAndCheckOptions{
+ Location: ImportedLocation,
},
)
require.NoError(t, err)
@@ -8444,13 +8444,13 @@ func TestInterpretASTMetering(t *testing.T) {
import B from "string-location"
`
- importedChecker, err := checker.ParseAndCheckWithOptions(t,
+ importedChecker, err := ParseAndCheckWithOptions(t,
`
let A = 1
let B = 1
`,
- checker.ParseAndCheckOptions{
- Location: utils.ImportedLocation,
+ ParseAndCheckOptions{
+ Location: ImportedLocation,
},
)
require.NoError(t, err)
@@ -8960,7 +8960,7 @@ func TestInterpretValueStringConversion(t *testing.T) {
interpreter.NewUnmeteredCapabilityValue(
4,
interpreter.AddressValue{1},
- interpreter.NewCompositeStaticTypeComputeTypeID(nil, utils.TestLocation, "Bar"),
+ interpreter.NewCompositeStaticTypeComputeTypeID(nil, TestLocation, "Bar"),
))
})
diff --git a/tests/interpreter/metatype_test.go b/interpreter/metatype_test.go
similarity index 99%
rename from tests/interpreter/metatype_test.go
rename to interpreter/metatype_test.go
index ad96c6b1d9..edcd83a901 100644
--- a/tests/interpreter/metatype_test.go
+++ b/interpreter/metatype_test.go
@@ -30,7 +30,8 @@ import (
"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/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
)
func TestInterpretMetaTypeEquality(t *testing.T) {
diff --git a/tests/interpreter/metering_test.go b/interpreter/metering_test.go
similarity index 94%
rename from tests/interpreter/metering_test.go
rename to interpreter/metering_test.go
index 243afdba05..267b15d985 100644
--- a/tests/interpreter/metering_test.go
+++ b/interpreter/metering_test.go
@@ -28,28 +28,28 @@ import (
"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"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestInterpretStatementHandler(t *testing.T) {
t.Parallel()
- importedChecker, err := checker.ParseAndCheckWithOptions(t,
+ importedChecker, err := ParseAndCheckWithOptions(t,
`
access(all) fun a() {
true
true
}
`,
- checker.ParseAndCheckOptions{
- Location: utils.ImportedLocation,
+ ParseAndCheckOptions{
+ Location: ImportedLocation,
},
)
require.NoError(t, err)
- importingChecker, err := checker.ParseAndCheckWithOptions(t,
+ importingChecker, err := ParseAndCheckWithOptions(t,
`
import a from "imported"
@@ -69,11 +69,11 @@ func TestInterpretStatementHandler(t *testing.T) {
true
}
`,
- checker.ParseAndCheckOptions{
+ ParseAndCheckOptions{
Config: &sema.Config{
ImportHandler: func(_ *sema.Checker, importedLocation common.Location, _ ast.Range) (sema.Import, error) {
assert.Equal(t,
- utils.ImportedLocation,
+ ImportedLocation,
importedLocation,
)
@@ -116,7 +116,7 @@ func TestInterpretStatementHandler(t *testing.T) {
},
ImportLocationHandler: func(inter *interpreter.Interpreter, location common.Location) interpreter.Import {
assert.Equal(t,
- utils.ImportedLocation,
+ ImportedLocation,
location,
)
@@ -163,7 +163,7 @@ func TestInterpretLoopIterationHandler(t *testing.T) {
t.Parallel()
- importedChecker, err := checker.ParseAndCheckWithOptions(t,
+ importedChecker, err := ParseAndCheckWithOptions(t,
`
access(all) fun a() {
var i = 1
@@ -174,11 +174,11 @@ func TestInterpretLoopIterationHandler(t *testing.T) {
for n in [1, 2, 3, 4, 5] {}
}
`,
- checker.ParseAndCheckOptions{},
+ ParseAndCheckOptions{},
)
require.NoError(t, err)
- importingChecker, err := checker.ParseAndCheckWithOptions(t,
+ importingChecker, err := ParseAndCheckWithOptions(t,
`
import a from "imported"
@@ -193,11 +193,11 @@ func TestInterpretLoopIterationHandler(t *testing.T) {
a()
}
`,
- checker.ParseAndCheckOptions{
+ ParseAndCheckOptions{
Config: &sema.Config{
ImportHandler: func(_ *sema.Checker, importedLocation common.Location, _ ast.Range) (sema.Import, error) {
assert.Equal(t,
- utils.ImportedLocation,
+ ImportedLocation,
importedLocation,
)
@@ -241,7 +241,7 @@ func TestInterpretLoopIterationHandler(t *testing.T) {
},
ImportLocationHandler: func(inter *interpreter.Interpreter, location common.Location) interpreter.Import {
assert.Equal(t,
- utils.ImportedLocation,
+ ImportedLocation,
location,
)
@@ -290,7 +290,7 @@ func TestInterpretFunctionInvocationHandler(t *testing.T) {
t.Parallel()
- importedChecker, err := checker.ParseAndCheckWithOptions(t,
+ importedChecker, err := ParseAndCheckWithOptions(t,
`
access(all) fun a() {}
@@ -302,13 +302,13 @@ func TestInterpretFunctionInvocationHandler(t *testing.T) {
true
}
`,
- checker.ParseAndCheckOptions{
- Location: utils.ImportedLocation,
+ ParseAndCheckOptions{
+ Location: ImportedLocation,
},
)
require.NoError(t, err)
- importingChecker, err := checker.ParseAndCheckWithOptions(t,
+ importingChecker, err := ParseAndCheckWithOptions(t,
`
import b from "imported"
@@ -328,11 +328,11 @@ func TestInterpretFunctionInvocationHandler(t *testing.T) {
true
}
`,
- checker.ParseAndCheckOptions{
+ ParseAndCheckOptions{
Config: &sema.Config{
ImportHandler: func(_ *sema.Checker, importedLocation common.Location, _ ast.Range) (sema.Import, error) {
assert.Equal(t,
- utils.ImportedLocation,
+ ImportedLocation,
importedLocation,
)
@@ -368,7 +368,7 @@ func TestInterpretFunctionInvocationHandler(t *testing.T) {
},
ImportLocationHandler: func(inter *interpreter.Interpreter, location common.Location) interpreter.Import {
assert.Equal(t,
- utils.ImportedLocation,
+ ImportedLocation,
location,
)
diff --git a/tests/interpreter/interpreter_test.go b/interpreter/misc_test.go
similarity index 98%
rename from tests/interpreter/interpreter_test.go
rename to interpreter/misc_test.go
index 7ae2fb8abc..8ec9d08532 100644
--- a/tests/interpreter/interpreter_test.go
+++ b/interpreter/misc_test.go
@@ -39,8 +39,9 @@ import (
"github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
- "github.com/onflow/cadence/tests/checker"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
type ParseCheckAndInterpretOptions struct {
@@ -50,12 +51,7 @@ type ParseCheckAndInterpretOptions struct {
}
func parseCheckAndInterpret(t testing.TB, code string) *interpreter.Interpreter {
- inter, err := parseCheckAndInterpretWithOptions(t, code, ParseCheckAndInterpretOptions{
- // attachments should be on by default in tests
- CheckerConfig: &sema.Config{
- AttachmentsEnabled: true,
- },
- })
+ inter, err := parseCheckAndInterpretWithOptions(t, code, ParseCheckAndInterpretOptions{})
require.NoError(t, err)
return inter
}
@@ -173,9 +169,9 @@ func parseCheckAndInterpretWithOptionsAndMemoryMetering(
err error,
) {
- checker, err := checker.ParseAndCheckWithOptionsAndMemoryMetering(t,
+ checker, err := ParseAndCheckWithOptionsAndMemoryMetering(t,
code,
- checker.ParseAndCheckOptions{
+ ParseAndCheckOptions{
Config: options.CheckerConfig,
},
memoryGauge,
@@ -1213,7 +1209,7 @@ func TestInterpretReturns(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.UnreachableStatementError{}, errs[0])
},
@@ -4212,19 +4208,19 @@ func TestInterpretImport(t *testing.T) {
t.Parallel()
- importedChecker, err := checker.ParseAndCheckWithOptions(t,
+ importedChecker, err := ParseAndCheckWithOptions(t,
`
access(all) fun answer(): Int {
return 42
}
`,
- checker.ParseAndCheckOptions{
+ ParseAndCheckOptions{
Location: ImportedLocation,
},
)
require.NoError(t, err)
- importingChecker, err := checker.ParseAndCheckWithOptions(t,
+ importingChecker, err := ParseAndCheckWithOptions(t,
`
import answer from "imported"
@@ -4232,7 +4228,7 @@ func TestInterpretImport(t *testing.T) {
return answer()
}
`,
- checker.ParseAndCheckOptions{
+ ParseAndCheckOptions{
Config: &sema.Config{
ImportHandler: func(_ *sema.Checker, importedLocation common.Location, _ ast.Range) (sema.Import, error) {
assert.Equal(t,
@@ -4303,9 +4299,9 @@ func TestInterpretImportError(t *testing.T) {
baseValueActivation.DeclareValue(stdlib.PanicFunction)
parseAndCheck := func(code string, location common.Location) *sema.Checker {
- checker, err := checker.ParseAndCheckWithOptions(t,
+ checker, err := ParseAndCheckWithOptions(t,
code,
- checker.ParseAndCheckOptions{
+ ParseAndCheckOptions{
Location: location,
Config: &sema.Config{
BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation {
@@ -5262,7 +5258,7 @@ func TestInterpretReferenceFailableDowncasting(t *testing.T) {
func(invocation interpreter.Invocation) interpreter.Value {
authorized := bool(invocation.Arguments[0].(interpreter.BoolValue))
- var auth interpreter.Authorization = interpreter.UnauthorizedAccess
+ var auth = interpreter.UnauthorizedAccess
if authorized {
auth = interpreter.ConvertSemaAccessToStaticAuthorization(
invocation.Interpreter,
@@ -6828,7 +6824,7 @@ func TestInterpretCompositeFunctionInvocationFromImportingProgram(t *testing.T)
t.Parallel()
- importedChecker, err := checker.ParseAndCheckWithOptions(t,
+ importedChecker, err := ParseAndCheckWithOptions(t,
`
// function must have arguments
access(all) fun x(x: Int) {}
@@ -6841,13 +6837,13 @@ func TestInterpretCompositeFunctionInvocationFromImportingProgram(t *testing.T)
}
}
`,
- checker.ParseAndCheckOptions{
+ ParseAndCheckOptions{
Location: ImportedLocation,
},
)
require.NoError(t, err)
- importingChecker, err := checker.ParseAndCheckWithOptions(t,
+ importingChecker, err := ParseAndCheckWithOptions(t,
`
import Y from "imported"
@@ -6856,7 +6852,7 @@ func TestInterpretCompositeFunctionInvocationFromImportingProgram(t *testing.T)
Y().x()
}
`,
- checker.ParseAndCheckOptions{
+ ParseAndCheckOptions{
Config: &sema.Config{
ImportHandler: func(_ *sema.Checker, importedLocation common.Location, _ ast.Range) (sema.Import, error) {
assert.Equal(t,
@@ -7282,8 +7278,8 @@ func TestInterpretEmitEvent(t *testing.T) {
_, err = inter.Invoke("test")
require.NoError(t, err)
- transferEventType := checker.RequireGlobalType(t, inter.Program.Elaboration, "Transfer")
- transferAmountEventType := checker.RequireGlobalType(t, inter.Program.Elaboration, "TransferAmount")
+ transferEventType := RequireGlobalType(t, inter.Program.Elaboration, "Transfer")
+ transferAmountEventType := RequireGlobalType(t, inter.Program.Elaboration, "TransferAmount")
fields1 := []interpreter.CompositeField{
{
@@ -7425,7 +7421,7 @@ func TestInterpretReferenceEventParameter(t *testing.T) {
_, err = inter.Invoke("test", ref)
require.NoError(t, err)
- eventType := checker.RequireGlobalType(t, inter.Program.Elaboration, "TestEvent")
+ eventType := RequireGlobalType(t, inter.Program.Elaboration, "TestEvent")
expectedEvents := []interpreter.Value{
interpreter.NewCompositeValue(
@@ -7763,7 +7759,7 @@ func TestInterpretEmitEventParameterTypes(t *testing.T) {
_, err = inter.Invoke("test")
require.NoError(t, err)
- testType := checker.RequireGlobalType(t, inter.Program.Elaboration, "Test")
+ testType := RequireGlobalType(t, inter.Program.Elaboration, "Test")
fields := []interpreter.CompositeField{
{
@@ -8530,82 +8526,6 @@ func TestInterpretCompositeDeclarationNestedConstructor(t *testing.T) {
)
}
-// TODO: re-enable this test with the v2 fungible token contract
-/* func TestInterpretFungibleTokenContract(t *testing.T) {
-
- t.Parallel()
-
- code := strings.Join(
- []string{
- examples.FungibleTokenContractInterface,
- examples.ExampleFungibleTokenContract,
- `
- access(all) fun test(): [Int; 2] {
-
- let publisher <- ExampleToken.sprout(balance: 100)
- let receiver <- ExampleToken.sprout(balance: 0)
-
- let withdrawn <- publisher.withdraw(amount: 60)
- receiver.deposit(vault: <-withdrawn)
-
- let publisherBalance = publisher.balance
- let receiverBalance = receiver.balance
-
- destroy publisher
- destroy receiver
-
- return [publisherBalance, receiverBalance]
- }
- `,
- },
- "\n",
- )
-
- baseValueActivation := sema.NewVariableActivation(sema.BaseValueActivation)
- baseValueActivation.DeclareValue(stdlib.PanicFunction)
-
- baseActivation := activations.NewActivation(nil, interpreter.BaseActivation)
- interpreter.Declare(baseActivation, stdlib.PanicFunction)
-
- inter, err := parseCheckAndInterpretWithOptions(t,
- code,
- ParseCheckAndInterpretOptions{
- Config: &interpreter.Config{
- BaseActivationHandler: func(_ common.Location) *interpreter.VariableActivation {
- return baseActivation
- },
- ContractValueHandler: makeContractValueHandler(nil, nil, nil),
- },
- CheckerConfig: &sema.Config{
- BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation {
- return baseValueActivation
- },
- },
- },
- )
- require.NoError(t, err)
-
- value, err := inter.Invoke("test")
- require.NoError(t, err)
-
- AssertValuesEqual(
- t,
- inter,
- interpreter.NewArrayValue(
- inter,
- interpreter.EmptyLocationRange,
- interpreter.ConstantSizedStaticType{
- Type: interpreter.PrimitiveStaticTypeInt,
- Size: 2,
- },
- common.ZeroAddress,
- interpreter.NewUnmeteredIntValueFromInt64(40),
- interpreter.NewUnmeteredIntValueFromInt64(60),
- ),
- value,
- )
-} */
-
func TestInterpretContractAccountFieldUse(t *testing.T) {
t.Parallel()
@@ -8694,7 +8614,7 @@ func TestInterpretConformToImportedInterface(t *testing.T) {
t.Parallel()
- importedChecker, err := checker.ParseAndCheckWithOptions(t,
+ importedChecker, err := ParseAndCheckWithOptions(t,
`
struct interface Foo {
fun check(answer: Int) {
@@ -8704,13 +8624,13 @@ func TestInterpretConformToImportedInterface(t *testing.T) {
}
}
`,
- checker.ParseAndCheckOptions{
+ ParseAndCheckOptions{
Location: ImportedLocation,
},
)
require.NoError(t, err)
- importingChecker, err := checker.ParseAndCheckWithOptions(t,
+ importingChecker, err := ParseAndCheckWithOptions(t,
`
import Foo from "imported"
@@ -8723,7 +8643,7 @@ func TestInterpretConformToImportedInterface(t *testing.T) {
bar.check(answer: 1)
}
`,
- checker.ParseAndCheckOptions{
+ ParseAndCheckOptions{
Config: &sema.Config{
ImportHandler: func(_ *sema.Checker, importedLocation common.Location, _ ast.Range) (sema.Import, error) {
assert.Equal(t,
@@ -10767,7 +10687,7 @@ func TestInterpretArrayFilter(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.PurityError{}, errs[0])
},
},
diff --git a/tests/interpreter/nesting_test.go b/interpreter/nesting_test.go
similarity index 100%
rename from tests/interpreter/nesting_test.go
rename to interpreter/nesting_test.go
diff --git a/tests/interpreter/path_test.go b/interpreter/path_test.go
similarity index 98%
rename from tests/interpreter/path_test.go
rename to interpreter/path_test.go
index 015ef66643..10ff7f32f9 100644
--- a/tests/interpreter/path_test.go
+++ b/interpreter/path_test.go
@@ -27,7 +27,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/interpreter"
"github.com/onflow/cadence/sema"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
)
func TestInterpretPath(t *testing.T) {
diff --git a/tests/interpreter/pathcapability_test.go b/interpreter/pathcapability_test.go
similarity index 100%
rename from tests/interpreter/pathcapability_test.go
rename to interpreter/pathcapability_test.go
diff --git a/tests/interpreter/range_value_test.go b/interpreter/range_value_test.go
similarity index 98%
rename from tests/interpreter/range_value_test.go
rename to interpreter/range_value_test.go
index ba3b714129..eb88cb4b50 100644
--- a/tests/interpreter/range_value_test.go
+++ b/interpreter/range_value_test.go
@@ -30,8 +30,8 @@ import (
"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"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
)
type containsTestCase struct {
@@ -440,7 +440,7 @@ func TestInclusiveRange(t *testing.T) {
)
}
- utils.AssertValuesEqual(
+ AssertValuesEqual(
t,
inter,
expectedRangeValue,
@@ -456,7 +456,7 @@ func TestInclusiveRange(t *testing.T) {
expectedValue = interpreter.AsBoolValue(tc.expectedWithoutStep)
}
- utils.AssertValuesEqual(
+ AssertValuesEqual(
t,
inter,
expectedValue,
diff --git a/tests/interpreter/reference_test.go b/interpreter/reference_test.go
similarity index 98%
rename from tests/interpreter/reference_test.go
rename to interpreter/reference_test.go
index 808ff46c83..273f49d74d 100644
--- a/tests/interpreter/reference_test.go
+++ b/interpreter/reference_test.go
@@ -28,8 +28,9 @@ import (
"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"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestInterpretResourceReferenceInstanceOf(t *testing.T) {
@@ -530,7 +531,7 @@ func TestInterpretResourceReferenceInvalidationOnMove(t *testing.T) {
errorHandler := func(tt *testing.T) func(err error) {
return func(err error) {
- errors := checker.RequireCheckerErrors(tt, err, 1)
+ errors := RequireCheckerErrors(tt, err, 1)
invalidatedRefError := &sema.InvalidatedResourceReferenceError{}
assert.ErrorAs(tt, errors[0], &invalidatedRefError)
}
@@ -637,7 +638,7 @@ func TestInterpretResourceReferenceInvalidationOnMove(t *testing.T) {
address := common.Address{0x1}
- rType := checker.RequireGlobalType(t, inter.Program.Elaboration, "R").(*sema.CompositeType)
+ rType := RequireGlobalType(t, inter.Program.Elaboration, "R").(*sema.CompositeType)
array := interpreter.NewArrayValue(
inter,
@@ -742,7 +743,7 @@ func TestInterpretResourceReferenceInvalidationOnMove(t *testing.T) {
}
`)
- rType := checker.RequireGlobalType(t, inter.Program.Elaboration, "R").(*sema.CompositeType)
+ rType := RequireGlobalType(t, inter.Program.Elaboration, "R").(*sema.CompositeType)
// Resource array in account 0x01
@@ -843,7 +844,7 @@ func TestInterpretResourceReferenceInvalidationOnMove(t *testing.T) {
address := common.Address{0x1}
- rType := checker.RequireGlobalType(t, inter.Program.Elaboration, "R").(*sema.CompositeType)
+ rType := RequireGlobalType(t, inter.Program.Elaboration, "R").(*sema.CompositeType)
array := interpreter.NewArrayValue(
inter,
@@ -969,7 +970,7 @@ func TestInterpretResourceReferenceInvalidationOnMove(t *testing.T) {
address := common.Address{0x1}
- rType := checker.RequireGlobalType(t, inter.Program.Elaboration, "R").(*sema.CompositeType)
+ rType := RequireGlobalType(t, inter.Program.Elaboration, "R").(*sema.CompositeType)
array := interpreter.NewArrayValue(
inter,
@@ -1524,7 +1525,7 @@ func TestInterpretResourceReferenceInvalidationOnDestroy(t *testing.T) {
errorHandler := func(tt *testing.T) func(err error) {
return func(err error) {
- errors := checker.RequireCheckerErrors(tt, err, 1)
+ errors := RequireCheckerErrors(tt, err, 1)
invalidatedRefError := &sema.InvalidatedResourceReferenceError{}
assert.ErrorAs(tt, errors[0], &invalidatedRefError)
}
@@ -1747,7 +1748,7 @@ func TestInterpretReferenceToReference(t *testing.T) {
}
`, ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.NestedReferenceError{}, errs[0])
},
})
@@ -1787,7 +1788,7 @@ func TestInterpretReferenceToReference(t *testing.T) {
}
`, ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.NestedReferenceError{}, errs[0])
},
})
@@ -3040,7 +3041,7 @@ func TestInterpretDereference(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.InvalidUnaryOperandError{}, errs[0])
},
@@ -3071,7 +3072,7 @@ func TestInterpretDereference(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.InvalidUnaryOperandError{}, errs[0])
},
@@ -3208,7 +3209,7 @@ func TestInterpretHostFunctionReferenceInvalidation(t *testing.T) {
result, err := inter.Invoke("main")
require.NoError(t, err)
- sType := checker.RequireGlobalType(t, inter.Program.Elaboration, "S").(*sema.CompositeType)
+ sType := RequireGlobalType(t, inter.Program.Elaboration, "S").(*sema.CompositeType)
expectedResult := interpreter.NewArrayValue(
inter,
@@ -3281,7 +3282,7 @@ func TestInterpretHostFunctionReferenceInvalidation(t *testing.T) {
result, err := inter.Invoke("main")
require.NoError(t, err)
- sType := checker.RequireGlobalType(t, inter.Program.Elaboration, "S").(*sema.CompositeType)
+ sType := RequireGlobalType(t, inter.Program.Elaboration, "S").(*sema.CompositeType)
expectedResult := interpreter.NewTypeValue(
inter,
diff --git a/tests/interpreter/resources_test.go b/interpreter/resources_test.go
similarity index 97%
rename from tests/interpreter/resources_test.go
rename to interpreter/resources_test.go
index 8afacd870b..564c745258 100644
--- a/tests/interpreter/resources_test.go
+++ b/interpreter/resources_test.go
@@ -24,11 +24,11 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- "github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/checker"
- . "github.com/onflow/cadence/tests/utils"
-
"github.com/onflow/cadence/interpreter"
+ "github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestInterpretOptionalResourceBindingWithSecondValue(t *testing.T) {
@@ -321,7 +321,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -367,7 +367,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -413,7 +413,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -459,7 +459,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -502,7 +502,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -542,7 +542,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -582,7 +582,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -622,7 +622,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -664,7 +664,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -705,7 +705,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -743,7 +743,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -776,7 +776,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -809,7 +809,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -840,7 +840,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -891,7 +891,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -936,7 +936,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -981,7 +981,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -1026,7 +1026,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -1067,7 +1067,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -1105,7 +1105,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -1143,7 +1143,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -1181,7 +1181,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -1222,7 +1222,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -1262,7 +1262,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -1300,7 +1300,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -1332,7 +1332,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -1364,7 +1364,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -1396,7 +1396,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -1430,7 +1430,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
}`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -1458,7 +1458,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
}`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 2)
+ errs := RequireCheckerErrors(t, err, 2)
require.IsType(t, &sema.ResourceLossError{}, errs[0])
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[1])
},
@@ -1491,7 +1491,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
}`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 6)
+ errs := RequireCheckerErrors(t, err, 6)
require.IsType(t, &sema.InvalidConditionalResourceOperandError{}, errs[0])
require.IsType(t, &sema.InvalidConditionalResourceOperandError{}, errs[1])
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[2])
@@ -1525,7 +1525,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
}`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -1553,7 +1553,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
}`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -1585,7 +1585,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
}`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -1614,7 +1614,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
}`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -1643,7 +1643,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
}`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -1675,7 +1675,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
}`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 2)
+ errs := RequireCheckerErrors(t, err, 2)
require.IsType(t, &sema.InvalidConditionalResourceOperandError{}, errs[0])
require.IsType(t, &sema.InvalidConditionalResourceOperandError{}, errs[1])
},
@@ -1708,7 +1708,7 @@ func TestInterpretInvalidatedResourceValidation(t *testing.T) {
}`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 2)
+ errs := RequireCheckerErrors(t, err, 2)
require.IsType(t, &sema.InvalidConditionalResourceOperandError{}, errs[0])
require.IsType(t, &sema.InvalidConditionalResourceOperandError{}, errs[1])
},
@@ -1740,7 +1740,7 @@ func TestInterpretResourceInvalidationWithConditionalExprInDestroy(t *testing.T)
}`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 2)
+ errs := RequireCheckerErrors(t, err, 2)
require.IsType(t, &sema.InvalidConditionalResourceOperandError{}, errs[0])
require.IsType(t, &sema.InvalidConditionalResourceOperandError{}, errs[0])
},
@@ -1782,7 +1782,7 @@ func TestInterpretResourceUseAfterInvalidation(t *testing.T) {
}`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 2)
+ errs := RequireCheckerErrors(t, err, 2)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[1])
},
@@ -1820,7 +1820,7 @@ func TestInterpretResourceUseAfterInvalidation(t *testing.T) {
}`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
},
@@ -2158,7 +2158,7 @@ func TestInterpretResourceDestroyedInPreCondition(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 2)
+ errs := RequireCheckerErrors(t, err, 2)
require.IsType(t, &sema.PurityError{}, errs[0])
require.IsType(t, &sema.InvalidInterfaceConditionResourceInvalidationError{}, errs[1])
},
@@ -2537,9 +2537,6 @@ func TestInterpreterDefaultDestroyEventBaseShadowing(t *testing.T) {
destroy trollAttachment
}
`, ParseCheckAndInterpretOptions{
- CheckerConfig: &sema.Config{
- AttachmentsEnabled: true,
- },
Config: &interpreter.Config{
OnEventEmitted: func(inter *interpreter.Interpreter, locationRange interpreter.LocationRange, event *interpreter.CompositeValue, eventType *sema.CompositeType) error {
events = append(events, event)
@@ -2588,9 +2585,6 @@ func TestInterpreterDefaultDestroyEventBaseShadowing(t *testing.T) {
destroy trollAttachment
}
`, ParseCheckAndInterpretOptions{
- CheckerConfig: &sema.Config{
- AttachmentsEnabled: true,
- },
Config: &interpreter.Config{
OnEventEmitted: func(inter *interpreter.Interpreter, locationRange interpreter.LocationRange, event *interpreter.CompositeValue, eventType *sema.CompositeType) error {
events = append(events, event)
@@ -2639,7 +2633,7 @@ func TestInterpretDefaultDestroyEventArgumentScoping(t *testing.T) {
},
},
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.DefaultDestroyInvalidArgumentError{}, errs[0])
assert.Equal(t, errs[0].(*sema.DefaultDestroyInvalidArgumentError).Kind, sema.InvalidIdentifier)
// ...
@@ -2863,7 +2857,7 @@ func TestInterpretMovedResourceInOptionalBinding(t *testing.T) {
}
`, ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
})
@@ -2906,7 +2900,7 @@ func TestInterpretMovedResourceInSecondValue(t *testing.T) {
}
`, ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.ResourceUseAfterInvalidationError{}, errs[0])
},
})
@@ -3038,7 +3032,7 @@ func TestInterpretPreConditionResourceMove(t *testing.T) {
}`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- checkerErrors := checker.RequireCheckerErrors(t, err, 3)
+ checkerErrors := RequireCheckerErrors(t, err, 3)
require.IsType(t, &sema.PurityError{}, checkerErrors[0])
require.IsType(t, &sema.InvalidInterfaceConditionResourceInvalidationError{}, checkerErrors[1])
require.IsType(t, &sema.PurityError{}, checkerErrors[2])
@@ -3572,7 +3566,7 @@ func TestInterpretInvalidNilCoalescingResourceDuplication(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.InvalidNilCoalescingRightResourceOperandError{}, errs[0])
},
},
diff --git a/tests/interpreter/runtimetype_test.go b/interpreter/runtimetype_test.go
similarity index 93%
rename from tests/interpreter/runtimetype_test.go
rename to interpreter/runtimetype_test.go
index c1ea4ea109..526d28856d 100644
--- a/tests/interpreter/runtimetype_test.go
+++ b/interpreter/runtimetype_test.go
@@ -24,7 +24,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/interpreter"
"github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
"github.com/stretchr/testify/assert"
)
@@ -65,7 +65,7 @@ func TestInterpretOptionalType(t *testing.T) {
assert.Equal(t,
interpreter.TypeValue{
Type: &interpreter.OptionalStaticType{
- Type: interpreter.NewCompositeStaticTypeComputeTypeID(nil, utils.TestLocation, "R"),
+ Type: interpreter.NewCompositeStaticTypeComputeTypeID(nil, TestLocation, "R"),
},
},
inter.Globals.Get("c").GetValue(inter),
@@ -124,7 +124,7 @@ func TestInterpretVariableSizedArrayType(t *testing.T) {
assert.Equal(t,
interpreter.TypeValue{
Type: &interpreter.VariableSizedStaticType{
- Type: interpreter.NewCompositeStaticTypeComputeTypeID(nil, utils.TestLocation, "R"),
+ Type: interpreter.NewCompositeStaticTypeComputeTypeID(nil, TestLocation, "R"),
},
},
inter.Globals.Get("c").GetValue(inter),
@@ -184,7 +184,7 @@ func TestInterpretConstantSizedArrayType(t *testing.T) {
assert.Equal(t,
interpreter.TypeValue{
Type: &interpreter.ConstantSizedStaticType{
- Type: interpreter.NewCompositeStaticTypeComputeTypeID(nil, utils.TestLocation, "R"),
+ Type: interpreter.NewCompositeStaticTypeComputeTypeID(nil, TestLocation, "R"),
Size: int64(400),
},
},
@@ -250,7 +250,7 @@ func TestInterpretDictionaryType(t *testing.T) {
assert.Equal(t,
interpreter.TypeValue{
Type: &interpreter.DictionaryStaticType{
- ValueType: interpreter.NewCompositeStaticTypeComputeTypeID(nil, utils.TestLocation, "R"),
+ ValueType: interpreter.NewCompositeStaticTypeComputeTypeID(nil, TestLocation, "R"),
KeyType: interpreter.PrimitiveStaticTypeInt,
},
},
@@ -305,14 +305,14 @@ func TestInterpretCompositeType(t *testing.T) {
assert.Equal(t,
interpreter.TypeValue{
- Type: interpreter.NewCompositeStaticTypeComputeTypeID(nil, utils.TestLocation, "R"),
+ Type: interpreter.NewCompositeStaticTypeComputeTypeID(nil, TestLocation, "R"),
},
inter.Globals.Get("a").GetValue(inter),
)
assert.Equal(t,
interpreter.TypeValue{
- Type: interpreter.NewCompositeStaticTypeComputeTypeID(nil, utils.TestLocation, "S"),
+ Type: interpreter.NewCompositeStaticTypeComputeTypeID(nil, TestLocation, "S"),
},
inter.Globals.Get("b").GetValue(inter),
)
@@ -334,7 +334,7 @@ func TestInterpretCompositeType(t *testing.T) {
assert.Equal(t,
interpreter.TypeValue{
- Type: interpreter.NewCompositeStaticTypeComputeTypeID(nil, utils.TestLocation, "F"),
+ Type: interpreter.NewCompositeStaticTypeComputeTypeID(nil, TestLocation, "F"),
},
inter.Globals.Get("f").GetValue(inter),
)
@@ -433,7 +433,7 @@ func TestInterpretReferenceType(t *testing.T) {
assert.Equal(t,
interpreter.TypeValue{
Type: &interpreter.ReferenceStaticType{
- ReferencedType: interpreter.NewCompositeStaticTypeComputeTypeID(nil, utils.TestLocation, "R"),
+ ReferencedType: interpreter.NewCompositeStaticTypeComputeTypeID(nil, TestLocation, "R"),
Authorization: interpreter.NewEntitlementSetAuthorization(
nil,
func() []common.TypeID { return []common.TypeID{"S.test.X"} },
@@ -458,7 +458,7 @@ func TestInterpretReferenceType(t *testing.T) {
assert.Equal(t,
interpreter.TypeValue{
Type: &interpreter.ReferenceStaticType{
- ReferencedType: interpreter.NewCompositeStaticTypeComputeTypeID(nil, utils.TestLocation, "S"),
+ ReferencedType: interpreter.NewCompositeStaticTypeComputeTypeID(nil, TestLocation, "S"),
Authorization: interpreter.NewEntitlementSetAuthorization(
nil,
func() []common.TypeID { return []common.TypeID{"S.test.X"} },
@@ -513,7 +513,7 @@ func TestInterpretIntersectionType(t *testing.T) {
interpreter.TypeValue{
Type: &interpreter.IntersectionStaticType{
Types: []*interpreter.InterfaceStaticType{
- interpreter.NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "R"),
+ interpreter.NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "R"),
},
},
},
@@ -529,7 +529,7 @@ func TestInterpretIntersectionType(t *testing.T) {
interpreter.TypeValue{
Type: &interpreter.IntersectionStaticType{
Types: []*interpreter.InterfaceStaticType{
- interpreter.NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "S"),
+ interpreter.NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "S"),
},
},
},
@@ -545,8 +545,8 @@ func TestInterpretIntersectionType(t *testing.T) {
interpreter.TypeValue{
Type: &interpreter.IntersectionStaticType{
Types: []*interpreter.InterfaceStaticType{
- interpreter.NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "S"),
- interpreter.NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "S2"),
+ interpreter.NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "S"),
+ interpreter.NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "S2"),
},
},
},
@@ -612,7 +612,7 @@ func TestInterpretCapabilityType(t *testing.T) {
interpreter.TypeValue{
Type: &interpreter.CapabilityStaticType{
BorrowType: &interpreter.ReferenceStaticType{
- ReferencedType: interpreter.NewCompositeStaticTypeComputeTypeID(nil, utils.TestLocation, "R"),
+ ReferencedType: interpreter.NewCompositeStaticTypeComputeTypeID(nil, TestLocation, "R"),
Authorization: interpreter.UnauthorizedAccess,
},
},
diff --git a/interpreter/statictype_test.go b/interpreter/statictype_test.go
index 76f3570deb..145296ad56 100644
--- a/interpreter/statictype_test.go
+++ b/interpreter/statictype_test.go
@@ -27,7 +27,7 @@ import (
"github.com/onflow/cadence/common"
. "github.com/onflow/cadence/interpreter"
"github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func TestCapabilityStaticType_Equal(t *testing.T) {
@@ -182,12 +182,12 @@ func TestCompositeStaticType_Equal(t *testing.T) {
require.True(t,
NewCompositeStaticTypeComputeTypeID(
nil,
- utils.TestLocation,
+ TestLocation,
"X",
).Equal(
NewCompositeStaticTypeComputeTypeID(
nil,
- utils.TestLocation,
+ TestLocation,
"X",
),
),
@@ -201,12 +201,12 @@ func TestCompositeStaticType_Equal(t *testing.T) {
require.False(t,
NewCompositeStaticTypeComputeTypeID(
nil,
- utils.TestLocation,
+ TestLocation,
"X",
).Equal(
NewCompositeStaticTypeComputeTypeID(
nil,
- utils.TestLocation,
+ TestLocation,
"Y",
),
),
@@ -333,8 +333,8 @@ func TestInterfaceStaticType_Equal(t *testing.T) {
t.Parallel()
require.True(t,
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "X").
- Equal(NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "X")),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "X").
+ Equal(NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "X")),
)
})
@@ -343,8 +343,8 @@ func TestInterfaceStaticType_Equal(t *testing.T) {
t.Parallel()
require.False(t,
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "X").
- Equal(NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "Y")),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "X").
+ Equal(NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "Y")),
)
})
@@ -749,14 +749,14 @@ func TestIntersectionStaticType_Equal(t *testing.T) {
require.True(t,
(&IntersectionStaticType{
Types: []*InterfaceStaticType{
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "X"),
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "Y"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "X"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "Y"),
},
}).Equal(
&IntersectionStaticType{
Types: []*InterfaceStaticType{
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "Y"),
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "X"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "Y"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "X"),
},
},
),
@@ -785,13 +785,13 @@ func TestIntersectionStaticType_Equal(t *testing.T) {
require.False(t,
(&IntersectionStaticType{
Types: []*InterfaceStaticType{
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "X"),
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "Y"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "X"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "Y"),
},
}).Equal(
&IntersectionStaticType{
Types: []*InterfaceStaticType{
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "X"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "X"),
},
},
),
@@ -805,14 +805,14 @@ func TestIntersectionStaticType_Equal(t *testing.T) {
require.True(t,
(&IntersectionStaticType{
Types: []*InterfaceStaticType{
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "X"),
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "Y"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "X"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "Y"),
},
}).Equal(
&IntersectionStaticType{
Types: []*InterfaceStaticType{
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "Y"),
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "X"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "Y"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "X"),
},
},
),
@@ -826,14 +826,14 @@ func TestIntersectionStaticType_Equal(t *testing.T) {
require.True(t,
(&IntersectionStaticType{
Types: []*InterfaceStaticType{
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "X"),
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "Y"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "X"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "Y"),
},
}).Equal(
&IntersectionStaticType{
Types: []*InterfaceStaticType{
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "X"),
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "Y"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "X"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "Y"),
},
},
),
@@ -847,14 +847,14 @@ func TestIntersectionStaticType_Equal(t *testing.T) {
require.False(t,
(&IntersectionStaticType{
Types: []*InterfaceStaticType{
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "X"),
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "Y"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "X"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "Y"),
},
}).Equal(
&IntersectionStaticType{
Types: []*InterfaceStaticType{
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "X"),
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "Z"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "X"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "Z"),
},
},
),
@@ -868,13 +868,13 @@ func TestIntersectionStaticType_Equal(t *testing.T) {
require.False(t,
(&IntersectionStaticType{
Types: []*InterfaceStaticType{
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "X"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "X"),
},
}).Equal(
&IntersectionStaticType{
Types: []*InterfaceStaticType{
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "X"),
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "Y"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "X"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "Y"),
},
},
),
@@ -888,14 +888,14 @@ func TestIntersectionStaticType_Equal(t *testing.T) {
require.False(t,
(&IntersectionStaticType{
Types: []*InterfaceStaticType{
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "X"),
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "Y"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "X"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "Y"),
},
}).Equal(
&IntersectionStaticType{
Types: []*InterfaceStaticType{
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "X"),
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "Z"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "X"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "Z"),
},
},
),
@@ -909,8 +909,8 @@ func TestIntersectionStaticType_Equal(t *testing.T) {
require.False(t,
(&IntersectionStaticType{
Types: []*InterfaceStaticType{
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "X"),
- NewInterfaceStaticTypeComputeTypeID(nil, utils.TestLocation, "Y"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "X"),
+ NewInterfaceStaticTypeComputeTypeID(nil, TestLocation, "Y"),
},
}).Equal(
&ReferenceStaticType{
diff --git a/interpreter/storage_test.go b/interpreter/storage_test.go
index 01e9299c38..0693df2d9b 100644
--- a/interpreter/storage_test.go
+++ b/interpreter/storage_test.go
@@ -29,7 +29,8 @@ import (
"github.com/onflow/cadence/common"
. "github.com/onflow/cadence/interpreter"
"github.com/onflow/cadence/sema"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
)
func TestCompositeStorage(t *testing.T) {
diff --git a/tests/interpreter/string_test.go b/interpreter/string_test.go
similarity index 99%
rename from tests/interpreter/string_test.go
rename to interpreter/string_test.go
index 410d2f478c..580608e26e 100644
--- a/tests/interpreter/string_test.go
+++ b/interpreter/string_test.go
@@ -26,7 +26,8 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/interpreter"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
)
func TestInterpretRecursiveValueString(t *testing.T) {
diff --git a/tests/interpreter/switch_test.go b/interpreter/switch_test.go
similarity index 96%
rename from tests/interpreter/switch_test.go
rename to interpreter/switch_test.go
index 3d0dda4b90..2a30c6cbdb 100644
--- a/tests/interpreter/switch_test.go
+++ b/interpreter/switch_test.go
@@ -24,11 +24,10 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- . "github.com/onflow/cadence/tests/utils"
-
"github.com/onflow/cadence/interpreter"
"github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/checker"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestInterpretSwitchStatement(t *testing.T) {
@@ -53,7 +52,7 @@ func TestInterpretSwitchStatement(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.UnreachableStatementError{}, errs[0])
},
@@ -91,7 +90,7 @@ func TestInterpretSwitchStatement(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.UnreachableStatementError{}, errs[0])
},
@@ -132,7 +131,7 @@ func TestInterpretSwitchStatement(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.UnreachableStatementError{}, errs[0])
},
@@ -219,7 +218,7 @@ func TestInterpretSwitchStatement(t *testing.T) {
`,
ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.UnreachableStatementError{}, errs[0])
},
diff --git a/tests/interpreter/transactions_test.go b/interpreter/transactions_test.go
similarity index 98%
rename from tests/interpreter/transactions_test.go
rename to interpreter/transactions_test.go
index 71680a184d..21a1642f99 100644
--- a/tests/interpreter/transactions_test.go
+++ b/interpreter/transactions_test.go
@@ -29,8 +29,9 @@ import (
"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"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestInterpretTransactions(t *testing.T) {
@@ -420,7 +421,7 @@ func TestRuntimeInvalidTransferInExecute(t *testing.T) {
}
`, ParseCheckAndInterpretOptions{
HandleCheckerError: func(err error) {
- errs := checker.RequireCheckerErrors(t, err, 3)
+ errs := RequireCheckerErrors(t, err, 3)
require.IsType(t, &sema.ResourceCapturingError{}, errs[0])
require.IsType(t, &sema.ResourceCapturingError{}, errs[1])
require.IsType(t, &sema.ResourceCapturingError{}, errs[2])
diff --git a/tests/interpreter/transfer_test.go b/interpreter/transfer_test.go
similarity index 98%
rename from tests/interpreter/transfer_test.go
rename to interpreter/transfer_test.go
index c40a4f0ee3..72447e2dd9 100644
--- a/tests/interpreter/transfer_test.go
+++ b/interpreter/transfer_test.go
@@ -28,7 +28,7 @@ import (
"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/test_utils/common_utils"
)
func TestInterpretTransferCheck(t *testing.T) {
diff --git a/tests/interpreter/uuid_test.go b/interpreter/uuid_test.go
similarity index 91%
rename from tests/interpreter/uuid_test.go
rename to interpreter/uuid_test.go
index 3e56037a5c..efdc8d1010 100644
--- a/tests/interpreter/uuid_test.go
+++ b/interpreter/uuid_test.go
@@ -28,15 +28,16 @@ import (
"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"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestInterpretResourceUUID(t *testing.T) {
t.Parallel()
- importedChecker, err := checker.ParseAndCheckWithOptions(t,
+ importedChecker, err := ParseAndCheckWithOptions(t,
`
access(all) resource R {}
@@ -44,13 +45,13 @@ func TestInterpretResourceUUID(t *testing.T) {
return <- create R()
}
`,
- checker.ParseAndCheckOptions{
+ ParseAndCheckOptions{
Location: ImportedLocation,
},
)
require.NoError(t, err)
- importingChecker, err := checker.ParseAndCheckWithOptions(t,
+ importingChecker, err := ParseAndCheckWithOptions(t,
`
import createR from "imported"
@@ -63,7 +64,7 @@ func TestInterpretResourceUUID(t *testing.T) {
]
}
`,
- checker.ParseAndCheckOptions{
+ ParseAndCheckOptions{
Config: &sema.Config{
ImportHandler: func(_ *sema.Checker, importedLocation common.Location, _ ast.Range) (sema.Import, error) {
assert.Equal(t,
diff --git a/interpreter/value_function_test.go b/interpreter/value_function_test.go
index 0cf1fd6464..2d25e8bc1b 100644
--- a/interpreter/value_function_test.go
+++ b/interpreter/value_function_test.go
@@ -24,10 +24,9 @@ import (
"github.com/stretchr/testify/assert"
"github.com/onflow/cadence/common"
- "github.com/onflow/cadence/tests/utils"
-
. "github.com/onflow/cadence/interpreter"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func TestFunctionStaticType(t *testing.T) {
@@ -67,7 +66,7 @@ func TestFunctionStaticType(t *testing.T) {
inter.SharedState.Config.CompositeTypeHandler = func(location common.Location, typeID TypeID) *sema.CompositeType {
return &sema.CompositeType{
- Location: utils.TestLocation,
+ Location: TestLocation,
Identifier: "foo",
Kind: common.CompositeKindStructure,
}
@@ -92,7 +91,7 @@ func TestFunctionStaticType(t *testing.T) {
var compositeValue Value = NewCompositeValue(
inter,
EmptyLocationRange,
- utils.TestLocation,
+ TestLocation,
"foo",
common.CompositeKindStructure,
[]CompositeField{},
diff --git a/interpreter/value_test.go b/interpreter/value_test.go
index 1bfc7d3cc5..295f5a4346 100644
--- a/interpreter/value_test.go
+++ b/interpreter/value_test.go
@@ -36,15 +36,15 @@ import (
. "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"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func newTestCompositeValue(inter *Interpreter, owner common.Address) *CompositeValue {
return NewCompositeValue(
inter,
EmptyLocationRange,
- utils.TestLocation,
+ TestLocation,
"Test",
common.CompositeKindStructure,
nil,
@@ -53,7 +53,7 @@ func newTestCompositeValue(inter *Interpreter, owner common.Address) *CompositeV
}
var testCompositeValueType = &sema.CompositeType{
- Location: utils.TestLocation,
+ Location: TestLocation,
Identifier: "Test",
Kind: common.CompositeKindStructure,
Members: &sema.StringMemberOrderedMap{},
@@ -94,7 +94,7 @@ func TestOwnerNewArray(t *testing.T) {
&Program{
Elaboration: elaboration,
},
- utils.TestLocation,
+ TestLocation,
&Config{Storage: storage},
)
require.NoError(t, err)
@@ -137,7 +137,7 @@ func TestOwnerArrayDeepCopy(t *testing.T) {
&Program{
Elaboration: elaboration,
},
- utils.TestLocation,
+ TestLocation,
&Config{
Storage: storage,
OnMeterComputation: getMeterCompFuncWithExpectedKinds(t,
@@ -206,7 +206,7 @@ func TestOwnerArrayElement(t *testing.T) {
&Program{
Elaboration: elaboration,
},
- utils.TestLocation,
+ TestLocation,
&Config{Storage: storage},
)
require.NoError(t, err)
@@ -248,7 +248,7 @@ func TestOwnerArraySetIndex(t *testing.T) {
&Program{
Elaboration: elaboration,
},
- utils.TestLocation,
+ TestLocation,
&Config{Storage: storage},
)
require.NoError(t, err)
@@ -300,7 +300,7 @@ func TestOwnerArrayAppend(t *testing.T) {
&Program{
Elaboration: elaboration,
},
- utils.TestLocation,
+ TestLocation,
&Config{Storage: storage},
)
require.NoError(t, err)
@@ -346,7 +346,7 @@ func TestOwnerArrayInsert(t *testing.T) {
&Program{
Elaboration: elaboration,
},
- utils.TestLocation,
+ TestLocation,
&Config{Storage: storage},
)
require.NoError(t, err)
@@ -392,7 +392,7 @@ func TestOwnerArrayRemove(t *testing.T) {
&Program{
Elaboration: elaboration,
},
- utils.TestLocation,
+ TestLocation,
&Config{Storage: storage},
)
require.NoError(t, err)
@@ -436,7 +436,7 @@ func TestOwnerNewDictionary(t *testing.T) {
&Program{
Elaboration: elaboration,
},
- utils.TestLocation,
+ TestLocation,
&Config{Storage: storage},
)
require.NoError(t, err)
@@ -483,7 +483,7 @@ func TestOwnerDictionary(t *testing.T) {
&Program{
Elaboration: elaboration,
},
- utils.TestLocation,
+ TestLocation,
&Config{Storage: storage},
)
require.NoError(t, err)
@@ -530,7 +530,7 @@ func TestOwnerDictionaryCopy(t *testing.T) {
&Program{
Elaboration: elaboration,
},
- utils.TestLocation,
+ TestLocation,
&Config{
Storage: storage,
OnMeterComputation: getMeterCompFuncWithExpectedKinds(t,
@@ -603,7 +603,7 @@ func TestOwnerDictionarySetSome(t *testing.T) {
&Program{
Elaboration: elaboration,
},
- utils.TestLocation,
+ TestLocation,
&Config{Storage: storage},
)
require.NoError(t, err)
@@ -657,7 +657,7 @@ func TestOwnerDictionaryInsertNonExisting(t *testing.T) {
&Program{
Elaboration: elaboration,
},
- utils.TestLocation,
+ TestLocation,
&Config{Storage: storage},
)
require.NoError(t, err)
@@ -712,7 +712,7 @@ func TestOwnerDictionaryRemove(t *testing.T) {
&Program{
Elaboration: elaboration,
},
- utils.TestLocation,
+ TestLocation,
&Config{Storage: storage},
)
require.NoError(t, err)
@@ -773,7 +773,7 @@ func TestOwnerDictionaryInsertExisting(t *testing.T) {
&Program{
Elaboration: elaboration,
},
- utils.TestLocation,
+ TestLocation,
&Config{Storage: storage},
)
require.NoError(t, err)
@@ -1115,7 +1115,7 @@ func TestStringer(t *testing.T) {
return NewCompositeValue(
inter,
EmptyLocationRange,
- utils.TestLocation,
+ TestLocation,
"Foo",
common.CompositeKindResource,
fields,
@@ -1137,7 +1137,7 @@ func TestStringer(t *testing.T) {
compositeValue := NewCompositeValue(
inter,
EmptyLocationRange,
- utils.TestLocation,
+ TestLocation,
"Foo",
common.CompositeKindResource,
fields,
@@ -1410,7 +1410,7 @@ func TestVisitor(t *testing.T) {
value = NewCompositeValue(
inter,
EmptyLocationRange,
- utils.TestLocation,
+ TestLocation,
"Foo",
common.CompositeKindStructure,
fields,
@@ -1742,7 +1742,7 @@ func TestGetHashInput(t *testing.T) {
return NewCompositeValue(
inter,
EmptyLocationRange,
- utils.TestLocation,
+ TestLocation,
"Foo",
common.CompositeKindEnum,
fields,
@@ -1770,7 +1770,7 @@ func TestGetHashInput(t *testing.T) {
return NewCompositeValue(
inter,
EmptyLocationRange,
- utils.TestLocation,
+ TestLocation,
strings.Repeat("a", 32),
common.CompositeKindEnum,
fields,
@@ -1898,9 +1898,9 @@ func TestEphemeralReferenceTypeConformance(t *testing.T) {
}
}`
- checker, err := checkerUtils.ParseAndCheckWithOptions(t,
+ checker, err := ParseAndCheckWithOptions(t,
code,
- checkerUtils.ParseAndCheckOptions{},
+ ParseAndCheckOptions{},
)
require.NoError(t, err)
@@ -2959,7 +2959,7 @@ func TestCompositeValue_Equal(t *testing.T) {
NewCompositeValue(
inter,
EmptyLocationRange,
- utils.TestLocation,
+ TestLocation,
"X",
common.CompositeKindStructure,
fields1,
@@ -2970,7 +2970,7 @@ func TestCompositeValue_Equal(t *testing.T) {
NewCompositeValue(
inter,
EmptyLocationRange,
- utils.TestLocation,
+ TestLocation,
"X",
common.CompositeKindStructure,
fields2,
@@ -3384,7 +3384,7 @@ func TestPublicKeyValue(t *testing.T) {
inter, err := NewInterpreter(
nil,
- utils.TestLocation,
+ TestLocation,
&Config{
Storage: storage,
},
@@ -3433,7 +3433,7 @@ func TestPublicKeyValue(t *testing.T) {
inter, err := NewInterpreter(
nil,
- utils.TestLocation,
+ TestLocation,
&Config{
Storage: storage,
},
@@ -3589,7 +3589,7 @@ func newTestInterpreter(tb testing.TB) *Interpreter {
inter, err := NewInterpreter(
nil,
- utils.TestLocation,
+ TestLocation,
&Config{
Storage: storage,
AtreeValueValidationEnabled: true,
@@ -3622,9 +3622,9 @@ func TestNonStorable(t *testing.T) {
}
`
- checker, err := checkerUtils.ParseAndCheckWithOptions(t,
+ checker, err := ParseAndCheckWithOptions(t,
code,
- checkerUtils.ParseAndCheckOptions{},
+ ParseAndCheckOptions{},
)
require.NoError(t, err)
@@ -3756,7 +3756,7 @@ func TestValue_ConformsToStaticType(t *testing.T) {
return NewCompositeValue(
inter,
EmptyLocationRange,
- utils.TestLocation,
+ TestLocation,
"Test",
common.CompositeKindStructure,
fields,
@@ -3775,7 +3775,7 @@ func TestValue_ConformsToStaticType(t *testing.T) {
members := &sema.StringMemberOrderedMap{}
compositeType := &sema.CompositeType{
- Location: utils.TestLocation,
+ Location: TestLocation,
Identifier: "Test",
Kind: common.CompositeKindStructure,
Members: members,
@@ -3801,7 +3801,7 @@ func TestValue_ConformsToStaticType(t *testing.T) {
&Program{
Elaboration: elaboration,
},
- utils.TestLocation,
+ TestLocation,
&Config{Storage: storage},
)
require.NoError(t, err)
@@ -4493,7 +4493,7 @@ func TestOverwriteDictionaryValueWhereKeyIsStoredInSeparateAtreeSlab(t *testing.
return NewCompositeValue(
inter,
EmptyLocationRange,
- utils.TestLocation,
+ TestLocation,
"Test",
common.CompositeKindEnum,
[]CompositeField{
@@ -4518,7 +4518,7 @@ func TestOverwriteDictionaryValueWhereKeyIsStoredInSeparateAtreeSlab(t *testing.
&Program{
Elaboration: elaboration,
},
- utils.TestLocation,
+ TestLocation,
&Config{
Storage: storage,
AtreeValueValidationEnabled: true,
@@ -4594,7 +4594,7 @@ func TestOverwriteDictionaryValueWhereKeyIsStoredInSeparateAtreeSlab(t *testing.
&Program{
Elaboration: elaboration,
},
- utils.TestLocation,
+ TestLocation,
&Config{
Storage: storage,
AtreeValueValidationEnabled: true,
diff --git a/interpreter/value_uint64.go b/interpreter/value_uint64.go
index 5c11cca04b..f8b3cdb2ce 100644
--- a/interpreter/value_uint64.go
+++ b/interpreter/value_uint64.go
@@ -19,12 +19,11 @@
package interpreter
import (
+ "encoding/binary"
"math"
"math/big"
"unsafe"
- "encoding/binary"
-
"github.com/onflow/atree"
"github.com/onflow/cadence/ast"
diff --git a/tests/interpreter/values_test.go b/interpreter/values_test.go
similarity index 96%
rename from tests/interpreter/values_test.go
rename to interpreter/values_test.go
index e725b5a30c..b874aa4213 100644
--- a/tests/interpreter/values_test.go
+++ b/interpreter/values_test.go
@@ -36,7 +36,8 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/interpreter"
"github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
)
// TODO: make these program args?
@@ -64,7 +65,7 @@ func TestInterpretRandomMapOperations(t *testing.T) {
Program: ast.NewProgram(nil, []ast.Declaration{}),
Elaboration: sema.NewElaboration(nil),
},
- utils.TestLocation,
+ TestLocation,
&interpreter.Config{
Storage: storage,
ImportLocationHandler: func(inter *interpreter.Interpreter, location common.Location) interpreter.Import {
@@ -119,7 +120,7 @@ func TestInterpretRandomMapOperations(t *testing.T) {
value, found := testMap.Get(inter, interpreter.EmptyLocationRange, orgKey)
require.True(t, found)
- utils.AssertValuesEqual(t, inter, orgValue, value)
+ AssertValuesEqual(t, inter, orgValue, value)
return false
})
@@ -138,7 +139,7 @@ func TestInterpretRandomMapOperations(t *testing.T) {
orgValue, ok := entries.get(inter, key)
require.True(t, ok, "cannot find key: %v", key)
- utils.AssertValuesEqual(t, inter, orgValue, value)
+ AssertValuesEqual(t, inter, orgValue, value)
return true
},
)
@@ -164,7 +165,7 @@ func TestInterpretRandomMapOperations(t *testing.T) {
value, found := copyOfTestMap.Get(inter, interpreter.EmptyLocationRange, orgKey)
require.True(t, found)
- utils.AssertValuesEqual(t, inter, orgValue, value)
+ AssertValuesEqual(t, inter, orgValue, value)
return false
})
@@ -192,7 +193,7 @@ func TestInterpretRandomMapOperations(t *testing.T) {
value, found := testMap.Get(inter, interpreter.EmptyLocationRange, orgKey)
require.True(t, found)
- utils.AssertValuesEqual(t, inter, orgValue, value)
+ AssertValuesEqual(t, inter, orgValue, value)
return false
})
@@ -233,7 +234,7 @@ func TestInterpretRandomMapOperations(t *testing.T) {
value, found := dictionary.Get(inter, interpreter.EmptyLocationRange, orgKey)
require.True(t, found)
- utils.AssertValuesEqual(t, inter, orgValue, value)
+ AssertValuesEqual(t, inter, orgValue, value)
return false
})
@@ -284,7 +285,7 @@ func TestInterpretRandomMapOperations(t *testing.T) {
// Removed value must be same as the original value
innerValue := someValue.InnerValue(inter, interpreter.EmptyLocationRange)
- utils.AssertValuesEqual(t, inter, orgValue, innerValue)
+ AssertValuesEqual(t, inter, orgValue, innerValue)
return false
})
@@ -344,7 +345,7 @@ func TestInterpretRandomMapOperations(t *testing.T) {
// Removed value must be same as the original value
innerValue := someValue.InnerValue(inter, interpreter.EmptyLocationRange)
- utils.AssertValuesEqual(t, inter, orgValue, innerValue)
+ AssertValuesEqual(t, inter, orgValue, innerValue)
return false
})
@@ -412,7 +413,7 @@ func TestInterpretRandomMapOperations(t *testing.T) {
// Removed value must be same as the original value
innerValue := someValue.InnerValue(inter, interpreter.EmptyLocationRange)
- utils.AssertValuesEqual(t, inter, value1, innerValue)
+ AssertValuesEqual(t, inter, value1, innerValue)
}
// Check the values
@@ -428,7 +429,7 @@ func TestInterpretRandomMapOperations(t *testing.T) {
// Read value must be updated value
innerValue := someValue.InnerValue(inter, interpreter.EmptyLocationRange)
- utils.AssertValuesEqual(t, inter, value2, innerValue)
+ AssertValuesEqual(t, inter, value2, innerValue)
}
})
@@ -515,7 +516,7 @@ func TestInterpretRandomMapOperations(t *testing.T) {
// Removed value must be same as the original value
innerValue := someValue.InnerValue(inter, interpreter.EmptyLocationRange)
- utils.AssertValuesEqual(t, inter, orgValue, innerValue)
+ AssertValuesEqual(t, inter, orgValue, innerValue)
deleteCount++
}
@@ -583,7 +584,7 @@ func TestInterpretRandomMapOperations(t *testing.T) {
value, found := movedDictionary.Get(inter, interpreter.EmptyLocationRange, orgKey)
require.True(t, found)
- utils.AssertValuesEqual(t, inter, orgValue, value)
+ AssertValuesEqual(t, inter, orgValue, value)
return false
})
@@ -607,7 +608,7 @@ func TestInterpretRandomArrayOperations(t *testing.T) {
Program: ast.NewProgram(nil, []ast.Declaration{}),
Elaboration: sema.NewElaboration(nil),
},
- utils.TestLocation,
+ TestLocation,
&interpreter.Config{
Storage: storage,
ImportLocationHandler: func(inter *interpreter.Interpreter, location common.Location) interpreter.Import {
@@ -651,7 +652,7 @@ func TestInterpretRandomArrayOperations(t *testing.T) {
for index, orgElement := range elements {
element := testArray.Get(inter, interpreter.EmptyLocationRange, index)
- utils.AssertValuesEqual(t, inter, orgElement, element)
+ AssertValuesEqual(t, inter, orgElement, element)
}
owner := testArray.GetOwner()
@@ -666,10 +667,10 @@ func TestInterpretRandomArrayOperations(t *testing.T) {
inter,
func(element interpreter.Value) (resume bool) {
orgElement := elements[index]
- utils.AssertValuesEqual(t, inter, orgElement, element)
+ AssertValuesEqual(t, inter, orgElement, element)
elementByIndex := testArray.Get(inter, interpreter.EmptyLocationRange, index)
- utils.AssertValuesEqual(t, inter, element, elementByIndex)
+ AssertValuesEqual(t, inter, element, elementByIndex)
index++
return true
@@ -695,7 +696,7 @@ func TestInterpretRandomArrayOperations(t *testing.T) {
for index, orgElement := range elements {
element := copyOfTestArray.Get(inter, interpreter.EmptyLocationRange, index)
- utils.AssertValuesEqual(t, inter, orgElement, element)
+ AssertValuesEqual(t, inter, orgElement, element)
}
owner := copyOfTestArray.GetOwner()
@@ -717,7 +718,7 @@ func TestInterpretRandomArrayOperations(t *testing.T) {
// go over original elements again and check no missing data (no side effect should be found)
for index, orgElement := range elements {
element := testArray.Get(inter, interpreter.EmptyLocationRange, index)
- utils.AssertValuesEqual(t, inter, orgElement, element)
+ AssertValuesEqual(t, inter, orgElement, element)
}
owner := testArray.GetOwner()
@@ -755,7 +756,7 @@ func TestInterpretRandomArrayOperations(t *testing.T) {
// Go over original values again and check no missing data (no side effect should be found)
for index, element := range newElements {
value := testArray.Get(inter, interpreter.EmptyLocationRange, index)
- utils.AssertValuesEqual(t, inter, element, value)
+ AssertValuesEqual(t, inter, element, value)
}
})
@@ -789,7 +790,7 @@ func TestInterpretRandomArrayOperations(t *testing.T) {
// Go over original values again and check no missing data (no side effect should be found)
for index, element := range newElements {
value := testArray.Get(inter, interpreter.EmptyLocationRange, index)
- utils.AssertValuesEqual(t, inter, element, value)
+ AssertValuesEqual(t, inter, element, value)
}
})
@@ -831,7 +832,7 @@ func TestInterpretRandomArrayOperations(t *testing.T) {
removedValue := testArray.Remove(inter, interpreter.EmptyLocationRange, 0)
// Removed value must be same as the original value
- utils.AssertValuesEqual(t, inter, element, removedValue)
+ AssertValuesEqual(t, inter, element, removedValue)
}
// Array must be empty
@@ -896,7 +897,7 @@ func TestInterpretRandomArrayOperations(t *testing.T) {
removedValue := testArray.RemoveFirst(inter, interpreter.EmptyLocationRange)
// Removed value must be same as the original value
- utils.AssertValuesEqual(t, inter, orgValue, removedValue)
+ AssertValuesEqual(t, inter, orgValue, removedValue)
deleteCount++
}
@@ -957,7 +958,7 @@ func TestInterpretRandomArrayOperations(t *testing.T) {
// Check the elements
for index, orgElement := range elements {
element := movedArray.Get(inter, interpreter.EmptyLocationRange, index)
- utils.AssertValuesEqual(t, inter, orgElement, element)
+ AssertValuesEqual(t, inter, orgElement, element)
}
owner = movedArray.GetOwner()
@@ -979,7 +980,7 @@ func TestInterpretRandomCompositeValueOperations(t *testing.T) {
Program: ast.NewProgram(nil, []ast.Declaration{}),
Elaboration: sema.NewElaboration(nil),
},
- utils.TestLocation,
+ TestLocation,
&interpreter.Config{
Storage: storage,
ImportLocationHandler: func(inter *interpreter.Interpreter, location common.Location) interpreter.Import {
@@ -1005,7 +1006,7 @@ func TestInterpretRandomCompositeValueOperations(t *testing.T) {
for fieldName, orgFieldValue := range orgFields {
fieldValue := testComposite.GetField(inter, interpreter.EmptyLocationRange, fieldName)
- utils.AssertValuesEqual(t, inter, orgFieldValue, fieldValue)
+ AssertValuesEqual(t, inter, orgFieldValue, fieldValue)
}
owner := testComposite.GetOwner()
@@ -1017,7 +1018,7 @@ func TestInterpretRandomCompositeValueOperations(t *testing.T) {
testComposite.ForEachField(inter, func(name string, value interpreter.Value) (resume bool) {
orgValue, ok := orgFields[name]
require.True(t, ok)
- utils.AssertValuesEqual(t, inter, orgValue, value)
+ AssertValuesEqual(t, inter, orgValue, value)
fieldCount++
// continue iteration
@@ -1042,7 +1043,7 @@ func TestInterpretRandomCompositeValueOperations(t *testing.T) {
for name, orgValue := range orgFields {
value := copyOfTestComposite.GetField(inter, interpreter.EmptyLocationRange, name)
- utils.AssertValuesEqual(t, inter, orgValue, value)
+ AssertValuesEqual(t, inter, orgValue, value)
}
owner := copyOfTestComposite.GetOwner()
@@ -1062,7 +1063,7 @@ func TestInterpretRandomCompositeValueOperations(t *testing.T) {
// go over original values again and check no missing data (no side effect should be found)
for name, orgValue := range orgFields {
value := testComposite.GetField(inter, interpreter.EmptyLocationRange, name)
- utils.AssertValuesEqual(t, inter, orgValue, value)
+ AssertValuesEqual(t, inter, orgValue, value)
}
owner := testComposite.GetOwner()
@@ -1115,7 +1116,7 @@ func TestInterpretRandomCompositeValueOperations(t *testing.T) {
// Check the elements
for fieldName, orgFieldValue := range fields {
fieldValue := movedComposite.GetField(inter, interpreter.EmptyLocationRange, fieldName)
- utils.AssertValuesEqual(t, inter, orgFieldValue, fieldValue)
+ AssertValuesEqual(t, inter, orgFieldValue, fieldValue)
}
owner = composite.GetOwner()
@@ -1714,7 +1715,7 @@ func TestCheckStorageHealthInMiddleOfDeepRemove(t *testing.T) {
Program: ast.NewProgram(nil, []ast.Declaration{}),
Elaboration: sema.NewElaboration(nil),
},
- utils.TestLocation,
+ TestLocation,
&interpreter.Config{
Storage: storage,
ImportLocationHandler: func(inter *interpreter.Interpreter, location common.Location) interpreter.Import {
@@ -1792,7 +1793,7 @@ func TestCheckStorageHealthInMiddleOfTransferAndRemove(t *testing.T) {
Program: ast.NewProgram(nil, []ast.Declaration{}),
Elaboration: sema.NewElaboration(nil),
},
- utils.TestLocation,
+ TestLocation,
&interpreter.Config{
Storage: storage,
ImportLocationHandler: func(inter *interpreter.Interpreter, location common.Location) interpreter.Import {
diff --git a/tests/interpreter/while_test.go b/interpreter/while_test.go
similarity index 97%
rename from tests/interpreter/while_test.go
rename to interpreter/while_test.go
index 10bcf69db6..c341dfdf57 100644
--- a/tests/interpreter/while_test.go
+++ b/interpreter/while_test.go
@@ -23,9 +23,8 @@ import (
"github.com/stretchr/testify/require"
- . "github.com/onflow/cadence/tests/utils"
-
"github.com/onflow/cadence/interpreter"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
)
func TestInterpretWhileStatement(t *testing.T) {
diff --git a/meetings/2022-07-22.md b/meetings/2022-07-22.md
deleted file mode 100644
index 85e76f7dd2..0000000000
--- a/meetings/2022-07-22.md
+++ /dev/null
@@ -1,106 +0,0 @@
-
-# July 22, 2022
-
-## External Mutability
-
-- FLIP that prevents external mutation was approved, implemented, and released in Secure Cadence:
- [https://github.com/onflow/flow/pull/703](https://github.com/onflow/flow/pull/703)
-- Open problems:
- - Composites were not covered by the FLIP, only arrays and dictionaries
- - Externally taking a reference to a field can circumvent the external mutability restriction
-- New FLIP: [https://github.com/onflow/flow/pull/1056](https://github.com/onflow/flow/pull/1056)
- - Purity/mutability modifier for functions
- - Automatic analysis to determine if function has side-effects
-
-## Condition can currently have side effects
-- https://github.com/onflow/cadence/issues/1805
-- Might be used for underhanded code: Post-condition might perform mutation. Example: FT withdrawal
-- Might be solved by purity FLIP
-- Can a pure function emit events?
- - Does affect on-chain state, but is not observable
-- Are other side-effecting functons like debugging logging allowed?
-- "Pure" vs "no side-effects"
- - "Pure" usually means no side-effects at all
- - Have to be pragmatic
-- Alternatives:
- - Prevent calls in general
- - Run-time errors if there are side-effects
-
-## Remove deprecated key API
-- We currently have two key management APIs:
- - `AuthAccount.addPublicKey`/`AuthAccount.removePublicKey`:
- - Low-level, accepts encoded key as byte array
- - Deprecated a year ago
- - [`AuthAccount.keys.add`](https://docs.onflow.org/cadence/language/accounts/#add-account-keys)/`AuthAccount.keys.remove`
- - High-level, accepts key as object (`PublicKey`)
- - Added a year ago
-- We attempted to remove the deprecated in the Secure Cadence release
- - Rolled back, as it will break client applications if they use SDK which uses deprecated API
-- Also: Events that are emitted when a key is added is inconsistent, depends on which API is used: https://github.com/onflow/cadence/issues/1796
-- Do we have metrics on how many SDKs are still using the deprecated API?
-- Actionables:
- - Add deprecation annotation to developer tooling
- - Pragma, e.g. `#deprecated`
- - Comment, e.g. `@deprecated`
- - Add support in VS Code, render as ~~addPublicKey~~
-
-## Interface default methods
-- https://github.com/onflow/cadence/pull/1076
-- Proposed for NFT metadata standard
-- Helps with preventing breakage in ecosystem
-- Avoid copy/paste and boilerplate, making code reusable
-- Does not help with FT/NFT rewrite proposal
-- Useful for utility/convenience functions, reducing boilerplate
-- Open Questions:
- - Security implications?
- - Related:
- - Post-conditions with side-effects
- - Mutability
- - Restrict to pure functions? Potentially too restrictive, e.g. couldn’t provide
- - Maybe allow opt out of mutating functions. But could also be used to opt-out of a fix
- - Examples?
- - Trust relationship problem
- - Already have this problem with contract updates
- - Modification of default implementation
- - Would be useful to provide utility functions, like FT transfer
- - It should not be possible to perform malicious code, as the same could be done in a non-default function
-- Not a breaking change, could merge and ship before Stable Cadence
-- When there is a conflict, e.g multiple interfaces provide default implementation:
- - No "winner" is selected by default
- - Instead, the user is required to provide an implementation
-- Follow up feature: Interface requirements
- - Declaration site: `CI1: CI2`
- - Use-site would still have to explicitly declare conformance for all interfaces: `C: CI1, CI2`
-
-## Storage Querying/Iteration API
-- https://github.com/onflow/cadence/issues/208
-- Finally added technical foundation a couple months ago:
- Account storage data is now stored in [atree](https://github.com/onflow/atree) values
- (atree is Cadence's storage layer)
-- Issue lays out proposal for adding API to iterate over account paths/values
-- Outstanding issues:
- - Accounts may store a lot of data. Pagination iteration? Iterator, cursor, enumerator
- - Concrete API proposal
-- First use-case: Developer tools like the Emulator and Playground
-- Need to show wallet developers how they can render information to users
-- Mutability not necessarily a problem: Run script against block.
- - Problem: data availability
- - Might be solved in future by "historic" data node
-- Storage Layer:
- - Iteration over dictionary changes when mutated
- - Keys are hashed
-- Start with MVP
-- Stages:
- - 1. Even useful if pagination problem is not solved yet
- - 2. Pagination for larger accounts
- - 3. Support for handling mutation
-- Also useful for e.g. dictionary, keys. Might be too large
- - Keys on demand
- - E.g. useful to pick a random key
-
-## Organisational
-
-- Should we move this meeting so it is not on a Friday evening for folks in Europe?
- - Not Friday, not Monday
- - Tuesday is best
- - Same time (8am PT)
diff --git a/meetings/2022-08-30.md b/meetings/2022-08-30.md
deleted file mode 100644
index 1a4f9e22e2..0000000000
--- a/meetings/2022-08-30.md
+++ /dev/null
@@ -1,93 +0,0 @@
-# August 30, 2022
-
-* We discussed the currently open FLIPs
-
-* **Remove public resource fields:**
- * https://github.com/onflow/flow/pull/739
- * Status:
- - No consensus
- * Open problems:
- - None
- * Next steps:
- - Ask author (Dete)
-
-* **Capability Controllers:**
- * https://github.com/onflow/flow/pull/798
- * Status:
- * More API discussions (delegation, revocation)
- * Exploring how to make APIs/use-casess simpler to use/understand
- * Sentiment: proposal OK, but also want to cover more use-cases
- * Maybe split proposal? At least gather use-cases, maybe propose functionality in separate FLIP(s)
- * Next steps:
- * Meeting
- * Finish use-case gathering
- * Open problems:
- * Should capabilities be resources? Agreement they should be values
- * Relation to extensibility proposal → some use-cases could be covered by extensibility ([FLIP 1101](https://github.com/onflow/flow/pull/1101))
- * It would be great to have account identity (-> [FLIP 945](https://github.com/onflow/flow/pull/945)), do not have to be storable, only needs to prove
- * Cons: tied to identity, not transferable between accounts owned by same person
- * Alternative (?): wrapping/unwrapping (pattern instead of new language feature)
- * Alternative (?): sharing using account
-
-* **Add identity to AuthAccount:**
- * https://github.com/onflow/flow/pull/945
- * Status:
- * Maybe not needed if capability controllers proposal gets added (?)
- * Missing use-case / documentation
- * Many cons, alternatives exist → need to be added to FLIP
- * Next steps:
- * Add cons to proposal
- * Extend article with why identity resource is not a good alternative
- * Promote safe patterns for identity/access control
- * Open problems:
- * "Too easy" to use instead of capabilities introduces a footgun.
-But: just another tool for access control, useful for certain use-cases, still recommend capabilities
- * Possible to pass on identity, potentially a malicious program pretends it has access
- * But also *not* providing identity will cause developers to create their own potential unsafe. Cannot prevent it
- * Alternative: instead of passing identity around, code wraps value for target, target has secret unwrapper
-
-* **Purity/mutability analysis:**
- * https://github.com/onflow/flow/pull/1056
- * Status:
- * Simplified original proposal
- * Consensus
- * Next steps:
- * Merge PRs into feature branch, let people try it out
- * Make decision on FLIP
- * Notes:
- * `pure` was changed to `view`, like in Solidity
- * Open problems:
- * None
-
-* **Extensibility:**
- * https://github.com/onflow/flow/pull/1101
- * Status:
- * Many open problems
- * Unclear definition of problem
- * Next steps:
- * Meeting
- * Clearly defining use-case / features
- * Open problems:
- * Current proposal has many open questions / edge cases
- * Unclear what features should be provided by proposal
-
-* **Add fields during contract update:**
- * https://github.com/onflow/flow/pull/1097
- * Status:
- * Good start
- * Need to answer outstanding questions
- * Overall agreement, probably gets approved/implemented once details figured out
- * Next steps:
- * Meeting
- * Open problems:
- * Migration
- * Field removal
- * Syntax
-
-* **Invalidate references to transferred resources:**
- * https://github.com/onflow/flow/pull/1043
- * Status:
- * Paused discussion on this, hoped to have [FLIP 1056](https://github.com/onflow/flow/pull/1056) solve this
- * Need to increase priority
- * Open problems:
- * ?
diff --git a/meetings/2022-09-13.md b/meetings/2022-09-13.md
deleted file mode 100644
index 6eb70b6fc4..0000000000
--- a/meetings/2022-09-13.md
+++ /dev/null
@@ -1,214 +0,0 @@
-
-# Sept 13, 2022
-
-## FLIPs
-
-* **Capability Controllers:**
- * [https://github.com/onflow/flow/pull/798](https://github.com/onflow/flow/pull/798)
- * Status: Scoping
- * Open problems:
- * What parts should be part of this FLIP?
- * What should rather go in follow-up proposal(s)?
- * How to provide better and easier to understand API?
- * Next steps:
- * At least define replacement for current API
- * Solve bootstrapping problem in separate FLIP
- * Meeting
-
-* **Add identity to AuthAccount:**
- * [https://github.com/onflow/flow/pull/945](https://github.com/onflow/flow/pull/945)
- * Status: Closed, replaced by capability publish/claim FLIP 1122
-
-* **Publish and Claim Capabilities**
- * [https://github.com/onflow/flow/pull/1122](https://github.com/onflow/flow/pull/1122)
- * Purpose: Capability bootstrapping. Replacement for FLIP 945
- * Status: New, just published
- * Open problems:
- * Only for capabilities or anything?
- * Off-chain or on-chain inspection?
- * Next steps: Clarify/resolve open problems
-
-* **Extensibility**(see below)
- * [https://github.com/onflow/flow/pull/1101](https://github.com/onflow/flow/pull/1101)
- * Status: Impass, unclear scope/direction
- * Open problems:
- * Two different proposals with different pros/cons
-(boxing/wrapping vs containment)
- * Next steps:
- * Meeting
-
-* **Add fields during contract update:**
- * [https://github.com/onflow/flow/pull/1097](https://github.com/onflow/flow/pull/1097)
- * Status: No update
- * Open problems:
- * Implementation details for migration (not impossible, just needs to be laid out)
- * Next steps:
- * Meeting
-
-* **Invalidate references to transferred resources:**
- * [https://github.com/onflow/flow/pull/1043](https://github.com/onflow/flow/pull/1043)
- * Status:
- * Agreement for need
- * Prototype implementation in progress
- * Open problems:
- * Concerns
- * Next steps:
- * Complete prototype
- * Analyze impact
-
-* **Borrow Contract**
- * [https://github.com/onflow/flow/pull/1071](https://github.com/onflow/flow/pull/1071)
- * Status:
- * Complete
- * Needs minor edits
- * Reference implementation in progress
- * Open problems:
- * Concern that static analysis is not possible anymore resolved:
- * Already have run-time imports of contracts
- * Concern for program cache invalidation:
- * Implementation detail, not a concern, functionality basically already available
- * Next steps:
- * Needs approval/rejection
-
-* **Remove public resource fields:**
- * [https://github.com/onflow/flow/pull/739](https://github.com/onflow/flow/pull/739)
- * Status: No progress
- * Open problems: None
- * Next steps: Dete
-
-* **Purity/mutability analysis:**
- * [https://github.com/onflow/flow/pull/1056](https://github.com/onflow/flow/pull/1056)
- * Status: Accepted 🎉
-
-## Extensions
-
-* [https://github.com/onflow/cadence/issues/357](https://github.com/onflow/cadence/issues/357)
-* Context
- * Long-requested feature: Add functionality and data to existing types, after the fact, without work from author of type. Controlled by user
- * Prior community effort: [https://forum.onflow.org/t/extensibility/622](https://forum.onflow.org/t/extensibility/622)
-* Open Questions:
- * What are the use-cases that should be covered?
- * Do we need to add support for extending fields?
- * This significantly complicates extensions by requiring them to define new (or partial) initializers for their new data
- * How limiting would it be to restrict extensions to be used only one at a time?
- * Otherwise we need to consider how to handle extensions with overlapping data/methods. In other languages this is simple but in Cadence two extensions that define the same type but use it differently would be a security issue
- * How can the same type interact with differently extended versions of itself? Can a CryptoKitty with a hat be used in places where only a CryptoKitty is expected? Can a CryptoKitty with a hat and a scarf be used as if it only had a scarf?
-
-## Account Storage Delta (hash)
-
-* [https://github.com/onflow/cadence/issues/1777](https://github.com/onflow/cadence/issues/1777)
-
-* Determine change on-chain was as expected
-
-* Accessible on-chain
-
-* Dry run: run transaction as script, get hash
-
-* Run transaction, ensure hash in post-condition
-
-* Related to iteration: detect invalidation due to mutation
-
-* Hash should be cheap, needs to be cheaper than comparison
-
-* Feedback:
-
- * Storage changes are not immediately effective, serialization is lazy
-(end of transaction)
-
- * But: storageUsed materializes cache
-
- * Potential problem: more modifications after transaction end
-
- * Hash of what? Full account? All accounts? Just part of an account’s storage?
-
- * Can we use state proofs?
-
-* Next steps:
-
- * Ping FVM team
-
- * Atree/State trie additions? Ask Ramtin, Faye
-
- * Keep discussion in Github issue, determine details
-
- * → propose FLIP once clear how to implement
-
-## Prevent re-entrancy attacks
-
-* [https://github.com/onflow/cadence/issues/1543](https://github.com/onflow/cadence/issues/1543)
-
-* Large topic, low priority relative to other issues
-
-* Many different options
- * Explicit vs implicit
- * Granularity: whole type vs individual fields
- * Static vs dynamic guarantees
-
-* Problems:
- * Learning curve
- * Ideally no-brainer or very easy to use
-
-* Ideas:
- * Rust/Ocaml ref-cells
- * Make cross-contract calls promises / asynchronous
- * Async prepares for sharding in future
- * Examples: Swift’s new actor system, Agoric, etc.
- * JS developers still try to understand promises
- * Does not handle all cases
- * Implicit / hidden
-
-## Extend character set of identifier part in paths
-
-* [https://github.com/onflow/cadence/issues/419](https://github.com/onflow/cadence/issues/419)
-* Allowing dots is parsing problems (conflict with field access)
-
-## Alternative to paths: Resolver functions
-
-* Not addressing by path, but by type (used to have this early on)
-* What if multiple elements for one type? Array? Identifier?
-* Resolver function for a type/name pair. E.g. FT + "default"
-* For / instead of public domain
-* Relation to capability controllers:
- * Gets rid of private paths, not paths in general
- * Could make use of this feature
-
-* Next steps:
- * What use-cases/problems does this solve?
- * Comparison to existing system
- * Pros/cons
-
-## Initialization problem
-
-* Context
- * How to ensure proper setup? e.g. linking, initialization of storage
- * Lost+Found
-
-* Problem:
- * Have bits and pieces
- * No concrete full solution
-
-* Related:
- * New FT + NFT standards have built-in info, collection data metadata
- * Specific to FT/NFT, not a general solution
- * Assumes collection is already stored
- * "Transaction/interaction templates" proposal
- * Setup (e.g. FT vault) + interactions (e.g. FT transfer)
-
-* Cadence-specific ideas:
- * Scoped access to storage (e.g. by path)
- * Related to granular capabilities for AuthAccount
-
-* Next steps:
- * Create issue, not a FLIP yet
-
-## Error messages of assert/pre/post are eagerly evaulated
-
-* [https://github.com/onflow/cadence/issues/1838](https://github.com/onflow/cadence/issues/1838)
-
-* Should go into Stable Cadence
-
-* Encourage error messages
-
-* Workaround create custom wrapper:
-assert(true, message: lazyMessage: ((): String)?)
-
diff --git a/meetings/2022-09-20-Extensions.md b/meetings/2022-09-20-Extensions.md
deleted file mode 100644
index 9e3fed4df9..0000000000
--- a/meetings/2022-09-20-Extensions.md
+++ /dev/null
@@ -1,57 +0,0 @@
-# Extensions Meeting Notes
-
-FLIP: https://github.com/onflow/flow/pull/1101
-
-## Two Paradigms
-### Statically Checked
-* Multiple different people could have the same extensions that do the same thing
-* What if someone deletes the contract defining an extension?
-### Dynamically Enforced
-* Extensions would function like a “sub-resource”, method lookup would first happen on the extension, then fall back to the parent
-
-
-# Discussion
-* Microplatforms that can be extended
- * Allow people to add features/functionality to their code without changing it, as this is the primary paradigm of smart contract development
- * Better for composability
- * People who add functionality should not be able to break the rules originally encoded into the base object
- * This paradigm benefits from thinking about extensions as an attachment rather than a wrapper; this is independent of whether or not we have a static representation
- * Owner of the resource **must** have control over what extensions are attached to the resource
-
-* Are these two proposals even that different?
- * Static version may be the same as the dynamic version just with added static typing
-* Should it be possible to override the behavior of the base resource?
- * Potential to be dangerous, but also potential to be very powerful
- * E.g. Vault that does automatic currency conversion
- * This could also be done by just creating a different type that wraps a Vault (e.g. implementing Provider and Receiver), rather than extending the Vault type
- * Assumption up to this point has been: extension can add new functionality but cannot change any old functionality
- * Extended version of a type is no longer an instance of the old type, which makes overriding the old type safe
- * Explicit casting
-* Metadata
- * Metadata should reflect the extensions that are present on the type, rather than only showing the base resource
-* Extension adds method that is later added by the base resource
- * What happens here?
- * In static model, the extension’s method would need to be removed
- * Could also require users to be explicit about which type (base or extension) they wish to use the method from (static dispatch)
- * Type.foo(instance)
- * Cadence’s flavor is more Pythonic than this very C++/Rust solution? Syntax is fundamentally different to what Cadence currently uses
- * Could also have the composed version default to the extension’s method and must be casted to the base type to use the base type’s method
- * Including the self pointer inside the definition of the extension itself
- * Or super keyword for extensions to refer to its base type
-* Benefit of extensions over a purely compositional model is extensions have information about what base type an extension is attached to (e.g. via a self pointer)
-* Signature extensions should not be removable and attachable to another resource
- * But it would make sense for a hat to be removable and given to another kitty
- * Need to allow extensions to decide whether they can be transferable or not
-* Having extensions be their own resources/NFTs that can be traded is a nice feature if it’s easy, but is not necessary
- * Extension could just be a manager for a resource type, rather than the extension being the resource itself
-* Object and its extensions should be independent types that can define conflicting methods
- * E.g. metadata case
- * Need some method to go from extension to base and vice versa
- * While you have the extension, you only have access to those methods, and while you have the base you only have access to its methods
- * Extension has a reference to its parent?
- * Like trait objects in Rust
-* Is this still extensions? Current proposal feels more like “attachments” rather than an extension of the base type
-* Not the same as a dictionary of owned resources on the parent type
- * Must have a backpointer from attachment to parent
- * Use cases where the attachment should not be transferable
- * For transferable cases, the attachment can be a manager that handles the resources, rather than the resource itself
diff --git a/meetings/2022-09-26 Capabilities.md b/meetings/2022-09-26 Capabilities.md
deleted file mode 100644
index 1babde82b0..0000000000
--- a/meetings/2022-09-26 Capabilities.md
+++ /dev/null
@@ -1,151 +0,0 @@
-
-# Capabilities Meeting Notes
-
-## Capability bootstrapping proposal
-
-* FLIP: https://github.com/onflow/flow/pull/1122
-
-* Publishing capabilities
-
-* Last problem: Spam
-
- * Off-chain or on-chain (events, iteration API)
-
- * Quantity
-
- * Message could be harassment
-
- * Ideas:
-
- * Maybe no default/built-in/system event, but a custom event?
-
- * Not concern of protocol, but level above:
-
- * Allow/Ignore-list in user agent (e.g wallet software)
-
- * User agent could default to everything, but have harassment/filtering feature
-
- * Events are for making systems aware of on-chain state changes
-
- * Warning in documentation:
-
- * Events should not be presented as-is to user
-
- * Having no events will result in user agents to repeatedly pull
-
- * Block explorer shows everything (today; could be extended, just like a user agent like a wallet)
-
- * Capabilities only?
-
- * Arbitrary publishing will result in avoiding capabilities
-
- * Should only be used to bridge to capabilities world
-
- * → design API so it can be extended to allow resources in the future in a backwards-compatible way
-
- * → only publish / claim / unpublish
-
- * Claim:
-
- * Event?
-
- * → Emit:
-
- * Not much harm
-
- * Useful in typical user agent (dashboard)
-
- * Need for reacting stays
-
- * Don’t emit:
-
- * Why?
-
- * Removal/unpublish?
-
- * Don’t remove:
-
- * No harm in staying
-
- * Removing seems implicit
-
- * Receiver may rely on cap existing in publisher
-
- * → Remove:
-
- * Optimize for standard case
-
- * No need to constantly clean up
-
- * Mailbox analogy: someone shows up and claims → gone, no further action required by publisher
-
- * Forces receiver to "move" the capability to their account
-
- * → Need good documentation with examples
-
- * E.g. Claim cap, get resource, store resource, throw away cap
-
- * Related: event API needs filtering and pagination
-
- * Concern: Capabilities can be copied
-
-## Capability Controllers
-
-* FLIP: https://github.com/onflow/flow/pull/798
-
-* Revocation problem example (admin interface)
-
-* Capability creation only in publisher’s account?
-
-* Admins should be able to undo, even each others’ decisions
-
-* Not a problem of the language / API (should make it possible, something else can make it easier); capabilities API should be as simple (basic?) as possible
-
-* Problems can mostly be solved with (better) attenuation
-
-* Need delegation without changing type
-
-* Attenuation allows custom code → security issues?
-
-* Use cases for both concrete type and interface
-
-* Tags?
-
-* Mapping of names to IDs in contract?
-
-* Use own name for capability. Does it require re-lookup based on ID?
-
-* Keep reference count?
-
-* Remove retarget?
-
- * Security issue: retarget after check
-
- * Can only retarget to same type
-
- * Safety footgun
-
- * Problematic in two-step process
-
- * But always a problem
-
- * Examples:
-
- * Caps on interfaces, don’t care about concrete type, care about functionality
-
- * Concrete vault vs e.g pooling/split abstraction
-
-* Remove restore?
-
-* Struct, but non-storable
-
-* Don’t return status flags. Either idempotent or panic
-
-* → Attenuation out of scope
-
-* → Example for delegation
-
-* → Example for cap petnames
-
-* → Default function petname should be default → easy to add later, move ahead without
-
diff --git a/meetings/2022-09-27.md b/meetings/2022-09-27.md
deleted file mode 100644
index 3cd8d2c2f4..0000000000
--- a/meetings/2022-09-27.md
+++ /dev/null
@@ -1,118 +0,0 @@
-# Sept 27, 2022
-
-## FLIPs
-
-* **Capability Controllers:**
- * https://github.com/onflow/flow/pull/798
- * Status: had meeting; scope clear, API design
- * Open problems:
- * None, mainly just API design
- * Next steps:
- * Move forward with API details
-
-* **Publish and Claim Capabilities**
- * https://github.com/onflow/flow/pull/1122
- * Status: meeting resolved outstanding questions
- * Open problems:
- * None for FLIP, but related: might need improve event API
- * Next steps:
- * Have a final look
-
-* **Extensibility**
- * https://github.com/onflow/flow/pull/1101
- * Status: Had meeting, still unclear what approach is best
- * Open problems:
- * Problem with extensions approach: changes in extension and extended type break code
- * Use case: metadata
- * Alternative: attachment-style proposal; requires iteration
- * Next steps:
- * Alternative FLIP for attachments
- * Compare with existing extensions FLIP
- * Pick one or find compromise
-
-* **Add fields during contract update**
- * https://github.com/onflow/flow/pull/1097
- * Status: No update
- * Open problems:
- * Implementation details for migration (not impossible, just needs to be laid out)
- * Next steps:
- * Call?
-
-* **Invalidate references to transferred resources:**
- * https://github.com/onflow/flow/pull/1043
- * Status:
- * Agreement for need
- * Prototype implementation: https://github.com/onflow/cadence/pull/1999
- * Agreement that any transfer (even stack-to-stack) invalidates
- * Open problems:
- * https://github.com/onflow/flow/pull/1043#issuecomment-1258742270
- * Maybe use stack depth check?
- * Next steps:
- * Analyze impact: analysis pass (also useful for breaking change analysis; hard to check)
- * Note: this is about ephemeral references (lifetime of a transaction/script), not capabilities
-
-* **Borrow Contract**
- * https://github.com/onflow/flow/pull/1071
- * Status:
- * Complete
- * Needs minor edits
- * Have reference implementation: https://github.com/onflow/cadence/pull/1934
- * Open problems:
- * Concern that static analysis is not possible anymore resolved, already have run-time imports of contracts
- * Concern for cache invalidation - implementation detail, not a concern, functionality basically already available
- * Next steps:
- * Needs approval/rejection
-
-## Contract removal
-* Was available until Secure Cadence release
-* Problem: Removal + addition allows circumventing updatability checks
- * E.g. change field type, change type kind, etc.
-* Currently disabled, as it is unclear how to implement this safely
-* Options:
- * Don't have removal
- * Revocation / tombstoning
- * Keep old contract information and treat addition as update
-* Unavailability of removal
- * Hinders development of utility contracts
- * Unable to clean up account storage
-* Removal of contracts/types might leads to breakage
-* Removal useful for "temporary" types, e.g. for capability attenuation
- * Idea: Marking contracts as "public"/"internal"/"beta", cannot be shared/stored/etc
-* It would be nice to have and expose instance count for types, allow removal if no instances
-
-## Scoped AuthAccounts / Account initialization
-* https://github.com/onflow/flow/issues/1131
-* Solve the account initialization problem
-* E.g. marketplace needs to know how to prepare user account
-* Responsibility of initialization should be on dapp, not user agent
- * However, power user might want to control where e.g. collection is stored, might have multiple
- * Normally user does not care, wants "default". Still, user agent (wallet software) should take care, not contract
-* Actors: user, asset creator, application developer
- * Asset creator and application developer often tied together
- * However, application developer might not be asset creator (e.g. marketplace)
-* User should be in control, not asset creator or application developer. Might use user agent. Asset creator might propose requirements so it can function
-* Analogy: User data vs system files (Installer asks where program should be installed)
-* Scoped AuthAccount is basically attenuated AuthAccount
-* Related (alternatives?):
- * Bjarte's FLIP: https://github.com/onflow/flow/pull/748
- * Transaction interaction templates
- * NFT catalog
- * Return initialization information
- * NFT Metadata: [https://github.com/onflow/flow-nft/blob/9877dccbd884e06bbd754a4f693b7169dd6dd62b/contracts/MetadataViews.cdc#L480-L537](https://github.com/onflow/flow-nft/blob/9877dccbd884e06bbd754a4f693b7169dd6dd62b/contracts/MetadataViews.cdc#L480-L537)
- * New NFT feature: [https://github.com/onflow/flow-nft/pull/126#discussion_r981328645](https://github.com/onflow/flow-nft/pull/126#discussion_r981328645)
- * Declaration in prepare block (?)
- * Pass box which captures initialization
- * Enforce limitation in type system (e.g. AuthAccount restricted to just storage, only certain path, only write, etc.)
-* Approach axes:
- * Limiting vs checking after the fact
- * Imperative vs declarative
-* Next steps:
- * Agreement on responsibility, formalize
- * Find solution that aligns
- * Meeting with people involved with existing solutions
- * Who? Dete, Austin (after 7th), Bjarte (other FLIP), Amit (NFT catalog, NFT Collection Metadata), Jeff (interaction templates)
-* Additional discussion points from Amit:
- * Fixing existing account links that have it wrong (and gracefully with an account that has it wrong). Currently its unlink -> link
- * [Metadata views] aren't very useful on-chain because you have to make custom templated transactions regardless in order to make these links because we lack a way to link at runtime (see https://github.com/onflow/cadence/issues/1617)
- * Having a way to allow a contract owner to be more prescriptive about what setup should be done (maybe past a single public link like the view provides).
-
diff --git a/meetings/2022-10-11.md b/meetings/2022-10-11.md
deleted file mode 100644
index 278cb1e919..0000000000
--- a/meetings/2022-10-11.md
+++ /dev/null
@@ -1,170 +0,0 @@
-# Oct 11, 2022
-
-## FLIPs
-
-### Capability Controllers
-
-* [https://github.com/onflow/flow/pull/798](https://github.com/onflow/flow/pull/798)
-* Status:
- * Ready for approval
- * Hardest problem was bootstrapping, solved by publish/claim
- * Want to potentially explore backward compatibility
-* Open problems:
- * Could emulate proposal / or existing API
- * How to have both at the same time
-* Next steps:
- * Determine backward compatibility
- * Other than that, ready to move to decision, mostly agreement
- * Could maybe consider adjust proposal to allow for backward-compatibility
-
-### Extensibility
-
-* [https://github.com/onflow/flow/pull/1101](https://github.com/onflow/flow/pull/1101)
-* [https://forum.onflow.org/t/flip-cadence-extensions-attachments/3645/2](https://forum.onflow.org/t/flip-cadence-extensions-attachments/3645/2)
-* Status:
- * Alternatively: [Attachments FLIP](https://github.com/onflow/flips/pull/11)
- * FLIP discussions now in forum: [https://forum.onflow.org/t/flip-cadence-extensions-attachments/3645](https://forum.onflow.org/t/flip-cadence-extensions-attachments/3645)
- * More dynamic, little static typing
- * Benefits:
- * Not prone to breakage on contract updates
- * Disadvantages:
- * Less ergonomic, less powerful
-* Open problems:
- * None (?) in both
-* Next steps:
- * Review/compare two FLIPs, make decisions on what matters
- * Both doable, static slightly more work
- * Most important is UX/use-cases for developers
- * Attachments proposal matches more closely use-cases (?)
- * Static guarantees / implicitness better
- * Extensions proposal provides more static guarantees
- * Extension can statically state requirements (type)
- * Often more, dynamic requirements
- * Can restrict which code can create instances
- * Usually instantiation is unrestricted, it’s acceptance which is limited
- * Openness VS security foot-gun
- * Prefer openness
- * Extensions more powerful, but also more complex
- * Attachments simpler, covers less use-cases, but more common one
-
-### Add fields during contract update
-
-* [https://github.com/onflow/flow/pull/1097](https://github.com/onflow/flow/pull/1097)
-* Status: No update
-* Open problems:
- * Implementation details for migration (not impossible, just needs to be laid out)
-* Next steps:
- * Call?
-
-### Invalidate references to transferred resources
-
-* [https://github.com/onflow/flow/pull/1043](https://github.com/onflow/flow/pull/1043)
-* Status:
- * Ready for decision
- * Implementation mostly ready ([https://github.com/onflow/cadence/pull/1999](https://github.com/onflow/cadence/pull/1999))
- * Initially only planned dynamic checks
- * Also added static checks to prevent bugs/problems early
- * Static checks cover most use-cases discovered during analysis of Mainnet contracts
-* Open problems:
- * None
-* Next steps:
- * Make a decision, mostly agreement
-
-### Borrow Contract
-
-* [https://github.com/onflow/flow/pull/1071](https://github.com/onflow/flow/pull/1071)
-* Status:
- * Complete
- * Have reference implementation ([https://github.com/onflow/cadence/pull/1934](https://github.com/onflow/cadence/pull/1934))
- * Needs some assistance on e.g. tests
- * FLIP is up-to-date
-* Open problems:
- * Concern that static analysis is not possible anymore resolved, already have run-time imports of contracts
- * Concern for cache invalidation – implementation detail, not a concern, functionality basically already available
-* Next steps:
- * Needs approval/rejection
-
-### Enforcing events / nested type requirements
-
-* We would like to remove the nested type requirements feature from Cadence
-* However, the new FT/NFT standards plan to keep using the feature for enforcing the declaration of event
-* Can we find an alternative to enforcing events without using nested type requirements?
- * Events as nested type requirements are mostly just boilerplate
- * Concrete type "needs" separate events, cannot emit events from interface
- * Definitions in concrete type are not "useful" right now, cannot enforce they are emitted in a certain way
- * Maybe just "inherit" event types from interface
- * Feedback: Too implicit
- * Contract-level events -> requires type field
- * Maybe move events to resource-level, i.e. FT/NFT itself?
- * Changing events significantly will affect existing off-chain systems
- * Emit event always in post-condition of interface
- * Currently (potentially unnecessarily) limited by new view-functions feature (conditions are view contexts)
- * Requires allowing definition of concrete events in interfaces
- * Might be easier to have "universal" event types with type field, instead of separate ones
- * Related: filtering on API
-* If we can't remove nested type requirements, can we maybe at least reduce the feature to just events? Only using the feature for events addresses at least some of the concerns we have with the feature, and we can still simplify the codebase a bit
-* Next steps:
- * Write example standard and derive required language changes (Deniz and Bjarte will look into it)
-
-### Additional Storage API functions
-
-* `clear`: [https://github.com/onflow/cadence/pull/1253](https://github.com/onflow/cadence/pull/1253)
- * `fun clear(_ path: Path): Bool`
- * Reason: sugar/helper
- * This function deletes whatever is present at the specified path, destroying any resources, and returns whether anything was present originally.
- * Concerns: implicitness, destruction without destroy
- * Maybe name "destroyAt"
-* `forceSave`: [https://github.com/onflow/cadence/pull/1252](https://github.com/onflow/cadence/pull/1252)
- * `fun forceSave(_ value: T, to path: Path): Bool`
- * This will save a value to the specified path, overwriting any data present (and destroying it if it is a resource). Returns whether or not any data was overwritten
- * Reason: save fails when value exists
- * Concerns: destruction without destroy
- * Maybe name "destroyAndSave"
-* Functionality exists already
-* Prefer explicitness / keyword (enforce one way)
-* Main use-case: avoiding path collisions
-* Related: Removal of storage paths (replace with type + name pair)
-* Concern: streamlining pattern we do not want to encourage
-* → Put on pause until we discussed path changes
-
-### Alternative to paths
-
-* FLIP draft: [https://github.com/onflow/flow/pull/1130](https://github.com/onflow/flow/pull/1130)
-* Cap Cons:
- * Remove private (no longer needed, were only used for caps)
- * Public for capabilities
-* Problems with paths:
- * Collisions
- * Most common use-case: one value per type
-* Type + name pair
-* Problem:
- * borrow can be for interface
-* Idea/goal for paths:
- * User’s account is controlled by user, UA mediates
- * Dapp/contracts should not dictate
- * Common user just has one value (e.g. default FT vault, NFT collection)
- * Power users might have multiple (e.g. multiple FT vaults, NFT collections, for different purposes. Cf. checking vs savings account)
- * Not (yet) a reality today, didn’t have necessary functionality
- * Efforts:
- * Interaction template library: Allow UA to inject path
- * New proposal does not hinder the goal (right?)
- * Goal requires introspection
-* Path/name choosing, mediated by UA
-* Related: account initialization (call on 2022-10-18)
-* Application "state" in user account VS user data stored in user account
- * Analogies:
- * Windows Programs directory vs documents directory
- * Mac/*nix /home vs /lib
-* Interoperability easier with user-managed/stored data
-* Next steps: continue discussion
- * How does the proposal solve the problems?
- * ?
-
-### Publish/claim capability use-cases?
-
-* Bootstrapping
-* Outline ideal use-case
-* Existing pattern of private push-inbox, in our case pull
- * Example: n email inbox where emails are pushed through the inbox and handled according to rules (rate limiting, requiring payment or anti-sybil proof)[ https://petmail.lothar.com/design.html](https://petmail.lothar.com/design.html)
-* Update best practices page
-* Next step: Write up, discuss (Kate)
diff --git a/meetings/2022-11-02.md b/meetings/2022-11-02.md
deleted file mode 100644
index 342daba752..0000000000
--- a/meetings/2022-11-02.md
+++ /dev/null
@@ -1,227 +0,0 @@
-# Nov 2, 2022
-
-## **Mainnet spork / Cadence release**
-
-We've achieved another big milestone! 🎉
-
-https://forum.onflow.org/t/cadence-updates-for-the-nov-2022-mainnet-spork/3748
-
-## FLIPs
-
-### Invalidate references to transferred resources
-
-* https://github.com/onflow/flow/pull/1043
-* Status: Accepted 🎉
-
-### Capability Controllers
-
-* https://github.com/onflow/flow/pull/798
-
-* Status:
- * Figured out how to add API in backward-compatible way.
- * Will allow deprecation instead of replacement
-
-* Open problems:
- * None
-
-* Next steps:
- * Vote!
-
-### Attachments
-
-* https://github.com/onflow/flips/pull/11
-
-* Forum discussion: https://forum.onflow.org/t/flip-cadence-extensions-attachments/3645/2
-
-* Status:
- * No feedback if extensions or attachments are preferred. Assume extensions subsumed by attachments.
- * Updated attachment proposal with feedback
-
-* Open problems:
- * attach expression evaluation order: right-to-left. Would be nice to have natural language
- * Currently: `attach A() to <-r`
- * Probably won't matter practically
- * Require it to be view?
- * attach as postfix operator / function?
- * Functions would not require separate handling
- * Naming: attachments are managers/glue vs first-class values like fields
- * Deniz: Attachment is a Manager ( Costume Manager vs Hat ), So maybe using the attachment proposal but naming it an extension can be a better choice. Attachment gives me a different feeling to me
- * Access control / reference kind (auth)
- * Not in the proposal
- * Currently non-auth reference, for owned and non-owned case
- * Iterating has this problem: &AnyAttachment + reflection
-
-* Next steps:
- * Address expression order
- * Address naming
- * Address access control
-
-### Add fields during contract update
-
-* https://github.com/onflow/flow/pull/1097
-
-* Status: No update
-
-* Open problems:
- * Implementation details for migration (not impossible, just needs to be laid out)
-
-* Next steps:
- * Call?
- * Anyone else interested?
-
-### Borrow Contract
-
-* https://github.com/onflow/flow/pull/1071
-
-* Status:
- * Waiting for assistance on Tests on the Cadence implementation side
-
-* Open problems:
- * None
-
-* Next steps:
- * Assist with implementation
-
-### Change semantics of for-loops
-
-* https://github.com/onflow/flips/blob/main/cadence/2022-10-11-for-loop-semantics.md
-
-* Status:
- * Ready for review
-
-* Open problems:
- * None
-
-* Next steps:
- * Vote!
-
-
-### Change the syntax for function types
-
-* https://github.com/onflow/flips/pull/43
-
-* Status:
- * FLIP open, ready for review
-
-* Open problems:
- * None
-
-* Next steps:
- * Vote!
-
-### Interface Inheritance
-
-* https://github.com/onflow/flips/pull/40
-
-* Forum discussion: https://forum.onflow.org/t/flip-interface-inheritance-in-cadence/3750
-
-* Status:
- * FLIP opened
- * Implementation in progress
- * Sentiment is positive for need
- * Blocker is details
-
-* Open questions:
- * How to resolve/handle conflicting default implementations?
- * Do implementations of an interface also have to explicitly specify all inherited interfaces as well?
- * Implicit or explicit conformance
- * Definitely require implementation of all interfaces, inherited or not
- * Maybe require explicit list, as acknowledgement
- * Can conflict with default method resolution
- * Related to first problem
- * Should be consistent
- * Multiple inheritance, lineralization
- * E.g. Python: C3
- * Scala, Rust: explicit order, allow disambiguation
- * Go? Struct embedding
- * Kotlin: https://kotlinlang.org/docs/interfaces.html#resolving-overriding-conflicts
- * Unique to Cadence, not in other languages: contract updatability
- * Related: Condition ordering. Basically: order of execution for code in interfaces
- * Conditions are view functions, so order "doesn't matter", but still needs to be deterministic (for reads, errors)
-
-* Next steps:
- * Resolve open problems
- * Document behaviour for current interface default functions => separate discussion
- * Maybe have breakout session to speed up
- * Who wants to join the discussion?
- * Josh, Satyam, Austin, Bjarte
-
-
-### Extend transaction format
-
-* https://github.com/onflow/flips/pull/41
-
-* TLDR:
- * Use-case: UA should allow users to choose e.g. storage location, etc.
- * Broad scope / far-reaching (Cadence, UA, SDKs, etc.)
- * Cadence: Multiple prepare blocks, field annotations ("roles"), multiple post blocks
- * Benefits: Composition, safety
-
-* Status:
- * FLIP open, looking for initial feedback
-
-* Open problems:
- * Not attached to particular solution
- * Complexity (many additions in multiple areas)
- * Code generation functionality
-
-* Notes:
- * Related to account initialization
- * Austin will reach out to Jeff to align both efforts
-
-* Next steps:
- * Needs more eyes, eventually have breakout session later
-
-## Behaviour of `Account.keys.forEach`
-
-* [https://github.com/onflow/cadence/pull/2038](https://github.com/onflow/cadence/pull/2038)
-
-* All keys or only revoked keys?
-* Maybe indicate through naming?
-* `AccountKey` has index
-* User has the ability to filter revoked keys
-* Currently: includes revoked keys, just like keys field
-* Additional function for filtering revoked?
- * Ideally index of all non-revoked keys in FVM
-* Ordering?
- * Maybe active first, revoked last
- * Would ideally also be based on index in FVM
-* Concern: feels like an array, so user/dev might assume certain ordering
-* Documentation should (already does?) mention order
-* Signal consideration of isRevoked by making it an additional parameter of the callback function? What about weight, that too (e.g. 0 weight)?
-* (Keys are immutable, other than revocation; e.g. can't change weight)
-* Next steps:
- * Leave as-is
- * Improve documentation
-
-## Removal/reduction of nested type requirements
-
-* Several options:
- * Reduction to just events
- * Removal; requires alternative
- * Deniz' issue: https://github.com/onflow/cadence/issues/2069
- * "Global" events
- * Could add additional information (originating contract) to global events
- * https://github.com/onflow/cadence/issues/2081
- * https://github.com/onflow/cadence/issues/1161
- * Use interface default function implementation
-* Related: additional feature to enforcing events are emitted
-* Need to guarantee that only FTs emit events, and only "concrete" events
-* Next steps:
- * Session on new standards, then have better understanding about events
- * e.g. separate vs shared event types
- * Discussion in next Smart Contract Engineering Open House
- * Evaluate options above, pros/cons
-
-## Resolving external mutation
-
-* https://github.com/dapperlabs/cadence-private-issues/issues/59
-
-* Any solutions beyond the reference exploit may impact usability too negatively to be worth implementing?
-
-* Next step:
- * Fill gap for references: dynamic check
- * Does not need FLIP
- * Maybe consider follow-up, address arbitrary mutating functions
- * Remove public fields FLIP, was rejected
- * Reconsider? Need to address outstanding problems
diff --git a/meetings/2022-11-16-Interface-Inheritance.md b/meetings/2022-11-16-Interface-Inheritance.md
deleted file mode 100644
index 8dc40689d4..0000000000
--- a/meetings/2022-11-16-Interface-Inheritance.md
+++ /dev/null
@@ -1,32 +0,0 @@
-# Nov 16, 2022
-
-## Interface Inheritance Meeting Notes
-
-* FLIP: https://github.com/onflow/flips/pull/40
-
-* Forum discussion: https://forum.onflow.org/t/flip-interface-inheritance-in-cadence/3750
-
-* Open Questions:
- * Functions with conditions:
- * FLIP proposes to order them in a pre-determined order and run them all.
- * No overriding is supported (because of security concerns).
- * Is overriding needed? Potentially unsafe to do so.
-
- * Default functions: Two main concerns.
- * Should allow overriding of default functions?
- * Can be a security/safety concern.
- * Someone in a middle of an inheritance chain can override a default function, which would change the behavior for downstream contracts.
- * One solution is to make default functions to be 'view' only.
- * Reduce the depth/impact of security concerns of overriding.
- * Still going to need a way to resolve ambiguity. e.g: Two ‘getId()’ view functions are available; which of the two should be called?
- * How to resolve ambiguity, when two or more default implementations are available for functions?
- * Two potential solutions:
- * Ask the user to solve it by overriding the method inside the concrete-type/interface which faces ambiguity
- (This is what is proposed in the FLIP).
- * Ambiguity resolution of default functions in concrete types also uses the same approach.
- See: https://github.com/onflow/cadence/pull/1076#discussion_r675861413
- * Order/linearize the default functions and pick the one that is 'closest' to the current interface/concrete type.
- * It is 'safe' only if the default functions are view only.
- * Might be surprising to the user.
- * Already disregarded this option for default functions ambiguity resolution in concrete implementations.
- * Need to resolve ambiguity regardless of whether default function overriding is supported or not.
diff --git a/meetings/2023-01-10.md b/meetings/2023-01-10.md
deleted file mode 100644
index 558369152f..0000000000
--- a/meetings/2023-01-10.md
+++ /dev/null
@@ -1,169 +0,0 @@
-# Jan 10, 2023
-
-## FLIPs
-
-### Capability Controllers
-
-[https://github.com/onflow/flow/pull/798](https://github.com/onflow/flow/pull/798)
-
-* Status:
- * Final API discussions
- * TODO:
- * Compatibility with AuthAccount capabilities and Inbox API
- * Emit events
-* Open problems:
- * None
-* Next steps:
- * Vote!
-
-### Auth fields and Safe Downcasting
-
-[https://github.com/onflow/flips/pull/54](https://github.com/onflow/flips/pull/54)
-
-* Status:
- * New
- * Spearheaded by Daniel, Dete, and Kate
- * Discuss proposal
-* Open problems:
- * Migration is complex and widespread
-
-### Attachments
-
-[https://github.com/onflow/flips/pull/11](https://github.com/onflow/flips/pull/11)
-
-[https://forum.onflow.org/t/flip-cadence-extensions-attachments/3645/2](https://forum.onflow.org/t/flip-cadence-extensions-attachments/3645/2)
-
-* Status:
- * Approved and implemented
- * Preview release available to try out the new feature
-* Next steps:
- * Implement iteration
- * This depends on whether we have safe downcasting as an alternative for reflection (see above, [https://github.com/onflow/flips/pull/54](https://github.com/onflow/flips/pull/54))
- * Allow declaring an attachment for restricted types ("set of interfaces") [https://github.com/onflow/cadence/issues/2224](https://github.com/onflow/cadence/issues/2224)
- * Attachment access control based on base resource access
- * Depends on [https://github.com/onflow/flips/pull/54](https://github.com/onflow/flips/pull/54)
-
-### Interface Inheritance
-
-[https://github.com/onflow/flips/pull/40](https://github.com/onflow/flips/pull/40)
-
-[https://forum.onflow.org/t/flip-interface-inheritance-in-cadence/3750](https://forum.onflow.org/t/flip-interface-inheritance-in-cadence/3750)
-
-* Status:
- * Had separate break-out sessions, will need another one
- * Implementation complete for the proposal. Would need changes for the parts of the proposal that would change.
- * Sentiment is positive for need
- * Blocker is details (default functions, in particular)
- * Ideas currently being discussed:
- * Forbid interface changes
- * Change default function
-
-* Open questions:
- * Meeting notes: [https://docs.google.com/document/d/1LUvRg0T09mdE2Ndgti6xI1AY_KPYGJr2ZRLVuqzGxFg/edit#heading=h.d4wc1pr484vi](https://docs.google.com/document/d/1LUvRg0T09mdE2Ndgti6xI1AY_KPYGJr2ZRLVuqzGxFg/edit#heading=h.d4wc1pr484vi)
-
-* Next steps:
- * Schedule another session
- * Is this still a blocker for NFT/FT v2?
-
-### Extend transaction format
-[https://github.com/onflow/flips/pull/41](https://github.com/onflow/flips/pull/41)
-
-* Status:
- * Got some feedback, needs more
- * Large proposal affecting many components
- * Small change, big (good) implications
- * Had break-out sessions, resolved some open questions
- * Need to resolve remaining open questions
-
-* Open problems:
- * No concrete solution, many possibilities, proposal has just one incomplete solution
- * Solution a bit more concrete (e.g. block syntax)
- * Unclear how wallets code-gen and insert parts into transaction
-
-* Next steps:
- * Get more feedback
- * Another Breakout session
- * Prioritize over e.g. reentrancy and external mutability improvements
- * Start with prototyping in Cadence (parsing and type checking)
-
-### AuthAccount capabilities
-
-* [https://github.com/onflow/flips/pull/53](https://github.com/onflow/flips/pull/53)
-
-* Status
- * Had break-out session
- * Child account model is really useful
- * However, should make it "harder" to perform such administrative tasks (linking account capability), also other operations like adding keys
- * At the same time: add safe-guards, require "sudo" signature
-
-* Open problems:
- * Safe guards
- * Once available, wallets need to support for safe guards (e.g. flag "sudo" transaction to user)
-
-* Next steps:
- * Wait with approval of FLIP until safe-guards are available
- * Start on discussion for "sudo" operations in forum, evtl. have FLIP
- * Enable on Testnet to enable demo/development of ecosystem
-
-## Other items for Stable Cadence?
-
-[https://forum.onflow.org/t/the-path-to-stable-cadence/2702](https://forum.onflow.org/t/the-path-to-stable-cadence/2702)
-
-We're mainly looking for changes, especially breaking ones.
-We'll prioritize additional features after Stable Cadence.
-
-* Type aliases
-
-* Enable non-facade capability patterns, e.g. attenuation "building blocks"
- * Currently possible, but heavy-weight (e.g. defining new type)
- * Sugar for e.g. adding pre and post conditions, wrapping, filtering, etc. around methods for an object
- * → auth modifier FLIP
- * → CapCon FLIP
-
-* Consumption of `self`
- * Currently: `resource R { fun foo() { … } }`
- * Implicitly: `resource R { fun foo(self: auth &R) { … } }`
- * Could be explicit: `resource R { fun foo(self: @R) { … } }`
-
-* Cannot return/export certain types, cannot emit events
- * Used to be a problem for function types, references, etc.
- * Should be resolved now, please report non-exportable issues
- * Maybe add ability to override serialization, e.g. allow export of function call value
-
-* Related: Allow import of any value in script (e.g. resource, capability)
-
-* Import just deserialize
- * `struct Foo { let bar: Int; init(bar: Int) { pre { self.bar > 0 } { … } }`
- * Currently allow e.g. `{"type": “Foo”, “bar”: 0}`
- * Call initializer instead?
- * Maybe allow either/or
-
-* Block access to certain read-only functions?
- * Data is assumed to be public
- * Minimize EN’s exclusive access/knowledge
-
-* Broken contracts
- * Skip in storage iteration
- * Might just be partially broken
- * → General problem/idea: Catch panics and resume
- * Issues:
- * Implementation complexity (snapshotting/rollback in storage system, in-memory objects, etc.)
- * Security problems (assumption of rollback)
- * Could allow in scripts
- * Maybe nested transactions?
- * Currently only have nested transactions, no rollback/resumption
- * Recovery:
- * Would be case-by-case (parsing, type checking, conformance, casting failure, etc.)
- * Could e.g. allow reading of fields of stored data, disallow function calls. Useful?
-
-## Nested type requirements → emit events in interfaces?
-
-* FT/NFT standards v2
-* [https://github.com/onflow/cadence/issues/1283](https://github.com/onflow/cadence/issues/1283)
-* [https://github.com/onflow/cadence/issues/2081](https://github.com/onflow/cadence/issues/2081)
-* [https://github.com/onflow/cadence/issues/2069](https://github.com/onflow/cadence/issues/2069)
-
-## Allow deletion of storage values with broken types?
-
-- [https://github.com/onflow/cadence/issues/2170](https://github.com/onflow/cadence/issues/2170)
-
diff --git a/meetings/2023-02-23.md b/meetings/2023-02-23.md
deleted file mode 100644
index c114c438ee..0000000000
--- a/meetings/2023-02-23.md
+++ /dev/null
@@ -1,171 +0,0 @@
-
-# Feb 23, 2023
-
-## FLIPs
-
-### Capability Controllers
-[https://github.com/onflow/flow/pull/798](https://github.com/onflow/flow/pull/798)
-
-* Status:
- * Had many breakout sessions
- * Final API discussions
- * TODO:
- * Compatibility with AuthAccount capabilities
- * Backwards compatibility / migration of existing data
- * Emit events
- * Pet names
-
-* Open problems:
- * Backwards compatibility / migration of existing data
-
-* Next steps:
- * Update proposal
- * One more breakout session
- * Vote!
-
-### Entitlements and Safe Downcasting
-[https://github.com/onflow/flips/pull/54](https://github.com/onflow/flips/pull/54)
-
-* Status:
- * Zeroing in on entitlements concept
- * Getting close to final design
- * Related: [account entitlements](https://forum.onflow.org/t/super-user-account/4088)
-
-* Open problems:
- * How do nested composite fields work?
- * Declaration syntax (resource-typed members)
-
-* Next steps:
- * Breakout session for nested composite fields
- * Asynchronous discussion for declaration syntax
- * Vote!
-
-### Attachments
-
-[https://github.com/onflow/flips/pull/11](https://github.com/onflow/flips/pull/11)
-
-[https://forum.onflow.org/t/flip-cadence-extensions-attachments/3645/2](https://forum.onflow.org/t/flip-cadence-extensions-attachments/3645/2)
-
-* Status:
- * Approved and implemented
- * Preview release available to try out the new feature
- * Second preview release
-
-* Open problems:
- * Trolling attack
- * Problem:
- * Attachments introduce the problem of receiving arbitrary values
- * What if attachment aborts in destructor?
- * Multiple kinds of aborts: panic, infinite loops, etc.
- * Owner cannot remove attachment
- * Owner cannot destroy outer resource
- * Solution ideas:
- * Allow force delete?
- * How?
- * What if code assumes destructor succeeded? e.g. FT total supply
- * Return to creator?
- * What if data cannot be paid for?
- * Return to "network lost and found"?
- * Preventing destroy
- * technically nearly impossible atm
- * Limit destroy?
- * Some destructors mutate, e.g. FT updates contract total supply
- * Only allow "self-calls"?
- * "Two-staged destructors"?
- * In other languages?
-
-* Next steps:
- * Address trolling attack?
- * Breakout session
- * Deploy to TN, not MN
- * Not feature flagged, would need two separate flow-go builds
-
-### Interface Inheritance
-
-[https://github.com/onflow/flips/pull/40](https://github.com/onflow/flips/pull/40)
-
-[https://forum.onflow.org/t/flip-interface-inheritance-in-cadence/3750](https://forum.onflow.org/t/flip-interface-inheritance-in-cadence/3750)
-
-* Status:
- * No further progress
- * Currently at bottom of priorities
-
-* Open questions:
- * Meeting notes: [https://docs.google.com/document/d/1LUvRg0T09mdE2Ndgti6xI1AY_KPYGJr2ZRLVuqzGxFg/edit#heading=h.d4wc1pr484vi](https://docs.google.com/document/d/1LUvRg0T09mdE2Ndgti6xI1AY_KPYGJr2ZRLVuqzGxFg/edit#heading=h.d4wc1pr484vi)
-
-* Next steps:
- * Schedule another session
- * Is this still a blocker for NFT/FT v2?
-
-### Extend transaction format
-[https://github.com/onflow/flips/pull/41](https://github.com/onflow/flips/pull/41)
-
-* Status:
- * Had many breakout sessions
- * Zeroing role based syntax
- * Roles have both prepare and resolve
-
-* Open problems:
- * Unexplored corner:
- * Useful for multi-sign use-cases
- * Does model also make sense for single-sign use-cases?
- * Signer assignment
- * Mapping signatures to roles
- * Currently Flow transaction signatures are sequential
- * Action-based model?
-
-* Next steps:
- * Another breakout session to continue conversation
- * Update Extended Transaction Format FLIP with meeting notes from last breakout session
- * Add information about new prepare/resolve mechanic proposed
-
-### AuthAccount capabilities
-
-[https://github.com/onflow/flips/pull/53](https://github.com/onflow/flips/pull/53)
-
-* Status
- * Had break-out session
- * Preview release
- * Enabled on all networks but Mainnet
- * Working on [account entitlements](https://forum.onflow.org/t/super-user-account/4088)
- * Want to approve and
-
-* Open problems:
- * Forbid Public?
- * Could restrict for linkAccount
- * What about CapCon issueAccount? introduce AccountCapability to allow distinguishing?
- * How can we get it out to Mainnet?
- * Add temporary mechanism, e.g. another type, like proposed originally in [https://forum.onflow.org/t/super-user-account/4088](https://forum.onflow.org/t/super-user-account/4088) ?
- * Need to prevent accidental signing
-
-* Next steps:
- * Brainstorm temporary solution
- * Another breakout session
- * Involve wallet folks (e.g. Dapper, Blocto, etc.)
-
-### External Mutability
-[https://github.com/onflow/flips/pull/58](https://github.com/onflow/flips/pull/58)
-
-[https://github.com/onflow/flips/pull/59](https://github.com/onflow/flips/pull/59)
-
-* Status:
- * Had breakout session
- * Multiple alternatives / FLIPs
- * FLIP 58:
- * Add additional static checks
- * Deemed overkill
- * FLIP 59:
- * Remove/restrict let fields
- * Deemed better than 58
- * Impact analysis:
- * Inner mutability used as a feature
- * E.g. MetadataViews standard
- * Need delegation functions for nested members
- * More boilerplate
- * Moves problem, but does not solve it
-
-* Open problems:
- * Unclear how to proceed
-
-* Next steps:
- * Breakout session to determine how to proceed
diff --git a/meetings/2023-04-13.md b/meetings/2023-04-13.md
deleted file mode 100644
index 80a5fad37b..0000000000
--- a/meetings/2023-04-13.md
+++ /dev/null
@@ -1,291 +0,0 @@
-
-# Apr 13, 2023
-
-* First fully open/public meeting 🎉
-
-* Code coverage feature shipping in CLI 🎉
-
- * Huge shoutout to Ardit Marku from Build Squad
-
-* New contributor: darkdrag00nv2 🎉
-
-* Contribute:
- * FLIPs
-
- * Cadence: [https://github.com/onflow/cadence/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22Good+First+Issue%22](https://github.com/onflow/cadence/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22Good+First+Issue%22)
-
- * Cadence tools: [https://github.com/onflow/cadence-tools/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22Good+First+Issue%22](https://github.com/onflow/cadence-tools/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22Good+First+Issue%22)
-
-## FLIPs
-
-### AuthAccount capabilities
-
-* [https://github.com/onflow/flips/pull/53](https://github.com/onflow/flips/pull/53)
-* Status
- * Approved and implemented 🎉
-
-### Capability Controllers
-
-* FLIP: [https://github.com/onflow/flow/pull/798](https://github.com/onflow/flow/pull/798)
-
-* Status:
-
- * Had many breakout sessions
-
- * Final API discussions
-
- * Implementation in progress
-
- * No remaining concerns
-
-* Open problems:
-
- * API: Capability publishing
-
-* Next steps:
-
- * One more breakout session
-
- * **Vote!**
-
-### Entitlements and Safe Downcasting
-
-* FLIP: [https://github.com/onflow/flips/pull/54](https://github.com/onflow/flips/pull/54)
-
-* Status:
-
- * Had breakout session for nested entitlements. Consensus on solution
-
- * Implementation in progress
-
- * No remaining concerns
-
-* Open problems:
-
- * Attachments
-
-* Next steps:
-
- * Address remaining technical issues async
-
- * **Vote!**
-
-### Attachments
-
-* Attachments FLIP: [https://github.com/onflow/flips/pull/11](https://github.com/onflow/flips/pull/11)
-
-* Forum discussion: [https://forum.onflow.org/t/flip-cadence-extensions-attachments/3645/2](https://forum.onflow.org/t/flip-cadence-extensions-attachments/3645/2)
-
-* Status:
-
- * Approved and merged 🎉
-
- * Deployed to Testnet
-
- * Receiving feedback
-
- * Discovering use-cases
-
- * Need mitigation for trolling attack
-
- * Mainnet blocked on solution for trolling attack
-
- * Had breakout session for trolling attack
-
- * Have idea for solution, but might depend on breaking change (Stable Cadence)
-
-* Open problem:
-
- * Trolling attack
-
-* Next steps:
-
- * Address trolling attack
-
- * Need breakout session
-
-### Interface Inheritance
-
-* FLIP: [https://github.com/onflow/flips/pull/40](https://github.com/onflow/flips/pull/40)
-
-* Forum discussion: [https://forum.onflow.org/t/flip-interface-inheritance-in-cadence/3750](https://forum.onflow.org/t/flip-interface-inheritance-in-cadence/3750)
-
-* Status:
-
- * Was on hold due to prioritization, planning to continue now, given other FLIPs done
-
- * Had breakout session
-
- * Implementation available
-
-* Open questions:
-
- * Multiple interface default functions (diamond problem)
-
- * Meeting notes: [https://docs.google.com/document/d/1LUvRg0T09mdE2Ndgti6xI1AY_KPYGJr2ZRLVuqzGxFg/edit#heading=h.d4wc1pr484vi](https://docs.google.com/document/d/1LUvRg0T09mdE2Ndgti6xI1AY_KPYGJr2ZRLVuqzGxFg/edit#heading=h.d4wc1pr484vi)
-
-* Next steps:
-
- * Schedule another breakout session
-
- * Is this still a blocker for NFT/FT v2?
-
- * Still being used, expected to be available
-
- * Not 100% required, but preferred. Less prone to errors
-
-### Extend transaction format
-
-* FLIP: [https://github.com/onflow/flips/pull/41](https://github.com/onflow/flips/pull/41)
-
-* Status:
-
- * No updates at the moment
-
- * Last breakout session was a while back
-
- * Planning to restart working group
-
-* Open problems:
-
- * Unexplored corner:
-
- * Useful for multi-sign use-cases
-
- * Does model also make sense for single-sign use-cases?
-
- * Signer assignment
-
- * Mapping signatures to roles
-
- * Currently Flow transaction signatures are sequential
-
- * Action-based model?
-
-* Next steps:
-
- * Have another breakout session
-
-### External Mutability
-
-* [https://github.com/onflow/flips/pull/58](https://github.com/onflow/flips/pull/58)
-
-* [https://github.com/onflow/flips/pull/59](https://github.com/onflow/flips/pull/59)
-
-* Status
-
- * Had breakout session
-
- * Multiple alternatives / FLIPs
-
- * FLIP 58:
-
- * Add additional static checks
-
- * Deemed overkill
-
- * FLIP 59:
-
- * Remove/restrict let fields
-
- * Deemed better than 58
-
- * Impact analysis:
-
- * Inner mutability used as a feature
-
- * E.g. MetadataViews standard
-
- * Need delegation functions for nested members
-
- * More boilerplate
-
- * Moves problem, but does not solve it
-
- * Investigating another idea (entitlements, references to fields)
-
-* Open problems:
-
- * Usability
-
- * FLIPs have different compromises
-
-* Next steps:
-
- * Breakout session to determine how to proceed
-
-## Related FLIPs
-
-### Account linking standard
-
-* FLIP: [https://github.com/onflow/flips/pull/72](https://github.com/onflow/flips/pull/72)
-
-* Status:
-
- * Had breakout session
-
- * Great feedback
-
- * Implementation in progress:
-
- * [https://github.com/Flowtyio/restricted-child-account](https://github.com/Flowtyio/restricted-child-account)
-
- * Positive sentiment, thumbs up from e.g. Flowty, Niftory, Dapper, etc
-
- * Wallets like it, even though it is more work for them
-
-* Open problem:
-
- * Regulatory risk for application developers
-
- * Discussions with legal council, technical solution
-
- * Discovery of linked assets
-
-* Next steps:
-
- * Work out how to restrict access
-
- * Continue implementation
-
-### FT/NFT v2 standards
-
-* FLIP: [https://github.com/onflow/flips/pull/56](https://github.com/onflow/flips/pull/56)
-
-* Status:
-
- * Multiple breakout sessions
-
- * Several major changes:
-
- * [https://github.com/onflow/flow-nft/pull/126#issuecomment-1505864702](https://github.com/onflow/flow-nft/pull/126#issuecomment-1505864702)
-
-* Open problems:
-
- * Waiting on FLIP for emitting events from interfaces (would allow nested type requirements)
-
- * [https://github.com/onflow/cadence/issues/2069](https://github.com/onflow/cadence/issues/2069)
-
- * Need to open FLIP for removal of nested type requirements
-
- * Upgrade constraints
-
-* Next steps:
-
- * Breakout session for upgrade
-
- * Maybe needs storage migration
-
- * Open FLIP for removal of nested type requirements
-
-## Questions
-
-* Changelog for Stable Cadence?
-
- * Announcement of breaking changes Stable Cadence in forum
-
- * [https://forum.onflow.org/t/another-update-on-stable-cadence/3715](https://forum.onflow.org/t/another-update-on-stable-cadence/3715)
-
- * Preview release available, needs to be updated
-
- * Will create TN instance with changes
diff --git a/meetings/2023-05-04.md b/meetings/2023-05-04.md
deleted file mode 100644
index df84098a6a..0000000000
--- a/meetings/2023-05-04.md
+++ /dev/null
@@ -1,167 +0,0 @@
-# May 4th, 2023
-
-## FLIPs
-
-### Capability Controllers
-
-* FLIP: [https://github.com/onflow/flow/pull/798](https://github.com/onflow/flow/pull/798)
-
-* Status:
- * Final API adjustments
- * Implementation nearing completion
- * No remaining concerns
-
-* Open problems:
- * None
-
-* Next steps:
- * Update FLIP, no capcons for links
- * Migration, rollout documentation
- * Documentation around pattern (e.g. getCapability to construct, link later)
- * Clarify migration: find storage path, storage path does not need to store anything
- * **Accept, unless objections**
-
-### Entitlements and Safe Downcasting
-
-* FLIP: [https://github.com/onflow/flips/pull/54](https://github.com/onflow/flips/pull/54)
-
-* Status:
- * Implementation done
- * No remaining concerns
- * Additional features requested → follow-up FLIPs
-
-* Open problems/concerns:
- * Complexity
- * Parts: entitlements, downcasting, mappings
- * Syntax (comma, and, set)
- * Migration?
- * Current access control pattern: public declaration, *but* restricted type to gate access
- * Maybe get rid of pub and priv?
- * Type in existing capability
- * Breakage is OK, security problem not. Maybe have contract be broken until fixed
-
-* Next steps:
- * Details for migration, maybe breakout session
- * Documentation and tutorials, for existing and new developers
- * Demonstrate with e.g. AuthAccount/PublicAccount, standard library (arrays, dictionaries, etc.), FT, NFT, etc.
- * Preview release for Stable Cadence: Emulator, Playground, etc.
- * **Accept, unless objections**
- * Maybe propose removal of restricted types, not "necessary" or very useful anymore
-
-### Attachments
-
-* FLIP: [https://github.com/onflow/flips/pull/11](https://github.com/onflow/flips/pull/11)
-
-* Forum discussion: [https://forum.onflow.org/t/flip-cadence-extensions-attachments/3645/2](https://forum.onflow.org/t/flip-cadence-extensions-attachments/3645/2)
-
-* Status:
- * Approved and merged 🎉
- * Deployed to Testnet
- * Receiving feedback
- * Discovering use-cases
- * Need mitigation for trolling attack
- * Mainnet blocked on solution for trolling attack
- * Had breakout session for trolling attack
- * Have idea for solution, but might depend on breaking change (Stable Cadence)
-
-* Open problem:
- * Trolling attack, blocking. Working on solution
-
-* Next steps:
- * Address trolling attack
- * Breakout session for contexts ("try-catch") in public
-
-### Interface Inheritance
-
-* FLIP: [https://github.com/onflow/flips/pull/40](https://github.com/onflow/flips/pull/40)
-
-* Forum discussion: [https://forum.onflow.org/t/flip-interface-inheritance-in-cadence/3750](https://forum.onflow.org/t/flip-interface-inheritance-in-cadence/3750)
-
-* Status:
- * Had more breakout sessions, ironed out almost all last questions/problems
- * Implementation available
-
-* Open questions/concerns:
- * Explicit declaration of inherited interfaces?
- * Declaration (conformance list)
- * Also in restricted types? Subtyping relationship → clarify in FLIP
- * No tooling required when reading contract
- * Also helps author
- * Verbosity / explicitness vs conciseness / implicitness
- * Example: FT
-
-* Next steps:
- * Resolve last question/concern
- * **Accept, unless objections**
-
-### Extend transaction format
-
-* FLIP: [https://github.com/onflow/flips/pull/41](https://github.com/onflow/flips/pull/41)
-
-* Status:
- * No updates at the moment
- * Last breakout session was a while back
- * Planning to restart working group
-
-* Open problems:
- * Unexplored corner:
- * Useful for multi-sign use-cases
- * Does model also make sense for single-sign use-cases?
- * Signer assignment
- * Mapping signatures to roles
- * Currently Flow transaction signatures are sequential
- * Action-based model?
-
-* Next steps:
- * Have another breakout session
- * Contact Jeff
-
-### External Mutability
-
-* [https://github.com/onflow/flips/pull/58](https://github.com/onflow/flips/pull/58)
-
-* [https://github.com/onflow/flips/pull/59](https://github.com/onflow/flips/pull/59)
-
-* Status
- * Had more breakout session
- * Working on comparison and examples
-
-* Open problems:
- * Usability
- * FLIPs have different compromises
-
-* Next steps:
- * Comparison of different solutions and examples
- * Another breakout session
-
-### Interface Conformance Improvements
-
-* FLIP: [https://github.com/onflow/flips/pull/83](https://github.com/onflow/flips/pull/83)
-
-* Overview:
- * Relaxation of existing restriction for interface conformance
- * Default function in one interface + Conditions in another interface is currently rejected
- * Proposal is to relax restriction and allow this case, given there is no conflict
-
-* Open problem:
- * Conditions may currently have side-effects
- * Delay until Stable Cadence?
-
-* Status:
- * Discuss and approve asynchronous
-
-## Questions
-
-* Can/should we maybe wipe Testnet?
- * Many broken/stale accounts and contracts
- * Hadn’t come up before
- * Maybe suggest, e.g. in GitHub discussions and/or forum
- * Big disruption for some users
- * Iteration broken (but shouldn’t be)
- * More realistic? There will be always broken code / accounts etc
- * Want to be able to test if dapp works with broken
- * Testnet is "staging" for Mainnet
- * Cannot wipe Mainnet
- * After Stable Cadence, should be less of an issue
- * Maybe FLIP? "Governance"?
- * Should be able to force delete broken values (--> force delete problem, see above: attachment trolling problem)
diff --git a/meetings/2023-06-15.md b/meetings/2023-06-15.md
deleted file mode 100644
index 8f2ff0df6f..0000000000
--- a/meetings/2023-06-15.md
+++ /dev/null
@@ -1,274 +0,0 @@
-# June 15th, 2023
-
-## FLIPs
-
-### Capability Controllers
-
-* FLIP: [https://github.com/onflow/flow/pull/798](https://github.com/onflow/flow/pull/798)
-
-* Status:
- * FLIP approved and merged 🎉
- * Implemented
- * Deployed on TN
- * Need documentation
-
-### Entitlements and Safe Downcasting
-
-* FLIP: [https://github.com/onflow/flips/pull/54](https://github.com/onflow/flips/pull/54)
-
-* Status:
- * FLIP approved and merged 🎉
- * Implementation almost complete (reference conversion)
- * Plan for migration: [https://github.com/onflow/flips/pull/95](https://github.com/onflow/flips/pull/95)
-
-* Open problems/concerns:
- * Migration
- * Need to migrate values (run-time types) and need to e.g. re-hash in dictionary
-
-* Next steps:
- * Merge last PR(s)
- * Preview release for Stable Cadence: Emulator, Playground, etc.
-
-### Attachments
-
-* FLIP: [https://github.com/onflow/flips/pull/11](https://github.com/onflow/flips/pull/11)
-
-* Forum discussion: [https://forum.onflow.org/t/flip-cadence-extensions-attachments/3645/2](https://forum.onflow.org/t/flip-cadence-extensions-attachments/3645/2)
-
-* Status:
- * FLIP approved and merged 🎉
- * Deployed to Testnet
- * Receiving feedback
- * Discovering use-cases
- * Need mitigation for forced resource deletion
- * Mainnet blocked on solution for forced resource deletion solution
- * Had breakout session for resource deletion solution
- * Have idea for solution, but might depend on breaking change (Stable Cadence)
-
-* Open problem:
- * Resource deletion, blocking. Working on solution
- * Maybe deploy to MN without solution?
-
-* Next steps:
- * Resource deletion solution
-
-### Interface Inheritance
-
-* FLIP: [https://github.com/onflow/flips/pull/40](https://github.com/onflow/flips/pull/40)
-
-* Forum discussion: [https://forum.onflow.org/t/flip-interface-inheritance-in-cadence/3750](https://forum.onflow.org/t/flip-interface-inheritance-in-cadence/3750)
-
-* Status:
- * FLIP approved and merged 🎉
- * Implemented
-
-### Interface Conformance Improvements
-
-* FLIP: [https://github.com/onflow/flips/pull/83](https://github.com/onflow/flips/pull/83)
-
-* Overview:
- * For interface conformance
- * Allow two interfaces, conditions + default function (currently prohibited)
-
-* Status:
- * Positive sentiment
-
-* Open questions:
- * None
-
-* Next steps:
-
- * **Approve, unless opposition**
-
-### Remove pub, pub(set) and priv
-
-* FLIP: [https://github.com/onflow/flips/pull/84](https://github.com/onflow/flips/pull/84)
-
-* Overview:
- * Remove access modifiers
- * Replacements already exist (access(all), access(self))
-
-* Status:
- * Positive sentiment
- * Implementation drafted
-
-* Open questions:
- * None
-
-* Next steps:
- * **Approve, unless opposition**
-
-### Emit events from function conditions, allow concrete events in interfaces
-
-* FLIP: [https://github.com/onflow/flips/pull/111](https://github.com/onflow/flips/pull/111)
-
-* Overview:
- * Originally proposed by Deniz
- * Emit events from conditions
- * Allow concrete events in interfaces, avoids need for redeclaration
- * Depends on nested type requirements getting removed
-
-* Status:
- * Positive sentiment
-
-* Open questions:
- * None
-
-* Next steps:
- * Discuss a bit more
- * Approve, unless opposition
-
-### Remove restricted types
-
-* FLIP: [https://github.com/onflow/flips/pull/85](https://github.com/onflow/flips/pull/85)
-
-* Overview:
- * Remove restricted types
- * Used for access control (restricted references)
- * Redundant with addition of entitlements
- * Interface sets (intersection types)
-
-* Status:
- * Positive sentiment
-
-* Open questions:
- * None
-
-* Next steps:
- * **Approve, unless opposition**
-
-### Account Type
-
-* FLIP: [https://github.com/onflow/flips/pull/92](https://github.com/onflow/flips/pull/92)
-
-* Overview:
- * Replace AuthAccount and PublicAccount
- * Originated in account linking FLIP
- * Use entitlements
-
-* Status:
- * Positive sentiment
-
-* Open problems:
- * None
- * Migration (effects on existing API, forced breakage)
- * (Naming)
-
-* Next steps:
- * Finish design for migration
- * **Approve, unless opposition**
-
-### External Mutability
-
-* Vision: [https://github.com/onflow/flips/pull/97](https://github.com/onflow/flips/pull/97)
- * Not a FLIP, but supporting document
- * Bigger picture for FLIPs
- * Update on previous proposals
- * Looking at problem again: use entitlements
-
-* FLIPs:
-
- * **Change member access semantic**
- * FLIP: [https://github.com/onflow/flips/pull/89](https://github.com/onflow/flips/pull/89)
-
- * Overview:
- * Accessing a field on a reference returns a reference
-
- * Status:
- * Positive sentiment
-
- * Open questions:
- * None
-
- * Next steps:
- * **Approve, unless opposition**
-
- * **Introduce built-in mutability entitlements**
-
- * FLIP: [https://github.com/onflow/flips/pull/86](https://github.com/onflow/flips/pull/86)
-
- * Overview:
- * Built-in entitlements for mutating functions of containers (arrays, dictionaries)
- * Can also used by user-defined types
-
- * Status:
- * Positive sentiment
-
- * Open questions:
- * Naming
-
- * Next steps:
- * Maybe approve and refactor names later if needed (before release)
- * **Approve, unless opposition**
-
- * **Improve entitlement mappings**
-
- * FLIP: [https://github.com/onflow/flips/pull/94](https://github.com/onflow/flips/pull/94)
-
- * Overview:
- * Allow entitlement mappings for non-reference fields
- * Improves "Change member access semantics" (FLIP 89)
-
- * Status:
- * Positive sentiment
-
- * Open questions:
- * None
-
- * Next steps:
- * **Approve, unless opposition**
-
-### Add Range type
-
-* FLIP: [https://github.com/onflow/flips/pull/96](https://github.com/onflow/flips/pull/96)
-
-* Status:
- * Design almost complete
- * Implementation in progress
- * Looking for feedback
- * Positive sentiment, but details unclear
-
-* Open questions:
- * Multiple types?
-
-* Next steps:
- * Complete
- * **Approve, unless opposition**
-
-### Extend transaction format
-
-* FLIP: [https://github.com/onflow/flips/pull/41](https://github.com/onflow/flips/pull/41)
-
-* Status:
- * No updates at the moment
- * Last breakout session was a while back
- * Planning to restart working group
-
-* Open problems:
-
- * Unexplored corner:
- * Useful for multi-sign use-cases
- * Does model also make sense for single-sign use-cases?
-
- * Signer assignment
- * Mapping signatures to roles
- * Currently Flow transaction signatures are sequential
-
- * Action-based model?
-
-* Next steps:
- * Have another breakout session
- * Contact Jeff
-
-## Questions/Feedback
-
-* Indicate feature support in CLI
-
-* Applications to demo changes and additions
-
- * Candidates:
- * Standards (FT, NFT)
- * Core contracts
- * Kitty Items (e.g. for marketplace)
- * NFT Pawn Shop
- * Asset Handover
diff --git a/meetings/2023-08-15.md b/meetings/2023-08-15.md
deleted file mode 100644
index f215b35d68..0000000000
--- a/meetings/2023-08-15.md
+++ /dev/null
@@ -1,167 +0,0 @@
-# Aug 14th, 2023
-
-## Ways to contribute
-
-* Participate in [FLIP (Flow Improvement Proposal) discussions](https://github.com/onflow/flips)
-* Contribute to Cadence implementation: ➡️[GitHub issues](https://github.com/onflow/cadence/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22Good+First+Issue%22)
-* Contribute Cadence tools: ➡️[GitHub issues](https://github.com/onflow/cadence-tools/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22Good+First+Issue%22)
-
-## FLIPs
-
-### Interface Conformance Improvements
-
-* FLIP: [https://github.com/onflow/flips/pull/83](https://github.com/onflow/flips/pull/83)
-* Status:
- * FLIP approved and merged 🎉
-
-### Remove pub, pub(set) and priv
-
-* FLIP: [https://github.com/onflow/flips/pull/84](https://github.com/onflow/flips/pull/84)
-* Status:
- * FLIP approved and merged 🎉
-
-### Emit events from function conditions, allow concrete events in interfaces
-
-* FLIP: [https://github.com/onflow/flips/pull/111](https://github.com/onflow/flips/pull/111)
-* Status:
- * FLIP approved and merged 🎉
-
-### Remove restricted types, interface set types
-
-* FLIP: [https://github.com/onflow/flips/pull/85](https://github.com/onflow/flips/pull/85)
-* Status:
- * FLIP approved and merged 🎉
-
-### Add Range type
-
-* FLIP: [https://github.com/onflow/flips/pull/96](https://github.com/onflow/flips/pull/96)
-* Status:
- * FLIP approved and merged 🎉
-
-### External Mutability
-
-* Vision: [https://github.com/onflow/flips/pull/97](https://github.com/onflow/flips/pull/97)
-* FLIPs:
- * **Change member access semantic**
- * FLIP: [https://github.com/onflow/flips/pull/89](https://github.com/onflow/flips/pull/89)
- * Status:
- * FLIP approved and merged 🎉
- * **Improve entitlement mappings**
- * FLIP: [https://github.com/onflow/flips/pull/94](https://github.com/onflow/flips/pull/94)
- * Status:
- * FLIP approved and merged 🎉
- * **Introduce built-in mutability entitlements**
- * FLIP: [https://github.com/onflow/flips/pull/86](https://github.com/onflow/flips/pull/86)
- * Status:
- * Positive sentiment
- * No new feedback in last few weeks
- * Implementation and documentation ready
- * Last conversation was about naming convention for entitlements
- * Open problems:
- * None
- * Next steps:
- * **Approved**
-
-### Account Type
-
-* FLIP: [https://github.com/onflow/flips/pull/92](https://github.com/onflow/flips/pull/92)
-* Status:
- * Positive sentiment
- * No new feedback in last few weeks
- * Implementation ready
-* Open problems:
- * None
-* Next steps:
- * **Approved**
-
-### Remove nested type requirements
-
-* FLIP: [https://github.com/onflow/flips/pull/118](https://github.com/onflow/flips/pull/118)
-* Overview:
- * Remove nested type requirements
- * Allow declaration of events in interfaces as concrete types (used in core contracts)
-* Status:
- * Positive sentiment
- * No new feedback in last few weeks
- * Implementation ready (2 PRs)
-* Open problems:
- * None
-* Next steps:
- * **Approved**
-
-### Random function
-
-* FLIP: [https://github.com/onflow/flips/pull/118](https://github.com/onflow/flips/pull/118)
-* Overview:
- * Rename unsafeRandom to random, underlying implementation has been secured using Flow protocol native random beacon
- * Update the interface to a safer and more convenient one (generalized types and a modulo parameter)
- * Rollout: add random, deprecate unsafeRandom, finally remove in SC release
-* Status:
- * Positive sentiment for random
-* Open problems:
- * Behavior in scripts
- * Should not panic
- * Several options
- * Naming:
- * Potential for misuse by developers. Unsafe → safe renaming might be confusing
- * Maybe addressed by commit-reveal scheme FLIP: [https://github.com/onflow/flips/pull/123](https://github.com/onflow/flips/pull/123)
-* Next steps:
- * Determine script behavior, maybe propose in separate FLIP
- * Schedule breakout session
- * Deniz
- * You? Leave a comment!
-* Feedback:
- * Just switch unsafeRandom to safe random generator for now
- * Different name/indicator to prevent misuse?
- * Trigger developers to check documentation, see/use commit-reveal scheme design pattern to use returned safe random properly
- * `random(iReadTheDocs: Bool)`
- * Our bar is very high, other systems isn't
-
-### Commit-reveal scheme for non-reverted randomness
-
-* FLIP: [https://github.com/onflow/flips/pull/123](https://github.com/onflow/flips/pull/123)
-* Overview:
- * Provide a safe pattern to address transaction abortion after a random is revealed
- * Commit to block
- * In the future, query history of past randoms
- * Use past, committed seed for new random
-* Status:
- * Positive sentiment
- * Waiting for feedback
-* Open problems:
- * None
-* Next steps:
- * Gather more feedback
-
-### Remove custom destructors
-
-* FLIP: [https://github.com/onflow/flips/pull/131](https://github.com/onflow/flips/pull/131)
-* Overview:
- * Proposal to address inability for users to destroy resources they own
- * One of the discussed options (others: try/catch, etc.)
- * Originated from attachments feature (attachment might prevent destruction of whole resource)
- * Remove destroy
- * Allows users to always destroy resources
-* Status:
- * New
- * Very much an RFC!
-* Open problems:
- * Philosophical question (sending to "burner account")
- * Existing code / applications
- * "Migration" path for use-cases like FT total supply
-* Next steps:
- * Discuss
- * Breakout session
- * You? Leave a comment!
- * Publish resource destruction options document, add to FLIP
-* Feedback:
- * Provide details on impact on applications, e.g. core contracts like FT/NFT
- * Chicken-and-egg problem: need more data on how feature is used, can then figure out if/what alternative is
- * Even if exploit vector isn’t used today, it should be addressed/prevented
- * If important use-case exists, also not worth it to remove
- * Emitting events could maybe be allowed
- * Given impact, reach out to more developers / gather more feedback
-
-## Related FLIPs / forum discussions
-
-* [https://forum.onflow.org/t/storage-fees-improvements-and-few-random-ideas-on-the-way/5104](https://forum.onflow.org/t/storage-fees-improvements-and-few-random-ideas-on-the-way/5104)
\ No newline at end of file
diff --git a/meetings/2023-09-12.md b/meetings/2023-09-12.md
deleted file mode 100644
index 0b2f11dc0f..0000000000
--- a/meetings/2023-09-12.md
+++ /dev/null
@@ -1,185 +0,0 @@
-
-## Sep 12th, 2023
-
-### Ways to contribute
-
-* Participate in [FLIP (Flow Improvement Proposal) discussions](https://github.com/onflow/flips)
-
-* Contribute to Cadence implementation: ➡️[GitHub issues](https://github.com/onflow/cadence/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22Good+First+Issue%22)
-
-* Contribute Cadence tools: ➡️[GitHub issues](https://github.com/onflow/cadence-tools/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22Good+First+Issue%22)
-
-### Website
-
-[https://cadence-lang.org/](https://cadence-lang.org/) 👀
-
-### Progress on Cadence 1.0
-
-[https://forum.onflow.org/t/update-on-cadence-1-0/5197](https://forum.onflow.org/t/update-on-cadence-1-0/5197) 🎉
-
-### FLIPs
-
-#### Relax interface conformance restrictions
-
-* FLIP: [https://github.com/onflow/flips/pull/134](https://github.com/onflow/flips/pull/134)
-
-* Overview:
-
- * Follow up on interface conformance improvements ([https://github.com/onflow/flips/pull/83](https://github.com/onflow/flips/pull/83)).
-
- * Proposes to allow empty function declaration defined in one interface to coexist with a default function implementation defined in another interface.
-
- * Currently the same is allowed if the empty declaration has a pre/post condition.
-
- * When interface default functions were introduced, interface inheritance did not exist yet
-
- * Current behavior was intentional, tried to avoid interface author breaking implementations by adding function implementation (default function)
-
-* Status:
-
- * FLIP is waiting for a final decision
-
- * Reference implementation is complete: [https://github.com/onflow/cadence/pull/2725](https://github.com/onflow/cadence/pull/2725)
-
-* Next steps:
-
- * Would like to get more feedback
-
- * Provide means / explanation to try out
-
-#### Random function
-
-* FLIP: [https://github.com/onflow/flips/pull/120](https://github.com/onflow/flips/pull/120)
-
-* Overview:
-
- * Rename unsafeRandom to random, underlying implementation has been secured using Flow protocol native random beacon
-
- * Update the interface to a safer and more convenient one (generalized types and a modulo parameter)
-
- * Rollout: add random, deprecate unsafeRandom, finally remove in SC release
-
-* Status:
-
- * Positive sentiment for random
-
- * Renamed to revertibleRandom
-
-* Open problems:
-
- * Behavior in scripts
-
- * Should not panic
-
- * Several options
-
- * Naming:
-
- * Potential for misuse by developers. Unsafe → safe renaming might be confusing
-
- * Maybe addressed by commit-reveal scheme FLIP: [https://github.com/onflow/flips/pull/123](https://github.com/onflow/flips/pull/123)
-
-* Next steps:
-
- * Voted, approved 🎉
-
-#### Commit-reveal scheme for non-reverted randomness
-
-* FLIP: [https://github.com/onflow/flips/pull/123](https://github.com/onflow/flips/pull/123)
-
-* Overview:
-
- * Provide a safe pattern to address transaction abortion after a random is revealed
-
- * Commit to block
-
- * In the future, query history of past randoms
-
- * Use past, committed seed for new random
-
-* Status:
-
- * Positive sentiment
-
- * Waiting for feedback
-
-* Open problems:
-
- * Storage/sharing of state, see below
-
-* Next steps:
-
- * Gather more feedback
-
- * Maybe have breakout session to discuss concerns
-
-* Feedback:
-
- * Why stored on-chain?
-
- * What is the concern?
-
- * Should be stored in protocol state
-
- * Details on how data is shared/stored
-
- * If just implementation detail, make it explicit
-
- * Where else?
-
-#### Remove custom destructors
-
-* FLIP: [https://github.com/onflow/flips/pull/131](https://github.com/onflow/flips/pull/131)
-
-* Overview:
-
- * Proposal to address inability for users to destroy resources they own
-
- * One of the discussed options (others: try/catch, etc.)
-
- * Originated from attachments feature (attachment might prevent destruction of whole resource)
-
- * Remove destroy
-
- * Allows users to always destroy resources
-
-* Status:
-
- * Breakout session: Came up open problem
-
- * Synced with execution team, discussed tombstoning (marking data as deleted, "garbage collection")
-
- * Updated FLIP with default events
-
- * FLIP ready for another round of discussion
-
-* Open problems:
-
- * Philosophical question (sending to "burner account")
-
- * Existing code / applications
-
- * "Migration" path for use-cases like FT total supply
-
- * Tombstoning implementation
-
-* Next steps:
-
- * Need to discuss implementation approach more
-
- * Implementation is not blocking Stable Cadence release, but can vote on change itself, removal of custom destructors
-
- * Do not need a solution for "large resource deletion" problem
-
- * Breakout session next week, after giving time to read through updated proposal
-
-* Feedback:
-
-### Related FLIPs / forum discussions
-
-* [https://forum.onflow.org/t/idea-wasm-execution-engine-in-cadence/5164](https://forum.onflow.org/t/idea-wasm-execution-engine-in-cadence/5164)
-
-* [https://forum.onflow.org/t/storage-fees-improvements-and-few-random-ideas-on-the-way/5104](https://forum.onflow.org/t/storage-fees-improvements-and-few-random-ideas-on-the-way/5104)
-
-* [https://forum.onflow.org/t/seeking-feedback-on-cadence-cookbook-modernization/5200/2](https://forum.onflow.org/t/seeking-feedback-on-cadence-cookbook-modernization/5200/2)
-
diff --git a/meetings/2023-10-24.md b/meetings/2023-10-24.md
deleted file mode 100644
index b8822d054e..0000000000
--- a/meetings/2023-10-24.md
+++ /dev/null
@@ -1,277 +0,0 @@
-
-## Oct 24th, 2023
-
-### FLIPs
-
-#### 134: Relax interface conformance restrictions
-
-* FLIP: [https://github.com/onflow/flips/pull/134](https://github.com/onflow/flips/pull/134)
-
-* Overview:
-
- * Follow up on interface conformance improvements ([https://github.com/onflow/flips/pull/83](https://github.com/onflow/flips/pull/83)).
-
- * Proposes to allow empty function declaration defined in one interface to coexist with a default function implementation defined in another interface.
-
- * Currently the same is allowed if the empty declaration has a pre/post condition.
-
- * When interface default functions were introduced, interface inheritance did not exist yet
-
- * Current behavior was intentional, tried to avoid interface author breaking implementations by adding function implementation (default function)
-
-* Status:
-
- * FLIP is waiting for a final decision
-
- * Reference implementation is complete: [https://github.com/onflow/cadence/pull/2725](https://github.com/onflow/cadence/pull/2725)
-
-* Next steps:
-
- * Would like to get more feedback
-
- * Provide means / explanation to try out
-
-* Notes:
-
- * Accepted
-
-#### 210: Improvement to entitlement mapping syntax
-
-* FLIP: [https://github.com/onflow/flips/pull/210](https://github.com/onflow/flips/pull/210)
-
-* Overview:
-
- * Got some feedback that visually entitlements and entitlement mappings appear too similar when used in an `access` modifier. This can be confusing to developers because the former cannot be accessed on an unentitled reference, while the latter can be (and produces an unentitled output)
-
- * Proposed needing a `mapping` keyword in access modifiers: e.g. `access(mapping M)`
-
-* Status:
-
- * FLIP proposed, has general approval
-
-* Next Steps:
-
- * Accept FLIP, merge implementation?
-
-* Notes:
-
- * Approved
-
-#### 196: Restrict Capabilities Publish
-
-* FLIP: [https://github.com/onflow/flips/pull/197](https://github.com/onflow/flips/pull/197)
-
-* Overview:
-
- * Current Cap Cons API allows publishing capabilities of another account
-
- * Was not possible with linking API
-
- * Could lead to confusion for developers (e.g. query balance, but balance is from another account)
-
-* Status:
-
- * Ready for vote
-
-* Next Steps:
-
-* Notes:
-
- * Approved
-
-#### 212: Reject references to references
-
-* FLIP: [https://github.com/onflow/flips/pull/212](https://github.com/onflow/flips/pull/212)
-
-* Overview:
-
- * It is currently possible to create references to references, e.g. &&T
-
- * Such references are not useful
-
- * In Cadence 1.0, additional work is requires to keep them working
-
- * Proposal is to forbid them
-
-* Status:
-
- * Ready for vote
-
-* Next Steps:
-
-* Notes:
-
- * Approved
-
-#### 131: Remove custom destructors
-
-* FLIP: [https://github.com/onflow/flips/pull/131](https://github.com/onflow/flips/pull/131)
-
-* Overview:
-
- * Proposal to address inability for users to destroy resources they own
-
- * One of the discussed options (others: try/catch, etc.)
-
- * Originated from attachments feature (attachment might prevent destruction of whole resource)
-
- * Remove destroy
-
- * Allows users to always destroy resources
-
-* Status:
-
- * Updated FLIP with default events
-
- * Discovered that introduction of attachments would require additional code in e.g. Vault.deposit to prevent exploit
-
- * FLIP ready for another round of discussion
-
-* Open problems:
-
- * Philosophical question (sending to "burner account")
-
- * Existing code / applications
-
- * "Migration" path for use-cases like FT total supply
-
- * Tombstoning implementation
-
-* Next steps:
-
- * Need to discuss implementation approach more
-
- * Implementation is not blocking Stable Cadence release, but can vote on change itself, removal of custom destructors
-
- * Do not need a solution for "large resource deletion" problem
-
- * Breakout session next week, after giving time to read through updated proposal
-
-* Feedback:
-
- * Non-mutable contraction mainnet using custom destructor
-
- * Overhead creating workaround
-
- * Will USDC implement a workaround ?
-
-* Notes:
-
- * Approved
-
-#### 95: Entitlements migration
-
-* FLIP: [https://github.com/onflow/flips/pull/95](https://github.com/onflow/flips/pull/95)
-
-* Overview:
-
-* Status:
-
-* Next Steps:
-
-#### 179: Staged Contract Updates
-
-* FLIP: [https://github.com/onflow/flips/pull/179](https://github.com/onflow/flips/pull/179)
-
-* Overview:
-
- * Contract mechanism to define contract update deployments and execute updates in stages at/beyond a block height. Execution can also be delegated to a third party via Capabilities
-
-* Status:
-
- * Proposed & approved by Jerome & Josh
-
- * Was hoping for community approval on the FLIP before moving to approval, but only feedback provided so far
-
-* Next Steps:
-
- * Approve unless recent feedback is opposed
-
- * Merge tryUpdate() to finalize v0 implementation & build out tests
-
- * Design automated update solution so delegated updates can be executed immediately post-spork
-
- * Begin to address callouts around:
-
- * Creating update configuration
-
- * Emulating configured updates
-
- * Monitoring update status
-
-### Other
-
-#### Discuss changes to attachments
-
-* Overview
-
- * Problem:
-
- * Attachments are able to declare what entitlements they need, to perform operations on base
-
- * A *third-party* might prepare a value with an attachment. With the transfer of the value, also the attachment and thus the permissions on the base, are transferred
-
- * The receiver might not realize
-
- * Reference to base stays "alive" beyond TX/script
-
- * Running example:
-
- * Currency converter on vault, can deposit and withdraw
-
- * Proposal:
-
- * Remove support for requirement of entitlements
-
- * Only allow public access to begin with
-
- * Later: Add support for entitled access,
-
- * e.g. through
-
- * Entitlement mapping
-
- * `access(M) attachment A for S {}`
-
- * Privilege escalation through mapping?
- E.g. Deposit → Withdraw
-
- * ```cadence
- mapping M {
- X -> Y
- }
-
- access(Y) fun foo() {
- // can use X on base
- }
- ```
-
- * Maybe hardcode to Identity mapping?
-
- * `access(X) fun foo() { … }`
-
- * no mapping
-
- * Requirements on per-function level (instead of whole attachment)
-
- * Do not want to require splitting attachments into parts
-
- * Alternative: Sanitization
-
- * Doesn’t scale, too easy to forget, footgun ("malicious USB stick")
-
-* Status:
-
- * Decide if this / what should be proposed in a FLIP
-
-* Next steps:
-
- * Propose FLIP for
-
- * Requirement removal
-
- * Propose unentitled access to start with
-
- * Can add entitled access later (see above)
-
- * Examples for proposals which allow entitlements
diff --git a/meetings/2023-11-15.md b/meetings/2023-11-15.md
deleted file mode 100644
index ea6c8018e5..0000000000
--- a/meetings/2023-11-15.md
+++ /dev/null
@@ -1,120 +0,0 @@
-
-# Nov 15th, 2023
-
-## FLIPs
-
-### 179: Staged Contract Updates
-
-* FLIP: [https://github.com/onflow/flips/pull/179](https://github.com/onflow/flips/pull/179)
-
-* Overview:
-
- * Contract mechanism to define contract update deployments and execute updates in stages at/beyond a block height. Execution can also be delegated to a third party via Capabilities
-
-* Status:
-
- * Approved
-
-### 217: New behavior for attachments with entitlements
-
-* FLIP: [https://github.com/onflow/flips/pull/213](https://github.com/onflow/flips/pull/213)
-
-* Overview:
-
- * Current attachment feature, requiring entitlements, allows third-parties to "sneak in" permissions into the base value
-
- * Proposal removes entitlement requirements, entitlements are derived from reference on base
-
- * Simple compromise
-
- * Tradeoff between power and safety. Only use-case that is no longer possible is read-escalation
-
-* Status:
-
- * "Audit" from security researcher
-
- * No open problems, proposal is complete and looking for feedback
-
-* Next Steps:
-
- * Accept unless there is no further feedback until end of next week
-
-## Other
-
-### Cadence 1.0 feedback
-
-* Austin reached out to community, asked for awareness
-
- * Very little awareness
-
- * Surprise of breaking changes
-
- * Breaking changes are not that big of a deal
-
- * But fact of breaking is scary
-
-* Going to talk to top 20 projects, with Andrea and Albert
-
- * Awareness
-
- * Get feedback
-
- * Support
-
-* Have not "advertised" it much so far
-
-* With rollout plan and environments, tools, etc. "ready", more announcements
-
-* Cadence 1.0 hackathon? (both projects and bug hunting / bug bash)
-
- * Example: OpenSea Sea Port bug bash
-
-* Cadence 1.0 office hours
-
-* Incentivize update?
-
-* Blackout periods? Awareness through disruption
-
- * TN
-
- * How to even do that on MN? Downtime would be brutal
-
- * Maybe depend on update staged?
-
-* How to amplify message?
-
- * In tooling like CLI, Emulator, etc.
-
- * In tools/projects like Flowdiver
-
- * On Website
-
-* Should not hide / make it very clear that this release is breaking
-
- * But also explain why the breaking changes are made (security, features, locked down contracts, etc.)
-
-### Cadence 1.0 migration plan
-
-* Had breakout session
-
-* Use Sandboxnet, clean network
-
- * Run pre-1.0 for a while, allow community to seed the environment with contracts and data
-
- * Then switch over
-
-* Is a clean Sandboxnet with 1.0 adding much value over Emulator?
-
- * Not really? For most developers Emulator is enough
-
- * Some developers don’t bother with the Emulator, go directly to TN
-
- * Some projects are relying on other projects (e.g FIND on FLOAT)
-
- * Difficult to have all dependencies deployed themselves in e.g. Emulator or even SN
-
- * Bringing up clean SN is not much effort
-
- * Bringing up SN from TN state is a lot of effort
-
- * "Seeding-period SN" solution good tradeoff
diff --git a/meetings/README.md b/meetings/README.md
new file mode 100644
index 0000000000..6d300c351c
--- /dev/null
+++ b/meetings/README.md
@@ -0,0 +1,3 @@
+# Cadence Language and Execution Working Group
+
+Meeting notes moved to https://github.com/onflow/Flow-Working-Groups/tree/main/cadence_language_and_execution_working_group
diff --git a/npm-packages/cadence-parser/README.md b/npm-packages/cadence-parser/README.md
index 6315c24b5e..93e999ce23 100644
--- a/npm-packages/cadence-parser/README.md
+++ b/npm-packages/cadence-parser/README.md
@@ -11,8 +11,8 @@ import {CadenceParser} from "@onflow/cadence-parser"
const parser = await CadenceParser.create("cadence-parser.wasm")
const ast = parser.parse(`
- pub contract HelloWorld {
- pub fun hello() {
+ access(all) contract HelloWorld {
+ access(all) fun hello() {
log("Hello, world!")
}
}
diff --git a/npm-packages/cadence-parser/package.json b/npm-packages/cadence-parser/package.json
index fc893be423..a3c6ba8a53 100644
--- a/npm-packages/cadence-parser/package.json
+++ b/npm-packages/cadence-parser/package.json
@@ -1,6 +1,6 @@
{
"name": "@onflow/cadence-parser",
- "version": "1.0.0-preview.52",
+ "version": "1.2.1-preview.52",
"description": "The Cadence parser",
"homepage": "https://github.com/onflow/cadence",
"repository": {
diff --git a/old_parser/declaration_test.go b/old_parser/declaration_test.go
index f41fd0c978..23463f9479 100644
--- a/old_parser/declaration_test.go
+++ b/old_parser/declaration_test.go
@@ -27,7 +27,7 @@ import (
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/common"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func TestParseVariableDeclaration(t *testing.T) {
@@ -41,7 +41,7 @@ func TestParseVariableDeclaration(t *testing.T) {
result, errs := testParseDeclarations("var x = 1")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -77,7 +77,7 @@ func TestParseVariableDeclaration(t *testing.T) {
result, errs := testParseDeclarations(" pub var x = 1")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessAll,
@@ -113,7 +113,7 @@ func TestParseVariableDeclaration(t *testing.T) {
result, errs := testParseDeclarations("let x = 1")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -149,7 +149,7 @@ func TestParseVariableDeclaration(t *testing.T) {
result, errs := testParseDeclarations("let x <- 1")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -185,7 +185,7 @@ func TestParseVariableDeclaration(t *testing.T) {
result, errs := testParseDeclarations("let r2: @R <- r")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -228,7 +228,7 @@ func TestParseVariableDeclaration(t *testing.T) {
result, errs := testParseStatements("var x <- y <- z")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -275,7 +275,7 @@ func TestParseVariableDeclaration(t *testing.T) {
StaticModifierEnabled: true,
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid static modifier for variable",
@@ -291,7 +291,7 @@ func TestParseVariableDeclaration(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations("static var x = 1")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -313,7 +313,7 @@ func TestParseVariableDeclaration(t *testing.T) {
NativeModifierEnabled: true,
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid native modifier for variable",
@@ -329,7 +329,7 @@ func TestParseVariableDeclaration(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations("native var x = 1")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -361,7 +361,7 @@ func TestParseParameterList(t *testing.T) {
result, errs := parse("()")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ParameterList{
Range: ast.Range{
StartPos: ast.Position{Line: 1, Column: 0, Offset: 0},
@@ -379,7 +379,7 @@ func TestParseParameterList(t *testing.T) {
result, errs := parse(" ( )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ParameterList{
Range: ast.Range{
StartPos: ast.Position{Line: 1, Column: 1, Offset: 1},
@@ -397,7 +397,7 @@ func TestParseParameterList(t *testing.T) {
result, errs := parse("( a : Int )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ParameterList{
Parameters: []*ast.Parameter{
{
@@ -435,7 +435,7 @@ func TestParseParameterList(t *testing.T) {
result, errs := parse("( a b : Int )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ParameterList{
Parameters: []*ast.Parameter{
{
@@ -473,7 +473,7 @@ func TestParseParameterList(t *testing.T) {
result, errs := parse("( a b : Int , c : Int )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ParameterList{
Parameters: []*ast.Parameter{
{
@@ -527,7 +527,7 @@ func TestParseParameterList(t *testing.T) {
t.Parallel()
_, errs := parse("( a b : Int c : Int )")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&MissingCommaInParameterListError{
Pos: ast.Position{Offset: 14, Line: 1, Column: 14},
@@ -549,7 +549,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
result, errs := testParseDeclarations("fun foo () { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -586,7 +586,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
result, errs := testParseDeclarations("pub fun foo () { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessAll,
@@ -623,7 +623,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
result, errs := testParseDeclarations("fun foo (): X { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -682,7 +682,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -797,7 +797,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
result, errs := testParseDeclarations("/// Test\nfun foo() {}")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -835,7 +835,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
result, errs := testParseDeclarations("\n /// First line\n \n/// Second line\n\n\nfun foo() {}")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -873,7 +873,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
result, errs := testParseDeclarations("\n /** Cool dogs.\n\n Cool cats!! */\n\n\nfun foo() {}")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -916,7 +916,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
result, errs := testParseDeclarations("fun main(): Int{ return 1 }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -985,7 +985,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1022,7 +1022,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
_, errs := testParseDeclarations("native fun foo() {}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -1046,7 +1046,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1083,7 +1083,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
_, errs := testParseDeclarations("static fun foo() {}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -1108,7 +1108,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1145,7 +1145,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
_, errs := testParseDeclarations("static native fun foo() {}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -1168,7 +1168,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
NativeModifierEnabled: true,
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid static modifier after native modifier",
@@ -1185,7 +1185,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
_, errs := testParseDeclarations("native static fun foo() {}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -1210,7 +1210,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessAll,
@@ -1247,7 +1247,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
_, errs := testParseDeclarations("pub static native fun foo() {}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -1271,7 +1271,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1321,7 +1321,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1378,7 +1378,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1443,7 +1443,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
_, errs := testParseDeclarations("fun foo() {}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected '(' as start of parameter list, got '<'",
@@ -1466,7 +1466,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "missing '>' at end of type parameter list",
@@ -1489,7 +1489,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&MissingCommaInParameterListError{
Pos: ast.Position{Offset: 13, Line: 1, Column: 13},
@@ -1521,7 +1521,7 @@ func TestParseAccess(t *testing.T) {
result, errs := parse("pub")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessAll,
result,
)
@@ -1534,7 +1534,7 @@ func TestParseAccess(t *testing.T) {
result, errs := parse("pub ( set )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessPubSettableLegacy,
result,
)
@@ -1545,7 +1545,7 @@ func TestParseAccess(t *testing.T) {
t.Parallel()
result, errs := parse("pub ( ")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected keyword \"set\", got EOF",
@@ -1555,7 +1555,7 @@ func TestParseAccess(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessNotSpecified,
result,
)
@@ -1566,7 +1566,7 @@ func TestParseAccess(t *testing.T) {
t.Parallel()
result, errs := parse("pub ( set ")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected token ')'",
@@ -1576,7 +1576,7 @@ func TestParseAccess(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessNotSpecified,
result,
)
@@ -1587,7 +1587,7 @@ func TestParseAccess(t *testing.T) {
t.Parallel()
result, errs := parse("pub ( foo )")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected keyword \"set\", got \"foo\"",
@@ -1597,7 +1597,7 @@ func TestParseAccess(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessNotSpecified,
result,
)
@@ -1610,7 +1610,7 @@ func TestParseAccess(t *testing.T) {
result, errs := parse("priv")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessSelf,
result,
)
@@ -1623,7 +1623,7 @@ func TestParseAccess(t *testing.T) {
result, errs := parse("access ( all )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessAll,
result,
)
@@ -1636,7 +1636,7 @@ func TestParseAccess(t *testing.T) {
result, errs := parse("access ( account )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessAccount,
result,
)
@@ -1649,7 +1649,7 @@ func TestParseAccess(t *testing.T) {
result, errs := parse("access ( contract )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessContract,
result,
)
@@ -1662,7 +1662,7 @@ func TestParseAccess(t *testing.T) {
result, errs := parse("access ( self )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessSelf,
result,
)
@@ -1673,7 +1673,7 @@ func TestParseAccess(t *testing.T) {
t.Parallel()
result, errs := parse("access ( ")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected keyword \"all\", \"account\", \"contract\", or \"self\", got EOF",
@@ -1683,7 +1683,7 @@ func TestParseAccess(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessNotSpecified,
result,
)
@@ -1694,7 +1694,7 @@ func TestParseAccess(t *testing.T) {
t.Parallel()
result, errs := parse("access ( self ")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected token ')'",
@@ -1704,7 +1704,7 @@ func TestParseAccess(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessNotSpecified,
result,
)
@@ -1715,7 +1715,7 @@ func TestParseAccess(t *testing.T) {
t.Parallel()
result, errs := parse("access ( foo )")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected keyword \"all\", \"account\", \"contract\", or \"self\", got \"foo\"",
@@ -1725,7 +1725,7 @@ func TestParseAccess(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessNotSpecified,
result,
)
@@ -1741,7 +1741,7 @@ func TestParseImportDeclaration(t *testing.T) {
t.Parallel()
result, errs := testParseDeclarations(` import`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected end in import declaration: expected string, address, or identifier",
@@ -1753,7 +1753,7 @@ func TestParseImportDeclaration(t *testing.T) {
var expected []ast.Declaration
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
expected,
result,
)
@@ -1766,7 +1766,7 @@ func TestParseImportDeclaration(t *testing.T) {
result, errs := testParseDeclarations(` import "foo"`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.ImportDeclaration{
Identifiers: nil,
@@ -1789,7 +1789,7 @@ func TestParseImportDeclaration(t *testing.T) {
result, errs := testParseDeclarations(` import 0x42`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.ImportDeclaration{
Identifiers: nil,
@@ -1812,7 +1812,7 @@ func TestParseImportDeclaration(t *testing.T) {
t.Parallel()
result, errs := testParseDeclarations(` import 0x10000000000000001`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "address too large",
@@ -1836,7 +1836,7 @@ func TestParseImportDeclaration(t *testing.T) {
},
}
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
expected,
result,
)
@@ -1847,7 +1847,7 @@ func TestParseImportDeclaration(t *testing.T) {
t.Parallel()
result, errs := testParseDeclarations(` import 1`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token in import declaration: " +
@@ -1860,7 +1860,7 @@ func TestParseImportDeclaration(t *testing.T) {
var expected []ast.Declaration
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
expected,
result,
)
@@ -1874,7 +1874,7 @@ func TestParseImportDeclaration(t *testing.T) {
result, errs := testParseDeclarations(` import foo from "bar"`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.ImportDeclaration{
Identifiers: []ast.Identifier{
@@ -1900,7 +1900,7 @@ func TestParseImportDeclaration(t *testing.T) {
t.Parallel()
result, errs := testParseDeclarations(` import foo "bar"`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token in import declaration: " +
@@ -1913,7 +1913,7 @@ func TestParseImportDeclaration(t *testing.T) {
var expected []ast.Declaration
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
expected,
result,
)
@@ -1926,7 +1926,7 @@ func TestParseImportDeclaration(t *testing.T) {
result, errs := testParseDeclarations(` import foo , bar , baz from 0x42`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.ImportDeclaration{
Identifiers: []ast.Identifier{
@@ -1962,7 +1962,7 @@ func TestParseImportDeclaration(t *testing.T) {
t.Parallel()
result, errs := testParseDeclarations(` import foo , bar , from 0x42`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: `expected identifier, got keyword "from"`,
@@ -1974,7 +1974,7 @@ func TestParseImportDeclaration(t *testing.T) {
var expected []ast.Declaration
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
expected,
result,
)
@@ -1987,7 +1987,7 @@ func TestParseImportDeclaration(t *testing.T) {
result, errs := testParseDeclarations(` import foo`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.ImportDeclaration{
Identifiers: nil,
@@ -2013,7 +2013,7 @@ func TestParseImportDeclaration(t *testing.T) {
`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.ImportDeclaration{
Identifiers: []ast.Identifier{
@@ -2076,7 +2076,7 @@ func TestParseEvent(t *testing.T) {
result, errs := testParseDeclarations("event E()")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -2119,7 +2119,7 @@ func TestParseEvent(t *testing.T) {
result, errs := testParseDeclarations(" priv event E2 ( a : Int , b : String )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
@@ -2224,7 +2224,7 @@ func TestParseFieldWithVariableKind(t *testing.T) {
result, errs := parse("var x : Int")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FieldDeclaration{
Access: ast.AccessNotSpecified,
VariableKind: ast.VariableKindVariable,
@@ -2258,7 +2258,7 @@ func TestParseFieldWithVariableKind(t *testing.T) {
result, errs := parse("let x : Int")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FieldDeclaration{
Access: ast.AccessNotSpecified,
VariableKind: ast.VariableKindConstant,
@@ -2316,7 +2316,7 @@ func TestParseField(t *testing.T) {
)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FieldDeclaration{
Access: ast.AccessNotSpecified,
Flags: ast.FieldDeclarationFlagsIsNative,
@@ -2367,7 +2367,7 @@ func TestParseField(t *testing.T) {
)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FieldDeclaration{
Access: ast.AccessNotSpecified,
Flags: ast.FieldDeclarationFlagsIsStatic,
@@ -2422,7 +2422,7 @@ func TestParseField(t *testing.T) {
)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FieldDeclaration{
Access: ast.AccessNotSpecified,
Flags: ast.FieldDeclarationFlagsIsStatic | ast.FieldDeclarationFlagsIsNative,
@@ -2458,7 +2458,7 @@ func TestParseField(t *testing.T) {
// For now, leading unknown identifiers are valid.
// This will be rejected in Stable Cadence.
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected identifier",
@@ -2481,7 +2481,7 @@ func TestParseField(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid static modifier after native modifier",
@@ -2505,7 +2505,7 @@ func TestParseField(t *testing.T) {
)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FieldDeclaration{
Access: ast.AccessAll,
Flags: ast.FieldDeclarationFlagsIsStatic | ast.FieldDeclarationFlagsIsNative,
@@ -2541,7 +2541,7 @@ func TestParseField(t *testing.T) {
// For now, leading unknown identifiers are valid.
// This will be rejected in Stable Cadence.
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected identifier",
@@ -2565,7 +2565,7 @@ func TestParseCompositeDeclaration(t *testing.T) {
result, errs := testParseDeclarations(" pub struct S { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessAll,
@@ -2592,7 +2592,7 @@ func TestParseCompositeDeclaration(t *testing.T) {
result, errs := testParseDeclarations(" pub resource R : RI { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessAll,
@@ -2640,7 +2640,7 @@ func TestParseCompositeDeclaration(t *testing.T) {
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -2822,7 +2822,7 @@ func TestParseAttachmentDeclaration(t *testing.T) {
result, errs := testParseDeclarations("pub attachment E for S {} ")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.AttachmentDeclaration{
Access: ast.AccessAll,
@@ -2857,7 +2857,7 @@ func TestParseAttachmentDeclaration(t *testing.T) {
}`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -2903,7 +2903,7 @@ func TestParseAttachmentDeclaration(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations("attachment E {} ")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected 'for', got '{'",
@@ -2921,7 +2921,7 @@ func TestParseAttachmentDeclaration(t *testing.T) {
result, errs := testParseDeclarations("pub attachment E for S: I {} ")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.AttachmentDeclaration{
Access: ast.AccessAll,
@@ -2963,7 +2963,7 @@ func TestParseAttachmentDeclaration(t *testing.T) {
result, errs := testParseDeclarations("pub attachment E for S: I1, I2 {} ")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.AttachmentDeclaration{
Access: ast.AccessAll,
@@ -3018,7 +3018,7 @@ func TestParseAttachmentDeclaration(t *testing.T) {
}`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.AttachmentDeclaration{
Access: ast.AccessAll,
@@ -3162,7 +3162,7 @@ func TestParseInterfaceDeclaration(t *testing.T) {
result, errs := testParseDeclarations(" pub struct interface S { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.InterfaceDeclaration{
Access: ast.AccessAll,
@@ -3187,7 +3187,7 @@ func TestParseInterfaceDeclaration(t *testing.T) {
t.Parallel()
result, errs := testParseDeclarations(" pub struct interface interface { }")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected interface name, got keyword \"interface\"",
@@ -3199,7 +3199,7 @@ func TestParseInterfaceDeclaration(t *testing.T) {
var expected []ast.Declaration
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
expected,
result,
)
@@ -3225,7 +3225,7 @@ func TestParseInterfaceDeclaration(t *testing.T) {
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.InterfaceDeclaration{
Access: ast.AccessNotSpecified,
@@ -3400,7 +3400,7 @@ func TestParseEnumDeclaration(t *testing.T) {
result, errs := testParseDeclarations(" pub enum E { case c ; pub case d }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessAll,
@@ -3450,7 +3450,7 @@ func TestParseEnumDeclaration(t *testing.T) {
StaticModifierEnabled: true,
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid static modifier for enum case",
@@ -3484,7 +3484,7 @@ func TestParseEnumDeclaration(t *testing.T) {
NativeModifierEnabled: true,
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid native modifier for enum case",
@@ -3519,7 +3519,7 @@ func TestParseTransactionDeclaration(t *testing.T) {
result, errs := testParseDeclarations("transaction { execute {} }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.TransactionDeclaration{
Execute: &ast.SpecialFunctionDeclaration{
@@ -3559,7 +3559,7 @@ func TestParseTransactionDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.TransactionDeclaration{
Fields: nil,
@@ -3595,7 +3595,7 @@ func TestParseTransactionDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.TransactionDeclaration{
Fields: []*ast.FieldDeclaration{
@@ -3788,7 +3788,7 @@ func TestParseTransactionDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.TransactionDeclaration{
Fields: []*ast.FieldDeclaration{
@@ -4027,7 +4027,7 @@ func TestParseTransactionDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.TransactionDeclaration{
Fields: []*ast.FieldDeclaration{
@@ -4250,7 +4250,7 @@ func TestParseFunctionAndBlock(t *testing.T) {
`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -4296,7 +4296,7 @@ func TestParseFunctionParameterWithoutLabel(t *testing.T) {
`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -4354,7 +4354,7 @@ func TestParseFunctionParameterWithLabel(t *testing.T) {
`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -4423,7 +4423,7 @@ func TestParseStructure(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -4603,7 +4603,7 @@ func TestParseStructureWithConformances(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -4674,7 +4674,7 @@ func TestParsePreAndPostConditions(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -4824,7 +4824,7 @@ func TestParseConditionMessage(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -5045,7 +5045,7 @@ func TestParseInterface(t *testing.T) {
},
}
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{test},
actual.Declarations(),
)
@@ -5063,7 +5063,7 @@ func TestParsePragmaNoArguments(t *testing.T) {
result, errs := testParseDeclarations(`#pedantic`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.PragmaDeclaration{
Expression: &ast.IdentifierExpression{
@@ -5093,7 +5093,7 @@ func TestParsePragmaNoArguments(t *testing.T) {
StaticModifierEnabled: true,
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid static modifier for pragma",
@@ -5109,7 +5109,7 @@ func TestParsePragmaNoArguments(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations("static #foo")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -5131,7 +5131,7 @@ func TestParsePragmaNoArguments(t *testing.T) {
NativeModifierEnabled: true,
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid native modifier for pragma",
@@ -5147,7 +5147,7 @@ func TestParsePragmaNoArguments(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations("native #foo")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -5167,7 +5167,7 @@ func TestParsePragmaArguments(t *testing.T) {
actual, err := testParseProgram(code)
require.NoError(t, err)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.PragmaDeclaration{
Expression: &ast.InvocationExpression{
@@ -5212,7 +5212,7 @@ func TestParseImportWithString(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.ImportDeclaration{
Identifiers: nil,
@@ -5238,7 +5238,7 @@ func TestParseImportWithAddress(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.ImportDeclaration{
Identifiers: nil,
@@ -5266,7 +5266,7 @@ func TestParseImportWithIdentifiers(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.ImportDeclaration{
Identifiers: []ast.Identifier{
@@ -5305,7 +5305,7 @@ func TestParseFieldWithFromIdentifier(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -5370,7 +5370,7 @@ func TestParseImportWithFromIdentifier(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.ImportDeclaration{
Identifiers: []ast.Identifier{
@@ -5415,7 +5415,7 @@ func TestParseResource(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -5445,7 +5445,7 @@ func TestParseEventDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -5531,7 +5531,7 @@ func TestParseEventEmitStatement(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -5617,7 +5617,7 @@ func TestParseResourceReturnType(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -5666,7 +5666,7 @@ func TestParseMovingVariableDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5702,7 +5702,7 @@ func TestParseResourceParameterType(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -5761,7 +5761,7 @@ func TestParseMovingVariableDeclarationWithTypeAnnotation(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5807,7 +5807,7 @@ func TestParseFieldDeclarationWithMoveTypeAnnotation(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -5864,7 +5864,7 @@ func TestParseDestructor(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -5922,7 +5922,7 @@ func TestParseCompositeDeclarationWithSemicolonSeparatedMembers(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -6136,7 +6136,7 @@ func TestParsePreconditionWithUnaryNegation(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -6215,7 +6215,7 @@ func TestParseInvalidAccessModifiers(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations("pub #test")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid access modifier for pragma",
@@ -6231,7 +6231,7 @@ func TestParseInvalidAccessModifiers(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations("pub transaction {}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid access modifier for transaction",
@@ -6247,7 +6247,7 @@ func TestParseInvalidAccessModifiers(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations("pub priv let x = 1")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid second access modifier",
@@ -6277,7 +6277,7 @@ func TestParseInvalidImportWithModifier(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid static modifier for import",
@@ -6296,7 +6296,7 @@ func TestParseInvalidImportWithModifier(t *testing.T) {
static import x from 0x1
`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -6321,7 +6321,7 @@ func TestParseInvalidImportWithModifier(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid native modifier for import",
@@ -6340,7 +6340,7 @@ func TestParseInvalidImportWithModifier(t *testing.T) {
native import x from 0x1
`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -6370,7 +6370,7 @@ func TestParseInvalidEventWithModifier(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid static modifier for event",
@@ -6389,7 +6389,7 @@ func TestParseInvalidEventWithModifier(t *testing.T) {
static event Foo()
`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -6414,7 +6414,7 @@ func TestParseInvalidEventWithModifier(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid native modifier for event",
@@ -6433,7 +6433,7 @@ func TestParseInvalidEventWithModifier(t *testing.T) {
native event Foo()
`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -6464,7 +6464,7 @@ func TestParseCompositeWithModifier(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid static modifier for structure",
@@ -6483,7 +6483,7 @@ func TestParseCompositeWithModifier(t *testing.T) {
static struct Foo()
`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -6508,7 +6508,7 @@ func TestParseCompositeWithModifier(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid native modifier for structure",
@@ -6527,7 +6527,7 @@ func TestParseCompositeWithModifier(t *testing.T) {
native struct Foo()
`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -6557,7 +6557,7 @@ func TestParseTransactionWithModifier(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid static modifier for transaction",
@@ -6576,7 +6576,7 @@ func TestParseTransactionWithModifier(t *testing.T) {
static transaction {}
`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -6601,7 +6601,7 @@ func TestParseTransactionWithModifier(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid native modifier for transaction",
@@ -6620,7 +6620,7 @@ func TestParseTransactionWithModifier(t *testing.T) {
native transaction {}
`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -6661,7 +6661,7 @@ func TestParseNestedPragma(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid native modifier for pragma",
@@ -6678,7 +6678,7 @@ func TestParseNestedPragma(t *testing.T) {
_, errs := parse("native #pragma", Config{})
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -6699,7 +6699,7 @@ func TestParseNestedPragma(t *testing.T) {
StaticModifierEnabled: true,
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid static modifier for pragma",
@@ -6719,7 +6719,7 @@ func TestParseNestedPragma(t *testing.T) {
Config{},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -6741,7 +6741,7 @@ func TestParseNestedPragma(t *testing.T) {
NativeModifierEnabled: true,
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid static modifier for pragma",
@@ -6761,7 +6761,7 @@ func TestParseNestedPragma(t *testing.T) {
// For now, leading unknown identifiers are valid.
// This will be rejected in Stable Cadence.
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected identifier",
@@ -6784,7 +6784,7 @@ func TestParseNestedPragma(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid static modifier after native modifier",
@@ -6801,7 +6801,7 @@ func TestParseNestedPragma(t *testing.T) {
_, errs := parse("pub #pragma", Config{})
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid access modifier for pragma",
@@ -6823,7 +6823,7 @@ func TestParseNestedPragma(t *testing.T) {
NativeModifierEnabled: true,
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid access modifier for pragma",
@@ -6843,7 +6843,7 @@ func TestParseNestedPragma(t *testing.T) {
// For now, leading unknown identifiers are valid.
// This will be rejected in Stable Cadence.
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected identifier",
@@ -6880,7 +6880,7 @@ func TestParseMemberDocStrings(t *testing.T) {
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -6996,7 +6996,7 @@ func TestParseMemberDocStrings(t *testing.T) {
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -7093,7 +7093,7 @@ func TestParseInvalidSpecialFunctionReturnTypeAnnotation(t *testing.T) {
init(): Int
}
`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid return type for initializer",
diff --git a/old_parser/expression_test.go b/old_parser/expression_test.go
index c90f4702cf..a91ad7d4dc 100644
--- a/old_parser/expression_test.go
+++ b/old_parser/expression_test.go
@@ -34,7 +34,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/errors"
"github.com/onflow/cadence/parser/lexer"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func TestParseSimpleInfixExpression(t *testing.T) {
@@ -48,7 +48,7 @@ func TestParseSimpleInfixExpression(t *testing.T) {
result, errs := testParseExpression("1+2*3")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationPlus,
Left: &ast.IntegerExpression{
@@ -93,7 +93,7 @@ func TestParseSimpleInfixExpression(t *testing.T) {
result, errs := testParseExpression(" 1 + 2 * 3 ")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationPlus,
Left: &ast.IntegerExpression{
@@ -138,7 +138,7 @@ func TestParseSimpleInfixExpression(t *testing.T) {
result, errs := testParseExpression("1 + 2 + 3")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationPlus,
Left: &ast.BinaryExpression{
@@ -183,7 +183,7 @@ func TestParseSimpleInfixExpression(t *testing.T) {
result, errs := testParseExpression("1 ?? 2 ?? 3")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationNilCoalesce,
Left: &ast.IntegerExpression{
@@ -233,7 +233,7 @@ func TestParseAdvancedExpression(t *testing.T) {
result, errs := testParseExpression("1 +- 2 -- 3")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationMinus,
Left: &ast.BinaryExpression{
@@ -278,7 +278,7 @@ func TestParseAdvancedExpression(t *testing.T) {
result, errs := testParseExpression("(1 + 2) * 3")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationMul,
Left: &ast.BinaryExpression{
@@ -369,7 +369,7 @@ func TestParseAdvancedExpression(t *testing.T) {
result, errs := testParseExpression("1 < 2 > 3")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationGreater,
Left: &ast.BinaryExpression{
@@ -414,7 +414,7 @@ func TestParseAdvancedExpression(t *testing.T) {
result, errs := testParseExpression("a ? b : c ? d : e")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ConditionalExpression{
Test: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -460,7 +460,7 @@ func TestParseAdvancedExpression(t *testing.T) {
result, errs := testParseExpression("true + false")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationPlus,
Left: &ast.BoolExpression{
@@ -489,7 +489,7 @@ func TestParseAdvancedExpression(t *testing.T) {
result, errs := testParseExpression("(<-x)")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.UnaryExpression{
Operation: ast.OperationMove,
Expression: &ast.IdentifierExpression{
@@ -517,7 +517,7 @@ func TestParseArrayExpression(t *testing.T) {
result, errs := testParseExpression("[ 1,2 + 3, 4 , 5 ]")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ArrayExpression{
Values: []ast.Expression{
&ast.IntegerExpression{
@@ -585,7 +585,7 @@ func TestParseArrayExpression(t *testing.T) {
result, errs := testParseExpression("[ 1 , \n 2 \n , \n\n 3 \n\n\n]")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ArrayExpression{
Values: []ast.Expression{
&ast.IntegerExpression{
@@ -632,7 +632,7 @@ func TestParseArrayExpression(t *testing.T) {
result, errs := testParseExpression("[\n]")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ArrayExpression{
Range: ast.Range{
StartPos: ast.Position{Line: 1, Column: 0, Offset: 0},
@@ -656,7 +656,7 @@ func TestParseDictionaryExpression(t *testing.T) {
result, errs := testParseExpression("{ 1:2 + 3, 4 : 5 }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.DictionaryExpression{
Entries: []ast.DictionaryEntry{
{
@@ -728,7 +728,7 @@ func TestParseDictionaryExpression(t *testing.T) {
result, errs := testParseExpression("{ 1 : 2 , \n 3 \n : \n 4 \n , \n\n 5 \n\n : \n\n 6 \n\n }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.DictionaryExpression{
Entries: []ast.DictionaryEntry{
{
@@ -808,7 +808,7 @@ func TestParseDictionaryExpression(t *testing.T) {
result, errs := testParseExpression("{\n}")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.DictionaryExpression{
Range: ast.Range{
StartPos: ast.Position{Line: 1, Column: 0, Offset: 0},
@@ -829,7 +829,7 @@ func TestParseIndexExpression(t *testing.T) {
result, errs := testParseExpression("a[0]")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IndexExpression{
TargetExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -861,7 +861,7 @@ func TestParseIndexExpression(t *testing.T) {
result, errs := testParseExpression("a [ 0 ]")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IndexExpression{
TargetExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -893,7 +893,7 @@ func TestParseIndexExpression(t *testing.T) {
result, errs := testParseExpression("a [foo]")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IndexExpression{
TargetExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -928,7 +928,7 @@ func TestParseIdentifier(t *testing.T) {
result, errs := testParseExpression("a + 3")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationPlus,
Left: &ast.IdentifierExpression{
@@ -959,7 +959,7 @@ func TestParsePath(t *testing.T) {
result, errs := testParseExpression("/foo/bar")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.PathExpression{
Domain: ast.Identifier{
Identifier: "foo",
@@ -986,7 +986,7 @@ func TestParseString(t *testing.T) {
result, errs := testParseExpression("\"\"")
assert.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "",
Range: ast.Range{
@@ -1003,7 +1003,7 @@ func TestParseString(t *testing.T) {
t.Parallel()
result, errs := testParseExpression("\"")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid end of string literal: missing '\"'",
@@ -1013,7 +1013,7 @@ func TestParseString(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "",
Range: ast.Range{
@@ -1030,7 +1030,7 @@ func TestParseString(t *testing.T) {
t.Parallel()
result, errs := testParseExpression("\"\n")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid end of string literal: missing '\"'",
@@ -1040,7 +1040,7 @@ func TestParseString(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "",
Range: ast.Range{
@@ -1056,7 +1056,7 @@ func TestParseString(t *testing.T) {
t.Parallel()
result, errs := testParseExpression("\"t")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid end of string literal: missing '\"'",
@@ -1066,7 +1066,7 @@ func TestParseString(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "t",
Range: ast.Range{
@@ -1083,7 +1083,7 @@ func TestParseString(t *testing.T) {
t.Parallel()
result, errs := testParseExpression("\"t\n")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid end of string literal: missing '\"'",
@@ -1093,7 +1093,7 @@ func TestParseString(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "t",
Range: ast.Range{
@@ -1110,7 +1110,7 @@ func TestParseString(t *testing.T) {
t.Parallel()
result, errs := testParseExpression("\"\\")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "incomplete escape sequence: missing character after escape character",
@@ -1124,7 +1124,7 @@ func TestParseString(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "",
Range: ast.Range{
@@ -1143,7 +1143,7 @@ func TestParseString(t *testing.T) {
result, errs := testParseExpression(`"te\tst\"te\u{1F3CE}\u{FE0F}xt"`)
assert.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "te\tst\"te\U0001F3CE\uFE0Fxt",
Range: ast.Range{
@@ -1160,7 +1160,7 @@ func TestParseString(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`"te\Xst"`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid escape character: 'X'",
@@ -1170,7 +1170,7 @@ func TestParseString(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "test",
Range: ast.Range{
@@ -1187,7 +1187,7 @@ func TestParseString(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`"te\u`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "incomplete Unicode escape sequence: missing character '{' after escape character",
@@ -1201,7 +1201,7 @@ func TestParseString(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "te",
Range: ast.Range{
@@ -1218,7 +1218,7 @@ func TestParseString(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`"te\us`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid Unicode escape sequence: expected '{', got 's'",
@@ -1232,7 +1232,7 @@ func TestParseString(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "te",
Range: ast.Range{
@@ -1249,7 +1249,7 @@ func TestParseString(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`"te\u{`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "incomplete Unicode escape sequence: missing character '}' after escape character",
@@ -1263,7 +1263,7 @@ func TestParseString(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "te",
Range: ast.Range{
@@ -1282,7 +1282,7 @@ func TestParseString(t *testing.T) {
result, errs := testParseExpression(`"te\u{}"`)
assert.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "te",
Range: ast.Range{
@@ -1309,7 +1309,7 @@ func TestParseString(t *testing.T) {
)
assert.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "test JJJJ KKKK LLLL MMMM NNNN OOOO",
Range: ast.Range{
@@ -1326,7 +1326,7 @@ func TestParseString(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`"te\u{X}st"`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid Unicode escape sequence: expected hex digit, got 'X'",
@@ -1336,7 +1336,7 @@ func TestParseString(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "test",
Range: ast.Range{
@@ -1360,7 +1360,7 @@ func TestParseInvocation(t *testing.T) {
result, errs := testParseExpression("f()")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1383,7 +1383,7 @@ func TestParseInvocation(t *testing.T) {
result, errs := testParseExpression("f ()")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1406,7 +1406,7 @@ func TestParseInvocation(t *testing.T) {
result, errs := testParseExpression("f ( )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1429,7 +1429,7 @@ func TestParseInvocation(t *testing.T) {
result, errs := testParseExpression("f(1)")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1466,7 +1466,7 @@ func TestParseInvocation(t *testing.T) {
result, errs := testParseExpression("f(label:1)")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1505,7 +1505,7 @@ func TestParseInvocation(t *testing.T) {
result, errs := testParseExpression("f(1,2)")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1555,7 +1555,7 @@ func TestParseInvocation(t *testing.T) {
result, errs := testParseExpression("f(a:1,b:2)")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1607,7 +1607,7 @@ func TestParseInvocation(t *testing.T) {
t.Parallel()
_, errs := testParseExpression("f(,,)")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected argument or end of argument list, got ','",
@@ -1623,7 +1623,7 @@ func TestParseInvocation(t *testing.T) {
t.Parallel()
_, errs := testParseExpression("f(1,,)")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected argument or end of argument list, got ','",
@@ -1639,7 +1639,7 @@ func TestParseInvocation(t *testing.T) {
t.Parallel()
_, errs := testParseExpression("f(1 2)")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected argument in argument list (expecting delimiter or end of argument list)," +
@@ -1658,7 +1658,7 @@ func TestParseInvocation(t *testing.T) {
result, errs := testParseExpression("f(1,g(2))")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1724,7 +1724,7 @@ func TestParseInvocation(t *testing.T) {
result, errs := testParseExpression("f(1,g(\"test\"))")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1793,7 +1793,7 @@ func TestParseMemberExpression(t *testing.T) {
result, errs := testParseExpression("f.n")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.MemberExpression{
Expression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1818,7 +1818,7 @@ func TestParseMemberExpression(t *testing.T) {
result, errs := testParseExpression("f .n")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.MemberExpression{
Expression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1841,7 +1841,7 @@ func TestParseMemberExpression(t *testing.T) {
t.Parallel()
result, errs := testParseExpression("f.")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected member name, got EOF",
@@ -1851,7 +1851,7 @@ func TestParseMemberExpression(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.MemberExpression{
Expression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1872,7 +1872,7 @@ func TestParseMemberExpression(t *testing.T) {
result, errs := testParseExpression("f.n * 3")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationMul,
Left: &ast.MemberExpression{
@@ -1909,7 +1909,7 @@ func TestParseMemberExpression(t *testing.T) {
result, errs := testParseExpression("3 * f.n")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationMul,
Left: &ast.IntegerExpression{
@@ -1946,7 +1946,7 @@ func TestParseMemberExpression(t *testing.T) {
result, errs := testParseExpression("f?.n")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.MemberExpression{
Optional: true,
Expression: &ast.IdentifierExpression{
@@ -1975,7 +1975,7 @@ func TestParseMemberExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2020,7 +2020,7 @@ func TestParseBlockComment(t *testing.T) {
result, errs := testParseExpression(" /* test foo/* bar */ asd*/ true")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BoolExpression{
Value: true,
Range: ast.Range{
@@ -2039,7 +2039,7 @@ func TestParseBlockComment(t *testing.T) {
result, errs := testParseExpression(" /*test foo*/ /* bar */ true")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BoolExpression{
Value: true,
Range: ast.Range{
@@ -2058,7 +2058,7 @@ func TestParseBlockComment(t *testing.T) {
result, errs := testParseExpression(" 1/*test foo*/+/* bar */ 2 ")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationPlus,
Left: &ast.IntegerExpression{
@@ -2089,7 +2089,7 @@ func TestParseBlockComment(t *testing.T) {
t.Parallel()
_, errs := testParseExpression(" /* test foo/* bar */ asd*/ true */ bar")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
// `true */ bar` is parsed as infix operation of path
&SyntaxError{
@@ -2110,7 +2110,7 @@ func TestParseBlockComment(t *testing.T) {
t.Parallel()
_, errs := testParseExpression(" /* test foo/* bar */ asd true ")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
// `true */ bar` is parsed as infix operation of path
&SyntaxError{
@@ -2185,7 +2185,7 @@ func TestParseBlockComment(t *testing.T) {
},
Config{},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token identifier in block comment",
@@ -2244,7 +2244,7 @@ func TestParseReference(t *testing.T) {
result, errs := testParseExpression("& t as T")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ReferenceExpression{
Expression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -2265,7 +2265,7 @@ func TestParseReference(t *testing.T) {
const code = `&y[z]`
_, errs := testParseExpression(code)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected casting expression",
@@ -2287,7 +2287,7 @@ func TestParseReference(t *testing.T) {
const code = `&x[y]? as &Z?`
_, errs := testParseExpression(code)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected casting expression",
@@ -2312,7 +2312,7 @@ func TestParseNilCoelesceReference(t *testing.T) {
`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationNilCoalesce,
Left: &ast.ReferenceExpression{
@@ -2394,7 +2394,7 @@ func TestParseCasts(t *testing.T) {
result, errs := testParseExpression(" t as T")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.CastingExpression{
Operation: ast.OperationCast,
Expression: &ast.IdentifierExpression{
@@ -2424,7 +2424,7 @@ func TestParseCasts(t *testing.T) {
result, errs := testParseExpression(" t as? T")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.CastingExpression{
Operation: ast.OperationFailableCast,
Expression: &ast.IdentifierExpression{
@@ -2455,7 +2455,7 @@ func TestParseCasts(t *testing.T) {
result, errs := testParseExpression(" t as! T")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.CastingExpression{
Operation: ast.OperationForceCast,
Expression: &ast.IdentifierExpression{
@@ -2490,7 +2490,7 @@ func TestParseForceExpression(t *testing.T) {
result, errs := testParseExpression("t!")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ForceExpression{
Expression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -2511,7 +2511,7 @@ func TestParseForceExpression(t *testing.T) {
result, errs := testParseExpression(" t ! ")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ForceExpression{
Expression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -2532,7 +2532,7 @@ func TestParseForceExpression(t *testing.T) {
result, errs := testParseExpression("<-t!")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.UnaryExpression{
Operation: ast.OperationMove,
Expression: &ast.ForceExpression{
@@ -2557,7 +2557,7 @@ func TestParseForceExpression(t *testing.T) {
result, errs := testParseExpression("10 * t!")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationMul,
Left: &ast.IntegerExpression{
@@ -2589,7 +2589,7 @@ func TestParseForceExpression(t *testing.T) {
result, errs := testParseStatements("x\n!y")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ExpressionStatement{
Expression: &ast.IdentifierExpression{
@@ -2623,7 +2623,7 @@ func TestParseForceExpression(t *testing.T) {
result, errs := testParseStatements("x\n.y!")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ExpressionStatement{
Expression: &ast.ForceExpression{
@@ -2653,7 +2653,7 @@ func TestParseForceExpression(t *testing.T) {
t.Parallel()
result, errs := testParseStatements("x. y")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid whitespace after '.'",
@@ -2663,7 +2663,7 @@ func TestParseForceExpression(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ExpressionStatement{
Expression: &ast.MemberExpression{
@@ -2697,7 +2697,7 @@ func TestParseCreate(t *testing.T) {
result, errs := testParseExpression("create T()")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.CreateExpression{
InvocationExpression: &ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
@@ -2723,7 +2723,7 @@ func TestParseNil(t *testing.T) {
result, errs := testParseExpression(" nil")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.NilExpression{
Pos: ast.Position{Line: 1, Column: 1, Offset: 1},
},
@@ -2742,7 +2742,7 @@ func TestParseDestroy(t *testing.T) {
result, errs := testParseExpression("destroy t")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.DestroyExpression{
Expression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -2768,7 +2768,7 @@ func TestParseAttach(t *testing.T) {
result, errs := testParseExpression("attach E() to r")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.AttachExpression{
Base: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -2797,7 +2797,7 @@ func TestParseAttach(t *testing.T) {
t.Parallel()
_, errs := testParseExpression("attach A to E")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected token '('",
@@ -2815,7 +2815,7 @@ func TestParseAttach(t *testing.T) {
result, errs := testParseExpression("attach A() to attach B() to r")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.AttachExpression{
Base: &ast.AttachExpression{
Base: &ast.IdentifierExpression{
@@ -2857,7 +2857,7 @@ func TestParseAttach(t *testing.T) {
t.Parallel()
_, errs := testParseExpression("attach A()")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected 'to', got EOF",
@@ -2873,7 +2873,7 @@ func TestParseAttach(t *testing.T) {
t.Parallel()
_, errs := testParseExpression("attach E() to")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected end of program",
@@ -2892,7 +2892,7 @@ func TestParseLineComment(t *testing.T) {
result, errs := testParseExpression(" //// // this is a comment\n 1 / 2")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationDiv,
Left: &ast.IntegerExpression{
@@ -2929,7 +2929,7 @@ func TestParseFunctionExpression(t *testing.T) {
result, errs := testParseExpression("fun () { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FunctionExpression{
ParameterList: &ast.ParameterList{
Parameters: nil,
@@ -2959,7 +2959,7 @@ func TestParseFunctionExpression(t *testing.T) {
result, errs := testParseExpression("fun (): X { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FunctionExpression{
ParameterList: &ast.ParameterList{
Parameters: nil,
@@ -3001,7 +3001,7 @@ func TestParseIntegerLiterals(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`0b`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "missing digits",
@@ -3020,7 +3020,7 @@ func TestParseIntegerLiterals(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0b"),
Value: new(big.Int),
@@ -3041,7 +3041,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`0b101010`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0b101010"),
Value: big.NewInt(42),
@@ -3060,7 +3060,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`0b001000`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0b001000"),
Value: big.NewInt(8),
@@ -3081,7 +3081,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`0b101010_101010`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0b101010_101010"),
Value: big.NewInt(2730),
@@ -3100,7 +3100,7 @@ func TestParseIntegerLiterals(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`0b_101010_101010`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&InvalidIntegerLiteralError{
Literal: "0b_101010_101010",
@@ -3115,7 +3115,7 @@ func TestParseIntegerLiterals(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0b_101010_101010"),
Value: big.NewInt(2730),
@@ -3134,7 +3134,7 @@ func TestParseIntegerLiterals(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`0b101010_101010_`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&InvalidIntegerLiteralError{
Literal: "0b101010_101010_",
@@ -3149,7 +3149,7 @@ func TestParseIntegerLiterals(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0b101010_101010_"),
Value: big.NewInt(2730),
@@ -3168,7 +3168,7 @@ func TestParseIntegerLiterals(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`0o`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "missing digits",
@@ -3187,7 +3187,7 @@ func TestParseIntegerLiterals(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0o"),
Value: new(big.Int),
@@ -3208,7 +3208,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`0o32`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0o32"),
Value: big.NewInt(26),
@@ -3229,7 +3229,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`0o32_45`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0o32_45"),
Value: big.NewInt(1701),
@@ -3248,7 +3248,7 @@ func TestParseIntegerLiterals(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`0o_32_45`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&InvalidIntegerLiteralError{
Literal: "0o_32_45",
@@ -3263,7 +3263,7 @@ func TestParseIntegerLiterals(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0o_32_45"),
Value: big.NewInt(1701),
@@ -3282,7 +3282,7 @@ func TestParseIntegerLiterals(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`0o32_45_`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&InvalidIntegerLiteralError{
Literal: "0o32_45_",
@@ -3297,7 +3297,7 @@ func TestParseIntegerLiterals(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0o32_45_"),
Value: big.NewInt(1701),
@@ -3318,7 +3318,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`1234567890`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("1234567890"),
Value: big.NewInt(1234567890),
@@ -3339,7 +3339,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`1_234_567_890`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("1_234_567_890"),
Value: big.NewInt(1234567890),
@@ -3358,7 +3358,7 @@ func TestParseIntegerLiterals(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`1_234_567_890_`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&InvalidIntegerLiteralError{
Literal: "1_234_567_890_",
@@ -3373,7 +3373,7 @@ func TestParseIntegerLiterals(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("1_234_567_890_"),
Value: big.NewInt(1234567890),
@@ -3392,7 +3392,7 @@ func TestParseIntegerLiterals(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`0x`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "missing digits",
@@ -3411,7 +3411,7 @@ func TestParseIntegerLiterals(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0x"),
Value: new(big.Int),
@@ -3432,7 +3432,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`0xf2`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0xf2"),
Value: big.NewInt(242),
@@ -3453,7 +3453,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`0xf2_09`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0xf2_09"),
Value: big.NewInt(61961),
@@ -3472,7 +3472,7 @@ func TestParseIntegerLiterals(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`0x_f2_09`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&InvalidIntegerLiteralError{
Literal: "0x_f2_09",
@@ -3487,7 +3487,7 @@ func TestParseIntegerLiterals(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0x_f2_09"),
Value: big.NewInt(61961),
@@ -3506,7 +3506,7 @@ func TestParseIntegerLiterals(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`0xf2_09_`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&InvalidIntegerLiteralError{
Literal: `0xf2_09_`,
@@ -3521,7 +3521,7 @@ func TestParseIntegerLiterals(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0xf2_09_"),
Value: big.NewInt(61961),
@@ -3542,7 +3542,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`0`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0"),
Value: big.NewInt(0),
@@ -3563,7 +3563,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`01`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("01"),
Value: big.NewInt(1),
@@ -3584,7 +3584,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`09`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("09"),
Value: big.NewInt(9),
@@ -3605,7 +3605,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression("00123")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("00123"),
Value: big.NewInt(123),
@@ -3624,7 +3624,7 @@ func TestParseIntegerLiterals(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`0z123`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid number literal prefix: 'z'",
@@ -3643,7 +3643,7 @@ func TestParseIntegerLiterals(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0z123"),
Value: new(big.Int),
@@ -3664,7 +3664,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`0_100`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0_100"),
Value: big.NewInt(100),
@@ -3685,7 +3685,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`1_100`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("1_100"),
Value: big.NewInt(1100),
@@ -3708,7 +3708,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`_100`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IdentifierExpression{
Identifier: ast.Identifier{
Identifier: "_100",
@@ -3731,7 +3731,7 @@ func TestParseFixedPoint(t *testing.T) {
result, errs := testParseExpression("1234_5678_90.0009_8765_4321")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FixedPointExpression{
PositiveLiteral: []byte("1234_5678_90.0009_8765_4321"),
Negative: false,
@@ -3754,7 +3754,7 @@ func TestParseFixedPoint(t *testing.T) {
result, errs := testParseExpression("0.1")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FixedPointExpression{
PositiveLiteral: []byte("0.1"),
Negative: false,
@@ -3775,7 +3775,7 @@ func TestParseFixedPoint(t *testing.T) {
t.Parallel()
result, errs := testParseExpression("0.")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "missing fractional digits",
@@ -3785,7 +3785,7 @@ func TestParseFixedPoint(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FixedPointExpression{
PositiveLiteral: []byte("0."),
Negative: false,
@@ -3813,7 +3813,7 @@ func TestParseLessThanOrTypeArguments(t *testing.T) {
result, errs := testParseExpression("1 < 2")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationLess,
Left: &ast.IntegerExpression{
@@ -3846,7 +3846,7 @@ func TestParseLessThanOrTypeArguments(t *testing.T) {
result, errs := testParseExpression("a < > ()")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -3870,7 +3870,7 @@ func TestParseLessThanOrTypeArguments(t *testing.T) {
result, errs := testParseExpression("a < { K : V } > ( 1 )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -3930,7 +3930,7 @@ func TestParseLessThanOrTypeArguments(t *testing.T) {
result, errs := testParseExpression("a < { K : V } , @R , [ S ] > ( 1 , 2 )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -4028,7 +4028,7 @@ func TestParseLessThanOrTypeArguments(t *testing.T) {
result, errs := testParseExpression("1 + a<>()")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationPlus,
Left: &ast.IntegerExpression{
@@ -4064,7 +4064,7 @@ func TestParseLessThanOrTypeArguments(t *testing.T) {
result, errs := testParseExpression("a>()")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -4114,7 +4114,7 @@ func TestParseLessThanOrTypeArguments(t *testing.T) {
result, errs := testParseExpression("a >()")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -4164,7 +4164,7 @@ func TestParseLessThanOrTypeArguments(t *testing.T) {
result, errs := testParseExpression("0 + 1 < 2")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationLess,
Left: &ast.BinaryExpression{
@@ -4209,7 +4209,7 @@ func TestParseLessThanOrTypeArguments(t *testing.T) {
result, errs := testParseExpression("0 + 1 << 2")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationBitwiseLeftShift,
Left: &ast.BinaryExpression{
@@ -4254,7 +4254,7 @@ func TestParseLessThanOrTypeArguments(t *testing.T) {
result, errs := testParseExpression("0 + 1 > 2")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationGreater,
Left: &ast.BinaryExpression{
@@ -4299,7 +4299,7 @@ func TestParseLessThanOrTypeArguments(t *testing.T) {
result, errs := testParseExpression("0 + 1 >> 2")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationBitwiseRightShift,
Left: &ast.BinaryExpression{
@@ -4348,7 +4348,7 @@ func TestParseBoolExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -4385,7 +4385,7 @@ func TestParseIdentifierExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -4421,7 +4421,7 @@ func TestParseArrayExpressionInVariableDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -4476,7 +4476,7 @@ func TestParseDictionaryExpressionInVariableDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -4549,7 +4549,7 @@ func TestParseInvocationExpressionWithoutLabels(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -4617,7 +4617,7 @@ func TestParseInvocationExpressionWithLabels(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -4704,7 +4704,7 @@ func TestParseOptionalMemberExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -4748,7 +4748,7 @@ func TestParseIndexExpressionInVariableDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -4799,7 +4799,7 @@ func TestParseUnaryExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -4839,7 +4839,7 @@ func TestParseOrExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -4886,7 +4886,7 @@ func TestParseAndExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -4933,7 +4933,7 @@ func TestParseEqualityExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -4980,7 +4980,7 @@ func TestParseRelationalExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5031,7 +5031,7 @@ func TestParseAdditiveExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5082,7 +5082,7 @@ func TestParseMultiplicativeExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5133,7 +5133,7 @@ func TestParseFunctionExpressionAndReturn(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5207,7 +5207,7 @@ func TestParseLeftAssociativity(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5270,7 +5270,7 @@ func TestParseNegativeInteger(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5309,7 +5309,7 @@ func TestParseNegativeFixedPoint(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5352,7 +5352,7 @@ func TestParseTernaryRightAssociativity(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5455,7 +5455,7 @@ func TestParseVoidLiteral(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5501,7 +5501,7 @@ func TestParseMissingReturnType(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5643,7 +5643,7 @@ func TestParseExpression(t *testing.T) {
},
}
- utils.AssertEqualWithDiff(t, expected, actual)
+ AssertEqualWithDiff(t, expected, actual)
}
func TestParseStringEscapes(t *testing.T) {
@@ -5671,7 +5671,7 @@ func TestParseStringEscapes(t *testing.T) {
},
}
- utils.AssertEqualWithDiff(t, expected, actual)
+ AssertEqualWithDiff(t, expected, actual)
}
func TestParseStringWithUnicode(t *testing.T) {
@@ -5699,7 +5699,7 @@ func TestParseStringWithUnicode(t *testing.T) {
},
}
- utils.AssertEqualWithDiff(t, expected, actual)
+ AssertEqualWithDiff(t, expected, actual)
}
func TestParseNilCoalescing(t *testing.T) {
@@ -5712,7 +5712,7 @@ func TestParseNilCoalescing(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5758,7 +5758,7 @@ func TestParseNilCoalescingRightAssociativity(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5861,7 +5861,7 @@ func TestParseFailableCasting(t *testing.T) {
failableDowncast.ParentVariableDeclaration = variableDeclaration
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
variableDeclaration,
},
@@ -5879,7 +5879,7 @@ func TestParseMoveOperator(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5937,7 +5937,7 @@ func TestParseFunctionExpressionWithResourceTypeAnnotation(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
@@ -6046,7 +6046,7 @@ func TestParseFailableCastingResourceTypeAnnotation(t *testing.T) {
failableDowncast.ParentVariableDeclaration = variableDeclaration
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
variableDeclaration,
},
@@ -6100,7 +6100,7 @@ func TestParseCasting(t *testing.T) {
cast.ParentVariableDeclaration = variableDeclaration
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
variableDeclaration,
},
@@ -6131,7 +6131,7 @@ func TestParseReferenceInVariableDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -6189,7 +6189,7 @@ func TestParseFixedPointExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -6229,7 +6229,7 @@ func TestParseFixedPointExpressionZeroInteger(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -6269,7 +6269,7 @@ func TestParsePathLiteral(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -6309,7 +6309,7 @@ func TestParseBitwiseExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
diff --git a/old_parser/lexer/lexer_test.go b/old_parser/lexer/lexer_test.go
index 1e48fed700..be9ee63f08 100644
--- a/old_parser/lexer/lexer_test.go
+++ b/old_parser/lexer/lexer_test.go
@@ -28,7 +28,7 @@ import (
"go.uber.org/goleak"
"github.com/onflow/cadence/ast"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func TestMain(m *testing.M) {
@@ -64,7 +64,7 @@ func testLex(t *testing.T, input string, expected []token) {
bytes := []byte(input)
withTokens(Lex(bytes, nil), func(actualTokens []Token) {
- utils.AssertEqualWithDiff(t, expectedTokens, actualTokens)
+ AssertEqualWithDiff(t, expectedTokens, actualTokens)
require.Len(t, actualTokens, len(expectedTokens))
for i, expectedToken := range expected {
diff --git a/old_parser/parser_test.go b/old_parser/parser_test.go
index 156ae7c286..ecff29407f 100644
--- a/old_parser/parser_test.go
+++ b/old_parser/parser_test.go
@@ -33,7 +33,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/errors"
"github.com/onflow/cadence/parser/lexer"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func TestMain(m *testing.M) {
@@ -240,7 +240,7 @@ func TestParseBuffering(t *testing.T) {
Config{},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected token identifier with string value c",
@@ -483,7 +483,7 @@ func TestParseBuffering(t *testing.T) {
Config{},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected token identifier with string value d",
@@ -511,7 +511,7 @@ func TestParseBuffering(t *testing.T) {
}
`
_, err := testParseProgram(code)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected token identifier",
@@ -536,7 +536,7 @@ func TestParseBuffering(t *testing.T) {
`
_, err := testParseProgram(code)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected token identifier",
@@ -703,7 +703,7 @@ func TestParseArgumentList(t *testing.T) {
t.Parallel()
_, errs := testParseArgumentList(`xyz`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected token '('",
@@ -722,7 +722,7 @@ func TestParseArgumentList(t *testing.T) {
var expected ast.Arguments
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
expected,
result,
)
@@ -747,7 +747,7 @@ func TestParseArgumentList(t *testing.T) {
result, errs := testParseArgumentList(`(1, b: true)`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.Arguments{
{
Label: "",
@@ -832,7 +832,7 @@ func TestParseBufferedErrors(t *testing.T) {
// there is another error (missing closing parenthesis after).
_, errs := testParseExpression("a(")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "missing type annotation after comma",
@@ -871,7 +871,7 @@ func TestParseExpressionDepthLimit(t *testing.T) {
_, err := testParseProgram(code)
require.Error(t, err)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
ExpressionDepthLimitReachedError{
Pos: ast.Position{
@@ -907,7 +907,7 @@ func TestParseTypeDepthLimit(t *testing.T) {
_, err := testParseProgram(code)
require.Error(t, err)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
TypeDepthLimitReachedError{
Pos: ast.Position{
@@ -933,7 +933,7 @@ func TestParseLocalReplayLimit(t *testing.T) {
code := []byte(builder.String())
_, err := ParseProgram(nil, code, Config{})
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
Error{
Code: code,
Errors: []error{
@@ -968,7 +968,7 @@ func TestParseGlobalReplayLimit(t *testing.T) {
code := []byte(builder.String())
_, err := ParseProgram(nil, code, Config{})
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
Error{
Code: code,
Errors: []error{
diff --git a/old_parser/statement_test.go b/old_parser/statement_test.go
index e22d1c2b94..ce5d17d25d 100644
--- a/old_parser/statement_test.go
+++ b/old_parser/statement_test.go
@@ -26,7 +26,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/ast"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func TestParseReplInput(t *testing.T) {
@@ -63,7 +63,7 @@ func TestParseReturnStatement(t *testing.T) {
result, errs := testParseStatements("return")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ReturnStatement{
Range: ast.Range{
@@ -83,7 +83,7 @@ func TestParseReturnStatement(t *testing.T) {
result, errs := testParseStatements("return 1")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ReturnStatement{
Expression: &ast.IntegerExpression{
@@ -112,7 +112,7 @@ func TestParseReturnStatement(t *testing.T) {
result, errs := testParseStatements("return \n1")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ReturnStatement{
Range: ast.Range{
@@ -143,7 +143,7 @@ func TestParseReturnStatement(t *testing.T) {
result, errs := testParseStatements("return ;\n1")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ReturnStatement{
Range: ast.Range{
@@ -179,7 +179,7 @@ func TestParseIfStatement(t *testing.T) {
result, errs := testParseStatements("if true { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.IfStatement{
Test: &ast.BoolExpression{
@@ -210,7 +210,7 @@ func TestParseIfStatement(t *testing.T) {
result, errs := testParseStatements("if true { 1 ; 2 }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.IfStatement{
Test: &ast.BoolExpression{
@@ -264,7 +264,7 @@ func TestParseIfStatement(t *testing.T) {
result, errs := testParseStatements("if true { 1 \n 2 }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.IfStatement{
Test: &ast.BoolExpression{
@@ -318,7 +318,7 @@ func TestParseIfStatement(t *testing.T) {
result, errs := testParseStatements("if true { 1 } else { 2 }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.IfStatement{
Test: &ast.BoolExpression{
@@ -380,7 +380,7 @@ func TestParseIfStatement(t *testing.T) {
result, errs := testParseStatements("if true{1}else if true {2} else{3}")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.IfStatement{
Test: &ast.BoolExpression{
@@ -514,7 +514,7 @@ func TestParseIfStatement(t *testing.T) {
expected.Test.(*ast.VariableDeclaration).ParentIfStatement = expected
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
expected,
},
@@ -564,7 +564,7 @@ func TestParseIfStatement(t *testing.T) {
expected.Test.(*ast.VariableDeclaration).ParentIfStatement = expected
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
expected,
},
@@ -585,7 +585,7 @@ func TestParseWhileStatement(t *testing.T) {
result, errs := testParseStatements("while true { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.WhileStatement{
Test: &ast.BoolExpression{
@@ -621,7 +621,7 @@ func TestParseAssignmentStatement(t *testing.T) {
result, errs := testParseStatements("x=1")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.AssignmentStatement{
Target: &ast.IdentifierExpression{
@@ -656,7 +656,7 @@ func TestParseAssignmentStatement(t *testing.T) {
result, errs := testParseStatements(" x = 1")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.AssignmentStatement{
Target: &ast.IdentifierExpression{
@@ -691,7 +691,7 @@ func TestParseAssignmentStatement(t *testing.T) {
result, errs := testParseStatements(" x <- 1")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.AssignmentStatement{
Target: &ast.IdentifierExpression{
@@ -726,7 +726,7 @@ func TestParseAssignmentStatement(t *testing.T) {
result, errs := testParseStatements(" x <-! 1")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.AssignmentStatement{
Target: &ast.IdentifierExpression{
@@ -766,7 +766,7 @@ func TestParseSwapStatement(t *testing.T) {
result, errs := testParseStatements(" x <-> y")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.SwapStatement{
Left: &ast.IdentifierExpression{
@@ -799,7 +799,7 @@ func TestParseForStatement(t *testing.T) {
result, errs := testParseStatements("for x in y { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ForStatement{
Identifier: ast.Identifier{
@@ -838,7 +838,7 @@ func TestParseForStatementIndexBinding(t *testing.T) {
result, errs := testParseStatements("for i, x in y { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ForStatement{
Identifier: ast.Identifier{
@@ -874,7 +874,7 @@ func TestParseForStatementIndexBinding(t *testing.T) {
t.Parallel()
_, errs := testParseStatements("for i x in y { }")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected keyword \"in\", got identifier",
@@ -894,7 +894,7 @@ func TestParseForStatementIndexBinding(t *testing.T) {
t.Parallel()
_, errs := testParseStatements("for in y { }")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected identifier, got keyword \"in\"",
@@ -921,7 +921,7 @@ func TestParseEmit(t *testing.T) {
result, errs := testParseStatements("emit T()")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.EmitStatement{
InvocationExpression: &ast.InvocationExpression{
@@ -953,7 +953,7 @@ func TestParseFunctionStatementOrExpression(t *testing.T) {
result, errs := testParseStatements("fun foo() {}")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -989,7 +989,7 @@ func TestParseFunctionStatementOrExpression(t *testing.T) {
result, errs := testParseStatements("fun () {}")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ExpressionStatement{
Expression: &ast.FunctionExpression{
@@ -1027,7 +1027,7 @@ func TestParseStatements(t *testing.T) {
result, errs := testParseStatements("a + b < c\nd")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ExpressionStatement{
Expression: &ast.BinaryExpression{
@@ -1073,7 +1073,7 @@ func TestParseStatements(t *testing.T) {
t.Parallel()
result, errs := testParseStatements(`assert true`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "statements on the same line must be separated with a semicolon",
@@ -1083,7 +1083,7 @@ func TestParseStatements(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ExpressionStatement{
Expression: &ast.IdentifierExpression{
@@ -1119,7 +1119,7 @@ func TestParseRemoveAttachmentStatement(t *testing.T) {
result, errs := testParseStatements("remove A from b")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.RemoveStatement{
Attachment: &ast.NominalType{
@@ -1148,7 +1148,7 @@ func TestParseRemoveAttachmentStatement(t *testing.T) {
result, errs := testParseStatements("remove Foo.E from b")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.RemoveStatement{
Attachment: &ast.NominalType{
@@ -1182,7 +1182,7 @@ func TestParseRemoveAttachmentStatement(t *testing.T) {
_, errs := testParseStatements("remove A")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected from keyword, got EOF",
@@ -1203,7 +1203,7 @@ func TestParseRemoveAttachmentStatement(t *testing.T) {
_, errs := testParseStatements("remove A from")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected end of program",
@@ -1220,7 +1220,7 @@ func TestParseRemoveAttachmentStatement(t *testing.T) {
_, errs := testParseStatements("remove [A] from e")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected attachment nominal type, got [A]",
@@ -1238,7 +1238,7 @@ func TestParseRemoveAttachmentStatement(t *testing.T) {
result, errs := testParseStatements("remove A from foo()")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.RemoveStatement{
Attachment: &ast.NominalType{
@@ -1276,7 +1276,7 @@ func TestParseSwitchStatement(t *testing.T) {
result, errs := testParseStatements("switch true { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.SwitchStatement{
Expression: &ast.BoolExpression{
@@ -1304,7 +1304,7 @@ func TestParseSwitchStatement(t *testing.T) {
result, errs := testParseStatements("switch x { case 1 :\n a\nb default : c\nd }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.SwitchStatement{
Expression: &ast.IdentifierExpression{
@@ -1402,7 +1402,7 @@ func TestParseIfStatementInFunctionDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1604,7 +1604,7 @@ func TestParseIfStatementWithVariableDeclaration(t *testing.T) {
ifStatement.Test = ifTestVariableDeclaration
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1650,7 +1650,7 @@ func TestParseIfStatementNoElse(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1722,7 +1722,7 @@ func TestParseWhileStatementInFunctionDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1802,7 +1802,7 @@ func TestParseForStatementInFunctionDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1864,7 +1864,7 @@ func TestParseAssignment(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1928,7 +1928,7 @@ func TestParseAccessAssignment(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -2041,7 +2041,7 @@ func TestParseExpressionStatementWithAccess(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -2143,7 +2143,7 @@ func TestParseMoveStatement(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -2205,7 +2205,7 @@ func TestParseFunctionExpressionStatementAfterVariableDeclarationWithCreateExpre
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -2308,7 +2308,7 @@ func TestParseExpressionStatementAfterReturnStatement(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -2369,7 +2369,7 @@ func TestParseSwapStatementInFunctionDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
diff --git a/old_parser/type_test.go b/old_parser/type_test.go
index 814a51b813..7e9bcdf1dc 100644
--- a/old_parser/type_test.go
+++ b/old_parser/type_test.go
@@ -27,7 +27,7 @@ import (
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/common"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func TestParseNominalType(t *testing.T) {
@@ -41,7 +41,7 @@ func TestParseNominalType(t *testing.T) {
result, errs := testParseType("Int")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.NominalType{
Identifier: ast.Identifier{
Identifier: "Int",
@@ -59,7 +59,7 @@ func TestParseNominalType(t *testing.T) {
result, errs := testParseType("Foo.Bar")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.NominalType{
Identifier: ast.Identifier{
Identifier: "Foo",
@@ -88,7 +88,7 @@ func TestParseArrayType(t *testing.T) {
result, errs := testParseType("[Int]")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.VariableSizedType{
Type: &ast.NominalType{
Identifier: ast.Identifier{
@@ -112,7 +112,7 @@ func TestParseArrayType(t *testing.T) {
result, errs := testParseType("[Int ; 2 ]")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ConstantSizedType{
Type: &ast.NominalType{
Identifier: ast.Identifier{
@@ -143,7 +143,7 @@ func TestParseArrayType(t *testing.T) {
t.Parallel()
result, errs := testParseType("[Int ; -2 ]")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: `expected positive integer size for constant sized type`,
@@ -166,7 +166,7 @@ func TestParseArrayType(t *testing.T) {
t.Parallel()
result, errs := testParseType("[Int ; X ]")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: `expected positive integer size for constant sized type`,
@@ -176,7 +176,7 @@ func TestParseArrayType(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.VariableSizedType{
Type: &ast.NominalType{
Identifier: ast.Identifier{
@@ -206,7 +206,7 @@ func TestParseOptionalType(t *testing.T) {
result, errs := testParseType("Int?")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.OptionalType{
Type: &ast.NominalType{
Identifier: ast.Identifier{
@@ -227,7 +227,7 @@ func TestParseOptionalType(t *testing.T) {
result, errs := testParseType("Int??")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.OptionalType{
Type: &ast.OptionalType{
Type: &ast.NominalType{
@@ -251,7 +251,7 @@ func TestParseOptionalType(t *testing.T) {
result, errs := testParseType("Int???")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.OptionalType{
Type: &ast.OptionalType{
Type: &ast.OptionalType{
@@ -283,7 +283,7 @@ func TestParseReferenceType(t *testing.T) {
result, errs := testParseType("&Int")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ReferenceType{
Authorization: nil,
Type: &ast.NominalType{
@@ -305,7 +305,7 @@ func TestParseReferenceType(t *testing.T) {
result, errs := testParseType("auth &Int")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ReferenceType{
Authorization: nil,
LegacyAuthorized: true,
@@ -333,7 +333,7 @@ func TestParseOptionalReferenceType(t *testing.T) {
result, errs := testParseType("&Int?")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.OptionalType{
Type: &ast.ReferenceType{
Authorization: nil,
@@ -363,7 +363,7 @@ func TestParseRestrictedType(t *testing.T) {
result, errs := testParseType("T{}")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntersectionType{
LegacyRestrictedType: &ast.NominalType{
NestedIdentifiers: nil,
@@ -388,7 +388,7 @@ func TestParseRestrictedType(t *testing.T) {
result, errs := testParseType("T{U}")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntersectionType{
LegacyRestrictedType: &ast.NominalType{
NestedIdentifiers: nil,
@@ -421,7 +421,7 @@ func TestParseRestrictedType(t *testing.T) {
result, errs := testParseType("T{U , V }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntersectionType{
LegacyRestrictedType: &ast.NominalType{
NestedIdentifiers: nil,
@@ -460,7 +460,7 @@ func TestParseRestrictedType(t *testing.T) {
result, errs := testParseType("{}")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntersectionType{
Range: ast.Range{
StartPos: ast.Position{Line: 1, Column: 0, Offset: 0},
@@ -478,7 +478,7 @@ func TestParseRestrictedType(t *testing.T) {
result, errs := testParseType("{ T }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntersectionType{
Types: []*ast.NominalType{
{
@@ -502,7 +502,7 @@ func TestParseRestrictedType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{ T , }")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "missing type after comma",
@@ -512,7 +512,7 @@ func TestParseRestrictedType(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntersectionType{
Types: []*ast.NominalType{
{
@@ -536,7 +536,7 @@ func TestParseRestrictedType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{ T U }")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected type",
@@ -555,7 +555,7 @@ func TestParseRestrictedType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{ T , U : V }")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected colon in restricted type",
@@ -574,7 +574,7 @@ func TestParseRestrictedType(t *testing.T) {
t.Parallel()
result, errs := testParseType("T{U , V : W }")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: `unexpected token: got ':', expected ',' or '}'`,
@@ -593,7 +593,7 @@ func TestParseRestrictedType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{[T]}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "non-nominal type in restriction list: [T]",
@@ -612,7 +612,7 @@ func TestParseRestrictedType(t *testing.T) {
t.Parallel()
result, errs := testParseType("T{[U]}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected non-nominal type: [U]",
@@ -631,7 +631,7 @@ func TestParseRestrictedType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{T, [U]}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "non-nominal type in restriction list: [U]",
@@ -650,7 +650,7 @@ func TestParseRestrictedType(t *testing.T) {
t.Parallel()
result, errs := testParseType("T{U, [V]}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected non-nominal type: [V]",
@@ -669,7 +669,7 @@ func TestParseRestrictedType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid end of input, expected type",
@@ -687,7 +687,7 @@ func TestParseRestrictedType(t *testing.T) {
t.Parallel()
result, errs := testParseType("T{")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid end of input, expected type",
@@ -705,7 +705,7 @@ func TestParseRestrictedType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{U")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid end of input, expected '}'",
@@ -723,7 +723,7 @@ func TestParseRestrictedType(t *testing.T) {
t.Parallel()
result, errs := testParseType("T{U")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid end of input, expected '}'",
@@ -741,7 +741,7 @@ func TestParseRestrictedType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{U,")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid end of input, expected type",
@@ -759,7 +759,7 @@ func TestParseRestrictedType(t *testing.T) {
t.Parallel()
result, errs := testParseType("T{U,")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid end of input, expected type",
@@ -777,7 +777,7 @@ func TestParseRestrictedType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{,}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected comma in restricted type",
@@ -795,7 +795,7 @@ func TestParseRestrictedType(t *testing.T) {
t.Parallel()
result, errs := testParseType("T{,}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected comma",
@@ -820,7 +820,7 @@ func TestParseDictionaryType(t *testing.T) {
result, errs := testParseType("{T: U}")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.DictionaryType{
KeyType: &ast.NominalType{
Identifier: ast.Identifier{
@@ -848,7 +848,7 @@ func TestParseDictionaryType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{T:}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "missing dictionary value type",
@@ -858,7 +858,7 @@ func TestParseDictionaryType(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.DictionaryType{
KeyType: &ast.NominalType{
Identifier: ast.Identifier{
@@ -881,7 +881,7 @@ func TestParseDictionaryType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{:}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected colon in dictionary type",
@@ -899,7 +899,7 @@ func TestParseDictionaryType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{:U}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected colon in dictionary type",
@@ -918,7 +918,7 @@ func TestParseDictionaryType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{T:U,}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected comma in dictionary type",
@@ -937,7 +937,7 @@ func TestParseDictionaryType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{T:U:}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected colon in dictionary type",
@@ -956,7 +956,7 @@ func TestParseDictionaryType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{T::U}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected colon in dictionary type",
@@ -975,7 +975,7 @@ func TestParseDictionaryType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{T:")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid end of input, expected type",
@@ -993,7 +993,7 @@ func TestParseDictionaryType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{T:U")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid end of input, expected '}'",
@@ -1018,7 +1018,7 @@ func TestParseFunctionType(t *testing.T) {
result, errs := testParseType("(():Void)")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FunctionType{
ParameterTypeAnnotations: nil,
ReturnTypeAnnotation: &ast.TypeAnnotation{
@@ -1047,7 +1047,7 @@ func TestParseFunctionType(t *testing.T) {
result, errs := testParseType("( ( String , Bool , @R ) : Int)")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FunctionType{
ParameterTypeAnnotations: []*ast.TypeAnnotation{
{
@@ -1112,7 +1112,7 @@ func TestParseInstantiationType(t *testing.T) {
result, errs := testParseType("T<>")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InstantiationType{
Type: &ast.NominalType{
Identifier: ast.Identifier{
@@ -1134,7 +1134,7 @@ func TestParseInstantiationType(t *testing.T) {
result, errs := testParseType("T")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InstantiationType{
Type: &ast.NominalType{
Identifier: ast.Identifier{
@@ -1168,7 +1168,7 @@ func TestParseInstantiationType(t *testing.T) {
result, errs := testParseType("T< U >")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InstantiationType{
Type: &ast.NominalType{
Identifier: ast.Identifier{
@@ -1202,7 +1202,7 @@ func TestParseInstantiationType(t *testing.T) {
result, errs := testParseType("T< U , @V >")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InstantiationType{
Type: &ast.NominalType{
Identifier: ast.Identifier{
@@ -1246,7 +1246,7 @@ func TestParseInstantiationType(t *testing.T) {
result, errs := testParseType("T")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InstantiationType{
Type: &ast.NominalType{
Identifier: ast.Identifier{
@@ -1280,7 +1280,7 @@ func TestParseInstantiationType(t *testing.T) {
result, errs := testParseType("T< U< V > >")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InstantiationType{
Type: &ast.NominalType{
Identifier: ast.Identifier{
@@ -1334,7 +1334,7 @@ func TestParseParametersAndArrayTypes(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessAll,
@@ -1483,7 +1483,7 @@ func TestParseDictionaryTypeInVariableDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -1805,7 +1805,7 @@ func TestParseIntegerTypes(t *testing.T) {
StartPos: ast.Position{Offset: 137, Line: 9, Column: 2},
}
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{a, b, c, d, e, f, g, h},
result.Declarations(),
)
@@ -1821,7 +1821,7 @@ func TestParseFunctionTypeInVariableDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -1899,7 +1899,7 @@ func TestParseFunctionArrayType(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -1983,7 +1983,7 @@ func TestParseFunctionTypeWithArrayReturnType(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2066,7 +2066,7 @@ func TestParseFunctionTypeWithFunctionReturnTypeInParentheses(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2156,7 +2156,7 @@ func TestParseFunctionTypeWithFunctionReturnType(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2246,7 +2246,7 @@ func TestParseOptionalTypeDouble(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2301,7 +2301,7 @@ func TestParseFunctionTypeWithResourceTypeAnnotation(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2358,7 +2358,7 @@ func TestParseReferenceTypeInVariableDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2419,7 +2419,7 @@ func TestParseOptionalReference(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2474,7 +2474,7 @@ func TestParseRestrictedReferenceTypeWithBaseType(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2541,7 +2541,7 @@ func TestParseRestrictedReferenceTypeWithoutBaseType(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2601,7 +2601,7 @@ func TestParseOptionalRestrictedType(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2668,7 +2668,7 @@ func TestParseOptionalRestrictedTypeOnlyRestrictions(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2728,7 +2728,7 @@ func TestParseAuthorizedReferenceType(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2783,7 +2783,7 @@ func TestParseInstantiationTypeInVariableDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2859,7 +2859,7 @@ func TestParseConstantSizedSizedArrayWithTrailingUnderscoreSize(t *testing.T) {
let T:[d;0_]=0
`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&InvalidIntegerLiteralError{
Literal: "0_",
diff --git a/parser/declaration_test.go b/parser/declaration_test.go
index 2f27396cbd..681d5cb593 100644
--- a/parser/declaration_test.go
+++ b/parser/declaration_test.go
@@ -29,7 +29,7 @@ import (
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/common"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func TestParseVariableDeclaration(t *testing.T) {
@@ -43,7 +43,7 @@ func TestParseVariableDeclaration(t *testing.T) {
result, errs := testParseDeclarations("var x = 1")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -79,7 +79,7 @@ func TestParseVariableDeclaration(t *testing.T) {
result, errs := testParseDeclarations(" access(all) var x = 1")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Value: &ast.IntegerExpression{
@@ -136,7 +136,7 @@ func TestParseVariableDeclaration(t *testing.T) {
result, errs := testParseDeclarations("let x = 1")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -172,7 +172,7 @@ func TestParseVariableDeclaration(t *testing.T) {
result, errs := testParseDeclarations("let x <- 1")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -208,7 +208,7 @@ func TestParseVariableDeclaration(t *testing.T) {
result, errs := testParseDeclarations("let r2: @R <- r")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -251,7 +251,7 @@ func TestParseVariableDeclaration(t *testing.T) {
result, errs := testParseStatements("var x <- y <- z")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -292,7 +292,7 @@ func TestParseVariableDeclaration(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations("view var x = 1")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid view modifier for variable",
@@ -314,7 +314,7 @@ func TestParseVariableDeclaration(t *testing.T) {
StaticModifierEnabled: true,
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid static modifier for variable",
@@ -330,7 +330,7 @@ func TestParseVariableDeclaration(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations("static var x = 1")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -352,7 +352,7 @@ func TestParseVariableDeclaration(t *testing.T) {
NativeModifierEnabled: true,
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid native modifier for variable",
@@ -368,7 +368,7 @@ func TestParseVariableDeclaration(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations("native var x = 1")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -402,7 +402,7 @@ func TestParseParameterList(t *testing.T) {
result, errs := parse("()")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ParameterList{
Range: ast.Range{
StartPos: ast.Position{Line: 1, Column: 0, Offset: 0},
@@ -420,7 +420,7 @@ func TestParseParameterList(t *testing.T) {
result, errs := parse(" ( )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ParameterList{
Range: ast.Range{
StartPos: ast.Position{Line: 1, Column: 1, Offset: 1},
@@ -438,7 +438,7 @@ func TestParseParameterList(t *testing.T) {
result, errs := parse("( a : Int )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ParameterList{
Parameters: []*ast.Parameter{
{
@@ -476,7 +476,7 @@ func TestParseParameterList(t *testing.T) {
result, errs := parse("( a b : Int )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ParameterList{
Parameters: []*ast.Parameter{
{
@@ -514,7 +514,7 @@ func TestParseParameterList(t *testing.T) {
result, errs := parse("( a b : Int , c : Int )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ParameterList{
Parameters: []*ast.Parameter{
{
@@ -568,7 +568,7 @@ func TestParseParameterList(t *testing.T) {
t.Parallel()
_, errs := parse("( a b : Int c : Int )")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&MissingCommaInParameterListError{
Pos: ast.Position{Offset: 14, Line: 1, Column: 14},
@@ -590,7 +590,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
result, errs := testParseDeclarations("fun foo () { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -628,7 +628,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
result, errs := testParseDeclarations("access(all) fun foo () { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
ParameterList: &ast.ParameterList{
@@ -688,7 +688,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
result, errs := testParseDeclarations("fun foo (): X { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -747,7 +747,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -870,7 +870,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
result, errs := testParseDeclarations("/// Test\nfun foo() {}")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -908,7 +908,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
result, errs := testParseDeclarations("\n /// First line\n \n/// Second line\n\n\nfun foo() {}")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -946,7 +946,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
result, errs := testParseDeclarations("\n /** Cool dogs.\n\n Cool cats!! */\n\n\nfun foo() {}")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -989,7 +989,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
result, errs := testParseDeclarations("fun main(): Int{ return 1 }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1052,7 +1052,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
result, errs := testParseDeclarations("view fun foo (): X { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1105,7 +1105,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1154,7 +1154,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
_, errs := testParseDeclarations("native fun foo() {}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -1178,7 +1178,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1215,7 +1215,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
_, errs := testParseDeclarations("static fun foo() {}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -1240,7 +1240,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1277,7 +1277,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
_, errs := testParseDeclarations("static native fun foo() {}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -1300,7 +1300,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
NativeModifierEnabled: true,
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid static modifier after native modifier",
@@ -1317,7 +1317,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
_, errs := testParseDeclarations("native static fun foo() {}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -1342,7 +1342,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Purity: 0,
@@ -1408,7 +1408,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
_, errs := testParseDeclarations("access(all) static native fun foo() {}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -1436,7 +1436,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1486,7 +1486,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1543,7 +1543,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1608,7 +1608,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
_, errs := testParseDeclarations("fun foo() {}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected '(' as start of parameter list, got '<'",
@@ -1631,7 +1631,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "missing '>' at end of type parameter list",
@@ -1654,7 +1654,7 @@ func TestParseFunctionDeclaration(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&MissingCommaInParameterListError{
Pos: ast.Position{Offset: 13, Line: 1, Column: 13},
@@ -1686,7 +1686,7 @@ func TestParseAccess(t *testing.T) {
result, errs := parse("access ( all )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessAll,
result,
)
@@ -1699,7 +1699,7 @@ func TestParseAccess(t *testing.T) {
result, errs := parse("access ( account )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessAccount,
result,
)
@@ -1712,7 +1712,7 @@ func TestParseAccess(t *testing.T) {
result, errs := parse("access ( contract )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessContract,
result,
)
@@ -1725,7 +1725,7 @@ func TestParseAccess(t *testing.T) {
result, errs := parse("access ( self )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessSelf,
result,
)
@@ -1736,7 +1736,7 @@ func TestParseAccess(t *testing.T) {
t.Parallel()
result, errs := parse("access ( ")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected keyword \"all\", \"account\", \"contract\", or \"self\", got EOF",
@@ -1746,7 +1746,7 @@ func TestParseAccess(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessNotSpecified,
result,
)
@@ -1757,7 +1757,7 @@ func TestParseAccess(t *testing.T) {
t.Parallel()
result, errs := parse("access ( self ")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected token ')'",
@@ -1767,7 +1767,7 @@ func TestParseAccess(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessNotSpecified,
result,
)
@@ -1780,7 +1780,7 @@ func TestParseAccess(t *testing.T) {
result, errs := parse("access ( foo )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.EntitlementAccess{
EntitlementSet: &ast.ConjunctiveEntitlementSet{
Elements: []*ast.NominalType{
@@ -1804,7 +1804,7 @@ func TestParseAccess(t *testing.T) {
result, errs := parse("access ( foo , bar )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.EntitlementAccess{
EntitlementSet: &ast.ConjunctiveEntitlementSet{
Elements: []*ast.NominalType{
@@ -1834,7 +1834,7 @@ func TestParseAccess(t *testing.T) {
result, errs := parse("access ( foo | bar )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.EntitlementAccess{
EntitlementSet: &ast.DisjunctiveEntitlementSet{
Elements: []*ast.NominalType{
@@ -1862,7 +1862,7 @@ func TestParseAccess(t *testing.T) {
t.Parallel()
result, errs := parse("access ( foo | bar , baz )")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: got ',', expected '|' or ')'",
@@ -1872,7 +1872,7 @@ func TestParseAccess(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessNotSpecified,
result,
)
@@ -1883,7 +1883,7 @@ func TestParseAccess(t *testing.T) {
t.Parallel()
result, errs := parse("access ( foo , bar | baz )")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: got '|', expected ',' or ')'",
@@ -1893,7 +1893,7 @@ func TestParseAccess(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessNotSpecified,
result,
)
@@ -1904,7 +1904,7 @@ func TestParseAccess(t *testing.T) {
t.Parallel()
result, errs := parse("access ( self , bar )")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected token ')'",
@@ -1914,7 +1914,7 @@ func TestParseAccess(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessNotSpecified,
result,
)
@@ -1925,7 +1925,7 @@ func TestParseAccess(t *testing.T) {
t.Parallel()
result, errs := parse("access ( self | bar )")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected token ')'",
@@ -1935,7 +1935,7 @@ func TestParseAccess(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessNotSpecified,
result,
)
@@ -1946,7 +1946,7 @@ func TestParseAccess(t *testing.T) {
t.Parallel()
result, errs := parse("access ( foo , self )")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected non-nominal type: self",
@@ -1956,7 +1956,7 @@ func TestParseAccess(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessNotSpecified,
result,
)
@@ -1967,7 +1967,7 @@ func TestParseAccess(t *testing.T) {
t.Parallel()
result, errs := parse("access ( foo | self )")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected non-nominal type: self",
@@ -1977,7 +1977,7 @@ func TestParseAccess(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessNotSpecified,
result,
)
@@ -1988,7 +1988,7 @@ func TestParseAccess(t *testing.T) {
t.Parallel()
result, errs := parse("access ( foo bar )")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected entitlement separator identifier",
@@ -1998,7 +1998,7 @@ func TestParseAccess(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessNotSpecified,
result,
)
@@ -2009,7 +2009,7 @@ func TestParseAccess(t *testing.T) {
t.Parallel()
result, errs := parse("access ( foo & bar )")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected entitlement separator '&'",
@@ -2019,7 +2019,7 @@ func TestParseAccess(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessNotSpecified,
result,
)
@@ -2032,7 +2032,7 @@ func TestParseAccess(t *testing.T) {
result, errs := parse("access ( mapping foo )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.MappedAccess{
EntitlementMap: &ast.NominalType{
Identifier: ast.Identifier{
@@ -2051,7 +2051,7 @@ func TestParseAccess(t *testing.T) {
t.Parallel()
result, errs := parse("access ( mapping )")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token in type: ')'",
@@ -2061,7 +2061,7 @@ func TestParseAccess(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.AccessNotSpecified,
result,
)
@@ -2078,7 +2078,7 @@ func TestParseImportDeclaration(t *testing.T) {
t.Parallel()
result, errs := testParseDeclarations(` import`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected end in import declaration: expected string, address, or identifier",
@@ -2090,7 +2090,7 @@ func TestParseImportDeclaration(t *testing.T) {
var expected []ast.Declaration
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
expected,
result,
)
@@ -2103,7 +2103,7 @@ func TestParseImportDeclaration(t *testing.T) {
result, errs := testParseDeclarations(` import "foo"`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.ImportDeclaration{
Identifiers: nil,
@@ -2126,7 +2126,7 @@ func TestParseImportDeclaration(t *testing.T) {
result, errs := testParseDeclarations(` import 0x42`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.ImportDeclaration{
Identifiers: nil,
@@ -2149,7 +2149,7 @@ func TestParseImportDeclaration(t *testing.T) {
t.Parallel()
result, errs := testParseDeclarations(` import 0x10000000000000001`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "address too large",
@@ -2173,7 +2173,7 @@ func TestParseImportDeclaration(t *testing.T) {
},
}
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
expected,
result,
)
@@ -2184,7 +2184,7 @@ func TestParseImportDeclaration(t *testing.T) {
t.Parallel()
result, errs := testParseDeclarations(` import 1`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token in import declaration: " +
@@ -2197,7 +2197,7 @@ func TestParseImportDeclaration(t *testing.T) {
var expected []ast.Declaration
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
expected,
result,
)
@@ -2211,7 +2211,7 @@ func TestParseImportDeclaration(t *testing.T) {
result, errs := testParseDeclarations(` import foo from "bar"`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.ImportDeclaration{
Identifiers: []ast.Identifier{
@@ -2237,7 +2237,7 @@ func TestParseImportDeclaration(t *testing.T) {
t.Parallel()
result, errs := testParseDeclarations(` import foo "bar"`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token in import declaration: " +
@@ -2250,7 +2250,7 @@ func TestParseImportDeclaration(t *testing.T) {
var expected []ast.Declaration
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
expected,
result,
)
@@ -2263,7 +2263,7 @@ func TestParseImportDeclaration(t *testing.T) {
result, errs := testParseDeclarations(` import foo , bar , baz from 0x42`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.ImportDeclaration{
Identifiers: []ast.Identifier{
@@ -2299,7 +2299,7 @@ func TestParseImportDeclaration(t *testing.T) {
t.Parallel()
result, errs := testParseDeclarations(` import foo , bar , from 0x42`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: `expected identifier, got keyword "from"`,
@@ -2311,7 +2311,7 @@ func TestParseImportDeclaration(t *testing.T) {
var expected []ast.Declaration
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
expected,
result,
)
@@ -2321,7 +2321,7 @@ func TestParseImportDeclaration(t *testing.T) {
t.Parallel()
result, errs := testParseDeclarations(`import foo, , bar from 0xaaaa`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Pos: ast.Position{Line: 1, Column: 12, Offset: 12},
@@ -2332,7 +2332,7 @@ func TestParseImportDeclaration(t *testing.T) {
)
var expected []ast.Declaration
- utils.AssertEqualWithDiff(t, expected, result)
+ AssertEqualWithDiff(t, expected, result)
})
t.Run("no identifiers, identifier location", func(t *testing.T) {
@@ -2342,7 +2342,7 @@ func TestParseImportDeclaration(t *testing.T) {
result, errs := testParseDeclarations(` import foo`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.ImportDeclaration{
Identifiers: nil,
@@ -2363,7 +2363,7 @@ func TestParseImportDeclaration(t *testing.T) {
_, errs := testParseDeclarations(`import foo, bar, baz, @ from 0x42`)
- utils.AssertEqualWithDiff(t, []error{
+ AssertEqualWithDiff(t, []error{
&SyntaxError{
Pos: ast.Position{Line: 1, Column: 22, Offset: 22},
Message: `unexpected token in import declaration: got '@', expected keyword "from" or ','`,
@@ -2381,7 +2381,7 @@ func TestParseImportDeclaration(t *testing.T) {
`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.ImportDeclaration{
Identifiers: []ast.Identifier{
@@ -2444,7 +2444,7 @@ func TestParseEvent(t *testing.T) {
result, errs := testParseDeclarations("event E()")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -2487,7 +2487,7 @@ func TestParseEvent(t *testing.T) {
result, errs := testParseDeclarations(" access(self) event E2 ( a : Int , b : String )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Members: ast.NewUnmeteredMembers(
@@ -2620,7 +2620,7 @@ func TestParseEvent(t *testing.T) {
result, errs := testParseDeclarations(` access(all) event ResourceDestroyed ( a : String = "foo")`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Members: ast.NewUnmeteredMembers(
@@ -2735,7 +2735,7 @@ func TestParseEvent(t *testing.T) {
_, errs := testParseDeclarations(" access(all) event ResourceDestroyed ( a : Int )")
- utils.AssertEqualWithDiff(t, []error{
+ AssertEqualWithDiff(t, []error{
&SyntaxError{
Pos: ast.Position{Line: 1, Column: 47, Offset: 47},
Message: "expected a default argument after type annotation, got ')'",
@@ -2749,7 +2749,7 @@ func TestParseEvent(t *testing.T) {
_, errs := testParseDeclarations(" access(all) event Foo ( a : Int = 3)")
- utils.AssertEqualWithDiff(t, []error{
+ AssertEqualWithDiff(t, []error{
&SyntaxError{
Pos: ast.Position{Line: 1, Column: 33, Offset: 33},
Message: "cannot use a default argument for this function",
@@ -2760,7 +2760,7 @@ func TestParseEvent(t *testing.T) {
t.Run("invalid event name", func(t *testing.T) {
_, errs := testParseDeclarations(`event continue {}`)
- utils.AssertEqualWithDiff(t, []error{
+ AssertEqualWithDiff(t, []error{
&SyntaxError{
Pos: ast.Position{Line: 1, Column: 6, Offset: 6},
Message: "expected identifier after start of event declaration, got keyword continue",
@@ -2798,7 +2798,7 @@ func TestParseFieldWithVariableKind(t *testing.T) {
result, errs := parse("var x : Int")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FieldDeclaration{
Access: ast.AccessNotSpecified,
VariableKind: ast.VariableKindVariable,
@@ -2832,7 +2832,7 @@ func TestParseFieldWithVariableKind(t *testing.T) {
result, errs := parse("let x : Int")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FieldDeclaration{
Access: ast.AccessNotSpecified,
VariableKind: ast.VariableKindConstant,
@@ -2890,7 +2890,7 @@ func TestParseField(t *testing.T) {
)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FieldDeclaration{
Access: ast.AccessNotSpecified,
Flags: ast.FieldDeclarationFlagsIsNative,
@@ -2923,7 +2923,7 @@ func TestParseField(t *testing.T) {
_, errs := parse("native let foo: Int", Config{})
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected identifier",
@@ -2946,7 +2946,7 @@ func TestParseField(t *testing.T) {
)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FieldDeclaration{
Access: ast.AccessNotSpecified,
Flags: ast.FieldDeclarationFlagsIsStatic,
@@ -2982,7 +2982,7 @@ func TestParseField(t *testing.T) {
Config{},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected identifier",
@@ -3006,7 +3006,7 @@ func TestParseField(t *testing.T) {
)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FieldDeclaration{
Access: ast.AccessNotSpecified,
Flags: ast.FieldDeclarationFlagsIsStatic | ast.FieldDeclarationFlagsIsNative,
@@ -3039,7 +3039,7 @@ func TestParseField(t *testing.T) {
_, errs := parse("static native let foo: Int", Config{})
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected identifier",
@@ -3062,7 +3062,7 @@ func TestParseField(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid static modifier after native modifier",
@@ -3086,7 +3086,7 @@ func TestParseField(t *testing.T) {
)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FieldDeclaration{
TypeAnnotation: &ast.TypeAnnotation{
Type: &ast.NominalType{
@@ -3140,7 +3140,7 @@ func TestParseField(t *testing.T) {
_, errs := parse("access(all) static native let foo: Int", Config{})
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected identifier",
@@ -3164,7 +3164,7 @@ func TestParseCompositeDeclaration(t *testing.T) {
result, errs := testParseDeclarations(" access(all) struct S { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Members: ast.NewUnmeteredMembers(nil),
@@ -3203,7 +3203,7 @@ func TestParseCompositeDeclaration(t *testing.T) {
result, errs := testParseDeclarations(" access(all) resource R : RI { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessAll,
@@ -3251,7 +3251,7 @@ func TestParseCompositeDeclaration(t *testing.T) {
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Members: ast.NewUnmeteredMembers(
@@ -3579,7 +3579,7 @@ func TestParseCompositeDeclaration(t *testing.T) {
}`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -3632,7 +3632,7 @@ func TestParseCompositeDeclaration(t *testing.T) {
}`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -3687,7 +3687,7 @@ func TestParseCompositeDeclaration(t *testing.T) {
view foo: Int
}`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid view modifier for variable",
@@ -3720,7 +3720,7 @@ func TestParseInvalidCompositeFunctionWithSelfParameter(t *testing.T) {
_, err := testParseDeclarations(code)
- utils.AssertEqualWithDiff(
+ AssertEqualWithDiff(
t,
[]error{
&SyntaxError{
@@ -3739,7 +3739,7 @@ func TestParseInvalidParameterWithoutLabel(t *testing.T) {
_, errs := testParseDeclarations(`access(all) fun foo(continue: Int) {}`)
- utils.AssertEqualWithDiff(t, []error{
+ AssertEqualWithDiff(t, []error{
&SyntaxError{
Pos: ast.Position{Line: 1, Column: 20, Offset: 20},
Message: "expected identifier for argument label or parameter name, got keyword continue",
@@ -3752,7 +3752,7 @@ func TestParseParametersWithExtraLabels(t *testing.T) {
_, errs := testParseDeclarations(`access(all) fun foo(_ foo: String, label fable table: Int) {}`)
- utils.AssertEqualWithDiff(t, []error{
+ AssertEqualWithDiff(t, []error{
&SyntaxError{
Pos: ast.Position{Line: 1, Column: 47, Offset: 47},
Message: "expected ':' after parameter name, got identifier",
@@ -3771,7 +3771,7 @@ func TestParseAttachmentDeclaration(t *testing.T) {
result, errs := testParseDeclarations("access(all) attachment E for S {} ")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.AttachmentDeclaration{
Access: ast.AccessAll,
@@ -3806,7 +3806,7 @@ func TestParseAttachmentDeclaration(t *testing.T) {
}`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -3852,7 +3852,7 @@ func TestParseAttachmentDeclaration(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations("attachment E {} ")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected 'for', got '{'",
@@ -3870,7 +3870,7 @@ func TestParseAttachmentDeclaration(t *testing.T) {
result, errs := testParseDeclarations("access(all) attachment E for S: I {} ")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.AttachmentDeclaration{
Access: ast.AccessAll,
@@ -3912,7 +3912,7 @@ func TestParseAttachmentDeclaration(t *testing.T) {
result, errs := testParseDeclarations("access(all) attachment E for S: I1, I2 {} ")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.AttachmentDeclaration{
Access: ast.AccessAll,
@@ -3986,7 +3986,7 @@ func TestParseAttachmentDeclaration(t *testing.T) {
}`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.AttachmentDeclaration{
Access: ast.AccessAll,
@@ -4193,7 +4193,7 @@ func TestParseAttachmentDeclaration(t *testing.T) {
_, errs := testParseDeclarations(`access(all) attachment E for S {
require entitlement X
}`)
- utils.AssertEqualWithDiff(t, []error{
+ AssertEqualWithDiff(t, []error{
&SyntaxError{
Pos: ast.Position{Line: 2, Column: 3, Offset: 36},
Message: "unexpected identifier",
@@ -4210,7 +4210,7 @@ func TestParseAttachmentDeclaration(t *testing.T) {
}`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.AttachmentDeclaration{
Access: ast.AccessAll,
@@ -4323,7 +4323,7 @@ func TestParseInterfaceDeclaration(t *testing.T) {
result, errs := testParseDeclarations(" access(all) struct interface S { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.InterfaceDeclaration{
Access: ast.AccessAll,
@@ -4348,7 +4348,7 @@ func TestParseInterfaceDeclaration(t *testing.T) {
t.Parallel()
result, errs := testParseDeclarations(" access(all) struct interface interface { }")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected interface name, got keyword \"interface\"",
@@ -4360,7 +4360,7 @@ func TestParseInterfaceDeclaration(t *testing.T) {
var expected []ast.Declaration
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
expected,
result,
)
@@ -4384,7 +4384,7 @@ func TestParseInterfaceDeclaration(t *testing.T) {
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.InterfaceDeclaration{
Members: ast.NewUnmeteredMembers(
@@ -4647,7 +4647,7 @@ func TestParseInterfaceDeclaration(t *testing.T) {
t.Run("invalid interface name", func(t *testing.T) {
_, errs := testParseDeclarations(`access(all) struct interface continue {}`)
- utils.AssertEqualWithDiff(t, []error{
+ AssertEqualWithDiff(t, []error{
&SyntaxError{
Pos: ast.Position{Line: 1, Column: 29, Offset: 29},
Message: "expected identifier following struct declaration, got keyword continue",
@@ -4664,7 +4664,7 @@ func TestParseInterfaceDeclaration(t *testing.T) {
}`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.InterfaceDeclaration{
Access: ast.AccessNotSpecified,
@@ -4720,7 +4720,7 @@ func TestParseEnumDeclaration(t *testing.T) {
result, errs := testParseDeclarations(" access(all) enum E { case c ; access(all) case d }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessAll,
@@ -4764,7 +4764,7 @@ func TestParseEnumDeclaration(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations(" enum E { view case e }")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid view modifier for enum case",
@@ -4786,7 +4786,7 @@ func TestParseEnumDeclaration(t *testing.T) {
StaticModifierEnabled: true,
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid static modifier for enum case",
@@ -4803,7 +4803,7 @@ func TestParseEnumDeclaration(t *testing.T) {
_, errs := testParseDeclarations(" enum E { static case e }")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected identifier",
@@ -4825,7 +4825,7 @@ func TestParseEnumDeclaration(t *testing.T) {
NativeModifierEnabled: true,
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid native modifier for enum case",
@@ -4842,7 +4842,7 @@ func TestParseEnumDeclaration(t *testing.T) {
_, errs := testParseDeclarations(" enum E { native case e }")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected identifier",
@@ -4865,7 +4865,7 @@ func TestParseTransactionDeclaration(t *testing.T) {
result, errs := testParseDeclarations("transaction { execute {} }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.TransactionDeclaration{
Execute: &ast.SpecialFunctionDeclaration{
@@ -4905,7 +4905,7 @@ func TestParseTransactionDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.TransactionDeclaration{
Fields: nil,
@@ -4941,7 +4941,7 @@ func TestParseTransactionDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.TransactionDeclaration{
Fields: []*ast.FieldDeclaration{
@@ -5141,7 +5141,7 @@ func TestParseTransactionDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.TransactionDeclaration{
Fields: []*ast.FieldDeclaration{
@@ -5388,7 +5388,7 @@ func TestParseTransactionDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.TransactionDeclaration{
Fields: []*ast.FieldDeclaration{
@@ -5628,7 +5628,7 @@ func TestParseTransactionDeclaration(t *testing.T) {
_, errs := testParseDeclarations(code)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
`unexpected identifier, expected keyword "prepare" or "execute", got "uwu"`,
errs[0].Error(),
)
@@ -5644,7 +5644,7 @@ func TestParseFunctionAndBlock(t *testing.T) {
`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -5690,7 +5690,7 @@ func TestParseFunctionParameterWithoutLabel(t *testing.T) {
`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -5748,7 +5748,7 @@ func TestParseFunctionParameterWithLabel(t *testing.T) {
`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -5817,7 +5817,7 @@ func TestParseStructure(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Members: ast.NewUnmeteredMembers(
@@ -6144,7 +6144,7 @@ func TestParseStructureWithConformances(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -6205,7 +6205,7 @@ func TestParseInvalidMember(t *testing.T) {
IgnoreLeadingIdentifierEnabled: false,
})
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected identifier",
@@ -6236,7 +6236,7 @@ func TestParsePreAndPostConditions(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -6393,7 +6393,7 @@ func TestParseConditionMessage(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -6507,7 +6507,7 @@ func TestParseInvalidEmitConditionNonInvocation(t *testing.T) {
}
`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected token '('",
@@ -6530,7 +6530,7 @@ func TestParseInvalidEmitConditionNonInvocation(t *testing.T) {
}
`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected token '('",
@@ -6562,7 +6562,7 @@ func TestParseEmitAndTestCondition(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -6833,7 +6833,7 @@ func TestParseInterface(t *testing.T) {
},
}
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{test},
actual.Declarations(),
)
@@ -6851,7 +6851,7 @@ func TestParsePragmaNoArguments(t *testing.T) {
result, errs := testParseDeclarations(`#pedantic`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.PragmaDeclaration{
Expression: &ast.IdentifierExpression{
@@ -6875,7 +6875,7 @@ func TestParsePragmaNoArguments(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations("view #foo")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid view modifier for pragma",
@@ -6897,7 +6897,7 @@ func TestParsePragmaNoArguments(t *testing.T) {
StaticModifierEnabled: true,
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid static modifier for pragma",
@@ -6913,7 +6913,7 @@ func TestParsePragmaNoArguments(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations("static #foo")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -6935,7 +6935,7 @@ func TestParsePragmaNoArguments(t *testing.T) {
NativeModifierEnabled: true,
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid native modifier for pragma",
@@ -6951,7 +6951,7 @@ func TestParsePragmaNoArguments(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations("native #foo")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -6971,7 +6971,7 @@ func TestParsePragmaArguments(t *testing.T) {
actual, err := testParseProgram(code)
require.NoError(t, err)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.PragmaDeclaration{
Expression: &ast.InvocationExpression{
@@ -7016,7 +7016,7 @@ func TestParseImportWithString(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.ImportDeclaration{
Identifiers: nil,
@@ -7042,7 +7042,7 @@ func TestParseImportWithAddress(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.ImportDeclaration{
Identifiers: nil,
@@ -7070,7 +7070,7 @@ func TestParseImportWithIdentifiers(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.ImportDeclaration{
Identifiers: []ast.Identifier{
@@ -7109,7 +7109,7 @@ func TestParseFieldWithFromIdentifier(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -7174,7 +7174,7 @@ func TestParseImportWithFromIdentifier(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.ImportDeclaration{
Identifiers: []ast.Identifier{
@@ -7206,7 +7206,7 @@ func TestParseInvalidImportWithPurity(t *testing.T) {
`
_, errs := testParseDeclarations(code)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid view modifier for import",
@@ -7227,7 +7227,7 @@ func TestParseInvalidDefaultArgument(t *testing.T) {
_, errs := testParseDeclarations(" access(all) fun foo ( a : Int = 3) { } ")
- utils.AssertEqualWithDiff(t, []error{
+ AssertEqualWithDiff(t, []error{
&SyntaxError{
Pos: ast.Position{Line: 1, Column: 31, Offset: 31},
Message: "cannot use a default argument for this function",
@@ -7241,7 +7241,7 @@ func TestParseInvalidDefaultArgument(t *testing.T) {
_, errs := testParseDeclarations(" let foo = fun ( a : Int = 3) { } ")
- utils.AssertEqualWithDiff(t, []error{
+ AssertEqualWithDiff(t, []error{
&SyntaxError{
Pos: ast.Position{Line: 1, Column: 25, Offset: 25},
Message: "cannot use a default argument for this function",
@@ -7259,7 +7259,7 @@ func TestParseInvalidEventWithPurity(t *testing.T) {
`
_, errs := testParseDeclarations(code)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid view modifier for event",
@@ -7279,7 +7279,7 @@ func TestParseInvalidCompositeWithPurity(t *testing.T) {
`
_, errs := testParseDeclarations(code)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid view modifier for struct",
@@ -7299,7 +7299,7 @@ func TestParseInvalidTransactionWithPurity(t *testing.T) {
`
_, errs := testParseDeclarations(code)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid view modifier for transaction",
@@ -7332,7 +7332,7 @@ func TestParseResource(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -7362,7 +7362,7 @@ func TestParseEventDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -7448,7 +7448,7 @@ func TestParseEventEmitStatement(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -7534,7 +7534,7 @@ func TestParseResourceReturnType(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -7583,7 +7583,7 @@ func TestParseMovingVariableDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -7619,7 +7619,7 @@ func TestParseResourceParameterType(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -7678,7 +7678,7 @@ func TestParseMovingVariableDeclarationWithTypeAnnotation(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -7724,7 +7724,7 @@ func TestParseFieldDeclarationWithMoveTypeAnnotation(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -7779,7 +7779,7 @@ func TestParseDestructor(t *testing.T) {
}
`
_, errs := testParseDeclarations(code)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&CustomDestructorError{
Pos: ast.Position{Offset: 37, Line: 3, Column: 12},
@@ -7799,7 +7799,7 @@ func TestParseCompositeDeclarationWithSemicolonSeparatedMembers(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -7965,7 +7965,7 @@ func TestParseInvalidCompositeFunctionNames(t *testing.T) {
assert.True(t, ok, "Parser error does not conform to parser.Error")
syntaxErr := errs.Errors[0].(*SyntaxError)
- utils.AssertEqualWithDiff(
+ AssertEqualWithDiff(
t,
"expected identifier after start of function declaration, got keyword init",
syntaxErr.Message,
@@ -8075,7 +8075,7 @@ func TestParsePreconditionWithUnaryNegation(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -8157,7 +8157,7 @@ func TestParseInvalidAccessModifiers(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations("access(all) #test")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid access modifier for pragma",
@@ -8173,7 +8173,7 @@ func TestParseInvalidAccessModifiers(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations("access(all) transaction {}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid access modifier for transaction",
@@ -8189,7 +8189,7 @@ func TestParseInvalidAccessModifiers(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations("access(all) access(self) let x = 1")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid second access modifier",
@@ -8219,7 +8219,7 @@ func TestParseInvalidImportWithModifier(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid static modifier for import",
@@ -8238,7 +8238,7 @@ func TestParseInvalidImportWithModifier(t *testing.T) {
static import x from 0x1
`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -8263,7 +8263,7 @@ func TestParseInvalidImportWithModifier(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid native modifier for import",
@@ -8282,7 +8282,7 @@ func TestParseInvalidImportWithModifier(t *testing.T) {
native import x from 0x1
`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -8312,7 +8312,7 @@ func TestParseInvalidEventWithModifier(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid static modifier for event",
@@ -8331,7 +8331,7 @@ func TestParseInvalidEventWithModifier(t *testing.T) {
static event Foo()
`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -8356,7 +8356,7 @@ func TestParseInvalidEventWithModifier(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid native modifier for event",
@@ -8375,7 +8375,7 @@ func TestParseInvalidEventWithModifier(t *testing.T) {
native event Foo()
`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -8406,7 +8406,7 @@ func TestParseCompositeWithModifier(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid static modifier for structure",
@@ -8425,7 +8425,7 @@ func TestParseCompositeWithModifier(t *testing.T) {
static struct Foo()
`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -8450,7 +8450,7 @@ func TestParseCompositeWithModifier(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid native modifier for structure",
@@ -8469,7 +8469,7 @@ func TestParseCompositeWithModifier(t *testing.T) {
native struct Foo()
`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -8499,7 +8499,7 @@ func TestParseTransactionWithModifier(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid static modifier for transaction",
@@ -8518,7 +8518,7 @@ func TestParseTransactionWithModifier(t *testing.T) {
static transaction {}
`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -8543,7 +8543,7 @@ func TestParseTransactionWithModifier(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid native modifier for transaction",
@@ -8562,7 +8562,7 @@ func TestParseTransactionWithModifier(t *testing.T) {
native transaction {}
`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -8603,7 +8603,7 @@ func TestParseNestedPragma(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid native modifier for pragma",
@@ -8620,7 +8620,7 @@ func TestParseNestedPragma(t *testing.T) {
_, errs := parse("native #pragma", Config{})
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -8641,7 +8641,7 @@ func TestParseNestedPragma(t *testing.T) {
StaticModifierEnabled: true,
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid static modifier for pragma",
@@ -8661,7 +8661,7 @@ func TestParseNestedPragma(t *testing.T) {
Config{},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -8683,7 +8683,7 @@ func TestParseNestedPragma(t *testing.T) {
NativeModifierEnabled: true,
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid static modifier for pragma",
@@ -8700,7 +8700,7 @@ func TestParseNestedPragma(t *testing.T) {
_, errs := parse("static native #pragma", Config{})
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected identifier",
@@ -8723,7 +8723,7 @@ func TestParseNestedPragma(t *testing.T) {
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid static modifier after native modifier",
@@ -8740,7 +8740,7 @@ func TestParseNestedPragma(t *testing.T) {
_, errs := parse("access(all) #pragma", Config{})
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid access modifier for pragma",
@@ -8762,7 +8762,7 @@ func TestParseNestedPragma(t *testing.T) {
NativeModifierEnabled: true,
},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid access modifier for pragma",
@@ -8779,7 +8779,7 @@ func TestParseNestedPragma(t *testing.T) {
_, errs := parse("access(all) static native #pragma", Config{})
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected identifier",
@@ -8803,7 +8803,7 @@ func TestParseEntitlementDeclaration(t *testing.T) {
result, errs := testParseDeclarations(" access(all) entitlement ABC ")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.EntitlementDeclaration{
Access: ast.AccessAll,
@@ -8834,7 +8834,7 @@ func TestParseEntitlementDeclaration(t *testing.T) {
`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Members: ast.NewUnmeteredMembers(
@@ -8897,7 +8897,7 @@ func TestParseEntitlementDeclaration(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations(" access(all) entitlement")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected identifier, got EOF",
@@ -8913,7 +8913,7 @@ func TestParseEntitlementDeclaration(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations(" access(all) view entitlement E")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid view modifier for entitlement",
@@ -8949,7 +8949,7 @@ func TestParseMemberDocStrings(t *testing.T) {
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -9062,7 +9062,7 @@ func TestParseMemberDocStrings(t *testing.T) {
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.CompositeDeclaration{
Access: ast.AccessNotSpecified,
@@ -9134,7 +9134,7 @@ func TestParseEntitlementMappingDeclaration(t *testing.T) {
result, errs := testParseDeclarations(" access(all) entitlement mapping M { } ")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.EntitlementMappingDeclaration{
Access: ast.AccessAll,
@@ -9162,7 +9162,7 @@ func TestParseEntitlementMappingDeclaration(t *testing.T) {
} `)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.EntitlementMappingDeclaration{
Access: ast.AccessAll,
@@ -9251,7 +9251,7 @@ func TestParseEntitlementMappingDeclaration(t *testing.T) {
} `)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.EntitlementMappingDeclaration{
Access: ast.AccessAll,
@@ -9356,7 +9356,7 @@ func TestParseEntitlementMappingDeclaration(t *testing.T) {
} `)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.EntitlementMappingDeclaration{
Access: ast.AccessAll,
@@ -9437,7 +9437,7 @@ func TestParseEntitlementMappingDeclaration(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations(" access(all) mapping M {} ")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -9453,7 +9453,7 @@ func TestParseEntitlementMappingDeclaration(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations(" access(all) entitlement M {} ")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: '{'",
@@ -9469,7 +9469,7 @@ func TestParseEntitlementMappingDeclaration(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations(" access(all) entitlement mapping M ")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected token '{'",
@@ -9485,7 +9485,7 @@ func TestParseEntitlementMappingDeclaration(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations(" access(all) entitlement mapping M {")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected token '}'",
@@ -9501,7 +9501,7 @@ func TestParseEntitlementMappingDeclaration(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations(" access(all) entitlement mapping M }")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected token '{'",
@@ -9517,7 +9517,7 @@ func TestParseEntitlementMappingDeclaration(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations(" access(all) entitlement mapping {}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected identifier following entitlement mapping declaration, got '{'",
@@ -9536,7 +9536,7 @@ func TestParseEntitlementMappingDeclaration(t *testing.T) {
&A -> B
} `)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected nominal type, got &A",
@@ -9555,7 +9555,7 @@ func TestParseEntitlementMappingDeclaration(t *testing.T) {
A -> [B]
} `)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected nominal type, got [B]",
@@ -9574,7 +9574,7 @@ func TestParseEntitlementMappingDeclaration(t *testing.T) {
A B
} `)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected token '->'",
@@ -9593,7 +9593,7 @@ func TestParseEntitlementMappingDeclaration(t *testing.T) {
A - B
} `)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected token '->'",
@@ -9612,7 +9612,7 @@ func TestParseEntitlementMappingDeclaration(t *testing.T) {
include &A
} `)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected nominal type, got &A",
@@ -9631,7 +9631,7 @@ func TestParseEntitlementMappingDeclaration(t *testing.T) {
include -> B
} `)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token in type: '->'",
@@ -9653,7 +9653,7 @@ func TestParseInvalidSpecialFunctionReturnTypeAnnotation(t *testing.T) {
init(): Int
}
`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid return type for initializer",
@@ -9709,7 +9709,7 @@ func TestSoftKeywordsInFunctionDeclaration(t *testing.T) {
},
},
}
- utils.AssertEqualWithDiff(t, expected, result)
+ AssertEqualWithDiff(t, expected, result)
})
}
@@ -9728,7 +9728,7 @@ func TestParseDeprecatedAccessModifiers(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations(" pub fun foo ( ) { }")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxErrorWithSuggestedReplacement{
Message: "`pub` is no longer a valid access keyword",
@@ -9749,7 +9749,7 @@ func TestParseDeprecatedAccessModifiers(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations(" priv fun foo ( ) { }")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxErrorWithSuggestedReplacement{
Message: "`priv` is no longer a valid access keyword",
@@ -9770,7 +9770,7 @@ func TestParseDeprecatedAccessModifiers(t *testing.T) {
t.Parallel()
_, errs := testParseDeclarations(" pub(set) fun foo ( ) { }")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "`pub(set)` is no longer a valid access keyword",
diff --git a/parser/expression_test.go b/parser/expression_test.go
index 0eab41178f..172884de18 100644
--- a/parser/expression_test.go
+++ b/parser/expression_test.go
@@ -34,7 +34,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/errors"
"github.com/onflow/cadence/parser/lexer"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func TestParseSimpleInfixExpression(t *testing.T) {
@@ -48,7 +48,7 @@ func TestParseSimpleInfixExpression(t *testing.T) {
result, errs := testParseExpression("1+2*3")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationPlus,
Left: &ast.IntegerExpression{
@@ -93,7 +93,7 @@ func TestParseSimpleInfixExpression(t *testing.T) {
result, errs := testParseExpression(" 1 + 2 * 3 ")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationPlus,
Left: &ast.IntegerExpression{
@@ -138,7 +138,7 @@ func TestParseSimpleInfixExpression(t *testing.T) {
result, errs := testParseExpression("1 + 2 + 3")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationPlus,
Left: &ast.BinaryExpression{
@@ -183,7 +183,7 @@ func TestParseSimpleInfixExpression(t *testing.T) {
result, errs := testParseExpression("1 ?? 2 ?? 3")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationNilCoalesce,
Left: &ast.IntegerExpression{
@@ -233,7 +233,7 @@ func TestParseAdvancedExpression(t *testing.T) {
result, errs := testParseExpression("1 +- 2 -- 3")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationMinus,
Left: &ast.BinaryExpression{
@@ -278,7 +278,7 @@ func TestParseAdvancedExpression(t *testing.T) {
result, errs := testParseExpression("(1 + 2) * 3")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationMul,
Left: &ast.BinaryExpression{
@@ -356,7 +356,7 @@ func TestParseAdvancedExpression(t *testing.T) {
result, errs := testParseExpression("1 < 2 > 3")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationGreater,
Left: &ast.BinaryExpression{
@@ -401,7 +401,7 @@ func TestParseAdvancedExpression(t *testing.T) {
result, errs := testParseExpression("a ? b : c ? d : e")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ConditionalExpression{
Test: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -447,7 +447,7 @@ func TestParseAdvancedExpression(t *testing.T) {
result, errs := testParseExpression("true + false")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationPlus,
Left: &ast.BoolExpression{
@@ -476,7 +476,7 @@ func TestParseAdvancedExpression(t *testing.T) {
result, errs := testParseExpression("(<-x)")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.UnaryExpression{
Operation: ast.OperationMove,
Expression: &ast.IdentifierExpression{
@@ -498,7 +498,7 @@ func TestParseAdvancedExpression(t *testing.T) {
result, errs := testParseExpression("<-x as! @T")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.UnaryExpression{
Operation: ast.OperationMove,
Expression: &ast.CastingExpression{
@@ -533,7 +533,7 @@ func TestParseAdvancedExpression(t *testing.T) {
result, errs := testParseExpression("<-x as? @T")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.UnaryExpression{
Operation: ast.OperationMove,
Expression: &ast.CastingExpression{
@@ -568,7 +568,7 @@ func TestParseAdvancedExpression(t *testing.T) {
result, errs := testParseExpression("<-x as @T")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.UnaryExpression{
Operation: ast.OperationMove,
Expression: &ast.CastingExpression{
@@ -609,7 +609,7 @@ func TestParseArrayExpression(t *testing.T) {
result, errs := testParseExpression("[ 1,2 + 3, 4 , 5 ]")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ArrayExpression{
Values: []ast.Expression{
&ast.IntegerExpression{
@@ -677,7 +677,7 @@ func TestParseArrayExpression(t *testing.T) {
result, errs := testParseExpression("[ 1 , \n 2 \n , \n\n 3 \n\n\n]")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ArrayExpression{
Values: []ast.Expression{
&ast.IntegerExpression{
@@ -724,7 +724,7 @@ func TestParseArrayExpression(t *testing.T) {
result, errs := testParseExpression("[\n]")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ArrayExpression{
Range: ast.Range{
StartPos: ast.Position{Line: 1, Column: 0, Offset: 0},
@@ -748,7 +748,7 @@ func TestParseDictionaryExpression(t *testing.T) {
result, errs := testParseExpression("{ 1:2 + 3, 4 : 5 }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.DictionaryExpression{
Entries: []ast.DictionaryEntry{
{
@@ -820,7 +820,7 @@ func TestParseDictionaryExpression(t *testing.T) {
result, errs := testParseExpression("{ 1 : 2 , \n 3 \n : \n 4 \n , \n\n 5 \n\n : \n\n 6 \n\n }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.DictionaryExpression{
Entries: []ast.DictionaryEntry{
{
@@ -900,7 +900,7 @@ func TestParseDictionaryExpression(t *testing.T) {
result, errs := testParseExpression("{\n}")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.DictionaryExpression{
Range: ast.Range{
StartPos: ast.Position{Line: 1, Column: 0, Offset: 0},
@@ -921,7 +921,7 @@ func TestParseIndexExpression(t *testing.T) {
result, errs := testParseExpression("a[0]")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IndexExpression{
TargetExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -953,7 +953,7 @@ func TestParseIndexExpression(t *testing.T) {
result, errs := testParseExpression("a [ 0 ]")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IndexExpression{
TargetExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -985,7 +985,7 @@ func TestParseIndexExpression(t *testing.T) {
result, errs := testParseExpression("a [foo]")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IndexExpression{
TargetExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1020,7 +1020,7 @@ func TestParseIdentifier(t *testing.T) {
result, errs := testParseExpression("a + 3")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationPlus,
Left: &ast.IdentifierExpression{
@@ -1051,7 +1051,7 @@ func TestParsePath(t *testing.T) {
result, errs := testParseExpression("/foo/bar")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.PathExpression{
Domain: ast.Identifier{
Identifier: "foo",
@@ -1078,7 +1078,7 @@ func TestParseString(t *testing.T) {
result, errs := testParseExpression("\"\"")
assert.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "",
Range: ast.Range{
@@ -1095,7 +1095,7 @@ func TestParseString(t *testing.T) {
t.Parallel()
result, errs := testParseExpression("\"")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid end of string literal: missing '\"'",
@@ -1105,7 +1105,7 @@ func TestParseString(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "",
Range: ast.Range{
@@ -1122,7 +1122,7 @@ func TestParseString(t *testing.T) {
t.Parallel()
result, errs := testParseExpression("\"\n")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid end of string literal: missing '\"'",
@@ -1132,7 +1132,7 @@ func TestParseString(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "",
Range: ast.Range{
@@ -1148,7 +1148,7 @@ func TestParseString(t *testing.T) {
t.Parallel()
result, errs := testParseExpression("\"t")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid end of string literal: missing '\"'",
@@ -1158,7 +1158,7 @@ func TestParseString(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "t",
Range: ast.Range{
@@ -1175,7 +1175,7 @@ func TestParseString(t *testing.T) {
t.Parallel()
result, errs := testParseExpression("\"t\n")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid end of string literal: missing '\"'",
@@ -1185,7 +1185,7 @@ func TestParseString(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "t",
Range: ast.Range{
@@ -1202,7 +1202,7 @@ func TestParseString(t *testing.T) {
t.Parallel()
result, errs := testParseExpression("\"\\")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "incomplete escape sequence: missing character after escape character",
@@ -1216,7 +1216,7 @@ func TestParseString(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "",
Range: ast.Range{
@@ -1235,7 +1235,7 @@ func TestParseString(t *testing.T) {
result, errs := testParseExpression(`"te\tst\"te\u{1F3CE}\u{FE0F}xt"`)
assert.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "te\tst\"te\U0001F3CE\uFE0Fxt",
Range: ast.Range{
@@ -1252,7 +1252,7 @@ func TestParseString(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`"te\Xst"`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid escape character: 'X'",
@@ -1262,7 +1262,7 @@ func TestParseString(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "test",
Range: ast.Range{
@@ -1279,7 +1279,7 @@ func TestParseString(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`"te\u`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "incomplete Unicode escape sequence: missing character '{' after escape character",
@@ -1293,7 +1293,7 @@ func TestParseString(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "te",
Range: ast.Range{
@@ -1310,7 +1310,7 @@ func TestParseString(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`"te\us`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid Unicode escape sequence: expected '{', got 's'",
@@ -1324,7 +1324,7 @@ func TestParseString(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "te",
Range: ast.Range{
@@ -1341,7 +1341,7 @@ func TestParseString(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`"te\u{`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "incomplete Unicode escape sequence: missing character '}' after escape character",
@@ -1355,7 +1355,7 @@ func TestParseString(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "te",
Range: ast.Range{
@@ -1374,7 +1374,7 @@ func TestParseString(t *testing.T) {
result, errs := testParseExpression(`"te\u{}"`)
assert.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "te",
Range: ast.Range{
@@ -1401,7 +1401,7 @@ func TestParseString(t *testing.T) {
)
assert.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "test JJJJ KKKK LLLL MMMM NNNN OOOO",
Range: ast.Range{
@@ -1418,7 +1418,7 @@ func TestParseString(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`"te\u{X}st"`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid Unicode escape sequence: expected hex digit, got 'X'",
@@ -1428,7 +1428,7 @@ func TestParseString(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.StringExpression{
Value: "test",
Range: ast.Range{
@@ -1452,7 +1452,7 @@ func TestParseInvocation(t *testing.T) {
result, errs := testParseExpression("f()")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1475,7 +1475,7 @@ func TestParseInvocation(t *testing.T) {
result, errs := testParseExpression("f ()")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1498,7 +1498,7 @@ func TestParseInvocation(t *testing.T) {
result, errs := testParseExpression("f ( )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1521,7 +1521,7 @@ func TestParseInvocation(t *testing.T) {
result, errs := testParseExpression("f(1)")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1558,7 +1558,7 @@ func TestParseInvocation(t *testing.T) {
result, errs := testParseExpression("f(label:1)")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1597,7 +1597,7 @@ func TestParseInvocation(t *testing.T) {
result, errs := testParseExpression("f(1,2)")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1647,7 +1647,7 @@ func TestParseInvocation(t *testing.T) {
result, errs := testParseExpression("f(a:1,b:2)")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1699,7 +1699,7 @@ func TestParseInvocation(t *testing.T) {
t.Parallel()
_, errs := testParseExpression("f(,,)")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected argument or end of argument list, got ','",
@@ -1715,7 +1715,7 @@ func TestParseInvocation(t *testing.T) {
t.Parallel()
_, errs := testParseExpression("f(1,,)")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected argument or end of argument list, got ','",
@@ -1731,7 +1731,7 @@ func TestParseInvocation(t *testing.T) {
t.Parallel()
_, errs := testParseExpression("f(1 2)")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected argument in argument list (expecting delimiter or end of argument list)," +
@@ -1750,7 +1750,7 @@ func TestParseInvocation(t *testing.T) {
result, errs := testParseExpression("f(1,g(2))")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1816,7 +1816,7 @@ func TestParseInvocation(t *testing.T) {
result, errs := testParseExpression("f(1,g(\"test\"))")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1885,7 +1885,7 @@ func TestParseMemberExpression(t *testing.T) {
result, errs := testParseExpression("f.n")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.MemberExpression{
Expression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1910,7 +1910,7 @@ func TestParseMemberExpression(t *testing.T) {
result, errs := testParseExpression("f .n")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.MemberExpression{
Expression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1933,7 +1933,7 @@ func TestParseMemberExpression(t *testing.T) {
t.Parallel()
result, errs := testParseExpression("f.")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected member name, got EOF",
@@ -1943,7 +1943,7 @@ func TestParseMemberExpression(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.MemberExpression{
Expression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -1964,7 +1964,7 @@ func TestParseMemberExpression(t *testing.T) {
result, errs := testParseExpression("f.n * 3")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationMul,
Left: &ast.MemberExpression{
@@ -2001,7 +2001,7 @@ func TestParseMemberExpression(t *testing.T) {
result, errs := testParseExpression("3 * f.n")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationMul,
Left: &ast.IntegerExpression{
@@ -2038,7 +2038,7 @@ func TestParseMemberExpression(t *testing.T) {
result, errs := testParseExpression("f?.n")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.MemberExpression{
Optional: true,
Expression: &ast.IdentifierExpression{
@@ -2067,7 +2067,7 @@ func TestParseMemberExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2112,7 +2112,7 @@ func TestParseBlockComment(t *testing.T) {
result, errs := testParseExpression(" /* test foo/* bar */ asd*/ true")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BoolExpression{
Value: true,
Range: ast.Range{
@@ -2131,7 +2131,7 @@ func TestParseBlockComment(t *testing.T) {
result, errs := testParseExpression(" /*test foo*/ /* bar */ true")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BoolExpression{
Value: true,
Range: ast.Range{
@@ -2150,7 +2150,7 @@ func TestParseBlockComment(t *testing.T) {
result, errs := testParseExpression(" 1/*test foo*/+/* bar */ 2 ")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationPlus,
Left: &ast.IntegerExpression{
@@ -2181,7 +2181,7 @@ func TestParseBlockComment(t *testing.T) {
t.Parallel()
_, errs := testParseExpression(" /* test foo/* bar */ asd*/ true */ bar")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
// `true */ bar` is parsed as infix operation of path
&SyntaxError{
@@ -2202,7 +2202,7 @@ func TestParseBlockComment(t *testing.T) {
t.Parallel()
_, errs := testParseExpression(" /* test foo/* bar */ asd true ")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
// `true */ bar` is parsed as infix operation of path
&SyntaxError{
@@ -2277,7 +2277,7 @@ func TestParseBlockComment(t *testing.T) {
},
Config{},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token identifier in block comment",
@@ -2300,7 +2300,7 @@ func TestParseMulInfixExpression(t *testing.T) {
result, errs := testParseExpression(" 1 ** 2")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationMul,
Left: &ast.IntegerExpression{
@@ -2373,7 +2373,7 @@ func TestParseReference(t *testing.T) {
result, errs := testParseExpression("& t")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ReferenceExpression{
Expression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -2396,7 +2396,7 @@ func TestParseReference(t *testing.T) {
result, errs := testParseExpression(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ReferenceExpression{
Expression: &ast.IndexExpression{
TargetExpression: &ast.IdentifierExpression{
@@ -2429,7 +2429,7 @@ func TestParseReference(t *testing.T) {
const code = `&x[y]? as &Z?`
_, errs := testParseExpression(code)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected end of program",
@@ -2454,7 +2454,7 @@ func TestParseNilCoelesceReference(t *testing.T) {
`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationNilCoalesce,
Left: &ast.CastingExpression{
@@ -2570,7 +2570,7 @@ func TestParseCasts(t *testing.T) {
result, errs := testParseExpression(" t as T")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.CastingExpression{
Operation: ast.OperationCast,
Expression: &ast.IdentifierExpression{
@@ -2600,7 +2600,7 @@ func TestParseCasts(t *testing.T) {
result, errs := testParseExpression(" t as? T")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.CastingExpression{
Operation: ast.OperationFailableCast,
Expression: &ast.IdentifierExpression{
@@ -2631,7 +2631,7 @@ func TestParseCasts(t *testing.T) {
result, errs := testParseExpression(" t as! T")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.CastingExpression{
Operation: ast.OperationForceCast,
Expression: &ast.IdentifierExpression{
@@ -2666,7 +2666,7 @@ func TestParseForceExpression(t *testing.T) {
result, errs := testParseExpression("t!")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ForceExpression{
Expression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -2687,7 +2687,7 @@ func TestParseForceExpression(t *testing.T) {
result, errs := testParseExpression(" t ! ")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ForceExpression{
Expression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -2708,7 +2708,7 @@ func TestParseForceExpression(t *testing.T) {
result, errs := testParseExpression("<-t!")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.UnaryExpression{
Operation: ast.OperationMove,
Expression: &ast.ForceExpression{
@@ -2733,7 +2733,7 @@ func TestParseForceExpression(t *testing.T) {
result, errs := testParseExpression("10 * t!")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationMul,
Left: &ast.IntegerExpression{
@@ -2765,7 +2765,7 @@ func TestParseForceExpression(t *testing.T) {
result, errs := testParseStatements("x\n!y")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ExpressionStatement{
Expression: &ast.IdentifierExpression{
@@ -2799,7 +2799,7 @@ func TestParseForceExpression(t *testing.T) {
result, errs := testParseStatements("x\n.y!")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ExpressionStatement{
Expression: &ast.ForceExpression{
@@ -2829,7 +2829,7 @@ func TestParseForceExpression(t *testing.T) {
t.Parallel()
result, errs := testParseStatements("x. y")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid whitespace after '.'",
@@ -2839,7 +2839,7 @@ func TestParseForceExpression(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ExpressionStatement{
Expression: &ast.MemberExpression{
@@ -2873,7 +2873,7 @@ func TestParseCreate(t *testing.T) {
result, errs := testParseExpression("create T()")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.CreateExpression{
InvocationExpression: &ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
@@ -2899,7 +2899,7 @@ func TestParseNil(t *testing.T) {
result, errs := testParseExpression(" nil")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.NilExpression{
Pos: ast.Position{Line: 1, Column: 1, Offset: 1},
},
@@ -2918,7 +2918,7 @@ func TestParseDestroy(t *testing.T) {
result, errs := testParseExpression("destroy t")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.DestroyExpression{
Expression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -2944,7 +2944,7 @@ func TestParseAttach(t *testing.T) {
result, errs := testParseExpression("attach E() to r")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.AttachExpression{
Base: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -2973,7 +2973,7 @@ func TestParseAttach(t *testing.T) {
t.Parallel()
_, errs := testParseExpression("attach E() to r with (X)")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -2991,7 +2991,7 @@ func TestParseAttach(t *testing.T) {
result, errs := testParseExpression("attach A() to attach B() to r")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.AttachExpression{
Base: &ast.AttachExpression{
Base: &ast.IdentifierExpression{
@@ -3033,7 +3033,7 @@ func TestParseAttach(t *testing.T) {
t.Parallel()
_, errs := testParseExpression("attach A()")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected 'to', got EOF",
@@ -3049,7 +3049,7 @@ func TestParseAttach(t *testing.T) {
t.Parallel()
_, errs := testParseExpression("attach E() to")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected end of program",
@@ -3068,7 +3068,7 @@ func TestParseLineComment(t *testing.T) {
result, errs := testParseExpression(" //// // this is a comment\n 1 / 2")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationDiv,
Left: &ast.IntegerExpression{
@@ -3105,7 +3105,7 @@ func TestParseFunctionExpression(t *testing.T) {
result, errs := testParseExpression("fun () { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FunctionExpression{
ParameterList: &ast.ParameterList{
Parameters: nil,
@@ -3135,7 +3135,7 @@ func TestParseFunctionExpression(t *testing.T) {
result, errs := testParseExpression("fun (): X { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FunctionExpression{
ParameterList: &ast.ParameterList{
Parameters: nil,
@@ -3174,7 +3174,7 @@ func TestParseFunctionExpression(t *testing.T) {
result, errs := testParseExpression("view fun (): X { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FunctionExpression{
Purity: 1,
ParameterList: &ast.ParameterList{
@@ -3212,7 +3212,7 @@ func TestParseFunctionExpression(t *testing.T) {
t.Parallel()
_, errs := testParseExpression("view for (): X { }")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: identifier",
@@ -3255,7 +3255,7 @@ func TestParseAdjacentViewKeyword(t *testing.T) {
},
StartPos: ast.Position{Line: 2, Column: 2, Offset: 3},
}
- utils.AssertEqualWithDiff(t, expected, result)
+ AssertEqualWithDiff(t, expected, result)
}
@@ -3268,7 +3268,7 @@ func TestParseIntegerLiterals(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`0b`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "missing digits",
@@ -3287,7 +3287,7 @@ func TestParseIntegerLiterals(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0b"),
Value: new(big.Int),
@@ -3308,7 +3308,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`0b101010`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0b101010"),
Value: big.NewInt(42),
@@ -3327,7 +3327,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`0b001000`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0b001000"),
Value: big.NewInt(8),
@@ -3348,7 +3348,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`0b101010_101010`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0b101010_101010"),
Value: big.NewInt(2730),
@@ -3367,7 +3367,7 @@ func TestParseIntegerLiterals(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`0b_101010_101010`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&InvalidIntegerLiteralError{
Literal: "0b_101010_101010",
@@ -3382,7 +3382,7 @@ func TestParseIntegerLiterals(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0b_101010_101010"),
Value: big.NewInt(2730),
@@ -3401,7 +3401,7 @@ func TestParseIntegerLiterals(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`0b101010_101010_`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&InvalidIntegerLiteralError{
Literal: "0b101010_101010_",
@@ -3416,7 +3416,7 @@ func TestParseIntegerLiterals(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0b101010_101010_"),
Value: big.NewInt(2730),
@@ -3435,7 +3435,7 @@ func TestParseIntegerLiterals(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`0o`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "missing digits",
@@ -3454,7 +3454,7 @@ func TestParseIntegerLiterals(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0o"),
Value: new(big.Int),
@@ -3475,7 +3475,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`0o32`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0o32"),
Value: big.NewInt(26),
@@ -3496,7 +3496,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`0o32_45`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0o32_45"),
Value: big.NewInt(1701),
@@ -3515,7 +3515,7 @@ func TestParseIntegerLiterals(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`0o_32_45`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&InvalidIntegerLiteralError{
Literal: "0o_32_45",
@@ -3530,7 +3530,7 @@ func TestParseIntegerLiterals(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0o_32_45"),
Value: big.NewInt(1701),
@@ -3549,7 +3549,7 @@ func TestParseIntegerLiterals(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`0o32_45_`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&InvalidIntegerLiteralError{
Literal: "0o32_45_",
@@ -3564,7 +3564,7 @@ func TestParseIntegerLiterals(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0o32_45_"),
Value: big.NewInt(1701),
@@ -3585,7 +3585,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`1234567890`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("1234567890"),
Value: big.NewInt(1234567890),
@@ -3606,7 +3606,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`1_234_567_890`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("1_234_567_890"),
Value: big.NewInt(1234567890),
@@ -3625,7 +3625,7 @@ func TestParseIntegerLiterals(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`1_234_567_890_`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&InvalidIntegerLiteralError{
Literal: "1_234_567_890_",
@@ -3640,7 +3640,7 @@ func TestParseIntegerLiterals(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("1_234_567_890_"),
Value: big.NewInt(1234567890),
@@ -3659,7 +3659,7 @@ func TestParseIntegerLiterals(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`0x`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "missing digits",
@@ -3678,7 +3678,7 @@ func TestParseIntegerLiterals(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0x"),
Value: new(big.Int),
@@ -3699,7 +3699,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`0xf2`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0xf2"),
Value: big.NewInt(242),
@@ -3720,7 +3720,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`0xf2_09`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0xf2_09"),
Value: big.NewInt(61961),
@@ -3739,7 +3739,7 @@ func TestParseIntegerLiterals(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`0x_f2_09`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&InvalidIntegerLiteralError{
Literal: "0x_f2_09",
@@ -3754,7 +3754,7 @@ func TestParseIntegerLiterals(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0x_f2_09"),
Value: big.NewInt(61961),
@@ -3773,7 +3773,7 @@ func TestParseIntegerLiterals(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`0xf2_09_`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&InvalidIntegerLiteralError{
Literal: `0xf2_09_`,
@@ -3788,7 +3788,7 @@ func TestParseIntegerLiterals(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0xf2_09_"),
Value: big.NewInt(61961),
@@ -3809,7 +3809,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`0`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0"),
Value: big.NewInt(0),
@@ -3830,7 +3830,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`01`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("01"),
Value: big.NewInt(1),
@@ -3851,7 +3851,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`09`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("09"),
Value: big.NewInt(9),
@@ -3872,7 +3872,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression("00123")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("00123"),
Value: big.NewInt(123),
@@ -3891,7 +3891,7 @@ func TestParseIntegerLiterals(t *testing.T) {
t.Parallel()
result, errs := testParseExpression(`0z123`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid number literal prefix: 'z'",
@@ -3910,7 +3910,7 @@ func TestParseIntegerLiterals(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0z123"),
Value: new(big.Int),
@@ -3931,7 +3931,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`0_100`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("0_100"),
Value: big.NewInt(100),
@@ -3952,7 +3952,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`1_100`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntegerExpression{
PositiveLiteral: []byte("1_100"),
Value: big.NewInt(1100),
@@ -3975,7 +3975,7 @@ func TestParseIntegerLiterals(t *testing.T) {
result, errs := testParseExpression(`_100`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IdentifierExpression{
Identifier: ast.Identifier{
Identifier: "_100",
@@ -3998,7 +3998,7 @@ func TestParseFixedPoint(t *testing.T) {
result, errs := testParseExpression("1234_5678_90.0009_8765_4321")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FixedPointExpression{
PositiveLiteral: []byte("1234_5678_90.0009_8765_4321"),
Negative: false,
@@ -4021,7 +4021,7 @@ func TestParseFixedPoint(t *testing.T) {
result, errs := testParseExpression("0.1")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FixedPointExpression{
PositiveLiteral: []byte("0.1"),
Negative: false,
@@ -4042,7 +4042,7 @@ func TestParseFixedPoint(t *testing.T) {
t.Parallel()
result, errs := testParseExpression("0.")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "missing fractional digits",
@@ -4052,7 +4052,7 @@ func TestParseFixedPoint(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FixedPointExpression{
PositiveLiteral: []byte("0."),
Negative: false,
@@ -4080,7 +4080,7 @@ func TestParseLessThanOrTypeArguments(t *testing.T) {
result, errs := testParseExpression("1 < 2")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationLess,
Left: &ast.IntegerExpression{
@@ -4113,7 +4113,7 @@ func TestParseLessThanOrTypeArguments(t *testing.T) {
result, errs := testParseExpression("a < > ()")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -4137,7 +4137,7 @@ func TestParseLessThanOrTypeArguments(t *testing.T) {
result, errs := testParseExpression("a < { K : V } > ( 1 )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -4197,7 +4197,7 @@ func TestParseLessThanOrTypeArguments(t *testing.T) {
result, errs := testParseExpression("a < { K : V } , @R , [ S ] > ( 1 , 2 )")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -4295,7 +4295,7 @@ func TestParseLessThanOrTypeArguments(t *testing.T) {
result, errs := testParseExpression("1 + a<>()")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationPlus,
Left: &ast.IntegerExpression{
@@ -4331,7 +4331,7 @@ func TestParseLessThanOrTypeArguments(t *testing.T) {
result, errs := testParseExpression("a>()")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -4381,7 +4381,7 @@ func TestParseLessThanOrTypeArguments(t *testing.T) {
result, errs := testParseExpression("a >()")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InvocationExpression{
InvokedExpression: &ast.IdentifierExpression{
Identifier: ast.Identifier{
@@ -4431,7 +4431,7 @@ func TestParseLessThanOrTypeArguments(t *testing.T) {
result, errs := testParseExpression("0 + 1 < 2")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationLess,
Left: &ast.BinaryExpression{
@@ -4476,7 +4476,7 @@ func TestParseLessThanOrTypeArguments(t *testing.T) {
result, errs := testParseExpression("0 + 1 << 2")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationBitwiseLeftShift,
Left: &ast.BinaryExpression{
@@ -4521,7 +4521,7 @@ func TestParseLessThanOrTypeArguments(t *testing.T) {
result, errs := testParseExpression("0 + 1 > 2")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationGreater,
Left: &ast.BinaryExpression{
@@ -4566,7 +4566,7 @@ func TestParseLessThanOrTypeArguments(t *testing.T) {
result, errs := testParseExpression("0 + 1 >> 2")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.BinaryExpression{
Operation: ast.OperationBitwiseRightShift,
Left: &ast.BinaryExpression{
@@ -4609,7 +4609,7 @@ func TestParseLessThanOrTypeArguments(t *testing.T) {
t.Parallel()
_, errs := testParseExpression("foo")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&RestrictedTypeError{
Range: ast.Range{
@@ -4633,7 +4633,7 @@ func TestParseBoolExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -4670,7 +4670,7 @@ func TestParseIdentifierExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -4706,7 +4706,7 @@ func TestParseArrayExpressionInVariableDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -4761,7 +4761,7 @@ func TestParseDictionaryExpressionInVariableDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -4834,7 +4834,7 @@ func TestParseInvocationExpressionWithoutLabels(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -4902,7 +4902,7 @@ func TestParseInvocationExpressionWithLabels(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -4989,7 +4989,7 @@ func TestParseOptionalMemberExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5033,7 +5033,7 @@ func TestParseIndexExpressionInVariableDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5087,7 +5087,7 @@ func TestParseUnaryExpression(t *testing.T) {
result, errs := testParseExpression(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.UnaryExpression{
Operation: ast.OperationMinus,
Expression: &ast.IdentifierExpression{
@@ -5111,7 +5111,7 @@ func TestParseUnaryExpression(t *testing.T) {
result, errs := testParseExpression(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.UnaryExpression{
Operation: ast.OperationNegate,
Expression: &ast.IdentifierExpression{
@@ -5135,7 +5135,7 @@ func TestParseUnaryExpression(t *testing.T) {
result, errs := testParseExpression(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.UnaryExpression{
Operation: ast.OperationMul,
Expression: &ast.IdentifierExpression{
@@ -5157,7 +5157,7 @@ func TestParseUnaryExpression(t *testing.T) {
const code = ` % boo`
_, errs := testParseExpression(code)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token in expression: '%'",
@@ -5179,7 +5179,7 @@ func TestParseOrExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5226,7 +5226,7 @@ func TestParseAndExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5273,7 +5273,7 @@ func TestParseEqualityExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5320,7 +5320,7 @@ func TestParseRelationalExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5371,7 +5371,7 @@ func TestParseAdditiveExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5422,7 +5422,7 @@ func TestParseMultiplicativeExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5473,7 +5473,7 @@ func TestParseFunctionExpressionAndReturn(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5547,7 +5547,7 @@ func TestParseLeftAssociativity(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5610,7 +5610,7 @@ func TestParseNegativeInteger(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5649,7 +5649,7 @@ func TestParseNegativeFixedPoint(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5692,7 +5692,7 @@ func TestParseTernaryRightAssociativity(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5795,7 +5795,7 @@ func TestParseVoidLiteral(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5841,7 +5841,7 @@ func TestParseMissingReturnType(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -5983,7 +5983,7 @@ func TestParseExpression(t *testing.T) {
},
}
- utils.AssertEqualWithDiff(t, expected, actual)
+ AssertEqualWithDiff(t, expected, actual)
}
func TestParseStringEscapes(t *testing.T) {
@@ -6011,7 +6011,7 @@ func TestParseStringEscapes(t *testing.T) {
},
}
- utils.AssertEqualWithDiff(t, expected, actual)
+ AssertEqualWithDiff(t, expected, actual)
}
func TestParseStringWithUnicode(t *testing.T) {
@@ -6039,7 +6039,7 @@ func TestParseStringWithUnicode(t *testing.T) {
},
}
- utils.AssertEqualWithDiff(t, expected, actual)
+ AssertEqualWithDiff(t, expected, actual)
}
func TestParseStringTemplate(t *testing.T) {
@@ -6082,7 +6082,7 @@ func TestParseStringTemplate(t *testing.T) {
},
}
- utils.AssertEqualWithDiff(t, expected, actual)
+ AssertEqualWithDiff(t, expected, actual)
})
t.Run("multi", func(t *testing.T) {
@@ -6128,7 +6128,7 @@ func TestParseStringTemplate(t *testing.T) {
},
}
- utils.AssertEqualWithDiff(t, expected, actual)
+ AssertEqualWithDiff(t, expected, actual)
})
t.Run("missing end", func(t *testing.T) {
@@ -6147,7 +6147,7 @@ func TestParseStringTemplate(t *testing.T) {
}
require.Error(t, err)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid end of string literal: missing '\"'",
@@ -6174,7 +6174,7 @@ func TestParseStringTemplate(t *testing.T) {
}
require.Error(t, err)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token in expression: '.'",
@@ -6201,7 +6201,7 @@ func TestParseStringTemplate(t *testing.T) {
}
require.Error(t, err)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected identifier got: 2 + 2",
@@ -6248,7 +6248,7 @@ func TestParseStringTemplate(t *testing.T) {
},
}
- utils.AssertEqualWithDiff(t, expected, actual)
+ AssertEqualWithDiff(t, expected, actual)
})
t.Run("invalid, empty", func(t *testing.T) {
@@ -6267,7 +6267,7 @@ func TestParseStringTemplate(t *testing.T) {
}
require.Error(t, err)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token in expression: ')'",
@@ -6294,7 +6294,7 @@ func TestParseStringTemplate(t *testing.T) {
}
require.Error(t, err)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected identifier got: add()",
@@ -6321,7 +6321,7 @@ func TestParseStringTemplate(t *testing.T) {
}
require.Error(t, err)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected token ')'",
@@ -6348,7 +6348,7 @@ func TestParseStringTemplate(t *testing.T) {
}
require.Error(t, err)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected token ')'",
@@ -6395,7 +6395,7 @@ func TestParseStringTemplate(t *testing.T) {
},
}
- utils.AssertEqualWithDiff(t, expected, actual)
+ AssertEqualWithDiff(t, expected, actual)
})
t.Run("valid, surrounded", func(t *testing.T) {
@@ -6441,7 +6441,7 @@ func TestParseStringTemplate(t *testing.T) {
},
}
- utils.AssertEqualWithDiff(t, expected, actual)
+ AssertEqualWithDiff(t, expected, actual)
})
t.Run("valid, adjacent", func(t *testing.T) {
@@ -6494,7 +6494,7 @@ func TestParseStringTemplate(t *testing.T) {
},
}
- utils.AssertEqualWithDiff(t, expected, actual)
+ AssertEqualWithDiff(t, expected, actual)
})
}
@@ -6508,7 +6508,7 @@ func TestParseNilCoalescing(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -6554,7 +6554,7 @@ func TestParseNilCoalescingRightAssociativity(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -6657,7 +6657,7 @@ func TestParseFailableCasting(t *testing.T) {
failableDowncast.ParentVariableDeclaration = variableDeclaration
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
variableDeclaration,
},
@@ -6675,7 +6675,7 @@ func TestParseMoveOperator(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -6733,7 +6733,7 @@ func TestParseFunctionExpressionWithResourceTypeAnnotation(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
@@ -6842,7 +6842,7 @@ func TestParseFailableCastingResourceTypeAnnotation(t *testing.T) {
failableDowncast.ParentVariableDeclaration = variableDeclaration
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
variableDeclaration,
},
@@ -6896,7 +6896,7 @@ func TestParseCasting(t *testing.T) {
cast.ParentVariableDeclaration = variableDeclaration
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
variableDeclaration,
},
@@ -6940,7 +6940,7 @@ func TestParseHardKeywords(t *testing.T) {
t.Parallel()
testParseIdentifiersWith(t, HardKeywords, func(t *testing.T, keyword string, err error) {
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Pos: ast.Position{Line: 1, Column: 4, Offset: 4},
@@ -7029,7 +7029,7 @@ func TestParseReferenceInVariableDeclaration(t *testing.T) {
expected.Value.(*ast.CastingExpression).ParentVariableDeclaration = expected
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
expected,
},
@@ -7047,7 +7047,7 @@ func TestParseFixedPointExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -7087,7 +7087,7 @@ func TestParseFixedPointExpressionZeroInteger(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -7127,7 +7127,7 @@ func TestParsePathLiteral(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -7167,7 +7167,7 @@ func TestParseBitwiseExpression(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
diff --git a/parser/lexer/lexer_test.go b/parser/lexer/lexer_test.go
index 831d31f5e7..3a30d729e4 100644
--- a/parser/lexer/lexer_test.go
+++ b/parser/lexer/lexer_test.go
@@ -28,7 +28,7 @@ import (
"go.uber.org/goleak"
"github.com/onflow/cadence/ast"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func TestMain(m *testing.M) {
@@ -67,7 +67,7 @@ func testLex(t *testing.T, input string, expected []token) {
require.NoError(t, err)
withTokens(tokenStream, func(actualTokens []Token) {
- utils.AssertEqualWithDiff(t, expectedTokens, actualTokens)
+ AssertEqualWithDiff(t, expectedTokens, actualTokens)
require.Len(t, actualTokens, len(expectedTokens))
for i, expectedToken := range expected {
diff --git a/parser/parser_test.go b/parser/parser_test.go
index 93bc5f4918..3629ac6b43 100644
--- a/parser/parser_test.go
+++ b/parser/parser_test.go
@@ -33,7 +33,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/errors"
"github.com/onflow/cadence/parser/lexer"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func TestMain(m *testing.M) {
@@ -240,7 +240,7 @@ func TestParseBuffering(t *testing.T) {
Config{},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected token identifier with string value c",
@@ -483,7 +483,7 @@ func TestParseBuffering(t *testing.T) {
Config{},
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected token identifier with string value d",
@@ -511,7 +511,7 @@ func TestParseBuffering(t *testing.T) {
}
`
_, err := testParseProgram(code)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected token identifier",
@@ -536,7 +536,7 @@ func TestParseBuffering(t *testing.T) {
`
_, err := testParseProgram(code)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&RestrictedTypeError{
Range: ast.Range{
@@ -705,7 +705,7 @@ func TestParseArgumentList(t *testing.T) {
t.Parallel()
_, errs := testParseArgumentList(`xyz`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected token '('",
@@ -724,7 +724,7 @@ func TestParseArgumentList(t *testing.T) {
var expected ast.Arguments
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
expected,
result,
)
@@ -750,7 +750,7 @@ func TestParseArgumentList(t *testing.T) {
result, errs := testParseArgumentList(`(1, b: true)`)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
ast.Arguments{
{
Label: "",
@@ -835,7 +835,7 @@ func TestParseBufferedErrors(t *testing.T) {
// there is another error (missing closing parenthesis after).
_, errs := testParseExpression("a(")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "missing type annotation after comma",
@@ -874,7 +874,7 @@ func TestParseExpressionDepthLimit(t *testing.T) {
_, err := testParseProgram(code)
require.Error(t, err)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
ExpressionDepthLimitReachedError{
Pos: ast.Position{
@@ -910,7 +910,7 @@ func TestParseTypeDepthLimit(t *testing.T) {
_, err := testParseProgram(code)
require.Error(t, err)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
TypeDepthLimitReachedError{
Pos: ast.Position{
@@ -936,7 +936,7 @@ func TestParseLocalReplayLimit(t *testing.T) {
code := []byte(builder.String())
_, err := ParseProgram(nil, code, Config{})
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
Error{
Code: code,
Errors: []error{
@@ -971,7 +971,7 @@ func TestParseGlobalReplayLimit(t *testing.T) {
code := []byte(builder.String())
_, err := ParseProgram(nil, code, Config{})
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
Error{
Code: code,
Errors: []error{
diff --git a/parser/statement_test.go b/parser/statement_test.go
index 8e3b6762cb..397fd3c19d 100644
--- a/parser/statement_test.go
+++ b/parser/statement_test.go
@@ -27,7 +27,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/ast"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func TestParseReplInput(t *testing.T) {
@@ -65,7 +65,7 @@ func TestParseReturnStatement(t *testing.T) {
result, errs := testParseStatements("return")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ReturnStatement{
Range: ast.Range{
@@ -85,7 +85,7 @@ func TestParseReturnStatement(t *testing.T) {
result, errs := testParseStatements("return 1")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ReturnStatement{
Expression: &ast.IntegerExpression{
@@ -114,7 +114,7 @@ func TestParseReturnStatement(t *testing.T) {
result, errs := testParseStatements("return \n1")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ReturnStatement{
Range: ast.Range{
@@ -145,7 +145,7 @@ func TestParseReturnStatement(t *testing.T) {
result, errs := testParseStatements("return ;\n1")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ReturnStatement{
Range: ast.Range{
@@ -181,7 +181,7 @@ func TestParseIfStatement(t *testing.T) {
result, errs := testParseStatements("if true { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.IfStatement{
Test: &ast.BoolExpression{
@@ -212,7 +212,7 @@ func TestParseIfStatement(t *testing.T) {
result, errs := testParseStatements("if true { 1 ; 2 }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.IfStatement{
Test: &ast.BoolExpression{
@@ -266,7 +266,7 @@ func TestParseIfStatement(t *testing.T) {
result, errs := testParseStatements("if true { 1 \n 2 }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.IfStatement{
Test: &ast.BoolExpression{
@@ -320,7 +320,7 @@ func TestParseIfStatement(t *testing.T) {
result, errs := testParseStatements("if true { 1 } else { 2 }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.IfStatement{
Test: &ast.BoolExpression{
@@ -382,7 +382,7 @@ func TestParseIfStatement(t *testing.T) {
result, errs := testParseStatements("if true{1}else if true {2} else{3}")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.IfStatement{
Test: &ast.BoolExpression{
@@ -516,7 +516,7 @@ func TestParseIfStatement(t *testing.T) {
expected.Test.(*ast.VariableDeclaration).ParentIfStatement = expected
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
expected,
},
@@ -566,7 +566,7 @@ func TestParseIfStatement(t *testing.T) {
expected.Test.(*ast.VariableDeclaration).ParentIfStatement = expected
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
expected,
},
@@ -587,7 +587,7 @@ func TestParseWhileStatement(t *testing.T) {
result, errs := testParseStatements("while true { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.WhileStatement{
Test: &ast.BoolExpression{
@@ -623,7 +623,7 @@ func TestParseAssignmentStatement(t *testing.T) {
result, errs := testParseStatements("x=1")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.AssignmentStatement{
Target: &ast.IdentifierExpression{
@@ -658,7 +658,7 @@ func TestParseAssignmentStatement(t *testing.T) {
result, errs := testParseStatements(" x = 1")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.AssignmentStatement{
Target: &ast.IdentifierExpression{
@@ -693,7 +693,7 @@ func TestParseAssignmentStatement(t *testing.T) {
result, errs := testParseStatements(" x <- 1")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.AssignmentStatement{
Target: &ast.IdentifierExpression{
@@ -728,7 +728,7 @@ func TestParseAssignmentStatement(t *testing.T) {
result, errs := testParseStatements(" x <-! 1")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.AssignmentStatement{
Target: &ast.IdentifierExpression{
@@ -768,7 +768,7 @@ func TestParseSwapStatement(t *testing.T) {
result, errs := testParseStatements(" x <-> y")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.SwapStatement{
Left: &ast.IdentifierExpression{
@@ -801,7 +801,7 @@ func TestParseForStatement(t *testing.T) {
result, errs := testParseStatements("for x in y { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ForStatement{
Identifier: ast.Identifier{
@@ -840,7 +840,7 @@ func TestParseForStatementIndexBinding(t *testing.T) {
result, errs := testParseStatements("for i, x in y { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ForStatement{
Identifier: ast.Identifier{
@@ -876,7 +876,7 @@ func TestParseForStatementIndexBinding(t *testing.T) {
t.Parallel()
_, errs := testParseStatements("for i x in y { }")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected keyword \"in\", got identifier",
@@ -896,7 +896,7 @@ func TestParseForStatementIndexBinding(t *testing.T) {
t.Parallel()
_, errs := testParseStatements("for in y { }")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected identifier, got keyword \"in\"",
@@ -923,7 +923,7 @@ func TestParseEmit(t *testing.T) {
result, errs := testParseStatements("emit T()")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.EmitStatement{
InvocationExpression: &ast.InvocationExpression{
@@ -955,7 +955,7 @@ func TestParseFunctionStatementOrExpression(t *testing.T) {
result, errs := testParseStatements("fun foo() {}")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -991,7 +991,7 @@ func TestParseFunctionStatementOrExpression(t *testing.T) {
result, errs := testParseStatements("view fun () {}")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ExpressionStatement{
Expression: &ast.FunctionExpression{
@@ -1025,7 +1025,7 @@ func TestParseFunctionStatementOrExpression(t *testing.T) {
result, errs := testParseStatements("view fun foo() {}")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.FunctionDeclaration{
Purity: ast.FunctionPurityView,
@@ -1062,7 +1062,7 @@ func TestParseFunctionStatementOrExpression(t *testing.T) {
result, errs := testParseStatements("fun () {}")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ExpressionStatement{
Expression: &ast.FunctionExpression{
@@ -1095,7 +1095,7 @@ func TestParseFunctionStatementOrExpression(t *testing.T) {
require.Empty(t, result)
- utils.AssertEqualWithDiff(t, []error{
+ AssertEqualWithDiff(t, []error{
&SyntaxError{
Message: "expected identifier after start of function declaration, got keyword continue",
Pos: ast.Position{Line: 1, Column: 4, Offset: 4},
@@ -1110,7 +1110,7 @@ func TestParseFunctionStatementOrExpression(t *testing.T) {
require.Empty(t, result)
- utils.AssertEqualWithDiff(t, []error{
+ AssertEqualWithDiff(t, []error{
&SyntaxError{
Message: "expected identifier after start of function declaration, got keyword break",
Pos: ast.Position{Line: 1, Column: 9, Offset: 9},
@@ -1123,7 +1123,7 @@ func TestParseViewNonFunction(t *testing.T) {
t.Parallel()
_, errs := testParseStatements("view return 3")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "statements on the same line must be separated with a semicolon",
@@ -1145,7 +1145,7 @@ func TestParseStatements(t *testing.T) {
result, errs := testParseStatements("a + b < c\nd")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ExpressionStatement{
Expression: &ast.BinaryExpression{
@@ -1191,7 +1191,7 @@ func TestParseStatements(t *testing.T) {
t.Parallel()
result, errs := testParseStatements(`assert true`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "statements on the same line must be separated with a semicolon",
@@ -1201,7 +1201,7 @@ func TestParseStatements(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.ExpressionStatement{
Expression: &ast.IdentifierExpression{
@@ -1237,7 +1237,7 @@ func TestParseRemoveAttachmentStatement(t *testing.T) {
result, errs := testParseStatements("remove A from b")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.RemoveStatement{
Attachment: &ast.NominalType{
@@ -1266,7 +1266,7 @@ func TestParseRemoveAttachmentStatement(t *testing.T) {
result, errs := testParseStatements("remove Foo.E from b")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.RemoveStatement{
Attachment: &ast.NominalType{
@@ -1300,7 +1300,7 @@ func TestParseRemoveAttachmentStatement(t *testing.T) {
_, errs := testParseStatements("remove A")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected from keyword, got EOF",
@@ -1321,7 +1321,7 @@ func TestParseRemoveAttachmentStatement(t *testing.T) {
_, errs := testParseStatements("remove A from")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected end of program",
@@ -1338,7 +1338,7 @@ func TestParseRemoveAttachmentStatement(t *testing.T) {
_, errs := testParseStatements("remove [A] from e")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected attachment nominal type, got [A]",
@@ -1356,7 +1356,7 @@ func TestParseRemoveAttachmentStatement(t *testing.T) {
result, errs := testParseStatements("remove A from foo()")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.RemoveStatement{
Attachment: &ast.NominalType{
@@ -1394,7 +1394,7 @@ func TestParseSwitchStatement(t *testing.T) {
result, errs := testParseStatements("switch true { }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.SwitchStatement{
Expression: &ast.BoolExpression{
@@ -1422,7 +1422,7 @@ func TestParseSwitchStatement(t *testing.T) {
result, errs := testParseStatements("switch x { case 1 :\n a\nb default : c\nd }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
&ast.SwitchStatement{
Expression: &ast.IdentifierExpression{
@@ -1503,7 +1503,7 @@ func TestParseSwitchStatement(t *testing.T) {
t.Run("Invalid identifiers in switch cases", func(t *testing.T) {
code := "switch 1 {AAAAA: break; case 3: break; default: break}"
_, errs := testParseStatements(code)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
`unexpected token: got identifier, expected "case" or "default"`,
errs[0].Error(),
)
@@ -1529,7 +1529,7 @@ func TestParseIfStatementInFunctionDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1731,7 +1731,7 @@ func TestParseIfStatementWithVariableDeclaration(t *testing.T) {
ifStatement.Test = ifTestVariableDeclaration
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1777,7 +1777,7 @@ func TestParseIfStatementNoElse(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1849,7 +1849,7 @@ func TestParseWhileStatementInFunctionDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1929,7 +1929,7 @@ func TestParseForStatementInFunctionDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -1991,7 +1991,7 @@ func TestParseAssignment(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -2055,7 +2055,7 @@ func TestParseAccessAssignment(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -2168,7 +2168,7 @@ func TestParseExpressionStatementWithAccess(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -2270,7 +2270,7 @@ func TestParseMoveStatement(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -2332,7 +2332,7 @@ func TestParseFunctionExpressionStatementAfterVariableDeclarationWithCreateExpre
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -2435,7 +2435,7 @@ func TestParseExpressionStatementAfterReturnStatement(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -2496,7 +2496,7 @@ func TestParseSwapStatementInFunctionDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
Access: ast.AccessNotSpecified,
@@ -2622,7 +2622,7 @@ func TestParseReferenceExpressionStatement(t *testing.T) {
castingExpression.ParentVariableDeclaration = expectedVariableDeclaration
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Statement{
expectedVariableDeclaration,
&ast.ExpressionStatement{
@@ -2685,7 +2685,7 @@ func TestSoftKeywordsInStatement(t *testing.T) {
},
},
}
- utils.AssertEqualWithDiff(t, expected, result)
+ AssertEqualWithDiff(t, expected, result)
})
}
diff --git a/parser/type_test.go b/parser/type_test.go
index 5a741dc03d..e5efe9d92d 100644
--- a/parser/type_test.go
+++ b/parser/type_test.go
@@ -27,7 +27,7 @@ import (
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/common"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func TestParseNominalType(t *testing.T) {
@@ -41,7 +41,7 @@ func TestParseNominalType(t *testing.T) {
result, errs := testParseType("Int")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.NominalType{
Identifier: ast.Identifier{
Identifier: "Int",
@@ -59,7 +59,7 @@ func TestParseNominalType(t *testing.T) {
result, errs := testParseType("Foo.Bar")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.NominalType{
Identifier: ast.Identifier{
Identifier: "Foo",
@@ -88,7 +88,7 @@ func TestParseArrayType(t *testing.T) {
result, errs := testParseType("[Int]")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.VariableSizedType{
Type: &ast.NominalType{
Identifier: ast.Identifier{
@@ -112,7 +112,7 @@ func TestParseArrayType(t *testing.T) {
result, errs := testParseType("[Int ; 2 ]")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ConstantSizedType{
Type: &ast.NominalType{
Identifier: ast.Identifier{
@@ -143,7 +143,7 @@ func TestParseArrayType(t *testing.T) {
t.Parallel()
result, errs := testParseType("[Int ; -2 ]")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: `expected positive integer size for constant sized type`,
@@ -166,7 +166,7 @@ func TestParseArrayType(t *testing.T) {
t.Parallel()
result, errs := testParseType("[Int ; X ]")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: `expected positive integer size for constant sized type`,
@@ -176,7 +176,7 @@ func TestParseArrayType(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.VariableSizedType{
Type: &ast.NominalType{
Identifier: ast.Identifier{
@@ -206,7 +206,7 @@ func TestParseOptionalType(t *testing.T) {
result, errs := testParseType("Int?")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.OptionalType{
Type: &ast.NominalType{
Identifier: ast.Identifier{
@@ -227,7 +227,7 @@ func TestParseOptionalType(t *testing.T) {
result, errs := testParseType("Int??")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.OptionalType{
Type: &ast.OptionalType{
Type: &ast.NominalType{
@@ -251,7 +251,7 @@ func TestParseOptionalType(t *testing.T) {
result, errs := testParseType("Int???")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.OptionalType{
Type: &ast.OptionalType{
Type: &ast.OptionalType{
@@ -283,7 +283,7 @@ func TestParseReferenceType(t *testing.T) {
result, errs := testParseType("&Int")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ReferenceType{
Type: &ast.NominalType{
Identifier: ast.Identifier{
@@ -302,7 +302,7 @@ func TestParseReferenceType(t *testing.T) {
t.Parallel()
_, errs := testParseType("auth &Int")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected authorization (entitlement list)",
@@ -320,7 +320,7 @@ func TestParseReferenceType(t *testing.T) {
result, errs := testParseType("auth(X) &Int")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ReferenceType{
Authorization: &ast.ConjunctiveEntitlementSet{
Elements: []*ast.NominalType{
@@ -351,7 +351,7 @@ func TestParseReferenceType(t *testing.T) {
result, errs := testParseType("auth(X, Y) &Int")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ReferenceType{
Authorization: &ast.ConjunctiveEntitlementSet{
Elements: []*ast.NominalType{
@@ -388,7 +388,7 @@ func TestParseReferenceType(t *testing.T) {
result, errs := testParseType("auth(X| Y) &Int")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ReferenceType{
Authorization: &ast.DisjunctiveEntitlementSet{
Elements: []*ast.NominalType{
@@ -424,7 +424,7 @@ func TestParseReferenceType(t *testing.T) {
_, errs := testParseType("auth() &Int")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token in type: ')'",
@@ -440,7 +440,7 @@ func TestParseReferenceType(t *testing.T) {
t.Parallel()
_, errs := testParseType("auth(X, Y | Z) &Int")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: got '|', expected ',' or ')'",
@@ -456,7 +456,7 @@ func TestParseReferenceType(t *testing.T) {
t.Parallel()
_, errs := testParseType("auth(X | Y, Z) &Int")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token: got ',', expected '|' or ')'",
@@ -474,7 +474,7 @@ func TestParseReferenceType(t *testing.T) {
result, errs := testParseType("auth ( mapping X ) & Int")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.ReferenceType{
Authorization: &ast.MappedAccess{
EntitlementMap: &ast.NominalType{
@@ -502,7 +502,7 @@ func TestParseReferenceType(t *testing.T) {
t.Parallel()
_, errs := testParseType("auth( mapping ) &Int")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected token in type: ')'",
@@ -525,7 +525,7 @@ func TestParseOptionalReferenceType(t *testing.T) {
result, errs := testParseType("&Int?")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.OptionalType{
Type: &ast.ReferenceType{
Type: &ast.NominalType{
@@ -553,7 +553,7 @@ func TestParseIntersectionType(t *testing.T) {
_, errs := testParseType("T{}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&RestrictedTypeError{
Range: ast.Range{
@@ -571,7 +571,7 @@ func TestParseIntersectionType(t *testing.T) {
t.Parallel()
_, errs := testParseType("T{U}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&RestrictedTypeError{
Range: ast.Range{
@@ -589,7 +589,7 @@ func TestParseIntersectionType(t *testing.T) {
t.Parallel()
_, errs := testParseType("T{U , V }")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&RestrictedTypeError{
Range: ast.Range{
@@ -609,7 +609,7 @@ func TestParseIntersectionType(t *testing.T) {
result, errs := testParseType("{}")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntersectionType{
Range: ast.Range{
StartPos: ast.Position{Line: 1, Column: 0, Offset: 0},
@@ -627,7 +627,7 @@ func TestParseIntersectionType(t *testing.T) {
result, errs := testParseType("{ T }")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntersectionType{
Types: []*ast.NominalType{
{
@@ -651,7 +651,7 @@ func TestParseIntersectionType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{ T , }")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "missing type after comma",
@@ -661,7 +661,7 @@ func TestParseIntersectionType(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.IntersectionType{
Types: []*ast.NominalType{
{
@@ -685,7 +685,7 @@ func TestParseIntersectionType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{ T U }")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected type",
@@ -704,7 +704,7 @@ func TestParseIntersectionType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{ T , U : V }")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected colon in intersection type",
@@ -723,7 +723,7 @@ func TestParseIntersectionType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{U , V : W }")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: `unexpected colon in intersection type`,
@@ -742,7 +742,7 @@ func TestParseIntersectionType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{[T]}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "non-nominal type in intersection list: [T]",
@@ -761,7 +761,7 @@ func TestParseIntersectionType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{T, [U]}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "non-nominal type in intersection list: [U]",
@@ -780,7 +780,7 @@ func TestParseIntersectionType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid end of input, expected type",
@@ -798,7 +798,7 @@ func TestParseIntersectionType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{U")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid end of input, expected '}'",
@@ -816,7 +816,7 @@ func TestParseIntersectionType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{U,")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid end of input, expected type",
@@ -834,7 +834,7 @@ func TestParseIntersectionType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{,}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected comma in intersection type",
@@ -859,7 +859,7 @@ func TestParseDictionaryType(t *testing.T) {
result, errs := testParseType("{T: U}")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.DictionaryType{
KeyType: &ast.NominalType{
Identifier: ast.Identifier{
@@ -887,7 +887,7 @@ func TestParseDictionaryType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{T:}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "missing dictionary value type",
@@ -897,7 +897,7 @@ func TestParseDictionaryType(t *testing.T) {
errs,
)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.DictionaryType{
KeyType: &ast.NominalType{
Identifier: ast.Identifier{
@@ -920,7 +920,7 @@ func TestParseDictionaryType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{:}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected colon in dictionary type",
@@ -938,7 +938,7 @@ func TestParseDictionaryType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{:U}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected colon in dictionary type",
@@ -957,7 +957,7 @@ func TestParseDictionaryType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{T:U,}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected comma in dictionary type",
@@ -976,7 +976,7 @@ func TestParseDictionaryType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{T:U:}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected colon in dictionary type",
@@ -995,7 +995,7 @@ func TestParseDictionaryType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{T::U}")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "unexpected colon in dictionary type",
@@ -1014,7 +1014,7 @@ func TestParseDictionaryType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{T:")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid end of input, expected type",
@@ -1032,7 +1032,7 @@ func TestParseDictionaryType(t *testing.T) {
t.Parallel()
result, errs := testParseType("{T:U")
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "invalid end of input, expected '}'",
@@ -1057,7 +1057,7 @@ func TestParseFunctionType(t *testing.T) {
result, errs := testParseType("fun():Void")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FunctionType{
PurityAnnotation: ast.FunctionPurityUnspecified,
ParameterTypeAnnotations: nil,
@@ -1087,7 +1087,7 @@ func TestParseFunctionType(t *testing.T) {
result, errs := testParseType("view fun ():Void")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FunctionType{
PurityAnnotation: ast.FunctionPurityView,
ParameterTypeAnnotations: nil,
@@ -1117,7 +1117,7 @@ func TestParseFunctionType(t *testing.T) {
result, errs := testParseType("fun( String , Bool , @R ) : Int")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.FunctionType{
ParameterTypeAnnotations: []*ast.TypeAnnotation{
{
@@ -1182,7 +1182,7 @@ func TestParseInstantiationType(t *testing.T) {
result, errs := testParseType("T<>")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InstantiationType{
Type: &ast.NominalType{
Identifier: ast.Identifier{
@@ -1204,7 +1204,7 @@ func TestParseInstantiationType(t *testing.T) {
result, errs := testParseType("T")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InstantiationType{
Type: &ast.NominalType{
Identifier: ast.Identifier{
@@ -1238,7 +1238,7 @@ func TestParseInstantiationType(t *testing.T) {
result, errs := testParseType("T< U >")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InstantiationType{
Type: &ast.NominalType{
Identifier: ast.Identifier{
@@ -1272,7 +1272,7 @@ func TestParseInstantiationType(t *testing.T) {
result, errs := testParseType("T< U , @V >")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InstantiationType{
Type: &ast.NominalType{
Identifier: ast.Identifier{
@@ -1316,7 +1316,7 @@ func TestParseInstantiationType(t *testing.T) {
result, errs := testParseType("T")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InstantiationType{
Type: &ast.NominalType{
Identifier: ast.Identifier{
@@ -1350,7 +1350,7 @@ func TestParseInstantiationType(t *testing.T) {
result, errs := testParseType("T< U< V > >")
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
&ast.InstantiationType{
Type: &ast.NominalType{
Identifier: ast.Identifier{
@@ -1404,7 +1404,7 @@ func TestParseParametersAndArrayTypes(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.FunctionDeclaration{
ParameterList: &ast.ParameterList{
@@ -1696,7 +1696,7 @@ func TestParseDictionaryTypeInVariableDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2018,7 +2018,7 @@ func TestParseIntegerTypes(t *testing.T) {
StartPos: ast.Position{Offset: 137, Line: 9, Column: 2},
}
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{a, b, c, d, e, f, g, h},
result.Declarations(),
)
@@ -2034,7 +2034,7 @@ func TestParseFunctionTypeInVariableDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2112,7 +2112,7 @@ func TestParseFunctionArrayType(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2196,7 +2196,7 @@ func TestParseFunctionTypeWithArrayReturnType(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2291,7 +2291,7 @@ func TestParseFunctionTypeWithFunctionReturnType(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2451,7 +2451,7 @@ func TestParseViewFunctionTypeWithNewSyntax(t *testing.T) {
StartPos: ast.Position{Offset: 3, Line: 2, Column: 2},
},
}
- utils.AssertEqualWithDiff(t, expected, result.Declarations())
+ AssertEqualWithDiff(t, expected, result.Declarations())
}
func TestParseNewSyntaxFunctionType(t *testing.T) {
@@ -2534,7 +2534,7 @@ func TestParseNewSyntaxFunctionType(t *testing.T) {
StartPos: ast.Position{Offset: 3, Line: 2, Column: 2},
},
}
- utils.AssertEqualWithDiff(t, expected, result.Declarations())
+ AssertEqualWithDiff(t, expected, result.Declarations())
}
func TestParseOptionalTypeDouble(t *testing.T) {
@@ -2547,7 +2547,7 @@ func TestParseOptionalTypeDouble(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2602,7 +2602,7 @@ func TestParseFunctionTypeWithResourceTypeAnnotation(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2659,7 +2659,7 @@ func TestParseReferenceTypeInVariableDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2720,7 +2720,7 @@ func TestParseOptionalReference(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2775,7 +2775,7 @@ func TestParseIntersectionReferenceType(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2835,7 +2835,7 @@ func TestParseOptionalIntersectionType(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2894,7 +2894,7 @@ func TestParseAuthorizedReferenceTypeWithNoEntitlements(t *testing.T) {
`
_, errs := testParseProgram(code)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&SyntaxError{
Message: "expected authorization (entitlement list)",
@@ -2915,7 +2915,7 @@ func TestParseInstantiationTypeInVariableDeclaration(t *testing.T) {
result, errs := testParseProgram(code)
require.Empty(t, errs)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]ast.Declaration{
&ast.VariableDeclaration{
Access: ast.AccessNotSpecified,
@@ -2991,7 +2991,7 @@ func TestParseConstantSizedSizedArrayWithTrailingUnderscoreSize(t *testing.T) {
let T:[d;0_]=0
`)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
[]error{
&InvalidIntegerLiteralError{
Literal: "0_",
@@ -3044,7 +3044,7 @@ func TestParseParenthesizedTypes(t *testing.T) {
},
}
- utils.AssertEqualWithDiff(t, expected, prog.Declarations())
+ AssertEqualWithDiff(t, expected, prog.Declarations())
}
func TestParseNestedParenthesizedTypes(t *testing.T) {
@@ -3084,5 +3084,5 @@ func TestParseNestedParenthesizedTypes(t *testing.T) {
},
}
- utils.AssertEqualWithDiff(t, expected, prog.Declarations())
+ AssertEqualWithDiff(t, expected, prog.Declarations())
}
diff --git a/runtime/.gitattributes b/runtime/.gitattributes
deleted file mode 100644
index 7a38edbb9a..0000000000
--- a/runtime/.gitattributes
+++ /dev/null
@@ -1,9 +0,0 @@
-*.interp linguist-generated=true
-*.tokens linguist-generated=true
-parser/cadence_parser.go linguist-generated=true
-parser/cadence_lexer.go linguist-generated=true
-parser/cadence_base_listener.go linguist-generated=true
-parser/cadence_base_visitor.go linguist-generated=true
-parser/cadence_visitor.go linguist-generated=true
-parser/cadence_listener.go linguist-generated=true
-
diff --git a/tests/account_test.go b/runtime/account_test.go
similarity index 99%
rename from tests/account_test.go
rename to runtime/account_test.go
index 3182684d35..0d65fa3ecd 100644
--- a/tests/account_test.go
+++ b/runtime/account_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"fmt"
@@ -35,10 +35,10 @@ import (
. "github.com/onflow/cadence/runtime"
"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"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestRuntimeAccountKeyConstructor(t *testing.T) {
@@ -998,7 +998,7 @@ func TestRuntimePublicAccountKeys(t *testing.T) {
value, err := test.executeScript(testEnv.runtime, testEnv.runtimeInterface)
require.NoError(t, err)
- utils.AssertEqualWithDiff(t, cadence.Void{}, value)
+ AssertEqualWithDiff(t, cadence.Void{}, value)
keys := make(map[int]*AccountKey, len(testEnv.storage.keys))
for _, key := range testEnv.storage.keys {
@@ -1043,7 +1043,7 @@ func TestRuntimePublicAccountKeys(t *testing.T) {
value, err := test.executeScript(testEnv.runtime, testEnv.runtimeInterface)
require.NoError(t, err)
- utils.AssertEqualWithDiff(t,
+ AssertEqualWithDiff(t,
cadence.NewOptional(cadence.String("Optional.map")),
value,
)
@@ -1717,7 +1717,7 @@ func TestRuntimePublicKey(t *testing.T) {
}
_, err := executeScript(script, runtimeInterface)
- errs := checker.RequireCheckerErrors(t, err, 4)
+ errs := RequireCheckerErrors(t, err, 4)
assert.IsType(t, &sema.InvalidAssignmentAccessError{}, errs[0])
assert.IsType(t, &sema.AssignmentToConstantMemberError{}, errs[1])
@@ -2360,7 +2360,7 @@ func TestRuntimeAuthAccountContracts(t *testing.T) {
},
)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.UnauthorizedReferenceAssignmentError{}, errs[0])
})
@@ -2402,7 +2402,7 @@ func TestRuntimeAuthAccountContracts(t *testing.T) {
},
)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.UnauthorizedReferenceAssignmentError{}, errs[0])
})
@@ -2614,7 +2614,7 @@ func TestRuntimeGetAuthAccount(t *testing.T) {
},
)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.TypeMismatchError{}, errs[0])
})
@@ -2642,7 +2642,7 @@ func TestRuntimeGetAuthAccount(t *testing.T) {
},
)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.InsufficientArgumentsError{}, errs[0])
})
@@ -2669,7 +2669,7 @@ func TestRuntimeGetAuthAccount(t *testing.T) {
Location: common.ScriptLocation{0x1},
},
)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.ExcessiveArgumentsError{}, errs[0])
})
@@ -2704,7 +2704,7 @@ func TestRuntimeGetAuthAccount(t *testing.T) {
},
)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.NotDeclaredError{}, errs[0])
})
diff --git a/tests/attachments_test.go b/runtime/attachments_test.go
similarity index 97%
rename from tests/attachments_test.go
rename to runtime/attachments_test.go
index 5cb1909ee8..4d3d400d1b 100644
--- a/tests/attachments_test.go
+++ b/runtime/attachments_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"testing"
@@ -28,15 +28,14 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/interpreter"
. "github.com/onflow/cadence/runtime"
- . "github.com/onflow/cadence/tests/runtime_utils"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
)
func TestRuntimeAccountAttachmentSaveAndLoad(t *testing.T) {
t.Parallel()
storage := NewTestLedger(nil, nil)
- rt := NewTestInterpreterRuntimeWithAttachments()
+ rt := NewTestInterpreterRuntime()
var logs []string
var events []string
@@ -147,7 +146,7 @@ func TestRuntimeAccountAttachmentExportFailure(t *testing.T) {
t.Parallel()
storage := NewTestLedger(nil, nil)
- rt := NewTestInterpreterRuntimeWithAttachments()
+ rt := NewTestInterpreterRuntime()
logs := make([]string, 0)
events := make([]string, 0)
@@ -238,7 +237,7 @@ func TestRuntimeAccountAttachmentExport(t *testing.T) {
t.Parallel()
storage := NewTestLedger(nil, nil)
- rt := NewTestInterpreterRuntimeWithAttachments()
+ rt := NewTestInterpreterRuntime()
var logs []string
var events []string
@@ -323,7 +322,7 @@ func TestRuntimeAccountAttachedExport(t *testing.T) {
t.Parallel()
storage := NewTestLedger(nil, nil)
- rt := NewTestInterpreterRuntimeWithAttachments()
+ rt := NewTestInterpreterRuntime()
var logs []string
var events []string
@@ -411,7 +410,7 @@ func TestRuntimeAccountAttachmentSaveAndBorrow(t *testing.T) {
t.Parallel()
storage := NewTestLedger(nil, nil)
- rt := NewTestInterpreterRuntimeWithAttachments()
+ rt := NewTestInterpreterRuntime()
var logs []string
var events []string
@@ -525,7 +524,7 @@ func TestRuntimeAccountAttachmentCapability(t *testing.T) {
t.Parallel()
storage := NewTestLedger(nil, nil)
- rt := NewTestInterpreterRuntimeWithAttachments()
+ rt := NewTestInterpreterRuntime()
var logs []string
var events []string
@@ -666,7 +665,7 @@ func TestRuntimeAttachmentStorage(t *testing.T) {
address := common.MustBytesToAddress([]byte{0x1})
newRuntime := func() (TestInterpreterRuntime, *TestRuntimeInterface) {
- runtime := NewTestInterpreterRuntimeWithAttachments()
+ runtime := NewTestInterpreterRuntime()
accountCodes := map[common.Location][]byte{}
diff --git a/tests/capabilities_test.go b/runtime/capabilities_test.go
similarity index 99%
rename from tests/capabilities_test.go
rename to runtime/capabilities_test.go
index f02f81c079..3e76980213 100644
--- a/tests/capabilities_test.go
+++ b/runtime/capabilities_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"testing"
@@ -27,8 +27,8 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/interpreter"
. "github.com/onflow/cadence/runtime"
- . "github.com/onflow/cadence/tests/runtime_utils"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
)
func TestRuntimeCapability_borrowAndCheck(t *testing.T) {
diff --git a/tests/capabilitycontrollers_test.go b/runtime/capabilitycontrollers_test.go
similarity index 99%
rename from tests/capabilitycontrollers_test.go
rename to runtime/capabilitycontrollers_test.go
index 2a9881d312..fc6f692fe4 100644
--- a/tests/capabilitycontrollers_test.go
+++ b/runtime/capabilitycontrollers_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"encoding/binary"
@@ -32,8 +32,8 @@ import (
. "github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
- . "github.com/onflow/cadence/tests/runtime_utils"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
)
func TestRuntimeCapabilityControllers(t *testing.T) {
diff --git a/runtime/config.go b/runtime/config.go
index 8f652fd894..c3be0083d5 100644
--- a/runtime/config.go
+++ b/runtime/config.go
@@ -35,8 +35,6 @@ type Config struct {
ResourceOwnerChangeHandlerEnabled bool
// CoverageReport enables and collects coverage reporting metrics
CoverageReport *CoverageReport
- // AttachmentsEnabled specifies if attachments are enabled
- AttachmentsEnabled bool
// LegacyContractUpgradeEnabled enabled specifies whether to use the old parser when parsing an old contract
LegacyContractUpgradeEnabled bool
// ContractUpdateTypeRemovalEnabled specifies if type removal is enabled in contract updates
diff --git a/runtime/contract_function_executor.go b/runtime/contract_function_executor.go
index e7f3cc7e24..8ba0f49bf8 100644
--- a/runtime/contract_function_executor.go
+++ b/runtime/contract_function_executor.go
@@ -273,6 +273,7 @@ func (executor *interpreterContractFunctionExecutor) convertArgument(
inter,
locationRange,
environment,
+ environment.ResolveLocation,
argument,
argumentType,
)
diff --git a/tests/contract_test.go b/runtime/contract_test.go
similarity index 99%
rename from tests/contract_test.go
rename to runtime/contract_test.go
index 288424ea5c..2bb89a2cb5 100644
--- a/tests/contract_test.go
+++ b/runtime/contract_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"encoding/hex"
@@ -33,9 +33,10 @@ import (
. "github.com/onflow/cadence/runtime"
"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/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestRuntimeContract(t *testing.T) {
@@ -1234,7 +1235,7 @@ func TestRuntimeContractTryUpdate(t *testing.T) {
)
RequireError(t, err)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
var notExportedError *sema.NotExportedError
require.ErrorAs(t, errs[0], ¬ExportedError)
})
diff --git a/tests/contract_update_test.go b/runtime/contract_update_test.go
similarity index 99%
rename from tests/contract_update_test.go
rename to runtime/contract_update_test.go
index 7cee60bf24..48a0ec8e48 100644
--- a/tests/contract_update_test.go
+++ b/runtime/contract_update_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"testing"
@@ -29,8 +29,8 @@ import (
"github.com/onflow/cadence/interpreter"
. "github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/stdlib"
- . "github.com/onflow/cadence/tests/runtime_utils"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
)
func TestRuntimeContractUpdateWithDependencies(t *testing.T) {
diff --git a/tests/contract_update_validation_test.go b/runtime/contract_update_validation_test.go
similarity index 99%
rename from tests/contract_update_validation_test.go
rename to runtime/contract_update_validation_test.go
index 0bebbb99a0..74afc1c447 100644
--- a/tests/contract_update_validation_test.go
+++ b/runtime/contract_update_validation_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"encoding/hex"
@@ -33,8 +33,8 @@ import (
. "github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
- . "github.com/onflow/cadence/tests/runtime_utils"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
)
func newContractDeployTransaction(function, name, code string) string {
diff --git a/tests/convertTypes_test.go b/runtime/convertTypes_test.go
similarity index 94%
rename from tests/convertTypes_test.go
rename to runtime/convertTypes_test.go
index 5d5ea6b2a9..3e50371edd 100644
--- a/tests/convertTypes_test.go
+++ b/runtime/convertTypes_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"testing"
@@ -28,7 +28,7 @@ import (
"github.com/onflow/cadence/common"
. "github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func TestRuntimeExportRecursiveType(t *testing.T) {
@@ -36,7 +36,7 @@ func TestRuntimeExportRecursiveType(t *testing.T) {
t.Parallel()
ty := &sema.CompositeType{
- Location: utils.TestLocation,
+ Location: TestLocation,
Identifier: "Foo",
Kind: common.CompositeKindResource,
Members: &sema.StringMemberOrderedMap{},
@@ -60,7 +60,7 @@ func TestRuntimeExportRecursiveType(t *testing.T) {
}
expected := cadence.NewResourceType(
- utils.TestLocation,
+ TestLocation,
"Foo",
fields,
nil,
@@ -94,7 +94,7 @@ func BenchmarkExportType(b *testing.B) {
b.Run("composite type", func(b *testing.B) {
ty := &sema.CompositeType{
- Location: utils.TestLocation,
+ Location: TestLocation,
Identifier: "Foo",
Kind: common.CompositeKindResource,
Members: &sema.StringMemberOrderedMap{},
@@ -118,7 +118,7 @@ func BenchmarkExportType(b *testing.B) {
}
expected := cadence.NewResourceType(
- utils.TestLocation,
+ TestLocation,
"Foo",
fields,
nil,
diff --git a/runtime/convertValues.go b/runtime/convertValues.go
index 99ddbf18c3..0de6e52513 100644
--- a/runtime/convertValues.go
+++ b/runtime/convertValues.go
@@ -20,9 +20,11 @@ package runtime
import (
"math/big"
+ "strings"
_ "unsafe"
"github.com/onflow/cadence"
+ "github.com/onflow/cadence/ast"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/errors"
"github.com/onflow/cadence/interpreter"
@@ -792,6 +794,7 @@ type valueImporter struct {
inter *interpreter.Interpreter
locationRange interpreter.LocationRange
standardLibraryHandler stdlib.StandardLibraryHandler
+ resolveLocation sema.LocationHandlerFunc
}
// ImportValue converts a Cadence value to a runtime value.
@@ -799,6 +802,7 @@ func ImportValue(
inter *interpreter.Interpreter,
locationRange interpreter.LocationRange,
standardLibraryHandler stdlib.StandardLibraryHandler,
+ resolveLocation sema.LocationHandlerFunc,
value cadence.Value,
expectedType sema.Type,
) (interpreter.Value, error) {
@@ -806,6 +810,7 @@ func ImportValue(
inter: inter,
locationRange: locationRange,
standardLibraryHandler: standardLibraryHandler,
+ resolveLocation: resolveLocation,
}.importValue(value, expectedType)
}
@@ -1509,6 +1514,33 @@ func (i valueImporter) importCompositeValue(
inter := i.inter
locationRange := i.locationRange
+ // Resolve the location if it is not nil (not a built-in type)
+
+ if location != nil {
+ resolveLocation := i.resolveLocation
+ if resolveLocation != nil {
+
+ rootIdentifier := strings.SplitN(qualifiedIdentifier, ".", 2)[0]
+
+ resolvedLocations, err := resolveLocation(
+ []ast.Identifier{{Identifier: rootIdentifier}},
+ location,
+ )
+ if err != nil {
+ return nil, err
+ }
+
+ if len(resolvedLocations) != 1 {
+ return nil, errors.NewDefaultUserError(
+ "cannot import value of type %s: location resolution failed",
+ qualifiedIdentifier,
+ )
+ }
+
+ location = resolvedLocations[0].Location
+ }
+ }
+
typeID := common.NewTypeIDFromQualifiedName(inter, location, qualifiedIdentifier)
compositeType, typeErr := inter.GetCompositeType(location, qualifiedIdentifier, typeID)
if typeErr != nil {
diff --git a/tests/convertValues_test.go b/runtime/convertValues_test.go
similarity index 98%
rename from tests/convertValues_test.go
rename to runtime/convertValues_test.go
index bbe37f6b3d..f6cf51fcb2 100644
--- a/tests/convertValues_test.go
+++ b/runtime/convertValues_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
_ "embed"
@@ -28,6 +28,7 @@ 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/errors"
@@ -36,8 +37,9 @@ import (
. "github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
- . "github.com/onflow/cadence/tests/runtime_utils"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
)
func TestRuntimeExportValue(t *testing.T) {
@@ -628,6 +630,7 @@ func TestRuntimeImportValue(t *testing.T) {
inter,
interpreter.EmptyLocationRange,
nil,
+ nil,
tt.value,
tt.expectedType,
)
@@ -1367,6 +1370,7 @@ func TestImportInclusiveRangeValue(t *testing.T) {
inter,
interpreter.EmptyLocationRange,
nil,
+ nil,
value,
sema.NewInclusiveRangeType(inter, sema.IntType),
)
@@ -1401,6 +1405,7 @@ func TestImportInclusiveRangeValue(t *testing.T) {
inter,
interpreter.EmptyLocationRange,
nil,
+ nil,
value,
sema.AnyStructType,
)
@@ -1435,6 +1440,7 @@ func TestImportInclusiveRangeValue(t *testing.T) {
inter,
interpreter.EmptyLocationRange,
nil,
+ nil,
value,
sema.AnyStructType,
)
@@ -1465,6 +1471,7 @@ func TestImportInclusiveRangeValue(t *testing.T) {
inter,
interpreter.EmptyLocationRange,
nil,
+ nil,
value,
sema.StringType,
)
@@ -2316,7 +2323,7 @@ func TestRuntimeExportCompositeValueWithFunctionValueField(t *testing.T) {
assert.Equal(t, expected, actual)
}
-//go:embed test-export-json-deterministic.txt
+//go:embed test-export-json-deterministic.json
var exportJsonDeterministicExpected string
func TestRuntimeExportJsonDeterministic(t *testing.T) {
@@ -3489,6 +3496,7 @@ func TestRuntimeImportExportArrayValue(t *testing.T) {
inter,
interpreter.EmptyLocationRange,
nil,
+ nil,
value,
sema.ByteArrayType,
)
@@ -3559,6 +3567,7 @@ func TestRuntimeImportExportArrayValue(t *testing.T) {
inter,
interpreter.EmptyLocationRange,
nil,
+ nil,
value,
&sema.VariableSizedType{
Type: sema.AnyStructType,
@@ -3604,6 +3613,7 @@ func TestRuntimeImportExportArrayValue(t *testing.T) {
inter,
interpreter.EmptyLocationRange,
nil,
+ nil,
value,
sema.AnyStructType,
)
@@ -3693,6 +3703,7 @@ func TestRuntimeImportExportDictionaryValue(t *testing.T) {
inter,
interpreter.EmptyLocationRange,
nil,
+ nil,
value,
&sema.DictionaryType{
KeyType: sema.StringType,
@@ -3779,6 +3790,7 @@ func TestRuntimeImportExportDictionaryValue(t *testing.T) {
inter,
interpreter.EmptyLocationRange,
nil,
+ nil,
value,
&sema.DictionaryType{
KeyType: sema.StringType,
@@ -3843,6 +3855,7 @@ func TestRuntimeImportExportDictionaryValue(t *testing.T) {
inter,
interpreter.EmptyLocationRange,
nil,
+ nil,
value,
sema.AnyStructType,
)
@@ -3910,6 +3923,7 @@ func TestRuntimeImportExportDictionaryValue(t *testing.T) {
inter,
interpreter.EmptyLocationRange,
nil,
+ nil,
dictionaryWithHeterogenousKeys,
sema.AnyStructType,
)
@@ -5023,6 +5037,7 @@ func TestRuntimeImportExportComplex(t *testing.T) {
inter,
interpreter.EmptyLocationRange,
nil,
+ nil,
externalCompositeValue,
semaCompositeType,
)
@@ -5256,7 +5271,7 @@ func TestRuntimeNestedStructArgPassing(t *testing.T) {
func TestRuntimeDestroyedResourceReferenceExport(t *testing.T) {
t.Parallel()
- rt := NewTestInterpreterRuntimeWithAttachments()
+ rt := NewTestInterpreterRuntime()
script := []byte(`
access(all) resource S {}
@@ -5552,3 +5567,96 @@ func TestRuntimeExportInterfaceType(t *testing.T) {
require.ErrorAs(t, err, &invalidReturnType)
})
}
+func TestRuntimeImportResolvedLocation(t *testing.T) {
+
+ t.Parallel()
+
+ addressLocation := common.AddressLocation{
+ Address: common.MustBytesToAddress([]byte{42}),
+ Name: "Test",
+ }
+
+ identifierLocation := common.IdentifierLocation("Test")
+
+ storage := NewUnmeteredInMemoryStorage()
+
+ program := &interpreter.Program{
+ Elaboration: sema.NewElaboration(nil),
+ }
+
+ inter, err := interpreter.NewInterpreter(
+ program,
+ addressLocation,
+ &interpreter.Config{
+ Storage: storage,
+ AtreeValueValidationEnabled: true,
+ AtreeStorageValidationEnabled: true,
+ },
+ )
+ require.NoError(t, err)
+
+ semaCompositeType := &sema.CompositeType{
+ Location: addressLocation,
+ Identifier: "Foo",
+ Kind: common.CompositeKindStructure,
+ Members: &sema.StringMemberOrderedMap{},
+ }
+
+ program.Elaboration.SetCompositeType(
+ semaCompositeType.ID(),
+ semaCompositeType,
+ )
+
+ externalCompositeType := cadence.NewStructType(
+ identifierLocation,
+ "Foo",
+ []cadence.Field{},
+ nil,
+ )
+
+ externalCompositeValue := cadence.NewStruct(nil).
+ WithType(externalCompositeType)
+
+ resolveLocation := func(
+ identifiers []ast.Identifier,
+ location common.Location,
+ ) ([]sema.ResolvedLocation, error) {
+ require.Equal(t, identifierLocation, location)
+
+ location = addressLocation
+
+ return []sema.ResolvedLocation{
+ {
+ Location: location,
+ Identifiers: identifiers,
+ },
+ }, nil
+ }
+
+ actual, err := ImportValue(
+ inter,
+ interpreter.EmptyLocationRange,
+ nil,
+ resolveLocation,
+ externalCompositeValue,
+ semaCompositeType,
+ )
+ require.NoError(t, err)
+
+ internalCompositeValue := interpreter.NewCompositeValue(
+ inter,
+ interpreter.EmptyLocationRange,
+ addressLocation,
+ "Foo",
+ common.CompositeKindStructure,
+ nil,
+ common.ZeroAddress,
+ )
+
+ AssertValuesEqual(
+ t,
+ inter,
+ internalCompositeValue,
+ actual,
+ )
+}
diff --git a/tests/coverage_test.go b/runtime/coverage_test.go
similarity index 99%
rename from tests/coverage_test.go
rename to runtime/coverage_test.go
index 8877be16eb..5f5f746113 100644
--- a/tests/coverage_test.go
+++ b/runtime/coverage_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"encoding/json"
@@ -31,8 +31,7 @@ import (
"github.com/onflow/cadence/parser"
. "github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/stdlib"
- . "github.com/onflow/cadence/tests/runtime_utils"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
)
func TestRuntimeNewLocationCoverage(t *testing.T) {
@@ -1816,7 +1815,7 @@ func TestRuntimeCoverageWithNoStatements(t *testing.T) {
}
coverageReport.ExcludeLocation(txLocation)
- deploy := utils.DeploymentTransaction("FooContract", contract)
+ deploy := DeploymentTransaction("FooContract", contract)
err := runtime.ExecuteTransaction(
Script{
Source: deploy,
diff --git a/tests/crypto_test.go b/runtime/crypto_test.go
similarity index 91%
rename from tests/crypto_test.go
rename to runtime/crypto_test.go
index c6fdd2bbe9..fcce37cf8b 100644
--- a/tests/crypto_test.go
+++ b/runtime/crypto_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"encoding/hex"
@@ -33,91 +33,9 @@ import (
. "github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
- . "github.com/onflow/cadence/tests/runtime_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
)
-func TestRuntimeCrypto_verify(t *testing.T) {
-
- t.Parallel()
-
- runtime := NewTestInterpreterRuntime()
-
- script := []byte(`
- import Crypto
-
- access(all) fun main(): Bool {
- let publicKey = PublicKey(
- publicKey: "0102".decodeHex(),
- signatureAlgorithm: SignatureAlgorithm.ECDSA_P256
- )
-
- let keyList = Crypto.KeyList()
- keyList.add(
- publicKey,
- hashAlgorithm: HashAlgorithm.SHA3_256,
- weight: 1.0
- )
-
- let signatureSet = [
- Crypto.KeyListSignature(
- keyIndex: 0,
- signature: "0304".decodeHex()
- )
- ]
-
- return keyList.verify(
- signatureSet: signatureSet,
- signedData: "0506".decodeHex(),
- domainSeparationTag: "foo"
- )
- }
- `)
-
- var called bool
-
- storage := NewTestLedger(nil, nil)
-
- runtimeInterface := &TestRuntimeInterface{
- Storage: storage,
- OnVerifySignature: func(
- signature []byte,
- tag string,
- signedData []byte,
- publicKey []byte,
- signatureAlgorithm SignatureAlgorithm,
- hashAlgorithm HashAlgorithm,
- ) (bool, error) {
- called = true
- assert.Equal(t, []byte{3, 4}, signature)
- assert.Equal(t, "foo", tag)
- assert.Equal(t, []byte{5, 6}, signedData)
- assert.Equal(t, []byte{1, 2}, publicKey)
- assert.Equal(t, SignatureAlgorithmECDSA_P256, signatureAlgorithm)
- assert.Equal(t, HashAlgorithmSHA3_256, hashAlgorithm)
- return true, nil
- },
- }
- addPublicKeyValidation(runtimeInterface, nil)
-
- result, err := runtime.ExecuteScript(
- Script{
- Source: script,
- },
- Context{
- Interface: runtimeInterface,
- Location: common.ScriptLocation{},
- },
- )
- require.NoError(t, err)
-
- assert.Equal(t,
- cadence.NewBool(true),
- result,
- )
-
- assert.True(t, called)
-}
-
func TestRuntimeHashAlgorithm_hash(t *testing.T) {
t.Parallel()
diff --git a/tests/debugger_test.go b/runtime/debugger_test.go
similarity index 98%
rename from tests/debugger_test.go
rename to runtime/debugger_test.go
index 3289668907..b9d060775e 100644
--- a/tests/debugger_test.go
+++ b/runtime/debugger_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"sync"
@@ -28,7 +28,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/interpreter"
. "github.com/onflow/cadence/runtime"
- . "github.com/onflow/cadence/tests/runtime_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
)
func TestRuntimeDebugger(t *testing.T) {
diff --git a/tests/deployedcontract_test.go b/runtime/deployedcontract_test.go
similarity index 94%
rename from tests/deployedcontract_test.go
rename to runtime/deployedcontract_test.go
index 7090f7ad77..bae773da2e 100644
--- a/tests/deployedcontract_test.go
+++ b/runtime/deployedcontract_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"testing"
@@ -26,8 +26,7 @@ import (
"github.com/onflow/cadence"
"github.com/onflow/cadence/common"
. "github.com/onflow/cadence/runtime"
- . "github.com/onflow/cadence/tests/runtime_utils"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
)
func TestRuntimeDeployedContracts(t *testing.T) {
@@ -104,7 +103,7 @@ func TestRuntimeDeployedContracts(t *testing.T) {
// deploy the contract
err := rt.ExecuteTransaction(
Script{
- Source: utils.DeploymentTransaction("Test", []byte(contractCode)),
+ Source: DeploymentTransaction("Test", []byte(contractCode)),
},
newContext(),
)
diff --git a/tests/deployment_test.go b/runtime/deployment_test.go
similarity index 98%
rename from tests/deployment_test.go
rename to runtime/deployment_test.go
index daa8845812..4d1ab95280 100644
--- a/tests/deployment_test.go
+++ b/runtime/deployment_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"encoding/hex"
@@ -34,8 +34,9 @@ import (
. "github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
- . "github.com/onflow/cadence/tests/runtime_utils"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
)
func TestRuntimeTransactionWithContractDeployment(t *testing.T) {
@@ -71,6 +72,7 @@ func TestRuntimeTransactionWithContractDeployment(t *testing.T) {
inter,
interpreter.EmptyLocationRange,
nil,
+ nil,
codeHashValue,
stdlib.HashType,
)
diff --git a/tests/entitlements_test.go b/runtime/entitlements_test.go
similarity index 98%
rename from tests/entitlements_test.go
rename to runtime/entitlements_test.go
index b09c67b726..428e56615d 100644
--- a/tests/entitlements_test.go
+++ b/runtime/entitlements_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"testing"
@@ -28,9 +28,8 @@ import (
"github.com/onflow/cadence/interpreter"
. "github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/checker"
- . "github.com/onflow/cadence/tests/runtime_utils"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestRuntimeAccountEntitlementSaveAndLoadSuccess(t *testing.T) {
@@ -221,7 +220,7 @@ func TestRuntimeAccountEntitlementAttachment(t *testing.T) {
t.Parallel()
storage := NewTestLedger(nil, nil)
- rt := NewTestInterpreterRuntimeWithAttachments()
+ rt := NewTestInterpreterRuntime()
accountCodes := map[Location][]byte{}
deployTx := DeploymentTransaction("Test", []byte(`
@@ -497,7 +496,7 @@ func TestRuntimeAccountEntitlementNamingConflict(t *testing.T) {
var checkerErr *sema.CheckerError
require.ErrorAs(t, err, &checkerErr)
- errs := checker.RequireCheckerErrors(t, checkerErr, 1)
+ errs := RequireCheckerErrors(t, checkerErr, 1)
var accessError *sema.InvalidAccessError
require.ErrorAs(t, errs[0], &accessError)
@@ -507,7 +506,7 @@ func TestRuntimeAccountEntitlementCapabilityCasting(t *testing.T) {
t.Parallel()
storage := NewTestLedger(nil, nil)
- rt := NewTestInterpreterRuntimeWithAttachments()
+ rt := NewTestInterpreterRuntime()
accountCodes := map[Location][]byte{}
deployTx := DeploymentTransaction("Test", []byte(`
@@ -607,7 +606,7 @@ func TestRuntimeAccountEntitlementCapabilityDictionary(t *testing.T) {
t.Parallel()
storage := NewTestLedger(nil, nil)
- rt := NewTestInterpreterRuntimeWithAttachments()
+ rt := NewTestInterpreterRuntime()
accountCodes := map[Location][]byte{}
deployTx := DeploymentTransaction("Test", []byte(`
@@ -722,7 +721,7 @@ func TestRuntimeAccountEntitlementGenericCapabilityDictionary(t *testing.T) {
t.Parallel()
storage := NewTestLedger(nil, nil)
- rt := NewTestInterpreterRuntimeWithAttachments()
+ rt := NewTestInterpreterRuntime()
accountCodes := map[Location][]byte{}
deployTx := DeploymentTransaction("Test", []byte(`
diff --git a/runtime/environment.go b/runtime/environment.go
index d45fc07274..ef3d0130d6 100644
--- a/runtime/environment.go
+++ b/runtime/environment.go
@@ -76,6 +76,8 @@ type Environment interface {
)
CommitStorage(inter *interpreter.Interpreter) error
NewAccountValue(inter *interpreter.Interpreter, address interpreter.AddressValue) interpreter.Value
+
+ ResolveLocation(identifiers []ast.Identifier, location common.Location) ([]ResolvedLocation, error)
}
// interpreterEnvironmentReconfigured is the portion of interpreterEnvironment
@@ -206,10 +208,9 @@ func (e *interpreterEnvironment) newCheckerConfig() *sema.Config {
BaseValueActivationHandler: e.getBaseValueActivation,
BaseTypeActivationHandler: e.getBaseTypeActivation,
ValidTopLevelDeclarationsHandler: validTopLevelDeclarations,
- LocationHandler: e.newLocationHandler(),
+ LocationHandler: e.ResolveLocation,
ImportHandler: e.resolveImport,
CheckHandler: e.newCheckHandler(),
- AttachmentsEnabled: e.config.AttachmentsEnabled,
}
}
@@ -644,16 +645,20 @@ func (e *interpreterEnvironment) check(
return elaboration, nil
}
-func (e *interpreterEnvironment) newLocationHandler() sema.LocationHandlerFunc {
- return func(identifiers []Identifier, location Location) (res []ResolvedLocation, err error) {
- errors.WrapPanic(func() {
- res, err = e.runtimeInterface.ResolveLocation(identifiers, location)
- })
- if err != nil {
- err = interpreter.WrappedExternalError(err)
- }
- return
+func (e *interpreterEnvironment) ResolveLocation(
+ identifiers []Identifier,
+ location Location,
+) (
+ res []ResolvedLocation,
+ err error,
+) {
+ errors.WrapPanic(func() {
+ res, err = e.runtimeInterface.ResolveLocation(identifiers, location)
+ })
+ if err != nil {
+ err = interpreter.WrappedExternalError(err)
}
+ return
}
func (e *interpreterEnvironment) newCheckHandler() sema.CheckHandlerFunc {
@@ -674,40 +679,29 @@ func (e *interpreterEnvironment) resolveImport(
importRange ast.Range,
) (sema.Import, error) {
- var elaboration *sema.Elaboration
- switch importedLocation {
- case stdlib.CryptoCheckerLocation:
- cryptoChecker := stdlib.CryptoChecker()
- elaboration = cryptoChecker.Elaboration
-
- default:
-
- // Check for cyclic imports
- if e.checkedImports[importedLocation] {
- return nil, &sema.CyclicImportsError{
- Location: importedLocation,
- Range: importRange,
- }
- } else {
- e.checkedImports[importedLocation] = true
- defer delete(e.checkedImports, importedLocation)
- }
-
- const getAndSetProgram = true
- program, err := e.GetProgram(
- importedLocation,
- getAndSetProgram,
- e.checkedImports,
- )
- if err != nil {
- return nil, err
+ // Check for cyclic imports
+ if e.checkedImports[importedLocation] {
+ return nil, &sema.CyclicImportsError{
+ Location: importedLocation,
+ Range: importRange,
}
+ } else {
+ e.checkedImports[importedLocation] = true
+ defer delete(e.checkedImports, importedLocation)
+ }
- elaboration = program.Elaboration
+ const getAndSetProgram = true
+ program, err := e.GetProgram(
+ importedLocation,
+ getAndSetProgram,
+ e.checkedImports,
+ )
+ if err != nil {
+ return nil, err
}
return sema.ElaborationImport{
- Elaboration: elaboration,
+ Elaboration: program.Elaboration,
}, nil
}
@@ -1006,36 +1000,30 @@ func (e *interpreterEnvironment) newInjectedCompositeFieldsHandler() interpreter
compositeKind common.CompositeKind,
) map[string]interpreter.Value {
- switch location {
- case stdlib.CryptoCheckerLocation:
- return nil
+ switch compositeKind {
+ case common.CompositeKindContract:
+ var address Address
- default:
- switch compositeKind {
- case common.CompositeKindContract:
- var address Address
-
- switch location := location.(type) {
- case common.AddressLocation:
- address = location.Address
- default:
- return nil
- }
+ switch location := location.(type) {
+ case common.AddressLocation:
+ address = location.Address
+ default:
+ return nil
+ }
- addressValue := interpreter.NewAddressValue(
- inter,
- address,
- )
+ addressValue := interpreter.NewAddressValue(
+ inter,
+ address,
+ )
- return map[string]interpreter.Value{
- sema.ContractAccountFieldName: stdlib.NewAccountReferenceValue(
- inter,
- e,
- addressValue,
- interpreter.FullyEntitledAccountAccess,
- interpreter.EmptyLocationRange,
- ),
- }
+ return map[string]interpreter.Value{
+ sema.ContractAccountFieldName: stdlib.NewAccountReferenceValue(
+ inter,
+ e,
+ addressValue,
+ interpreter.FullyEntitledAccountAccess,
+ interpreter.EmptyLocationRange,
+ ),
}
}
@@ -1046,36 +1034,22 @@ func (e *interpreterEnvironment) newInjectedCompositeFieldsHandler() interpreter
func (e *interpreterEnvironment) newImportLocationHandler() interpreter.ImportLocationHandlerFunc {
return func(inter *interpreter.Interpreter, location common.Location) interpreter.Import {
- switch location {
- case stdlib.CryptoCheckerLocation:
- cryptoChecker := stdlib.CryptoChecker()
- program := interpreter.ProgramFromChecker(cryptoChecker)
- subInterpreter, err := inter.NewSubInterpreter(program, location)
- if err != nil {
- panic(err)
- }
- return interpreter.InterpreterImport{
- Interpreter: subInterpreter,
- }
-
- default:
- const getAndSetProgram = true
- program, err := e.GetProgram(
- location,
- getAndSetProgram,
- importResolutionResults{},
- )
- if err != nil {
- panic(err)
- }
+ const getAndSetProgram = true
+ program, err := e.GetProgram(
+ location,
+ getAndSetProgram,
+ importResolutionResults{},
+ )
+ if err != nil {
+ panic(err)
+ }
- subInterpreter, err := inter.NewSubInterpreter(program, location)
- if err != nil {
- panic(err)
- }
- return interpreter.InterpreterImport{
- Interpreter: subInterpreter,
- }
+ subInterpreter, err := inter.NewSubInterpreter(program, location)
+ if err != nil {
+ panic(err)
+ }
+ return interpreter.InterpreterImport{
+ Interpreter: subInterpreter,
}
}
}
@@ -1123,45 +1097,32 @@ func (e *interpreterEnvironment) newCompositeValueFunctionsHandler() interpreter
func (e *interpreterEnvironment) loadContract(
inter *interpreter.Interpreter,
compositeType *sema.CompositeType,
- constructorGenerator func(common.Address) *interpreter.HostFunctionValue,
- invocationRange ast.Range,
+ _ func(common.Address) *interpreter.HostFunctionValue,
+ _ ast.Range,
) *interpreter.CompositeValue {
- switch compositeType.Location {
- case stdlib.CryptoCheckerLocation:
- contract, err := stdlib.NewCryptoContract(
- inter,
- constructorGenerator(common.ZeroAddress),
- invocationRange,
- )
- if err != nil {
- panic(err)
- }
- return contract
-
- default:
+ var contractValue interpreter.Value
- var storedValue interpreter.Value
-
- switch location := compositeType.Location.(type) {
-
- case common.AddressLocation:
- storageMap := e.storage.GetStorageMap(
- location.Address,
- StorageDomainContract,
- false,
+ location := compositeType.Location
+ if addressLocation, ok := location.(common.AddressLocation); ok {
+ storageMap := e.storage.GetStorageMap(
+ addressLocation.Address,
+ StorageDomainContract,
+ false,
+ )
+ if storageMap != nil {
+ contractValue = storageMap.ReadValue(
+ inter,
+ interpreter.StringStorageMapKey(addressLocation.Name),
)
- if storageMap != nil {
- storedValue = storageMap.ReadValue(inter, interpreter.StringStorageMapKey(location.Name))
- }
- }
-
- if storedValue == nil {
- panic(errors.NewDefaultUserError("failed to load contract: %s", compositeType.Location))
}
+ }
- return storedValue.(*interpreter.CompositeValue)
+ if contractValue == nil {
+ panic(errors.NewDefaultUserError("failed to load contract: %s", location))
}
+
+ return contractValue.(*interpreter.CompositeValue)
}
func (e *interpreterEnvironment) newOnFunctionInvocationHandler() func(_ *interpreter.Interpreter) {
diff --git a/tests/error_test.go b/runtime/error_test.go
similarity index 99%
rename from tests/error_test.go
rename to runtime/error_test.go
index 2a99de14ad..4d74c390c1 100644
--- a/tests/error_test.go
+++ b/runtime/error_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"encoding/hex"
@@ -31,7 +31,7 @@ import (
. "github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
- . "github.com/onflow/cadence/tests/runtime_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
)
func TestRuntimeError(t *testing.T) {
diff --git a/tests/errors_test.go b/runtime/errors_test.go
similarity index 99%
rename from tests/errors_test.go
rename to runtime/errors_test.go
index 9fafcbf8fc..979a7c366e 100644
--- a/tests/errors_test.go
+++ b/runtime/errors_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"fmt"
diff --git a/tests/ft_test.go b/runtime/ft_test.go
similarity index 99%
rename from tests/ft_test.go
rename to runtime/ft_test.go
index 2efce854de..b9374d986e 100644
--- a/tests/ft_test.go
+++ b/runtime/ft_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"fmt"
@@ -31,8 +31,9 @@ import (
"github.com/onflow/cadence/interpreter"
. "github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/sema"
- . "github.com/onflow/cadence/tests/runtime_utils"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
)
const modifiedFungibleTokenContractInterface = `
@@ -627,7 +628,7 @@ func BenchmarkRuntimeFungibleTokenTransfer(b *testing.B) {
err := runtime.ExecuteTransaction(
Script{
- Source: utils.DeploymentTransaction(
+ Source: DeploymentTransaction(
"FungibleToken",
[]byte(modifiedFungibleTokenContractInterface),
),
@@ -644,7 +645,7 @@ func BenchmarkRuntimeFungibleTokenTransfer(b *testing.B) {
err = runtime.ExecuteTransaction(
Script{
- Source: utils.DeploymentTransaction("FlowToken", []byte(modifiedFlowContract)),
+ Source: DeploymentTransaction("FlowToken", []byte(modifiedFlowContract)),
},
Context{
Interface: runtimeInterface,
@@ -767,7 +768,7 @@ func BenchmarkRuntimeFungibleTokenTransfer(b *testing.B) {
sum = sum.Plus(inter, value, interpreter.EmptyLocationRange).(interpreter.UFix64Value)
}
- utils.RequireValuesEqual(b, nil, mintAmountValue, sum)
+ RequireValuesEqual(b, nil, mintAmountValue, sum)
}
const oldExampleToken = `
@@ -1043,7 +1044,7 @@ func TestRuntimeBrokenFungibleTokenRecovery(t *testing.T) {
err := runtime.ExecuteTransaction(
Script{
- Source: utils.DeploymentTransaction(
+ Source: DeploymentTransaction(
"FungibleToken",
[]byte(modifiedFungibleTokenContractInterface),
),
@@ -1222,7 +1223,7 @@ func TestRuntimeBrokenFungibleTokenRecovery(t *testing.T) {
Environment: environment,
},
)
- utils.RequireError(t, err)
+ RequireError(t, err)
require.ErrorContains(t, err, "Vault.withdraw is not available in recovered program")
t.Log(err.Error())
diff --git a/tests/import_test.go b/runtime/import_test.go
similarity index 95%
rename from tests/import_test.go
rename to runtime/import_test.go
index 2e75215a84..cbc92d7401 100644
--- a/tests/import_test.go
+++ b/runtime/import_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"fmt"
@@ -30,9 +30,9 @@ import (
"github.com/onflow/cadence/encoding/json"
. "github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/checker"
- . "github.com/onflow/cadence/tests/runtime_utils"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestRuntimeCyclicImport(t *testing.T) {
@@ -91,7 +91,7 @@ func TestRuntimeCyclicImport(t *testing.T) {
var checkerErr *sema.CheckerError
require.ErrorAs(t, err, &checkerErr)
- errs := checker.RequireCheckerErrors(t, checkerErr, 1)
+ errs := RequireCheckerErrors(t, checkerErr, 1)
var importedProgramErr *sema.ImportedProgramError
require.ErrorAs(t, errs[0], &importedProgramErr)
@@ -101,7 +101,7 @@ func TestRuntimeCyclicImport(t *testing.T) {
var checkerErr2 *sema.CheckerError
require.ErrorAs(t, importedProgramErr.Err, &checkerErr2)
- errs = checker.RequireCheckerErrors(t, checkerErr2, 1)
+ errs = RequireCheckerErrors(t, checkerErr2, 1)
var importedProgramErr2 *sema.ImportedProgramError
require.ErrorAs(t, errs[0], &importedProgramErr2)
@@ -111,7 +111,7 @@ func TestRuntimeCyclicImport(t *testing.T) {
var checkerErr3 *sema.CheckerError
require.ErrorAs(t, importedProgramErr2.Err, &checkerErr3)
- errs = checker.RequireCheckerErrors(t, checkerErr3, 1)
+ errs = RequireCheckerErrors(t, checkerErr3, 1)
require.IsType(t, &sema.CyclicImportsError{}, errs[0])
}
@@ -201,7 +201,7 @@ func TestRuntimeCheckCyclicImportsAfterUpdate(t *testing.T) {
var checkerErr *sema.CheckerError
require.ErrorAs(t, err, &checkerErr)
- errs := checker.RequireCheckerErrors(t, checkerErr, 1)
+ errs := RequireCheckerErrors(t, checkerErr, 1)
var importedProgramErr *sema.ImportedProgramError
require.ErrorAs(t, errs[0], &importedProgramErr)
@@ -209,7 +209,7 @@ func TestRuntimeCheckCyclicImportsAfterUpdate(t *testing.T) {
var nestedCheckerErr *sema.CheckerError
require.ErrorAs(t, importedProgramErr.Err, &nestedCheckerErr)
- errs = checker.RequireCheckerErrors(t, nestedCheckerErr, 1)
+ errs = RequireCheckerErrors(t, nestedCheckerErr, 1)
require.IsType(t, &sema.CyclicImportsError{}, errs[0])
}
@@ -318,7 +318,7 @@ func TestRuntimeCheckCyclicImportAddress(t *testing.T) {
var checkerErr *sema.CheckerError
require.ErrorAs(t, err, &checkerErr)
- errs := checker.RequireCheckerErrors(t, checkerErr, 1)
+ errs := RequireCheckerErrors(t, checkerErr, 1)
// Direct cycle, by importing `Foo` in `Foo`
require.IsType(t, &sema.CyclicImportsError{}, errs[0])
@@ -403,7 +403,7 @@ func TestRuntimeCheckCyclicImportToSelfDuringDeploy(t *testing.T) {
var checkerErr *sema.CheckerError
require.ErrorAs(t, err, &checkerErr)
- errs := checker.RequireCheckerErrors(t, checkerErr, 1)
+ errs := RequireCheckerErrors(t, checkerErr, 1)
require.IsType(t, &sema.CyclicImportsError{}, errs[0])
}
diff --git a/tests/imported_values_memory_metering_test.go b/runtime/imported_values_memory_metering_test.go
similarity index 99%
rename from tests/imported_values_memory_metering_test.go
rename to runtime/imported_values_memory_metering_test.go
index 8b24d84ae1..d7620f27e9 100644
--- a/tests/imported_values_memory_metering_test.go
+++ b/runtime/imported_values_memory_metering_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"fmt"
@@ -29,8 +29,8 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/encoding/json"
. "github.com/onflow/cadence/runtime"
- . "github.com/onflow/cadence/tests/runtime_utils"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
)
func testUseMemory(meter map[common.MemoryKind]uint64) func(common.MemoryUsage) error {
@@ -628,7 +628,7 @@ func TestRuntimeScriptDecodedLocationMetering(t *testing.T) {
},
)
- utils.RequireError(t, err)
+ RequireError(t, err)
var entryPointErr *InvalidEntryPointArgumentError
require.ErrorAs(t, err, &entryPointErr)
diff --git a/tests/inbox_test.go b/runtime/inbox_test.go
similarity index 99%
rename from tests/inbox_test.go
rename to runtime/inbox_test.go
index c2330bc954..7017e4a5d9 100644
--- a/tests/inbox_test.go
+++ b/runtime/inbox_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"fmt"
@@ -30,7 +30,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/encoding/json"
. "github.com/onflow/cadence/runtime"
- . "github.com/onflow/cadence/tests/runtime_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
)
func TestRuntimeAccountInboxPublishUnpublish(t *testing.T) {
diff --git a/tests/literal_test.go b/runtime/literal_test.go
similarity index 99%
rename from tests/literal_test.go
rename to runtime/literal_test.go
index 296488776f..6109662007 100644
--- a/tests/literal_test.go
+++ b/runtime/literal_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"fmt"
@@ -29,8 +29,8 @@ import (
"github.com/onflow/cadence/common"
. "github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/sema"
- . "github.com/onflow/cadence/tests/runtime_utils"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
)
func TestRuntimeParseLiteral(t *testing.T) {
diff --git a/tests/nft_test.go b/runtime/nft_test.go
similarity index 99%
rename from tests/nft_test.go
rename to runtime/nft_test.go
index dd0f70db3d..fcaebdc473 100644
--- a/tests/nft_test.go
+++ b/runtime/nft_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
const modifiedNonFungibleTokenInterface = `
diff --git a/tests/predeclaredvalues_test.go b/runtime/predeclaredvalues_test.go
similarity index 98%
rename from tests/predeclaredvalues_test.go
rename to runtime/predeclaredvalues_test.go
index acefd56e08..9b916a3c0f 100644
--- a/tests/predeclaredvalues_test.go
+++ b/runtime/predeclaredvalues_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"math/big"
@@ -33,9 +33,9 @@ import (
. "github.com/onflow/cadence/runtime"
"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/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestRuntimePredeclaredValues(t *testing.T) {
@@ -245,7 +245,7 @@ func TestRuntimePredeclaredValues(t *testing.T) {
require.ErrorAs(t, err, &checkerErr)
assert.Equal(t, common.ScriptLocation{}, checkerErr.Location)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
var notDeclaredErr *sema.NotDeclaredError
require.ErrorAs(t, errs[0], ¬DeclaredErr)
diff --git a/tests/program_params_validation_test.go b/runtime/program_params_validation_test.go
similarity index 97%
rename from tests/program_params_validation_test.go
rename to runtime/program_params_validation_test.go
index 827de1ebe5..5cc5485f9d 100644
--- a/tests/program_params_validation_test.go
+++ b/runtime/program_params_validation_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"fmt"
@@ -30,9 +30,9 @@ import (
"github.com/onflow/cadence/encoding/json"
. "github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/checker"
- . "github.com/onflow/cadence/tests/runtime_utils"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestRuntimeScriptParameterTypeValidation(t *testing.T) {
@@ -346,7 +346,7 @@ func TestRuntimeScriptParameterTypeValidation(t *testing.T) {
var checkerError *sema.CheckerError
require.ErrorAs(t, err, &checkerError)
- errs := checker.RequireCheckerErrors(t, checkerError, 1)
+ errs := RequireCheckerErrors(t, checkerError, 1)
assert.IsType(t, &sema.InvalidTypeArgumentError{}, errs[0])
})
@@ -385,7 +385,7 @@ func TestRuntimeScriptParameterTypeValidation(t *testing.T) {
var checkerError *sema.CheckerError
require.ErrorAs(t, err, &checkerError)
- errs := checker.RequireCheckerErrors(t, checkerError, 1)
+ errs := RequireCheckerErrors(t, checkerError, 1)
assert.IsType(t, &sema.InvalidTypeArgumentError{}, errs[0])
})
@@ -811,7 +811,7 @@ func TestRuntimeTransactionParameterTypeValidation(t *testing.T) {
err := executeTransaction(t, script, contracts, cadence.NewOptional(nil))
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.InvalidNonImportableTransactionParameterTypeError{}, errs[0])
})
@@ -876,7 +876,7 @@ func TestRuntimeTransactionParameterTypeValidation(t *testing.T) {
err := executeTransaction(t, script, contracts, cadence.NewOptional(nil))
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.InvalidNonImportableTransactionParameterTypeError{}, errs[0])
})
@@ -903,7 +903,7 @@ func TestRuntimeTransactionParameterTypeValidation(t *testing.T) {
err := executeTransaction(t, script, contracts, cadence.NewOptional(nil))
- errs := checker.RequireCheckerErrors(t, err, 2)
+ errs := RequireCheckerErrors(t, err, 2)
require.IsType(t, &sema.InvalidNonImportableTransactionParameterTypeError{}, errs[0])
require.IsType(t, &sema.ResourceLossError{}, errs[1])
@@ -918,7 +918,7 @@ func TestRuntimeTransactionParameterTypeValidation(t *testing.T) {
err := executeTransaction(t, script, nil, cadence.NewOptional(nil))
- errs := checker.RequireCheckerErrors(t, err, 2)
+ errs := RequireCheckerErrors(t, err, 2)
require.IsType(t, &sema.InvalidNonImportableTransactionParameterTypeError{}, errs[0])
require.IsType(t, &sema.ResourceLossError{}, errs[1])
@@ -943,7 +943,7 @@ func TestRuntimeTransactionParameterTypeValidation(t *testing.T) {
err := executeTransaction(t, script, contracts, cadence.NewOptional(nil))
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.InvalidNonImportableTransactionParameterTypeError{}, errs[0])
})
@@ -968,7 +968,7 @@ func TestRuntimeTransactionParameterTypeValidation(t *testing.T) {
err := executeTransaction(t, script, nil, cadence.NewArray([]cadence.Value{}))
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.InvalidNonImportableTransactionParameterTypeError{}, errs[0])
})
@@ -1004,7 +1004,7 @@ func TestRuntimeTransactionParameterTypeValidation(t *testing.T) {
err := executeTransaction(t, script, nil, cadence.NewArray([]cadence.Value{}))
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.InvalidNonImportableTransactionParameterTypeError{}, errs[0])
})
@@ -1110,7 +1110,7 @@ func TestRuntimeTransactionParameterTypeValidation(t *testing.T) {
if test.expectErrors {
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, &sema.InvalidNonImportableTransactionParameterTypeError{}, errs[0])
} else {
diff --git a/tests/resource_duplicate_test.go b/runtime/resource_duplicate_test.go
similarity index 98%
rename from tests/resource_duplicate_test.go
rename to runtime/resource_duplicate_test.go
index 246f073a61..9304dfb07a 100644
--- a/tests/resource_duplicate_test.go
+++ b/runtime/resource_duplicate_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"testing"
@@ -29,8 +29,8 @@ import (
"github.com/onflow/cadence/interpreter"
. "github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/sema"
- . "github.com/onflow/cadence/tests/runtime_utils"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
)
func TestRuntimeResourceDuplicationWithContractTransferInTransaction(t *testing.T) {
diff --git a/tests/resourcedictionary_test.go b/runtime/resourcedictionary_test.go
similarity index 98%
rename from tests/resourcedictionary_test.go
rename to runtime/resourcedictionary_test.go
index e1b939e74e..a1a5100423 100644
--- a/tests/resourcedictionary_test.go
+++ b/runtime/resourcedictionary_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"encoding/hex"
@@ -29,8 +29,7 @@ import (
"github.com/onflow/cadence"
"github.com/onflow/cadence/common"
. "github.com/onflow/cadence/runtime"
- . "github.com/onflow/cadence/tests/runtime_utils"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
)
const resourceDictionaryContract = `
@@ -94,7 +93,7 @@ func TestRuntimeResourceDictionaryValues(t *testing.T) {
contract := []byte(resourceDictionaryContract)
- deploy := utils.DeploymentTransaction("Test", contract)
+ deploy := DeploymentTransaction("Test", contract)
setupTx := []byte(`
import Test from 0xCADE
@@ -450,7 +449,7 @@ func TestRuntimeResourceDictionaryValues_Nested(t *testing.T) {
}
`)
- deploy := utils.DeploymentTransaction("Test", contract)
+ deploy := DeploymentTransaction("Test", contract)
setupTx := []byte(`
import Test from 0xCADE
@@ -754,7 +753,7 @@ func TestRuntimeResourceDictionaryValues_Removal(t *testing.T) {
contract := []byte(resourceDictionaryContract)
- deployTx := utils.DeploymentTransaction("Test", contract)
+ deployTx := DeploymentTransaction("Test", contract)
setupTx := []byte(`
import Test from 0x1
@@ -883,7 +882,7 @@ func TestRuntimeResourceDictionaryValues_Destruction(t *testing.T) {
contract := []byte(resourceDictionaryContract)
- deployTx := utils.DeploymentTransaction("Test", contract)
+ deployTx := DeploymentTransaction("Test", contract)
setupTx := []byte(`
import Test from 0x1
@@ -996,7 +995,7 @@ func TestRuntimeResourceDictionaryValues_Insertion(t *testing.T) {
contract := []byte(resourceDictionaryContract)
- deployTx := utils.DeploymentTransaction("Test", contract)
+ deployTx := DeploymentTransaction("Test", contract)
setupTx := []byte(`
import Test from 0x1
@@ -1137,7 +1136,7 @@ func TestRuntimeResourceDictionaryValues_ValueTransferAndDestroy(t *testing.T) {
contract := []byte(resourceDictionaryContract)
- deployTx := utils.DeploymentTransaction("Test", contract)
+ deployTx := DeploymentTransaction("Test", contract)
setupTx := []byte(`
import Test from 0x1
@@ -1330,7 +1329,7 @@ func BenchmarkRuntimeResourceDictionaryValues(b *testing.B) {
}
`)
- deploy := utils.DeploymentTransaction("Test", contract)
+ deploy := DeploymentTransaction("Test", contract)
setupTx := []byte(`
import Test from 0xCADE
diff --git a/tests/rlp_test.go b/runtime/rlp_test.go
similarity index 98%
rename from tests/rlp_test.go
rename to runtime/rlp_test.go
index 1aa9296eed..93cfaa1ed6 100644
--- a/tests/rlp_test.go
+++ b/runtime/rlp_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"testing"
@@ -28,8 +28,8 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/encoding/json"
. "github.com/onflow/cadence/runtime"
- . "github.com/onflow/cadence/tests/runtime_utils"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
)
func TestRuntimeRLPDecodeString(t *testing.T) {
diff --git a/runtime/runtime.go b/runtime/runtime.go
index 1bb4254d84..e385f2c0c7 100644
--- a/runtime/runtime.go
+++ b/runtime/runtime.go
@@ -357,6 +357,7 @@ func UserPanicToError(f func()) (returnedError error) {
type ArgumentDecoder interface {
stdlib.StandardLibraryHandler
+ ResolveLocation(identifiers []ast.Identifier, location common.Location) ([]ResolvedLocation, error)
// DecodeArgument decodes a transaction/script argument against the given type.
DecodeArgument(argument []byte, argumentType cadence.Type) (cadence.Value, error)
@@ -414,6 +415,7 @@ func validateArgumentParams(
inter,
locationRange,
decoder,
+ decoder.ResolveLocation,
value,
parameterType,
)
diff --git a/tests/runtime_memory_metering_test.go b/runtime/runtime_memory_metering_test.go
similarity index 99%
rename from tests/runtime_memory_metering_test.go
rename to runtime/runtime_memory_metering_test.go
index e2aac366fd..d6d389ff73 100644
--- a/tests/runtime_memory_metering_test.go
+++ b/runtime/runtime_memory_metering_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"fmt"
@@ -31,8 +31,8 @@ import (
"github.com/onflow/cadence/encoding/json"
"github.com/onflow/cadence/errors"
. "github.com/onflow/cadence/runtime"
- . "github.com/onflow/cadence/tests/runtime_utils"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
)
type testMemoryGauge struct {
diff --git a/tests/runtime_test.go b/runtime/runtime_test.go
similarity index 98%
rename from tests/runtime_test.go
rename to runtime/runtime_test.go
index a0a1be7826..91b7bcdc86 100644
--- a/tests/runtime_test.go
+++ b/runtime/runtime_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"crypto/rand"
@@ -43,9 +43,9 @@ import (
. "github.com/onflow/cadence/runtime"
"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/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestRuntimeImport(t *testing.T) {
@@ -1773,7 +1773,7 @@ func TestRuntimeStorageMultipleTransactionsInclusiveRangeFunction(t *testing.T)
var checkerErr *sema.CheckerError
require.ErrorAs(t, err, &checkerErr)
- errs := checker.RequireCheckerErrors(t, checkerErr, 1)
+ errs := RequireCheckerErrors(t, checkerErr, 1)
assert.IsType(t, &sema.TypeMismatchError{}, errs[0])
@@ -3356,7 +3356,7 @@ func TestRuntimeStorageLoadedDestructionConcreteTypeWithAttachment(t *testing.T)
t.Parallel()
- runtime := NewTestInterpreterRuntimeWithAttachments()
+ runtime := NewTestInterpreterRuntime()
addressValue := Address{
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1,
@@ -3486,7 +3486,7 @@ func TestRuntimeStorageLoadedDestructionConcreteTypeWithAttachmentUnloadedContra
t.Parallel()
- runtime := NewTestInterpreterRuntimeWithAttachments()
+ runtime := NewTestInterpreterRuntime()
addressValue := Address{
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1,
@@ -3620,7 +3620,7 @@ func TestRuntimeStorageLoadedDestructionConcreteTypeSameNamedInterface(t *testin
t.Parallel()
- runtime := NewTestInterpreterRuntimeWithAttachments()
+ runtime := NewTestInterpreterRuntime()
addressValue := Address{
0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1,
@@ -4883,7 +4883,7 @@ func TestRuntimeTransactionTopLevelDeclarations(t *testing.T) {
var checkerErr *sema.CheckerError
require.ErrorAs(t, err, &checkerErr)
- errs := checker.RequireCheckerErrors(t, checkerErr, 1)
+ errs := RequireCheckerErrors(t, checkerErr, 1)
assert.IsType(t, &sema.InvalidTopLevelDeclarationError{}, errs[0])
})
@@ -7730,8 +7730,6 @@ func BenchmarkRuntimeScriptNoop(b *testing.B) {
Environment: environment,
}
- require.NotNil(b, stdlib.CryptoChecker())
-
runtime := NewTestInterpreterRuntime()
b.ReportAllocs()
@@ -7768,7 +7766,7 @@ func TestRuntimeImportTestStdlib(t *testing.T) {
RequireError(t, err)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
notDeclaredErr := &sema.NotDeclaredError{}
require.ErrorAs(t, errs[0], ¬DeclaredErr)
@@ -8541,7 +8539,7 @@ func TestRuntimeOptionalReferenceAttack(t *testing.T) {
var checkerErr *sema.CheckerError
require.ErrorAs(t, err, &checkerErr)
- errs := checker.RequireCheckerErrors(t, checkerErr, 1)
+ errs := RequireCheckerErrors(t, checkerErr, 1)
assert.IsType(t, &sema.TypeMismatchError{}, errs[0])
}
@@ -9072,7 +9070,7 @@ func TestRuntimeTypesAndConversions(t *testing.T) {
})
}
- for name, ty := range checker.AllBaseSemaTypes() {
+ for name, ty := range AllBaseSemaTypes() {
// Inclusive range is a dynamically created type.
if _, isInclusiveRange := ty.(*sema.InclusiveRangeType); isInclusiveRange {
continue
@@ -9844,7 +9842,7 @@ func TestRuntimePreconditionDuplication(t *testing.T) {
var checkerErr *sema.CheckerError
require.ErrorAs(t, err, &checkerErr)
- errs := checker.RequireCheckerErrors(t, checkerErr, 3)
+ errs := RequireCheckerErrors(t, checkerErr, 3)
assert.IsType(t, &sema.PurityError{}, errs[0])
assert.IsType(t, &sema.InvalidInterfaceConditionResourceInvalidationError{}, errs[1])
@@ -10562,7 +10560,7 @@ func TestRuntimeNonPublicAccessModifierInInterface(t *testing.T) {
t.Parallel()
- runtime := NewTestInterpreterRuntimeWithAttachments()
+ runtime := NewTestInterpreterRuntime()
address1 := common.MustBytesToAddress([]byte{0x1})
address2 := common.MustBytesToAddress([]byte{0x2})
@@ -10695,7 +10693,7 @@ func TestRuntimeContractWithInvalidCapability(t *testing.T) {
t.Parallel()
- runtime := NewTestInterpreterRuntimeWithAttachments()
+ runtime := NewTestInterpreterRuntime()
address := common.MustBytesToAddress([]byte{0x1})
@@ -11563,3 +11561,108 @@ func TestResultRedeclared(t *testing.T) {
})
}
+
+func TestRuntimeIdentifierLocationToAddressLocationRewrite(t *testing.T) {
+
+ t.Parallel()
+
+ signerAddress := common.MustBytesToAddress([]byte{0x42})
+
+ const fooContractName = "Foo"
+ fooIdentifierLocation := common.IdentifierLocation(fooContractName)
+ fooAddressLocation := common.AddressLocation{
+ Address: signerAddress,
+ Name: fooContractName,
+ }
+
+ fooContract := []byte(`
+ access(all)
+ contract Foo {
+ access(all) var answer: Int
+
+ init() {
+ self.answer = 42
+ }
+ }
+ `)
+
+ accountCodes := map[Location][]byte{}
+ var events []cadence.Event
+
+ runtimeInterface := &TestRuntimeInterface{
+ Storage: NewTestLedger(nil, nil),
+ OnGetSigningAccounts: func() ([]Address, error) {
+ return []Address{signerAddress}, nil
+ },
+ OnResolveLocation: func(identifiers []Identifier, location Location) ([]ResolvedLocation, error) {
+ assert.Empty(t, identifiers)
+ assert.Equal(t, fooIdentifierLocation, location)
+
+ // NOTE: rewrite identifier location to address location
+ location = fooAddressLocation
+
+ return []ResolvedLocation{
+ {
+ Location: location,
+ Identifiers: identifiers,
+ },
+ }, nil
+ },
+ OnGetAccountContractCode: func(location common.AddressLocation) (code []byte, err error) {
+ return accountCodes[location], nil
+ },
+ OnUpdateAccountContractCode: func(location common.AddressLocation, code []byte) error {
+ accountCodes[location] = code
+ return nil
+ },
+ OnEmitEvent: func(event cadence.Event) error {
+ events = append(events, event)
+ return nil
+ },
+ OnGetCode: func(location Location) ([]byte, error) {
+ return nil, errors.New("GetCode should not be called")
+ },
+ }
+
+ runtime := NewTestInterpreterRuntime()
+
+ nextTransactionLocation := NewTransactionLocationGenerator()
+ nextScriptLocation := NewScriptLocationGenerator()
+
+ // Deploy
+
+ deploy := DeploymentTransaction(fooContractName, fooContract)
+
+ err := runtime.ExecuteTransaction(
+ Script{
+ Source: deploy,
+ },
+ Context{
+ Interface: runtimeInterface,
+ Location: nextTransactionLocation(),
+ },
+ )
+ require.NoError(t, err)
+
+ // Test
+
+ result, err := runtime.ExecuteScript(
+ Script{
+ Source: []byte(`
+ import Foo
+
+ access(all)
+ fun main(): Int {
+ return Foo.answer
+ }
+ `),
+ },
+ Context{
+ Interface: runtimeInterface,
+ Location: nextScriptLocation(),
+ },
+ )
+ require.NoError(t, err)
+
+ assert.Equal(t, cadence.NewInt(42), result)
+}
diff --git a/tests/sharedstate_test.go b/runtime/sharedstate_test.go
similarity index 97%
rename from tests/sharedstate_test.go
rename to runtime/sharedstate_test.go
index b5d37b29a3..3008c85fff 100644
--- a/tests/sharedstate_test.go
+++ b/runtime/sharedstate_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"testing"
@@ -28,8 +28,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/interpreter"
. "github.com/onflow/cadence/runtime"
- . "github.com/onflow/cadence/tests/runtime_utils"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
)
func TestRuntimeSharedState(t *testing.T) {
diff --git a/tests/storage_test.go b/runtime/storage_test.go
similarity index 99%
rename from tests/storage_test.go
rename to runtime/storage_test.go
index 39aeccd5bc..5a7bb60bc9 100644
--- a/tests/storage_test.go
+++ b/runtime/storage_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"encoding/binary"
@@ -36,8 +36,9 @@ import (
"github.com/onflow/cadence/encoding/json"
"github.com/onflow/cadence/interpreter"
. "github.com/onflow/cadence/runtime"
- . "github.com/onflow/cadence/tests/runtime_utils"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/interpreter_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
)
func withWritesToStorage(
@@ -5941,7 +5942,7 @@ func TestRuntimeStorageReferenceBoundFunction(t *testing.T) {
t.Run("struct", func(t *testing.T) {
t.Parallel()
- runtime := NewTestInterpreterRuntimeWithAttachments()
+ runtime := NewTestInterpreterRuntime()
tx := []byte(`
transaction {
diff --git a/tests/test-export-json-deterministic.txt b/runtime/test-export-json-deterministic.json
similarity index 100%
rename from tests/test-export-json-deterministic.txt
rename to runtime/test-export-json-deterministic.json
diff --git a/tests/type_test.go b/runtime/type_test.go
similarity index 98%
rename from tests/type_test.go
rename to runtime/type_test.go
index 5ee6afc790..c96a705675 100644
--- a/tests/type_test.go
+++ b/runtime/type_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"testing"
@@ -27,7 +27,7 @@ import (
"github.com/onflow/cadence"
"github.com/onflow/cadence/common"
. "github.com/onflow/cadence/runtime"
- . "github.com/onflow/cadence/tests/runtime_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
)
func TestRuntimeTypeStorage(t *testing.T) {
diff --git a/tests/validation_test.go b/runtime/validation_test.go
similarity index 96%
rename from tests/validation_test.go
rename to runtime/validation_test.go
index b46b609df8..db212f8547 100644
--- a/tests/validation_test.go
+++ b/runtime/validation_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package tests
+package runtime_test
import (
"testing"
@@ -28,8 +28,8 @@ import (
"github.com/onflow/cadence/encoding/json"
"github.com/onflow/cadence/interpreter"
. "github.com/onflow/cadence/runtime"
- . "github.com/onflow/cadence/tests/runtime_utils"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
)
// TestRuntimeArgumentImportMissingType tests if errors produced while validating
diff --git a/tests/checker/access_test.go b/sema/accesses_test.go
similarity index 99%
rename from tests/checker/access_test.go
rename to sema/accesses_test.go
index 13e2eb3de6..976e30811e 100644
--- a/tests/checker/access_test.go
+++ b/sema/accesses_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -28,6 +28,7 @@ import (
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func expectSuccess(t *testing.T, err error) {
@@ -603,8 +604,7 @@ func TestCheckAccessModifierGlobalCompositeDeclaration(t *testing.T) {
),
ParseAndCheckOptions{
Config: &sema.Config{
- AccessCheckMode: checkMode,
- AttachmentsEnabled: true,
+ AccessCheckMode: checkMode,
},
},
)
diff --git a/tests/checker/account_test.go b/sema/account_test.go
similarity index 99%
rename from tests/checker/account_test.go
rename to sema/account_test.go
index 1fc36ef465..6084a5042b 100644
--- a/tests/checker/account_test.go
+++ b/sema/account_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -27,7 +27,8 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckAccountStorageSave(t *testing.T) {
@@ -887,7 +888,7 @@ func TestCheckAccountStorageBorrow(t *testing.T) {
sema.NewEntitlementSetAccess(
[]*sema.EntitlementType{
{
- Location: utils.TestLocation,
+ Location: TestLocation,
Identifier: "X",
},
},
diff --git a/tests/checker/any_test.go b/sema/any_test.go
similarity index 96%
rename from tests/checker/any_test.go
rename to sema/any_test.go
index fda0cd08b6..c9c0c76222 100644
--- a/tests/checker/any_test.go
+++ b/sema/any_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -24,6 +24,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckAnyStruct(t *testing.T) {
diff --git a/tests/checker/arrays_dictionaries_test.go b/sema/arrays_dictionaries_test.go
similarity index 99%
rename from tests/checker/arrays_dictionaries_test.go
rename to sema/arrays_dictionaries_test.go
index dea57fc1a6..6e5a512d05 100644
--- a/tests/checker/arrays_dictionaries_test.go
+++ b/sema/arrays_dictionaries_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -30,6 +30,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckDictionary(t *testing.T) {
diff --git a/tests/checker/assert_test.go b/sema/assert_test.go
similarity index 96%
rename from tests/checker/assert_test.go
rename to sema/assert_test.go
index ea9591bcd9..0c19bdc57e 100644
--- a/tests/checker/assert_test.go
+++ b/sema/assert_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -26,6 +26,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckAssertWithoutMessage(t *testing.T) {
diff --git a/tests/checker/assignment_test.go b/sema/assignment_test.go
similarity index 98%
rename from tests/checker/assignment_test.go
rename to sema/assignment_test.go
index 6342ae4174..96494ccde0 100644
--- a/tests/checker/assignment_test.go
+++ b/sema/assignment_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -25,6 +25,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckInvalidUnknownDeclarationAssignment(t *testing.T) {
diff --git a/tests/checker/attachments_test.go b/sema/attachments_test.go
similarity index 97%
rename from tests/checker/attachments_test.go
rename to sema/attachments_test.go
index c35be0f06a..d7d5e62447 100644
--- a/tests/checker/attachments_test.go
+++ b/sema/attachments_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -26,6 +26,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckAttachmentBasic(t *testing.T) {
@@ -3816,7 +3817,6 @@ func TestCheckAttachmentsExternalMutation(t *testing.T) {
`,
ParseAndCheckOptions{Config: &sema.Config{
SuggestionsEnabled: true,
- AttachmentsEnabled: true,
}},
)
@@ -3896,7 +3896,6 @@ func TestCheckAttachmentsExternalMutation(t *testing.T) {
`,
ParseAndCheckOptions{Config: &sema.Config{
SuggestionsEnabled: true,
- AttachmentsEnabled: true,
}},
)
@@ -3970,7 +3969,6 @@ func TestCheckAttachmentsExternalMutation(t *testing.T) {
`,
ParseAndCheckOptions{Config: &sema.Config{
SuggestionsEnabled: true,
- AttachmentsEnabled: true,
}},
)
@@ -4389,95 +4387,6 @@ func TestCheckAttachmentsResourceReference(t *testing.T) {
})
}
-func TestCheckAttachmentsNotEnabled(t *testing.T) {
-
- t.Parallel()
-
- parseAndCheckWithoutAttachments := func(t *testing.T, code string) (*sema.Checker, error) {
- return ParseAndCheckWithOptions(t, code, ParseAndCheckOptions{})
- }
-
- t.Run("declaration", func(t *testing.T) {
-
- t.Parallel()
-
- _, err := parseAndCheckWithoutAttachments(t,
- `
- struct S {}
- attachment Test for S {}`,
- )
-
- errs := RequireCheckerErrors(t, err, 1)
- assert.IsType(t, &sema.AttachmentsNotEnabledError{}, errs[0])
- })
-
- t.Run("attach", func(t *testing.T) {
-
- t.Parallel()
-
- _, err := parseAndCheckWithoutAttachments(t,
- `
- struct S {}
- let s = attach A() to S()
- `,
- )
-
- errs := RequireCheckerErrors(t, err, 2)
- assert.IsType(t, &sema.AttachmentsNotEnabledError{}, errs[0])
- assert.IsType(t, &sema.NotDeclaredError{}, errs[1])
- })
-
- t.Run("remove", func(t *testing.T) {
-
- t.Parallel()
-
- _, err := parseAndCheckWithoutAttachments(t,
- `
- struct S {}
- fun foo() {
- remove A from S()
- }
- `,
- )
-
- errs := RequireCheckerErrors(t, err, 2)
- assert.IsType(t, &sema.AttachmentsNotEnabledError{}, errs[0])
- assert.IsType(t, &sema.NotDeclaredError{}, errs[1])
- })
-
- t.Run("type indexing", func(t *testing.T) {
-
- t.Parallel()
-
- _, err := parseAndCheckWithoutAttachments(t,
- `
- struct S {}
- attachment A for S {}
- let s = S()
- let r = s[A]
- `,
- )
-
- errs := RequireCheckerErrors(t, err, 2)
- assert.IsType(t, &sema.AttachmentsNotEnabledError{}, errs[0])
- assert.IsType(t, &sema.AttachmentsNotEnabledError{}, errs[1])
- })
-
- t.Run("regular indexing ok", func(t *testing.T) {
-
- t.Parallel()
-
- _, err := parseAndCheckWithoutAttachments(t,
- `
- let x = [1, 2, 3]
- let y = x[2]
- `,
- )
-
- require.NoError(t, err)
- })
-}
-
func TestCheckAttachmentForEachAttachment(t *testing.T) {
t.Parallel()
diff --git a/tests/checker/boolean_test.go b/sema/boolean_test.go
similarity index 93%
rename from tests/checker/boolean_test.go
rename to sema/boolean_test.go
index a6e5224581..7c6202a5c2 100644
--- a/tests/checker/boolean_test.go
+++ b/sema/boolean_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -25,6 +25,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckBoolean(t *testing.T) {
diff --git a/tests/checker/builtinfunctions_test.go b/sema/builtinfunctions_test.go
similarity index 99%
rename from tests/checker/builtinfunctions_test.go
rename to sema/builtinfunctions_test.go
index be7a0ba1d1..07ca190593 100644
--- a/tests/checker/builtinfunctions_test.go
+++ b/sema/builtinfunctions_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -28,6 +28,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckToString(t *testing.T) {
diff --git a/tests/checker/capability_controller_test.go b/sema/capability_controller_test.go
similarity index 98%
rename from tests/checker/capability_controller_test.go
rename to sema/capability_controller_test.go
index 98cd7ec076..994f600999 100644
--- a/tests/checker/capability_controller_test.go
+++ b/sema/capability_controller_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -26,6 +26,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckStorageCapabilityController(t *testing.T) {
diff --git a/tests/checker/capability_test.go b/sema/capability_test.go
similarity index 98%
rename from tests/checker/capability_test.go
rename to sema/capability_test.go
index 3a9ffc013e..cb430f7b82 100644
--- a/tests/checker/capability_test.go
+++ b/sema/capability_test.go
@@ -16,17 +16,18 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
"testing"
- "github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/utils"
-
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+
+ "github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckCapability(t *testing.T) {
@@ -92,7 +93,7 @@ func TestCheckCapability_borrow(t *testing.T) {
for _, auth := range []sema.Access{sema.UnauthorizedAccess,
sema.NewEntitlementSetAccess([]*sema.EntitlementType{{
- Location: utils.TestLocation,
+ Location: TestLocation,
Identifier: "X",
}}, sema.Conjunction),
} {
@@ -319,7 +320,7 @@ func TestCheckCapability_check(t *testing.T) {
for _, auth := range []sema.Access{sema.UnauthorizedAccess,
sema.NewEntitlementSetAccess([]*sema.EntitlementType{{
- Location: utils.TestLocation,
+ Location: TestLocation,
Identifier: "X",
}}, sema.Conjunction),
} {
diff --git a/tests/checker/casting_test.go b/sema/casting_test.go
similarity index 99%
rename from tests/checker/casting_test.go
rename to sema/casting_test.go
index d8f901c874..b77dbdc466 100644
--- a/tests/checker/casting_test.go
+++ b/sema/casting_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -26,6 +26,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckCastingIntLiteralToIntegerType(t *testing.T) {
diff --git a/tests/checker/character_test.go b/sema/character_test.go
similarity index 95%
rename from tests/checker/character_test.go
rename to sema/character_test.go
index 816ae93159..7b7c664e95 100644
--- a/tests/checker/character_test.go
+++ b/sema/character_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -25,6 +25,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckCharacterLiteral(t *testing.T) {
diff --git a/sema/check_attach_expression.go b/sema/check_attach_expression.go
index 392f5caec5..3a468544fc 100644
--- a/sema/check_attach_expression.go
+++ b/sema/check_attach_expression.go
@@ -25,12 +25,6 @@ import (
func (checker *Checker) VisitAttachExpression(expression *ast.AttachExpression) Type {
- if !checker.Config.AttachmentsEnabled {
- checker.report(&AttachmentsNotEnabledError{
- Range: ast.NewRangeFromPositioned(checker.memoryGauge, expression),
- })
- }
-
attachment := expression.Attachment
baseExpression := expression.Base
diff --git a/sema/check_composite_declaration.go b/sema/check_composite_declaration.go
index fdcfc70531..9b201296cf 100644
--- a/sema/check_composite_declaration.go
+++ b/sema/check_composite_declaration.go
@@ -145,13 +145,6 @@ func (checker *Checker) VisitAttachmentDeclaration(declaration *ast.AttachmentDe
}
func (checker *Checker) visitAttachmentDeclaration(declaration *ast.AttachmentDeclaration) (_ struct{}) {
-
- if !checker.Config.AttachmentsEnabled {
- checker.report(&AttachmentsNotEnabledError{
- Range: ast.NewRangeFromPositioned(checker.memoryGauge, declaration),
- })
- }
-
checker.visitCompositeLikeDeclaration(declaration)
attachmentType := checker.Elaboration.CompositeDeclarationType(declaration)
checker.checkAttachmentMembersAccess(attachmentType)
diff --git a/sema/check_expression.go b/sema/check_expression.go
index 683c6bcfe6..caff4f0ee6 100644
--- a/sema/check_expression.go
+++ b/sema/check_expression.go
@@ -444,12 +444,6 @@ func (checker *Checker) checkTypeIndexingExpression(
targetExpression := indexExpression.TargetExpression
- if !checker.Config.AttachmentsEnabled {
- checker.report(&AttachmentsNotEnabledError{
- Range: ast.NewRangeFromPositioned(checker.memoryGauge, indexExpression),
- })
- }
-
expressionType := ast.ExpressionAsType(indexExpression.IndexingExpression)
if expressionType == nil {
return InvalidType
diff --git a/sema/check_remove_statement.go b/sema/check_remove_statement.go
index 6ac905ea74..bfb984ed22 100644
--- a/sema/check_remove_statement.go
+++ b/sema/check_remove_statement.go
@@ -25,12 +25,6 @@ import (
func (checker *Checker) VisitRemoveStatement(statement *ast.RemoveStatement) (_ struct{}) {
- if !checker.Config.AttachmentsEnabled {
- checker.report(&AttachmentsNotEnabledError{
- Range: ast.NewRangeFromPositioned(checker.memoryGauge, statement),
- })
- }
-
nominalType := checker.convertNominalType(statement.Attachment)
base := checker.VisitExpression(statement.Value, statement, nil)
checker.checkUnusedExpressionResourceLoss(base, statement.Value)
diff --git a/tests/checker/composite_test.go b/sema/composite_test.go
similarity index 99%
rename from tests/checker/composite_test.go
rename to sema/composite_test.go
index 241a6ce50b..dc6c8dc927 100644
--- a/tests/checker/composite_test.go
+++ b/sema/composite_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -29,6 +29,7 @@ import (
"github.com/onflow/cadence/errors"
"github.com/onflow/cadence/parser"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckInvalidCompositeRedeclaringType(t *testing.T) {
diff --git a/tests/checker/conditional_test.go b/sema/conditional_test.go
similarity index 97%
rename from tests/checker/conditional_test.go
rename to sema/conditional_test.go
index 733c3fade3..c4db51acd5 100644
--- a/tests/checker/conditional_test.go
+++ b/sema/conditional_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -25,6 +25,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckConditionalExpressionTest(t *testing.T) {
diff --git a/tests/checker/conditions_test.go b/sema/conditions_test.go
similarity index 99%
rename from tests/checker/conditions_test.go
rename to sema/conditions_test.go
index 4c240510c9..afcc7762fc 100644
--- a/tests/checker/conditions_test.go
+++ b/sema/conditions_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -26,6 +26,7 @@ import (
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckFunctionTestConditions(t *testing.T) {
diff --git a/sema/config.go b/sema/config.go
index 06f6e9ce95..1f22107539 100644
--- a/sema/config.go
+++ b/sema/config.go
@@ -53,6 +53,4 @@ type Config struct {
AllowNativeDeclarations bool
// AllowStaticDeclarations determines if declarations may be static
AllowStaticDeclarations bool
- // AttachmentsEnabled determines if attachments are enabled
- AttachmentsEnabled bool
}
diff --git a/tests/checker/conformance_test.go b/sema/conformance_test.go
similarity index 99%
rename from tests/checker/conformance_test.go
rename to sema/conformance_test.go
index 8bb29b7548..d2f873cab5 100644
--- a/tests/checker/conformance_test.go
+++ b/sema/conformance_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -27,6 +27,7 @@ import (
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/errors"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckEventNonTypeRequirementConformance(t *testing.T) {
diff --git a/tests/checker/contract_test.go b/sema/contract_test.go
similarity index 99%
rename from tests/checker/contract_test.go
rename to sema/contract_test.go
index 9bb97a50d0..e21b6d7873 100644
--- a/tests/checker/contract_test.go
+++ b/sema/contract_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -27,6 +27,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckInvalidContractAccountField(t *testing.T) {
diff --git a/tests/checker/crypto_test.go b/sema/crypto_test.go
similarity index 99%
rename from tests/checker/crypto_test.go
rename to sema/crypto_test.go
index 191183d7a4..e6f751395d 100644
--- a/tests/checker/crypto_test.go
+++ b/sema/crypto_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -27,6 +27,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckHashAlgorithmCases(t *testing.T) {
diff --git a/tests/checker/declaration_test.go b/sema/declaration_test.go
similarity index 99%
rename from tests/checker/declaration_test.go
rename to sema/declaration_test.go
index 6d7cfd6fdc..139ae9e332 100644
--- a/tests/checker/declaration_test.go
+++ b/sema/declaration_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -27,6 +27,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckConstantAndVariableDeclarations(t *testing.T) {
diff --git a/tests/checker/dictionary_test.go b/sema/dictionary_test.go
similarity index 95%
rename from tests/checker/dictionary_test.go
rename to sema/dictionary_test.go
index abb66fe3b8..edd9dd83cb 100644
--- a/tests/checker/dictionary_test.go
+++ b/sema/dictionary_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -25,6 +25,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckIncompleteDictionaryType(t *testing.T) {
diff --git a/tests/checker/dynamic_casting_test.go b/sema/dynamic_casting_test.go
similarity index 99%
rename from tests/checker/dynamic_casting_test.go
rename to sema/dynamic_casting_test.go
index ce7f2e38d7..da02975b35 100644
--- a/tests/checker/dynamic_casting_test.go
+++ b/sema/dynamic_casting_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -28,7 +28,8 @@ import (
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
var dynamicCastingOperations = []ast.Operation{
@@ -1206,7 +1207,7 @@ func TestCheckDynamicCastingCapability(t *testing.T) {
t.Parallel()
structType := &sema.CompositeType{
- Location: utils.TestLocation,
+ Location: TestLocation,
Identifier: "S",
Kind: common.CompositeKindStructure,
}
diff --git a/tests/checker/entitlements_test.go b/sema/entitlements_test.go
similarity index 99%
rename from tests/checker/entitlements_test.go
rename to sema/entitlements_test.go
index b546de5713..3b47df81b3 100644
--- a/tests/checker/entitlements_test.go
+++ b/sema/entitlements_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -27,6 +27,7 @@ import (
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckBasicEntitlementDeclaration(t *testing.T) {
diff --git a/tests/checker/entrypoint_test.go b/sema/entrypoint_test.go
similarity index 98%
rename from tests/checker/entrypoint_test.go
rename to sema/entrypoint_test.go
index 4bbba80238..e3bc9ab1a1 100644
--- a/tests/checker/entrypoint_test.go
+++ b/sema/entrypoint_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -24,6 +24,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckEntryPointParameters(t *testing.T) {
diff --git a/tests/checker/enum_test.go b/sema/enum_test.go
similarity index 98%
rename from tests/checker/enum_test.go
rename to sema/enum_test.go
index 671177fd5f..96d092297c 100644
--- a/tests/checker/enum_test.go
+++ b/sema/enum_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -27,6 +27,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckInvalidNonEnumCompositeEnumCases(t *testing.T) {
diff --git a/tests/checker/errors_test.go b/sema/error_handling_test.go
similarity index 96%
rename from tests/checker/errors_test.go
rename to sema/error_handling_test.go
index 33da8bc032..a7cb4923c2 100644
--- a/tests/checker/errors_test.go
+++ b/sema/error_handling_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -27,7 +27,8 @@ import (
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckErrorShortCircuiting(t *testing.T) {
@@ -81,7 +82,7 @@ func TestCheckErrorShortCircuiting(t *testing.T) {
access(all) let y = Y
`,
ParseAndCheckOptions{
- Location: utils.ImportedLocation,
+ Location: ImportedLocation,
Config: &sema.Config{
ErrorShortCircuitingEnabled: true,
},
diff --git a/sema/errors.go b/sema/errors.go
index 3686d9f185..96edbf076e 100644
--- a/sema/errors.go
+++ b/sema/errors.go
@@ -4639,22 +4639,6 @@ func (e *InvalidTypeIndexingError) Error() string {
)
}
-// AttachmentsNotEnabledError
-type AttachmentsNotEnabledError struct {
- ast.Range
-}
-
-var _ SemanticError = &AttachmentsNotEnabledError{}
-var _ errors.UserError = &AttachmentsNotEnabledError{}
-
-func (*AttachmentsNotEnabledError) isSemanticError() {}
-
-func (*AttachmentsNotEnabledError) IsUserError() {}
-
-func (e *AttachmentsNotEnabledError) Error() string {
- return "attachments are not enabled and cannot be used in this environment"
-}
-
// InvalidAttachmentEntitlementError
type InvalidAttachmentEntitlementError struct {
Attachment *CompositeType
diff --git a/tests/checker/events_test.go b/sema/events_test.go
similarity index 99%
rename from tests/checker/events_test.go
rename to sema/events_test.go
index bf140bb749..e3d6cdbbea 100644
--- a/tests/checker/events_test.go
+++ b/sema/events_test.go
@@ -16,22 +16,21 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
"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/sema"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckEventDeclaration(t *testing.T) {
@@ -296,7 +295,7 @@ func TestCheckEmitEvent(t *testing.T) {
access(all) event Transfer(to: Int, from: Int)
`,
ParseAndCheckOptions{
- Location: utils.ImportedLocation,
+ Location: ImportedLocation,
},
)
require.NoError(t, err)
diff --git a/tests/checker/external_mutation_test.go b/sema/external_mutation_test.go
similarity index 99%
rename from tests/checker/external_mutation_test.go
rename to sema/external_mutation_test.go
index bd56e9b039..96936fa073 100644
--- a/tests/checker/external_mutation_test.go
+++ b/sema/external_mutation_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -28,6 +28,7 @@ import (
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckArrayUpdateIndexAccess(t *testing.T) {
diff --git a/tests/checker/fixedpoint_test.go b/sema/fixedpoint_test.go
similarity index 99%
rename from tests/checker/fixedpoint_test.go
rename to sema/fixedpoint_test.go
index 2e7d514785..bb537432b8 100644
--- a/tests/checker/fixedpoint_test.go
+++ b/sema/fixedpoint_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -29,6 +29,7 @@ import (
"github.com/onflow/cadence/format"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckFixedPointLiteralTypeConversionInVariableDeclaration(t *testing.T) {
diff --git a/tests/checker/for_test.go b/sema/for_test.go
similarity index 99%
rename from tests/checker/for_test.go
rename to sema/for_test.go
index d2b6a231d5..7a92fc90a8 100644
--- a/tests/checker/for_test.go
+++ b/sema/for_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -28,6 +28,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckForVariableSized(t *testing.T) {
diff --git a/tests/checker/force_test.go b/sema/force_test.go
similarity index 97%
rename from tests/checker/force_test.go
rename to sema/force_test.go
index 2317ebc1fc..63b93013d8 100644
--- a/tests/checker/force_test.go
+++ b/sema/force_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -25,6 +25,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckForce(t *testing.T) {
diff --git a/tests/checker/function_expression_test.go b/sema/function_expression_test.go
similarity index 95%
rename from tests/checker/function_expression_test.go
rename to sema/function_expression_test.go
index 14f65c0e91..3ba5f2e6b4 100644
--- a/tests/checker/function_expression_test.go
+++ b/sema/function_expression_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -25,6 +25,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckInvalidFunctionExpressionReturnValue(t *testing.T) {
diff --git a/tests/checker/function_test.go b/sema/function_test.go
similarity index 99%
rename from tests/checker/function_test.go
rename to sema/function_test.go
index 88edcf9306..1f823f9a23 100644
--- a/tests/checker/function_test.go
+++ b/sema/function_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -28,6 +28,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/parser"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckReferenceInFunction(t *testing.T) {
diff --git a/sema/gen/golden_test.go b/sema/gen/golden_test.go
index bcb116fa0f..62555c9176 100644
--- a/sema/gen/golden_test.go
+++ b/sema/gen/golden_test.go
@@ -43,7 +43,7 @@ import (
_ "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"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestConstructor(t *testing.T) {
@@ -57,11 +57,11 @@ func TestConstructor(t *testing.T) {
Kind: common.DeclarationKindFunction,
})
- _, err := checker.ParseAndCheckWithOptions(t,
+ _, err := ParseAndCheckWithOptions(t,
`
let x = Foo(bar: 1)
`,
- checker.ParseAndCheckOptions{
+ ParseAndCheckOptions{
Config: &sema.Config{
BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation {
return baseValueActivation
@@ -83,11 +83,11 @@ func TestContract(t *testing.T) {
Kind: common.DeclarationKindContract,
})
- _, err := checker.ParseAndCheckWithOptions(t,
+ _, err := ParseAndCheckWithOptions(t,
`
let x = Test.Foo(bar: 1)
`,
- checker.ParseAndCheckOptions{
+ ParseAndCheckOptions{
Config: &sema.Config{
BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation {
return baseValueActivation
diff --git a/tests/checker/genericfunction_test.go b/sema/genericfunction_test.go
similarity index 99%
rename from tests/checker/genericfunction_test.go
rename to sema/genericfunction_test.go
index 0d8dc3e805..f88e9ac00a 100644
--- a/tests/checker/genericfunction_test.go
+++ b/sema/genericfunction_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -30,6 +30,7 @@ import (
"github.com/onflow/cadence/parser"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func parseAndCheckWithTestValue(t *testing.T, code string, ty sema.Type) (*sema.Checker, error) {
diff --git a/tests/checker/hashable_struct_test.go b/sema/hashable_struct_test.go
similarity index 95%
rename from tests/checker/hashable_struct_test.go
rename to sema/hashable_struct_test.go
index 4ae190201e..82875b9f95 100644
--- a/tests/checker/hashable_struct_test.go
+++ b/sema/hashable_struct_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -24,6 +24,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckHashableStruct(t *testing.T) {
diff --git a/tests/checker/if_test.go b/sema/if_test.go
similarity index 98%
rename from tests/checker/if_test.go
rename to sema/if_test.go
index 5681f8f111..6fd1e517c7 100644
--- a/tests/checker/if_test.go
+++ b/sema/if_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -25,6 +25,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckIfStatementTest(t *testing.T) {
diff --git a/tests/checker/import_test.go b/sema/import_test.go
similarity index 97%
rename from tests/checker/import_test.go
rename to sema/import_test.go
index bc586139c6..c5bf92d36e 100644
--- a/tests/checker/import_test.go
+++ b/sema/import_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -30,7 +30,8 @@ import (
"github.com/onflow/cadence/errors"
"github.com/onflow/cadence/parser"
"github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckInvalidImport(t *testing.T) {
@@ -56,7 +57,7 @@ func TestCheckRepeatedImport(t *testing.T) {
access(all) let y = 2
`,
ParseAndCheckOptions{
- Location: utils.ImportedLocation,
+ Location: ImportedLocation,
},
)
require.NoError(t, err)
@@ -169,7 +170,7 @@ func TestCheckInvalidRepeatedImport(t *testing.T) {
access(all) let x = 1
`,
ParseAndCheckOptions{
- Location: utils.ImportedLocation,
+ Location: ImportedLocation,
},
)
@@ -287,7 +288,7 @@ func TestCheckImportAll(t *testing.T) {
}
`,
ParseAndCheckOptions{
- Location: utils.ImportedLocation,
+ Location: ImportedLocation,
},
)
@@ -322,7 +323,7 @@ func TestCheckInvalidImportUnexported(t *testing.T) {
access(all) let x = 1
`,
ParseAndCheckOptions{
- Location: utils.ImportedLocation,
+ Location: ImportedLocation,
},
)
@@ -363,7 +364,7 @@ func TestCheckImportSome(t *testing.T) {
access(all) let x = 1
`,
ParseAndCheckOptions{
- Location: utils.ImportedLocation,
+ Location: ImportedLocation,
},
)
@@ -446,7 +447,7 @@ func TestCheckImportTypes(t *testing.T) {
body,
),
ParseAndCheckOptions{
- Location: utils.ImportedLocation,
+ Location: ImportedLocation,
},
)
@@ -552,7 +553,7 @@ func TestCheckInvalidImportCycleSelf(t *testing.T) {
return err
}
- err = check(code, utils.TestLocation)
+ err = check(code, TestLocation)
errs := RequireCheckerErrors(t, err, 1)
@@ -739,7 +740,7 @@ func TestCheckImportContract(t *testing.T) {
}
}`,
ParseAndCheckOptions{
- Location: utils.ImportedLocation,
+ Location: ImportedLocation,
},
)
@@ -787,7 +788,7 @@ func TestCheckImportContract(t *testing.T) {
}
}`,
ParseAndCheckOptions{
- Location: utils.ImportedLocation,
+ Location: ImportedLocation,
},
)
diff --git a/tests/checker/indexing_test.go b/sema/indexing_test.go
similarity index 98%
rename from tests/checker/indexing_test.go
rename to sema/indexing_test.go
index 1e9bef01e1..1979e67610 100644
--- a/tests/checker/indexing_test.go
+++ b/sema/indexing_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -25,6 +25,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckArrayIndexingWithInteger(t *testing.T) {
diff --git a/tests/checker/initialization_test.go b/sema/initialization_test.go
similarity index 99%
rename from tests/checker/initialization_test.go
rename to sema/initialization_test.go
index 48242a9b6c..a4656a2e3c 100644
--- a/tests/checker/initialization_test.go
+++ b/sema/initialization_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -25,6 +25,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
// TODO: test multiple initializers once overloading is supported
diff --git a/tests/checker/integer_test.go b/sema/integer_test.go
similarity index 99%
rename from tests/checker/integer_test.go
rename to sema/integer_test.go
index 798b168393..5f53f7b0ed 100644
--- a/tests/checker/integer_test.go
+++ b/sema/integer_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -28,6 +28,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
var allIntegerTypesAndAddressType = common.Concat(
diff --git a/tests/checker/interface_test.go b/sema/interface_test.go
similarity index 96%
rename from tests/checker/interface_test.go
rename to sema/interface_test.go
index d0943d0fb0..48fc511f4a 100644
--- a/tests/checker/interface_test.go
+++ b/sema/interface_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -27,11 +27,8 @@ import (
"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"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func constructorArguments(compositeKind common.CompositeKind) string {
@@ -1630,128 +1627,6 @@ func TestCheckInvalidTypeRequirementDeclaration(t *testing.T) {
})
}
-// TODO: re-enable this test with the v2 fungible token contract
-/* func TestCheckContractInterfaceFungibleToken(t *testing.T) {
-
- t.Parallel()
-
- const code = examples.FungibleTokenContractInterface
-
- _, err := ParseAndCheck(t, code)
- require.NoError(t, err)
-} */
-
-// TODO: re-enable this test with the v2 fungible token contract
-/* func TestCheckContractInterfaceFungibleTokenConformance(t *testing.T) {
-
- t.Parallel()
-
- code := examples.FungibleTokenContractInterface + "\n" + examples.ExampleFungibleTokenContract
-
- _, err := ParseAndCheckWithPanic(t, code)
- require.NoError(t, err)
-} */
-
-func BenchmarkContractInterfaceFungibleToken(b *testing.B) {
-
- const code = examples.FungibleTokenContractInterface
-
- program, err := parser.ParseProgram(nil, []byte(code), parser.Config{})
- if err != nil {
- b.Fatal(err)
- }
-
- b.ReportAllocs()
- b.ResetTimer()
-
- for i := 0; i < b.N; i++ {
- checker, err := sema.NewChecker(
- program,
- TestLocation,
- nil,
- &sema.Config{
- AccessCheckMode: sema.AccessCheckModeNotSpecifiedUnrestricted,
- },
- )
- if err != nil {
- b.Fatal(err)
- }
- err = checker.Check()
- if err != nil {
- b.Fatal(err)
- }
- }
-}
-
-func BenchmarkCheckContractInterfaceFungibleTokenConformance(b *testing.B) {
-
- code := examples.FungibleTokenContractInterface + "\n" + examples.ExampleFungibleTokenContract
-
- program, err := parser.ParseProgram(nil, []byte(code), parser.Config{})
- if err != nil {
- b.Fatal(err)
- }
-
- baseValueActivation := sema.NewVariableActivation(sema.BaseValueActivation)
- baseValueActivation.DeclareValue(stdlib.PanicFunction)
-
- config := &sema.Config{
- AccessCheckMode: sema.AccessCheckModeNotSpecifiedUnrestricted,
- BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation {
- return baseValueActivation
- },
- }
-
- b.ReportAllocs()
- b.ResetTimer()
-
- for i := 0; i < b.N; i++ {
- checker, err := sema.NewChecker(
- program,
- TestLocation,
- nil,
- config,
- )
- if err != nil {
- b.Fatal(err)
- }
- err = checker.Check()
- if err != nil {
- b.Fatal(err)
- }
- }
-}
-
-// TODO: re-enable this test with the v2 fungible token contract
-/* func TestCheckContractInterfaceFungibleTokenUse(t *testing.T) {
-
- t.Parallel()
-
- code := examples.FungibleTokenContractInterface + "\n" +
- examples.ExampleFungibleTokenContract + "\n" + `
-
- fun test(): Int {
- let publisher <- ExampleToken.sprout(balance: 100)
- let receiver <- ExampleToken.sprout(balance: 0)
-
- let withdrawn <- publisher.withdraw(amount: 60)
- receiver.deposit(vault: <-withdrawn)
-
- let publisherBalance = publisher.balance
- let receiverBalance = receiver.balance
-
- destroy publisher
- destroy receiver
-
- return receiverBalance
- }
- `
-
- _, err := ParseAndCheckWithPanic(t, code)
-
- require.NoError(t, err)
-} */
-
// TestCheckInvalidInterfaceUseAsTypeSuggestion tests that an interface
// can not be used as a type, and the suggestion to fix it is correct
func TestCheckInvalidInterfaceUseAsTypeSuggestion(t *testing.T) {
diff --git a/tests/checker/intersection_test.go b/sema/intersection_test.go
similarity index 99%
rename from tests/checker/intersection_test.go
rename to sema/intersection_test.go
index ee3b8bf94e..e0965d843a 100644
--- a/tests/checker/intersection_test.go
+++ b/sema/intersection_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -26,6 +26,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckIntersectionType(t *testing.T) {
diff --git a/tests/checker/invalid_test.go b/sema/invalid_test.go
similarity index 98%
rename from tests/checker/invalid_test.go
rename to sema/invalid_test.go
index b5f058e34c..51ea254984 100644
--- a/tests/checker/invalid_test.go
+++ b/sema/invalid_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -24,6 +24,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckSpuriousIdentifierAssignmentInvalidValueTypeMismatch(t *testing.T) {
diff --git a/tests/checker/invocation_test.go b/sema/invocation_test.go
similarity index 97%
rename from tests/checker/invocation_test.go
rename to sema/invocation_test.go
index ded43f11ae..1d0543b2cb 100644
--- a/tests/checker/invocation_test.go
+++ b/sema/invocation_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -28,7 +28,8 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckInvalidFunctionCallWithTooFewArguments(t *testing.T) {
@@ -374,7 +375,7 @@ func TestCheckArgumentLabels(t *testing.T) {
fun test(foo bar: Int, baz: String) {}
`,
ParseAndCheckOptions{
- Location: utils.ImportedLocation,
+ Location: ImportedLocation,
},
)
@@ -435,7 +436,7 @@ func TestCheckArgumentLabels(t *testing.T) {
}
`,
ParseAndCheckOptions{
- Location: utils.ImportedLocation,
+ Location: ImportedLocation,
},
)
@@ -496,7 +497,7 @@ func TestCheckArgumentLabels(t *testing.T) {
}
`,
ParseAndCheckOptions{
- Location: utils.ImportedLocation,
+ Location: ImportedLocation,
},
)
@@ -561,7 +562,7 @@ func TestCheckArgumentLabels(t *testing.T) {
}
`,
ParseAndCheckOptions{
- Location: utils.ImportedLocation,
+ Location: ImportedLocation,
},
)
diff --git a/tests/checker/member_test.go b/sema/member_test.go
similarity index 99%
rename from tests/checker/member_test.go
rename to sema/member_test.go
index c2778c7c18..9d8706dbbe 100644
--- a/tests/checker/member_test.go
+++ b/sema/member_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -27,6 +27,7 @@ import (
"github.com/onflow/cadence/interpreter"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckOptionalChainingNonOptionalFieldRead(t *testing.T) {
diff --git a/tests/checker/metatype_test.go b/sema/metatype_test.go
similarity index 99%
rename from tests/checker/metatype_test.go
rename to sema/metatype_test.go
index cb9c5c1b7c..3f5455b0a0 100644
--- a/tests/checker/metatype_test.go
+++ b/sema/metatype_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -25,6 +25,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckMetaType(t *testing.T) {
diff --git a/tests/checker/move_test.go b/sema/move_test.go
similarity index 97%
rename from tests/checker/move_test.go
rename to sema/move_test.go
index 848fc6c6e7..d772f2f293 100644
--- a/tests/checker/move_test.go
+++ b/sema/move_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -24,6 +24,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckInvalidMoves(t *testing.T) {
diff --git a/tests/checker/nesting_test.go b/sema/nesting_test.go
similarity index 99%
rename from tests/checker/nesting_test.go
rename to sema/nesting_test.go
index 40ec6ab6e9..cd0cd659cf 100644
--- a/tests/checker/nesting_test.go
+++ b/sema/nesting_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -29,6 +29,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckCompositeDeclarationNesting(t *testing.T) {
diff --git a/tests/checker/never_test.go b/sema/never_test.go
similarity index 98%
rename from tests/checker/never_test.go
rename to sema/never_test.go
index 59c62020cc..ee3ba85b1c 100644
--- a/tests/checker/never_test.go
+++ b/sema/never_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -25,6 +25,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckNever(t *testing.T) {
diff --git a/tests/checker/nil_coalescing_test.go b/sema/nil_coalescing_test.go
similarity index 98%
rename from tests/checker/nil_coalescing_test.go
rename to sema/nil_coalescing_test.go
index 78a79677c0..2e6d505cfb 100644
--- a/tests/checker/nil_coalescing_test.go
+++ b/sema/nil_coalescing_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -25,6 +25,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckNilCoalescingNilIntToOptional(t *testing.T) {
diff --git a/tests/utils/occurrence_matcher.go b/sema/occurrence_matcher_test.go
similarity index 98%
rename from tests/utils/occurrence_matcher.go
rename to sema/occurrence_matcher_test.go
index 830af59c65..1f672755ac 100644
--- a/tests/utils/occurrence_matcher.go
+++ b/sema/occurrence_matcher_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package utils
+package sema_test
import (
"github.com/onflow/cadence/common"
diff --git a/tests/checker/occurrences_test.go b/sema/occurrences_test.go
similarity index 99%
rename from tests/checker/occurrences_test.go
rename to sema/occurrences_test.go
index 462bb1e770..cb4454e170 100644
--- a/tests/checker/occurrences_test.go
+++ b/sema/occurrences_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -26,7 +26,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
// TODO: implement occurrences for type references
diff --git a/tests/checker/operations_test.go b/sema/operations_test.go
similarity index 99%
rename from tests/checker/operations_test.go
rename to sema/operations_test.go
index 3a198b4004..319e3ee5f3 100644
--- a/tests/checker/operations_test.go
+++ b/sema/operations_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -30,6 +30,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckInvalidUnaryBooleanNegationOfInteger(t *testing.T) {
diff --git a/tests/checker/optional_test.go b/sema/optional_test.go
similarity index 99%
rename from tests/checker/optional_test.go
rename to sema/optional_test.go
index e502aa9f26..98e797855e 100644
--- a/tests/checker/optional_test.go
+++ b/sema/optional_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -27,6 +27,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckOptional(t *testing.T) {
diff --git a/tests/checker/overloading_test.go b/sema/overloading_test.go
similarity index 96%
rename from tests/checker/overloading_test.go
rename to sema/overloading_test.go
index d78bc4ba9b..dfe464e1b9 100644
--- a/tests/checker/overloading_test.go
+++ b/sema/overloading_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -26,6 +26,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckInvalidCompositeInitializerOverloading(t *testing.T) {
diff --git a/tests/checker/path_test.go b/sema/path_test.go
similarity index 98%
rename from tests/checker/path_test.go
rename to sema/path_test.go
index c21e313830..5aceafd85e 100644
--- a/tests/checker/path_test.go
+++ b/sema/path_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -27,6 +27,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckPath(t *testing.T) {
diff --git a/tests/checker/pragma_test.go b/sema/pragma_test.go
similarity index 98%
rename from tests/checker/pragma_test.go
rename to sema/pragma_test.go
index 087ea1926a..1ee6e070bb 100644
--- a/tests/checker/pragma_test.go
+++ b/sema/pragma_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -26,6 +26,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckPragmaExpression(t *testing.T) {
diff --git a/tests/checker/predeclaredvalues_test.go b/sema/predeclaredvalues_test.go
similarity index 95%
rename from tests/checker/predeclaredvalues_test.go
rename to sema/predeclaredvalues_test.go
index 1ebcfb7d14..046ea7435a 100644
--- a/tests/checker/predeclaredvalues_test.go
+++ b/sema/predeclaredvalues_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -26,6 +26,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckPredeclaredValues(t *testing.T) {
diff --git a/tests/checker/purity_test.go b/sema/purity_test.go
similarity index 99%
rename from tests/checker/purity_test.go
rename to sema/purity_test.go
index 16914158f5..76a79255d9 100644
--- a/tests/checker/purity_test.go
+++ b/sema/purity_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -26,6 +26,7 @@ import (
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckPuritySubtyping(t *testing.T) {
diff --git a/tests/checker/range_test.go b/sema/range_test.go
similarity index 97%
rename from tests/checker/range_test.go
rename to sema/range_test.go
index d72c798855..94919757fd 100644
--- a/tests/checker/range_test.go
+++ b/sema/range_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"strings"
@@ -27,7 +27,8 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckRange(t *testing.T) {
@@ -95,7 +96,7 @@ func TestCheckRange(t *testing.T) {
// assert that the unordered repr of expected matches that of ranges
assertSetsEqual := func(t *testing.T, expected []sema.Range, ranges map[sema.Range]int) {
bag := getCounts(expected)
- utils.AssertEqualWithDiff(t, bag, ranges)
+ AssertEqualWithDiff(t, bag, ranges)
}
barTypeVariable, ok := checker.Elaboration.GetGlobalType("_TEST_Bar")
diff --git a/tests/checker/range_value_test.go b/sema/range_value_test.go
similarity index 99%
rename from tests/checker/range_value_test.go
rename to sema/range_value_test.go
index f93fd5a9c9..12929896b5 100644
--- a/tests/checker/range_value_test.go
+++ b/sema/range_value_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -28,6 +28,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
type inclusiveRangeConstructionTest struct {
diff --git a/tests/checker/reference_test.go b/sema/reference_test.go
similarity index 99%
rename from tests/checker/reference_test.go
rename to sema/reference_test.go
index ef4b92f33b..0914180f30 100644
--- a/tests/checker/reference_test.go
+++ b/sema/reference_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -28,7 +28,8 @@ import (
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckReference(t *testing.T) {
@@ -1066,7 +1067,7 @@ func TestCheckReferenceExpressionReferenceType(t *testing.T) {
refValueType := RequireGlobalValue(t, checker.Elaboration, "ref")
xType := RequireGlobalType(t, checker.Elaboration, "X").(*sema.EntitlementType)
- var access sema.Access = sema.UnauthorizedAccess
+ var access = sema.UnauthorizedAccess
if !auth.Equal(sema.UnauthorizedAccess) {
access = sema.NewEntitlementSetAccess([]*sema.EntitlementType{xType}, sema.Conjunction)
}
@@ -1088,7 +1089,7 @@ func TestCheckReferenceExpressionReferenceType(t *testing.T) {
for _, auth := range []sema.Access{
sema.UnauthorizedAccess,
sema.NewEntitlementSetAccess([]*sema.EntitlementType{{
- Location: utils.TestLocation,
+ Location: TestLocation,
Identifier: "X",
}}, sema.Conjunction),
} {
@@ -1929,7 +1930,7 @@ func TestCheckInvalidatedReferenceUse(t *testing.T) {
}
`,
ParseAndCheckOptions{
- Location: utils.ImportedLocation,
+ Location: ImportedLocation,
},
)
diff --git a/tests/checker/resources_test.go b/sema/resource_test.go
similarity index 99%
rename from tests/checker/resources_test.go
rename to sema/resource_test.go
index 050a117a56..f46d1d08a7 100644
--- a/tests/checker/resources_test.go
+++ b/sema/resource_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -25,11 +25,13 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
+ . "github.com/onflow/cadence/test_utils/sema_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"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func TestCheckFailableCastingWithResourceAnnotation(t *testing.T) {
diff --git a/tests/checker/return_test.go b/sema/return_test.go
similarity index 99%
rename from tests/checker/return_test.go
rename to sema/return_test.go
index 32b5cf4593..61f7f54835 100644
--- a/tests/checker/return_test.go
+++ b/sema/return_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -28,6 +28,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckInvalidReturnValue(t *testing.T) {
diff --git a/tests/checker/rlp_test.go b/sema/rlp_test.go
similarity index 97%
rename from tests/checker/rlp_test.go
rename to sema/rlp_test.go
index 2f77cb0708..216c1829fb 100644
--- a/tests/checker/rlp_test.go
+++ b/sema/rlp_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -26,6 +26,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckRLPDecodeString(t *testing.T) {
diff --git a/tests/checker/runtimetype_test.go b/sema/runtimetype_test.go
similarity index 99%
rename from tests/checker/runtimetype_test.go
rename to sema/runtimetype_test.go
index 7ee3c911e3..22a46b6248 100644
--- a/tests/checker/runtimetype_test.go
+++ b/sema/runtimetype_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -25,6 +25,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckOptionalTypeConstructor(t *testing.T) {
diff --git a/tests/checker/storable_test.go b/sema/storable_test.go
similarity index 99%
rename from tests/checker/storable_test.go
rename to sema/storable_test.go
index 5aac22ecfe..23c0b96722 100644
--- a/tests/checker/storable_test.go
+++ b/sema/storable_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -29,6 +29,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckStorable(t *testing.T) {
@@ -47,7 +48,6 @@ func TestCheckStorable(t *testing.T) {
BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation {
return baseValueActivation
},
- AttachmentsEnabled: true,
},
},
)
diff --git a/tests/checker/string_test.go b/sema/string_test.go
similarity index 99%
rename from tests/checker/string_test.go
rename to sema/string_test.go
index 620ea67fb5..cc46bc786d 100644
--- a/tests/checker/string_test.go
+++ b/sema/string_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -25,6 +25,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckCharacter(t *testing.T) {
diff --git a/tests/checker/swap_test.go b/sema/swap_test.go
similarity index 99%
rename from tests/checker/swap_test.go
rename to sema/swap_test.go
index 28e708aceb..9f39ffdff5 100644
--- a/tests/checker/swap_test.go
+++ b/sema/swap_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"fmt"
@@ -26,6 +26,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckInvalidUnknownDeclarationSwap(t *testing.T) {
diff --git a/tests/checker/switch_test.go b/sema/switch_test.go
similarity index 99%
rename from tests/checker/switch_test.go
rename to sema/switch_test.go
index 0f34d0a506..197e1dd5d5 100644
--- a/tests/checker/switch_test.go
+++ b/sema/switch_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -25,6 +25,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckSwitchStatementTest(t *testing.T) {
diff --git a/tests/checker/transactions_test.go b/sema/transactions_test.go
similarity index 99%
rename from tests/checker/transactions_test.go
rename to sema/transactions_test.go
index 2dfde9d8c8..dd80079ecd 100644
--- a/tests/checker/transactions_test.go
+++ b/sema/transactions_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -25,6 +25,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckTransactions(t *testing.T) {
diff --git a/tests/checker/type_inference_test.go b/sema/type_inference_test.go
similarity index 99%
rename from tests/checker/type_inference_test.go
rename to sema/type_inference_test.go
index 6aa900a98e..db3dcb247d 100644
--- a/tests/checker/type_inference_test.go
+++ b/sema/type_inference_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -26,6 +26,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckArrayElementTypeInference(t *testing.T) {
diff --git a/tests/checker/typeargument_test.go b/sema/typeargument_test.go
similarity index 99%
rename from tests/checker/typeargument_test.go
rename to sema/typeargument_test.go
index 5c03e2794a..cbb85a5ff5 100644
--- a/tests/checker/typeargument_test.go
+++ b/sema/typeargument_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -27,6 +27,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckTypeArguments(t *testing.T) {
diff --git a/tests/checker/utils_test.go b/sema/utils_test.go
similarity index 96%
rename from tests/checker/utils_test.go
rename to sema/utils_test.go
index 5aa262f30d..f19512f82b 100644
--- a/tests/checker/utils_test.go
+++ b/sema/utils_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -24,6 +24,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func ParseAndCheckWithPanic(t *testing.T, code string) (*sema.Checker, error) {
diff --git a/tests/checker/while_test.go b/sema/while_test.go
similarity index 97%
rename from tests/checker/while_test.go
rename to sema/while_test.go
index a6eaa55230..3922b94315 100644
--- a/tests/checker/while_test.go
+++ b/sema/while_test.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_test
import (
"testing"
@@ -24,6 +24,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/onflow/cadence/sema"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func TestCheckInvalidWhileTest(t *testing.T) {
diff --git a/stdlib/account_test.go b/stdlib/account_test.go
index 0fbd4f1164..2429663cc2 100644
--- a/stdlib/account_test.go
+++ b/stdlib/account_test.go
@@ -25,7 +25,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func TestSemaCheckPathLiteralForInternalStorageDomains(t *testing.T) {
@@ -75,7 +75,7 @@ func TestCanBorrow(t *testing.T) {
`)
typeID := func(qualifiedIdentifier string) sema.TypeID {
- return utils.TestLocation.TypeID(nil, qualifiedIdentifier)
+ return TestLocation.TypeID(nil, qualifiedIdentifier)
}
entitlementE := inter.Program.Elaboration.EntitlementType(typeID("E"))
diff --git a/stdlib/builtin_test.go b/stdlib/builtin_test.go
index 676603eaa5..9ac63b1ff5 100644
--- a/stdlib/builtin_test.go
+++ b/stdlib/builtin_test.go
@@ -21,17 +21,16 @@ package stdlib
import (
"testing"
- "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/activations"
+ "github.com/onflow/cadence/common"
"github.com/onflow/cadence/interpreter"
"github.com/onflow/cadence/parser"
"github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func newUnmeteredInMemoryStorage() interpreter.InMemoryStorage {
@@ -53,7 +52,7 @@ func newInterpreter(t *testing.T, code string, valueDeclarations ...StandardLibr
checker, err := sema.NewChecker(
program,
- utils.TestLocation,
+ TestLocation,
nil,
&sema.Config{
BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation {
@@ -100,9 +99,9 @@ func TestCheckAssert(t *testing.T) {
baseValueActivation.DeclareValue(AssertFunction)
parseAndCheck := func(t *testing.T, code string) (*sema.Checker, error) {
- return checker.ParseAndCheckWithOptions(t,
+ return ParseAndCheckWithOptions(t,
code,
- checker.ParseAndCheckOptions{
+ ParseAndCheckOptions{
Config: &sema.Config{
BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation {
return baseValueActivation
@@ -116,7 +115,7 @@ func TestCheckAssert(t *testing.T) {
_, err := parseAndCheck(t, `let _ = assert()`)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, errs[0], &sema.InsufficientArgumentsError{})
})
@@ -124,7 +123,7 @@ func TestCheckAssert(t *testing.T) {
_, err := parseAndCheck(t, `let _ = assert(1)`)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, errs[0], &sema.TypeMismatchError{})
})
@@ -146,7 +145,7 @@ func TestCheckAssert(t *testing.T) {
_, err := parseAndCheck(t, `let _ = assert(true, message: 1)`)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, errs[0], &sema.TypeMismatchError{})
})
@@ -154,7 +153,7 @@ func TestCheckAssert(t *testing.T) {
_, err := parseAndCheck(t, `let _ = assert(true, "")`)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, errs[0], &sema.MissingArgumentLabelError{})
})
@@ -162,7 +161,7 @@ func TestCheckAssert(t *testing.T) {
_, err := parseAndCheck(t, `let _ = assert(true, message: "foo", true)`)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, errs[0], &sema.ExcessiveArgumentsError{})
})
}
@@ -184,7 +183,7 @@ func TestInterpretAssert(t *testing.T) {
Err: AssertionError{
Message: "oops",
},
- Location: utils.TestLocation,
+ Location: TestLocation,
},
err,
)
@@ -195,7 +194,7 @@ func TestInterpretAssert(t *testing.T) {
Err: AssertionError{
Message: "",
},
- Location: utils.TestLocation,
+ Location: TestLocation,
},
err)
@@ -218,9 +217,9 @@ func TestCheckPanic(t *testing.T) {
baseValueActivation.DeclareValue(PanicFunction)
parseAndCheck := func(t *testing.T, code string) (*sema.Checker, error) {
- return checker.ParseAndCheckWithOptions(t,
+ return ParseAndCheckWithOptions(t,
code,
- checker.ParseAndCheckOptions{
+ ParseAndCheckOptions{
Config: &sema.Config{
BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation {
return baseValueActivation
@@ -234,7 +233,7 @@ func TestCheckPanic(t *testing.T) {
_, err := parseAndCheck(t, `let _ = panic()`)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, errs[0], &sema.InsufficientArgumentsError{})
})
@@ -250,7 +249,7 @@ func TestCheckPanic(t *testing.T) {
_, err := parseAndCheck(t, `let _ = panic(true)`)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, errs[0], &sema.TypeMismatchError{})
})
@@ -258,7 +257,7 @@ func TestCheckPanic(t *testing.T) {
_, err := parseAndCheck(t, `let _ = panic("test", 1)`)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
require.IsType(t, errs[0], &sema.ExcessiveArgumentsError{})
})
}
@@ -278,7 +277,7 @@ func TestInterpretPanic(t *testing.T) {
Err: PanicError{
Message: "oops",
},
- Location: utils.TestLocation,
+ Location: TestLocation,
},
err,
)
diff --git a/stdlib/cadence_v0.42_to_v1_contract_upgrade_validation_test.go b/stdlib/cadence_v0.42_to_v1_contract_upgrade_validation_test.go
index 0fa29ad911..3aa074687b 100644
--- a/stdlib/cadence_v0.42_to_v1_contract_upgrade_validation_test.go
+++ b/stdlib/cadence_v0.42_to_v1_contract_upgrade_validation_test.go
@@ -33,8 +33,8 @@ import (
"github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
- "github.com/onflow/cadence/tests/runtime_utils"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/runtime_utils"
)
func testContractUpdate(t *testing.T, oldCode string, newCode string) error {
@@ -46,11 +46,10 @@ func testContractUpdate(t *testing.T, oldCode string, newCode string) error {
checker, err := sema.NewChecker(
newProgram,
- utils.TestLocation,
+ TestLocation,
nil,
&sema.Config{
- AccessCheckMode: sema.AccessCheckModeStrict,
- AttachmentsEnabled: true,
+ AccessCheckMode: sema.AccessCheckModeStrict,
})
require.NoError(t, err)
@@ -60,13 +59,13 @@ func testContractUpdate(t *testing.T, oldCode string, newCode string) error {
program := interpreter.ProgramFromChecker(checker)
upgradeValidator := stdlib.NewCadenceV042ToV1ContractUpdateValidator(
- utils.TestLocation,
+ TestLocation,
"Test",
- &runtime_utils.TestRuntimeInterface{},
+ &TestRuntimeInterface{},
oldProgram,
program,
map[common.Location]*sema.Elaboration{
- utils.TestLocation: checker.Elaboration,
+ TestLocation: checker.Elaboration,
})
return upgradeValidator.Validate()
}
@@ -88,7 +87,7 @@ func testContractUpdateWithImports(
upgradeValidator := stdlib.NewCadenceV042ToV1ContractUpdateValidator(
location,
contractName,
- &runtime_utils.TestRuntimeInterface{
+ &TestRuntimeInterface{
OnGetAccountContractNames: func(address runtime.Address) ([]string, error) {
return []string{"TestImport"}, nil
},
@@ -130,8 +129,7 @@ func parseAndCheckPrograms(
location,
nil,
&sema.Config{
- AccessCheckMode: sema.AccessCheckModeStrict,
- AttachmentsEnabled: true,
+ AccessCheckMode: sema.AccessCheckModeStrict,
},
)
@@ -171,7 +169,6 @@ func parseAndCheckPrograms(
return
},
- AttachmentsEnabled: true,
})
require.NoError(t, err)
@@ -747,7 +744,7 @@ func TestContractUpgradeFieldType(t *testing.T) {
upgradeValidator := stdlib.NewCadenceV042ToV1ContractUpdateValidator(
location,
contractName,
- &runtime_utils.TestRuntimeInterface{
+ &TestRuntimeInterface{
OnGetAccountContractNames: func(address runtime.Address) ([]string, error) {
return []string{"TestImport"}, nil
},
@@ -821,7 +818,7 @@ func TestContractUpgradeFieldType(t *testing.T) {
upgradeValidator := stdlib.NewCadenceV042ToV1ContractUpdateValidator(
location,
contractName,
- &runtime_utils.TestRuntimeInterface{
+ &TestRuntimeInterface{
OnGetAccountContractNames: func(address runtime.Address) ([]string, error) {
return []string{"TestImport"}, nil
},
@@ -899,7 +896,7 @@ func TestContractUpgradeFieldType(t *testing.T) {
upgradeValidator := stdlib.NewCadenceV042ToV1ContractUpdateValidator(
location,
contractName,
- &runtime_utils.TestRuntimeInterface{
+ &TestRuntimeInterface{
OnGetAccountContractNames: func(address runtime.Address) ([]string, error) {
return []string{"TestImport"}, nil
},
@@ -922,7 +919,7 @@ func TestContractUpgradeFieldType(t *testing.T) {
// This should be an error.
// If there are custom rules, they MUST be followed.
- utils.RequireError(t, err)
+ RequireError(t, err)
cause := getSingleContractUpdateErrorCause(t, err, "Test")
var fieldMismatchError *stdlib.FieldMismatchError
@@ -1034,7 +1031,7 @@ func TestContractUpgradeFieldType(t *testing.T) {
upgradeValidator := stdlib.NewCadenceV042ToV1ContractUpdateValidator(
location,
contractName,
- &runtime_utils.TestRuntimeInterface{
+ &TestRuntimeInterface{
OnGetAccountContractNames: func(address runtime.Address) ([]string, error) {
return []string{"TestImport"}, nil
},
@@ -1164,7 +1161,7 @@ func TestContractUpgradeFieldType(t *testing.T) {
upgradeValidator := stdlib.NewCadenceV042ToV1ContractUpdateValidator(
location,
contractName,
- &runtime_utils.TestRuntimeInterface{
+ &TestRuntimeInterface{
OnGetAccountContractNames: func(address runtime.Address) ([]string, error) {
return []string{"TestImport"}, nil
},
@@ -1260,7 +1257,7 @@ func TestContractUpgradeFieldType(t *testing.T) {
upgradeValidator := stdlib.NewCadenceV042ToV1ContractUpdateValidator(
location,
contractName,
- &runtime_utils.TestRuntimeInterface{
+ &TestRuntimeInterface{
OnGetAccountContractNames: func(address runtime.Address) ([]string, error) {
return []string{"TestImport"}, nil
},
@@ -2446,7 +2443,7 @@ func TestInterfaceConformanceChange(t *testing.T) {
upgradeValidator := stdlib.NewCadenceV042ToV1ContractUpdateValidator(
location,
contractName,
- &runtime_utils.TestRuntimeInterface{
+ &TestRuntimeInterface{
OnGetAccountContractNames: func(address runtime.Address) ([]string, error) {
return []string{"TestImport"}, nil
},
@@ -2531,7 +2528,7 @@ func TestInterfaceConformanceChange(t *testing.T) {
upgradeValidator := stdlib.NewCadenceV042ToV1ContractUpdateValidator(
location,
contractName,
- &runtime_utils.TestRuntimeInterface{
+ &TestRuntimeInterface{
OnGetAccountContractNames: func(address runtime.Address) ([]string, error) {
return []string{"TestImport"}, nil
},
@@ -2605,7 +2602,7 @@ func TestInterfaceConformanceChange(t *testing.T) {
upgradeValidator := stdlib.NewCadenceV042ToV1ContractUpdateValidator(
location,
contractName,
- &runtime_utils.TestRuntimeInterface{
+ &TestRuntimeInterface{
OnGetAccountContractNames: func(address runtime.Address) ([]string, error) {
return []string{"TestImport"}, nil
},
@@ -2629,7 +2626,7 @@ func TestInterfaceConformanceChange(t *testing.T) {
// This should be an error.
// If there are custom rules, they MUST be followed.
- utils.RequireError(t, err)
+ RequireError(t, err)
cause := getSingleContractUpdateErrorCause(t, err, "Test")
var conformanceMismatchError *stdlib.ConformanceMismatchError
@@ -2745,7 +2742,7 @@ func TestEnumUpdates(t *testing.T) {
`
err := testContractUpdate(t, oldCode, newCode)
- utils.RequireError(t, err)
+ RequireError(t, err)
cause := getSingleContractUpdateErrorCause(t, err, "Test")
var conformanceMismatchError *stdlib.ConformanceMismatchError
@@ -2776,7 +2773,7 @@ func TestEnumUpdates(t *testing.T) {
`
err := testContractUpdate(t, oldCode, newCode)
- utils.RequireError(t, err)
+ RequireError(t, err)
cause := getSingleContractUpdateErrorCause(t, err, "Test")
var missingEnumCasesError *stdlib.MissingEnumCasesError
diff --git a/stdlib/contracts/crypto.cdc b/stdlib/contracts/crypto.cdc
deleted file mode 100644
index a8c50dcdfe..0000000000
--- a/stdlib/contracts/crypto.cdc
+++ /dev/null
@@ -1,177 +0,0 @@
-
-access(all) contract Crypto {
-
- access(all)
- fun hash(_ data: [UInt8], algorithm: HashAlgorithm): [UInt8] {
- return algorithm.hash(data)
- }
-
- access(all)
- fun hashWithTag(_ data: [UInt8], tag: String, algorithm: HashAlgorithm): [UInt8] {
- return algorithm.hashWithTag(data, tag: tag)
- }
-
- access(all)
- struct KeyListEntry {
-
- access(all)
- let keyIndex: Int
-
- access(all)
- let publicKey: PublicKey
-
- access(all)
- let hashAlgorithm: HashAlgorithm
-
- access(all)
- let weight: UFix64
-
- access(all)
- let isRevoked: Bool
-
- init(
- keyIndex: Int,
- publicKey: PublicKey,
- hashAlgorithm: HashAlgorithm,
- weight: UFix64,
- isRevoked: Bool
- ) {
- self.keyIndex = keyIndex
- self.publicKey = publicKey
- self.hashAlgorithm = hashAlgorithm
- self.weight = weight
- self.isRevoked = isRevoked
- }
- }
-
- access(all)
- struct KeyList {
-
- access(self)
- let entries: [KeyListEntry]
-
- init() {
- self.entries = []
- }
-
- /// Adds a new key with the given weight
- access(all)
- fun add(
- _ publicKey: PublicKey,
- hashAlgorithm: HashAlgorithm,
- weight: UFix64
- ): KeyListEntry {
-
- let keyIndex = self.entries.length
- let entry = KeyListEntry(
- keyIndex: keyIndex,
- publicKey: publicKey,
- hashAlgorithm: hashAlgorithm,
- weight: weight,
- isRevoked: false
- )
- self.entries.append(entry)
- return entry
- }
-
- /// Returns the key at the given index, if it exists.
- /// Revoked keys are always returned, but they have the `isRevoked` field set to true
- access(all)
- fun get(keyIndex: Int): KeyListEntry? {
- if keyIndex >= self.entries.length {
- return nil
- }
-
- return self.entries[keyIndex]
- }
-
- /// Marks the key at the given index revoked, but does not delete it
- access(all)
- fun revoke(keyIndex: Int) {
- if keyIndex >= self.entries.length {
- return
- }
-
- let currentEntry = self.entries[keyIndex]
- self.entries[keyIndex] = KeyListEntry(
- keyIndex: currentEntry.keyIndex,
- publicKey: currentEntry.publicKey,
- hashAlgorithm: currentEntry.hashAlgorithm,
- weight: currentEntry.weight,
- isRevoked: true
- )
- }
-
- /// Returns true if the given signatures are valid for the given signed data
- access(all)
- fun verify(
- signatureSet: [KeyListSignature],
- signedData: [UInt8],
- domainSeparationTag: String
- ): Bool {
-
- var validWeights: UFix64 = 0.0
-
- let seenKeyIndices: {Int: Bool} = {}
-
- for signature in signatureSet {
-
- // Ensure the key index is valid
-
- if signature.keyIndex >= self.entries.length {
- return false
- }
-
- // Ensure this key index has not already been seen
-
- if seenKeyIndices[signature.keyIndex] ?? false {
- return false
- }
-
- // Record the key index was seen
-
- seenKeyIndices[signature.keyIndex] = true
-
- // Get the actual key
-
- let key = self.entries[signature.keyIndex]
-
- // Ensure the key is not revoked
-
- if key.isRevoked {
- return false
- }
-
- // Ensure the signature is valid
-
- if !key.publicKey.verify(
- signature: signature.signature,
- signedData: signedData,
- domainSeparationTag: domainSeparationTag,
- hashAlgorithm:key.hashAlgorithm
- ) {
- return false
- }
-
- validWeights = validWeights + key.weight
- }
-
- return validWeights >= 1.0
- }
- }
-
- access(all)
- struct KeyListSignature {
-
- access(all)
- let keyIndex: Int
-
- access(all)
- let signature: [UInt8]
-
- init(keyIndex: Int, signature: [UInt8]) {
- self.keyIndex = keyIndex
- self.signature = signature
- }
- }
-}
diff --git a/stdlib/contracts/crypto.go b/stdlib/contracts/crypto.go
deleted file mode 100644
index a64180f160..0000000000
--- a/stdlib/contracts/crypto.go
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * Cadence - The resource-oriented smart contract programming language
- *
- * Copyright Flow Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package contracts
-
-import (
- _ "embed"
-)
-
-//go:embed crypto.cdc
-var Crypto []byte
diff --git a/stdlib/contracts/crypto_test.cdc b/stdlib/contracts/crypto_test.cdc
deleted file mode 100644
index d4e654287b..0000000000
--- a/stdlib/contracts/crypto_test.cdc
+++ /dev/null
@@ -1,341 +0,0 @@
-import Test
-import Crypto from "crypto.cdc"
-
-access(all)
-fun setup() {
- let err = Test.deployContract(
- name: "Crypto",
- path: "crypto.cdc",
- arguments: []
- )
-
- Test.expect(err, Test.beNil())
-}
-
-access(all)
-fun testCryptoHash() {
- let hash = Crypto.hash([1, 2, 3], algorithm: HashAlgorithm.SHA3_256)
- Test.assertEqual(32, hash.length)
-}
-
-access(all)
-fun testCryptoHashWithTag() {
- let hash = Crypto.hashWithTag(
- [1, 2, 3],
- tag: "v0.1.tag",
- algorithm: HashAlgorithm.SHA3_256
- )
- Test.assertEqual(32, hash.length)
-}
-
-access(all)
-fun testAddKeyToKeyList() {
- let keyList = Crypto.KeyList()
-
- let publicKey = PublicKey(
- publicKey:
- "db04940e18ec414664ccfd31d5d2d4ece3985acb8cb17a2025b2f1673427267968e52e2bbf3599059649d4b2cce98fdb8a3048e68abf5abe3e710129e90696ca".decodeHex(),
- signatureAlgorithm: SignatureAlgorithm.ECDSA_P256
- )
- keyList.add(
- publicKey,
- hashAlgorithm: HashAlgorithm.SHA3_256,
- weight: 1.0
- )
-
- Test.assert(keyList.get(keyIndex: 0) != nil)
-}
-
-access(all)
-fun testGetKeyFromList() {
- let keyList = Crypto.KeyList()
-
- let publicKey = PublicKey(
- publicKey:
- "db04940e18ec414664ccfd31d5d2d4ece3985acb8cb17a2025b2f1673427267968e52e2bbf3599059649d4b2cce98fdb8a3048e68abf5abe3e710129e90696ca".decodeHex(),
- signatureAlgorithm: SignatureAlgorithm.ECDSA_P256
- )
- keyList.add(
- publicKey,
- hashAlgorithm: HashAlgorithm.SHA3_256,
- weight: 1.0
- )
-
- Test.assert(keyList.get(keyIndex: 0) != nil)
- Test.assert(keyList.get(keyIndex: 2) == nil)
-}
-
-access(all)
-fun testRevokeKeyFromList() {
- let keyList = Crypto.KeyList()
-
- let publicKey = PublicKey(
- publicKey:
- "db04940e18ec414664ccfd31d5d2d4ece3985acb8cb17a2025b2f1673427267968e52e2bbf3599059649d4b2cce98fdb8a3048e68abf5abe3e710129e90696ca".decodeHex(),
- signatureAlgorithm: SignatureAlgorithm.ECDSA_P256
- )
- keyList.add(
- publicKey,
- hashAlgorithm: HashAlgorithm.SHA3_256,
- weight: 0.5
- )
-
- keyList.revoke(keyIndex: 0)
- keyList.revoke(keyIndex: 2)
-
- Test.assert(keyList.get(keyIndex: 0)!.isRevoked)
- Test.assert(keyList.get(keyIndex: 2) == nil)
-}
-
-access(all)
-fun testKeyListVerify() {
- let keyList = Crypto.KeyList()
-
- let publicKeyA = PublicKey(
- publicKey:
- "db04940e18ec414664ccfd31d5d2d4ece3985acb8cb17a2025b2f1673427267968e52e2bbf3599059649d4b2cce98fdb8a3048e68abf5abe3e710129e90696ca".decodeHex(),
- signatureAlgorithm: SignatureAlgorithm.ECDSA_P256
- )
-
- keyList.add(
- publicKeyA,
- hashAlgorithm: HashAlgorithm.SHA3_256,
- weight: 0.5
- )
-
- let publicKeyB = PublicKey(
- publicKey:
- "df9609ee588dd4a6f7789df8d56f03f545d4516f0c99b200d73b9a3afafc14de5d21a4fc7a2a2015719dc95c9e756cfa44f2a445151aaf42479e7120d83df956".decodeHex(),
- signatureAlgorithm: SignatureAlgorithm.ECDSA_P256
- )
-
- keyList.add(
- publicKeyB,
- hashAlgorithm: HashAlgorithm.SHA3_256,
- weight: 0.5
- )
-
- let signatureSet = [
- Crypto.KeyListSignature(
- keyIndex: 0,
- signature:
- "8870a8cbe6f44932ba59e0d15a706214cc4ad2538deb12c0cf718d86f32c47765462a92ce2da15d4a29eb4e2b6fa05d08c7db5d5b2a2cd8c2cb98ded73da31f6".decodeHex()
- ),
- Crypto.KeyListSignature(
- keyIndex: 1,
- signature:
- "bbdc5591c3f937a730d4f6c0a6fde61a0a6ceaa531ccb367c3559335ab9734f4f2b9da8adbe371f1f7da913b5a3fdd96a871e04f078928ca89a83d841c72fadf".decodeHex()
- )
- ]
-
- // "foo", encoded as UTF-8, in hex representation
- let signedData = "666f6f".decodeHex()
-
- let isValid = keyList.verify(
- signatureSet: signatureSet,
- signedData: signedData,
- domainSeparationTag: "FLOW-V0.0-user"
- )
-
- Test.assert(isValid)
-}
-
-access(all)
-fun testKeyListVerifyInsufficientWeights() {
- let keyList = Crypto.KeyList()
-
- let publicKeyA = PublicKey(
- publicKey:
- "db04940e18ec414664ccfd31d5d2d4ece3985acb8cb17a2025b2f1673427267968e52e2bbf3599059649d4b2cce98fdb8a3048e68abf5abe3e710129e90696ca".decodeHex(),
- signatureAlgorithm: SignatureAlgorithm.ECDSA_P256
- )
-
- keyList.add(
- publicKeyA,
- hashAlgorithm: HashAlgorithm.SHA3_256,
- weight: 0.4
- )
-
- let publicKeyB = PublicKey(
- publicKey:
- "df9609ee588dd4a6f7789df8d56f03f545d4516f0c99b200d73b9a3afafc14de5d21a4fc7a2a2015719dc95c9e756cfa44f2a445151aaf42479e7120d83df956".decodeHex(),
- signatureAlgorithm: SignatureAlgorithm.ECDSA_P256
- )
-
- keyList.add(
- publicKeyB,
- hashAlgorithm: HashAlgorithm.SHA3_256,
- weight: 0.5
- )
-
- let signatureSet = [
- Crypto.KeyListSignature(
- keyIndex: 0,
- signature:
- "8870a8cbe6f44932ba59e0d15a706214cc4ad2538deb12c0cf718d86f32c47765462a92ce2da15d4a29eb4e2b6fa05d08c7db5d5b2a2cd8c2cb98ded73da31f6".decodeHex()
- ),
- Crypto.KeyListSignature(
- keyIndex: 1,
- signature:
- "bbdc5591c3f937a730d4f6c0a6fde61a0a6ceaa531ccb367c3559335ab9734f4f2b9da8adbe371f1f7da913b5a3fdd96a871e04f078928ca89a83d841c72fadf".decodeHex()
- )
- ]
-
- // "foo", encoded as UTF-8, in hex representation
- let signedData = "666f6f".decodeHex()
-
- let isValid = keyList.verify(
- signatureSet: signatureSet,
- signedData: signedData,
- domainSeparationTag: "FLOW-V0.0-user"
- )
-
- Test.assert(!isValid)
-}
-
-access(all)
-fun testKeyListVerifyWithRevokedKey() {
- let keyList = Crypto.KeyList()
-
- let publicKey = PublicKey(
- publicKey:
- "db04940e18ec414664ccfd31d5d2d4ece3985acb8cb17a2025b2f1673427267968e52e2bbf3599059649d4b2cce98fdb8a3048e68abf5abe3e710129e90696ca".decodeHex(),
- signatureAlgorithm: SignatureAlgorithm.ECDSA_P256
- )
- keyList.add(
- publicKey,
- hashAlgorithm: HashAlgorithm.SHA3_256,
- weight: 0.5
- )
-
- let signatureSet = [
- Crypto.KeyListSignature(
- keyIndex: 0,
- signature:
- "8870a8cbe6f44932ba59e0d15a706214cc4ad2538deb12c0cf718d86f32c47765462a92ce2da15d4a29eb4e2b6fa05d08c7db5d5b2a2cd8c2cb98ded73da31f6".decodeHex()
- )
- ]
-
- // "foo", encoded as UTF-8, in hex representation
- let signedData = "666f6f".decodeHex()
-
- keyList.revoke(keyIndex: 0)
-
- let isValid = keyList.verify(
- signatureSet: signatureSet,
- signedData: signedData,
- domainSeparationTag: "FLOW-V0.0-user"
- )
-
- Test.assert(!isValid)
-}
-
-access(all)
-fun testKeyListVerifyWithMissingSignature() {
- let keyList = Crypto.KeyList()
-
- let publicKey = PublicKey(
- publicKey:
- "db04940e18ec414664ccfd31d5d2d4ece3985acb8cb17a2025b2f1673427267968e52e2bbf3599059649d4b2cce98fdb8a3048e68abf5abe3e710129e90696ca".decodeHex(),
- signatureAlgorithm: SignatureAlgorithm.ECDSA_P256
- )
- keyList.add(
- publicKey,
- hashAlgorithm: HashAlgorithm.SHA3_256,
- weight: 0.5
- )
-
- let signatureSet = [
- Crypto.KeyListSignature(
- keyIndex: 1,
- signature:
- "8870a8cbe6f44932ba59e0d15a706214cc4ad2538deb12c0cf718d86f32c47765462a92ce2da15d4a29eb4e2b6fa05d08c7db5d5b2a2cd8c2cb98ded73da31f6".decodeHex()
- )
- ]
-
- // "foo", encoded as UTF-8, in hex representation
- let signedData = "666f6f".decodeHex()
-
- let isValid = keyList.verify(
- signatureSet: signatureSet,
- signedData: signedData,
- domainSeparationTag: "FLOW-V0.0-user"
- )
-
- Test.assert(!isValid)
-}
-
-access(all)
-fun testKeyListVerifyDuplicateSignature() {
- let keyList = Crypto.KeyList()
-
- let publicKey = PublicKey(
- publicKey:
- "db04940e18ec414664ccfd31d5d2d4ece3985acb8cb17a2025b2f1673427267968e52e2bbf3599059649d4b2cce98fdb8a3048e68abf5abe3e710129e90696ca".decodeHex(),
- signatureAlgorithm: SignatureAlgorithm.ECDSA_P256
- )
- keyList.add(
- publicKey,
- hashAlgorithm: HashAlgorithm.SHA3_256,
- weight: 0.5
- )
-
- let signatureSet = [
- Crypto.KeyListSignature(
- keyIndex: 0,
- signature:
- "8870a8cbe6f44932ba59e0d15a706214cc4ad2538deb12c0cf718d86f32c47765462a92ce2da15d4a29eb4e2b6fa05d08c7db5d5b2a2cd8c2cb98ded73da31f6".decodeHex()
- ),
- Crypto.KeyListSignature(
- keyIndex: 0,
- signature:
- "8870a8cbe6f44932ba59e0d15a706214cc4ad2538deb12c0cf718d86f32c47765462a92ce2da15d4a29eb4e2b6fa05d08c7db5d5b2a2cd8c2cb98ded73da31f6".decodeHex()
- )
- ]
-
- // "foo", encoded as UTF-8, in hex representation
- let signedData = "666f6f".decodeHex()
-
- let isValid = keyList.verify(
- signatureSet: signatureSet,
- signedData: signedData,
- domainSeparationTag: "FLOW-V0.0-user"
- )
-
- Test.assert(!isValid)
-}
-
-access(all)
-fun testKeyListVerifyInvalidSignature() {
- let keyList = Crypto.KeyList()
-
- let publicKey = PublicKey(
- publicKey:
- "db04940e18ec414664ccfd31d5d2d4ece3985acb8cb17a2025b2f1673427267968e52e2bbf3599059649d4b2cce98fdb8a3048e68abf5abe3e710129e90696ca".decodeHex(),
- signatureAlgorithm: SignatureAlgorithm.ECDSA_P256
- )
- keyList.add(
- publicKey,
- hashAlgorithm: HashAlgorithm.SHA3_256,
- weight: 0.5
- )
-
- let signatureSet = [
- Crypto.KeyListSignature(
- keyIndex: 0,
- signature:
- "db70a8cbe6f44932ba59e0d15a706214cc4ad2538deb12c0cf718d86f32c47765462a92ce2da15d4a29eb4e2b6fa05d08c7db5d5b2a2cd8c2cb98ded73da31f6".decodeHex()
- )
- ]
-
- // "foo", encoded as UTF-8, in hex representation
- let signedData = "666f6f".decodeHex()
-
- let isValid = keyList.verify(
- signatureSet: signatureSet,
- signedData: signedData,
- domainSeparationTag: "FLOW-V0.0-user"
- )
-
- Test.assert(!isValid)
-}
diff --git a/stdlib/crypto.go b/stdlib/crypto.go
index 77897d43a5..c8838a474b 100644
--- a/stdlib/crypto.go
+++ b/stdlib/crypto.go
@@ -19,110 +19,12 @@
package stdlib
import (
- "sync"
-
- "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")
-
-var cryptoOnce sync.Once
-
-// Deprecated: Use CryptoChecker instead
-var cryptoChecker *sema.Checker
-
-// Deprecated: Use CryptoContractType instead
-var cryptoContractType *sema.CompositeType
-
-// Deprecated: Use CryptoContractInitializerTypes
-var cryptoContractInitializerTypes []sema.Type
-
-func CryptoChecker() *sema.Checker {
- cryptoOnce.Do(initCrypto)
- return cryptoChecker
-}
-
-func CryptoContractType() *sema.CompositeType {
- cryptoOnce.Do(initCrypto)
- return cryptoContractType
-}
-
-func CryptoContractInitializerTypes() []sema.Type {
- cryptoOnce.Do(initCrypto)
- return cryptoContractInitializerTypes
-}
-
-func initCrypto() {
- program, err := parser.ParseProgram(
- nil,
- contracts.Crypto,
- parser.Config{},
- )
- if err != nil {
- panic(err)
- }
-
- cryptoChecker, err = sema.NewChecker(
- program,
- CryptoCheckerLocation,
- nil,
- &sema.Config{
- AccessCheckMode: sema.AccessCheckModeStrict,
- },
- )
- if err != nil {
- panic(err)
- }
-
- err = cryptoChecker.Check()
- if err != nil {
- panic(err)
- }
-
- variable, ok := cryptoChecker.Elaboration.GetGlobalType("Crypto")
- if !ok {
- panic(errors.NewUnreachableError())
- }
- cryptoContractType = variable.Type.(*sema.CompositeType)
-
- cryptoContractInitializerTypes = make([]sema.Type, len(cryptoContractType.ConstructorParameters))
- for i, parameter := range cryptoContractType.ConstructorParameters {
- cryptoContractInitializerTypes[i] = parameter.TypeAnnotation.Type
- }
-}
-
-func NewCryptoContract(
- inter *interpreter.Interpreter,
- constructor interpreter.FunctionValue,
- invocationRange ast.Range,
-) (
- *interpreter.CompositeValue,
- error,
-) {
- initializerTypes := CryptoContractInitializerTypes()
- value, err := inter.InvokeFunctionValue(
- constructor,
- nil,
- initializerTypes,
- initializerTypes,
- CryptoContractType(),
- invocationRange,
- )
- if err != nil {
- return nil, err
- }
-
- compositeValue := value.(*interpreter.CompositeValue)
-
- return compositeValue, nil
-}
+const CryptoContractLocation = common.IdentifierLocation("Crypto")
func cryptoAlgorithmEnumConstructorType[T sema.CryptoAlgorithm](
enumType *sema.CompositeType,
diff --git a/stdlib/crypto_test.go b/stdlib/crypto_test.go
deleted file mode 100644
index d68d9b69ff..0000000000
--- a/stdlib/crypto_test.go
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Cadence - The resource-oriented smart contract programming language
- *
- * Copyright Flow Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package stdlib
-
-import (
- "testing"
-
- "github.com/stretchr/testify/require"
-
- "github.com/onflow/cadence/sema"
-)
-
-func TestCryptoContract(t *testing.T) {
- require.IsType(t, &sema.Checker{}, CryptoChecker())
-}
diff --git a/stdlib/rlp/rlp_test.go b/stdlib/rlp/rlp_test.go
index f707026356..ce07309d82 100644
--- a/stdlib/rlp/rlp_test.go
+++ b/stdlib/rlp/rlp_test.go
@@ -24,7 +24,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/stdlib/rlp"
- . "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func TestRLPReadSize(t *testing.T) {
diff --git a/stdlib/test.go b/stdlib/test.go
index 1a00e839ed..30e9e3d3d6 100644
--- a/stdlib/test.go
+++ b/stdlib/test.go
@@ -494,17 +494,6 @@ func NewTestInterpreterContractValueHandler(
) interpreter.ContractValue {
switch compositeType.Location {
- case CryptoCheckerLocation:
- contract, err := NewCryptoContract(
- inter,
- constructorGenerator(common.ZeroAddress),
- invocationRange,
- )
- if err != nil {
- panic(err)
- }
- return contract
-
case TestContractLocation:
contract, err := GetTestContractType().NewTestContract(
inter,
diff --git a/stdlib/test_test.go b/stdlib/test_test.go
index 19912f763c..9e602af451 100644
--- a/stdlib/test_test.go
+++ b/stdlib/test_test.go
@@ -34,8 +34,8 @@ import (
"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"
+ . "github.com/onflow/cadence/test_utils/common_utils"
+ . "github.com/onflow/cadence/test_utils/sema_utils"
)
func newTestContractInterpreter(t *testing.T, code string) (*interpreter.Interpreter, error) {
@@ -65,7 +65,7 @@ func newTestContractInterpreterWithTestFramework(
checker, err := sema.NewChecker(
program,
- utils.TestLocation,
+ TestLocation,
nil,
&sema.Config{
BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation {
@@ -288,7 +288,7 @@ func TestTestNewMatcher(t *testing.T) {
_, err := newTestContractInterpreter(t, script)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.TypeMismatchError{}, errs[0])
})
@@ -334,7 +334,7 @@ func TestTestNewMatcher(t *testing.T) {
_, err := newTestContractInterpreter(t, script)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.TypeMismatchError{}, errs[0])
})
@@ -461,7 +461,7 @@ func TestTestEqualMatcher(t *testing.T) {
_, err := newTestContractInterpreter(t, script)
require.Error(t, err)
- errs := checker.RequireCheckerErrors(t, err, 2)
+ errs := RequireCheckerErrors(t, err, 2)
assert.IsType(t, &sema.TypeMismatchError{}, errs[0])
assert.IsType(t, &sema.TypeMismatchError{}, errs[1])
})
@@ -499,7 +499,7 @@ func TestTestEqualMatcher(t *testing.T) {
_, err := newTestContractInterpreter(t, script)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.TypeMismatchError{}, errs[0])
})
@@ -671,7 +671,7 @@ func TestTestEqualMatcher(t *testing.T) {
_, err := newTestContractInterpreter(t, script)
- errs := checker.RequireCheckerErrors(t, err, 4)
+ errs := RequireCheckerErrors(t, err, 4)
assert.IsType(t, &sema.TypeMismatchError{}, errs[0])
assert.IsType(t, &sema.TypeMismatchError{}, errs[1])
assert.IsType(t, &sema.TypeMismatchError{}, errs[2])
@@ -705,7 +705,7 @@ func TestTestEqualMatcher(t *testing.T) {
_, err := newTestContractInterpreter(t, script)
- errs := checker.RequireCheckerErrors(t, err, 3)
+ errs := RequireCheckerErrors(t, err, 3)
assert.IsType(t, &sema.TypeMismatchError{}, errs[0])
assert.IsType(t, &sema.TypeMismatchError{}, errs[1])
assert.IsType(t, &sema.TypeMismatchError{}, errs[2])
@@ -990,7 +990,7 @@ func TestAssertEqual(t *testing.T) {
_, err := newTestContractInterpreter(t, script)
- errs := checker.RequireCheckerErrors(t, err, 2)
+ errs := RequireCheckerErrors(t, err, 2)
assert.IsType(t, &sema.TypeMismatchError{}, errs[0])
assert.IsType(t, &sema.TypeMismatchError{}, errs[1])
})
@@ -1016,7 +1016,7 @@ func TestAssertEqual(t *testing.T) {
_, err := newTestContractInterpreter(t, script)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.TypeMismatchError{}, errs[0])
})
@@ -1041,7 +1041,7 @@ func TestAssertEqual(t *testing.T) {
_, err := newTestContractInterpreter(t, script)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.TypeMismatchError{}, errs[0])
})
}
@@ -1931,7 +1931,7 @@ func TestTestExpect(t *testing.T) {
_, err := newTestContractInterpreter(t, script)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.TypeMismatchError{}, errs[0])
})
@@ -1955,7 +1955,7 @@ func TestTestExpect(t *testing.T) {
_, err := newTestContractInterpreter(t, script)
- errs := checker.RequireCheckerErrors(t, err, 2)
+ errs := RequireCheckerErrors(t, err, 2)
assert.IsType(t, &sema.TypeMismatchError{}, errs[0])
assert.IsType(t, &sema.TypeMismatchError{}, errs[1])
})
@@ -1981,7 +1981,7 @@ func TestTestExpect(t *testing.T) {
_, err := newTestContractInterpreter(t, script)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.TypeMismatchError{}, errs[0])
})
@@ -2006,7 +2006,7 @@ func TestTestExpect(t *testing.T) {
_, err := newTestContractInterpreter(t, script)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.TypeMismatchError{}, errs[0])
})
}
@@ -2176,7 +2176,7 @@ func TestTestExpectFailure(t *testing.T) {
`
_, err := newTestContractInterpreter(t, script)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.TypeMismatchError{}, errs[0])
})
@@ -2213,7 +2213,7 @@ func TestTestExpectFailure(t *testing.T) {
`
_, err := newTestContractInterpreter(t, script)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.TypeMismatchError{}, errs[0])
})
}
@@ -2377,7 +2377,7 @@ func TestBlockchain(t *testing.T) {
}
_, err := newTestContractInterpreterWithTestFramework(t, script, testFramework)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.TypeMismatchError{}, errs[0])
assert.False(t, resetInvoked)
})
@@ -2481,7 +2481,7 @@ func TestBlockchain(t *testing.T) {
}
_, err := newTestContractInterpreterWithTestFramework(t, script, testFramework)
- errs := checker.RequireCheckerErrors(t, err, 1)
+ errs := RequireCheckerErrors(t, err, 1)
assert.IsType(t, &sema.TypeMismatchError{}, errs[0])
assert.False(t, moveTimeInvoked)
})
diff --git a/test_utils/common_utils/utils.go b/test_utils/common_utils/utils.go
new file mode 100644
index 0000000000..009494e373
--- /dev/null
+++ b/test_utils/common_utils/utils.go
@@ -0,0 +1,112 @@
+/*
+ * Cadence - The resource-oriented smart contract programming language
+ *
+ * Copyright Flow Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package common_utils
+
+import (
+ "strings"
+ "testing"
+
+ "github.com/k0kubun/pp"
+ "github.com/kr/pretty"
+ "github.com/stretchr/testify/assert"
+ "github.com/stretchr/testify/require"
+
+ "github.com/onflow/cadence/ast"
+ "github.com/onflow/cadence/errors"
+
+ "github.com/onflow/cadence/common"
+)
+
+func init() {
+ pp.ColoringEnabled = false
+}
+
+// TestLocation is used as the default location for programs in tests.
+const TestLocation = common.StringLocation("test")
+
+// ImportedLocation is used as the default location for imported programs in tests.
+const ImportedLocation = common.StringLocation("imported")
+
+// AssertEqualWithDiff asserts that two objects are equal.
+//
+// If the objects are not equal, this function prints a human-readable diff.
+func AssertEqualWithDiff(t *testing.T, expected, actual any) {
+
+ // the maximum levels of a struct to recurse into
+ // this prevents infinite recursion from circular references
+ diff := pretty.Diff(expected, actual)
+
+ if len(diff) != 0 {
+ s := strings.Builder{}
+
+ for i, d := range diff {
+ if i == 0 {
+ s.WriteString("diff : ")
+ } else {
+ s.WriteString(" ")
+ }
+
+ s.WriteString(d)
+ s.WriteString("\n")
+ }
+
+ t.Errorf(
+ "Not equal: \n"+
+ "expected: %s\n"+
+ "actual : %s\n\n"+
+ "%s",
+ pp.Sprint(expected),
+ pp.Sprint(actual),
+ s.String(),
+ )
+ }
+}
+
+// RequireError is a wrapper around require.Error which also ensures
+// that the error message, the secondary message (if any),
+// and the error notes' (if any) messages can be successfully produced
+func RequireError(t *testing.T, err error) {
+ require.Error(t, err)
+
+ _ = err.Error()
+
+ if hasImportLocation, ok := err.(common.HasLocation); ok {
+ location := hasImportLocation.ImportLocation()
+ assert.NotNil(t, location)
+ }
+
+ if hasPosition, ok := err.(ast.HasPosition); ok {
+ _ = hasPosition.StartPosition()
+ _ = hasPosition.EndPosition(nil)
+ }
+
+ if hasErrorNotes, ok := err.(errors.ErrorNotes); ok {
+ for _, note := range hasErrorNotes.ErrorNotes() {
+ _ = note.Message()
+ }
+ }
+
+ if hasSecondaryError, ok := err.(errors.SecondaryError); ok {
+ _ = hasSecondaryError.SecondaryError()
+ }
+
+ if hasSuggestedFixes, ok := err.(errors.HasSuggestedFixes[ast.TextEdit]); ok {
+ _ = hasSuggestedFixes.SuggestFixes("")
+ }
+}
diff --git a/tests/runtime_utils/interpreter.go b/test_utils/interpreter_utils/interpreter.go
similarity index 92%
rename from tests/runtime_utils/interpreter.go
rename to test_utils/interpreter_utils/interpreter.go
index e7458be09b..46a8182023 100644
--- a/tests/runtime_utils/interpreter.go
+++ b/test_utils/interpreter_utils/interpreter.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package runtime_utils
+package interpreter_utils
import (
"testing"
@@ -24,7 +24,7 @@ import (
"github.com/stretchr/testify/require"
"github.com/onflow/cadence/interpreter"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func NewTestInterpreter(tb testing.TB) *interpreter.Interpreter {
@@ -32,7 +32,7 @@ func NewTestInterpreter(tb testing.TB) *interpreter.Interpreter {
inter, err := interpreter.NewInterpreter(
nil,
- utils.TestLocation,
+ TestLocation,
&interpreter.Config{
Storage: storage,
AtreeValueValidationEnabled: true,
diff --git a/tests/utils/utils.go b/test_utils/interpreter_utils/values.go
similarity index 56%
rename from tests/utils/utils.go
rename to test_utils/interpreter_utils/values.go
index 1c6d840712..f271ba944b 100644
--- a/tests/utils/utils.go
+++ b/test_utils/interpreter_utils/values.go
@@ -16,113 +16,37 @@
* limitations under the License.
*/
-package utils
+package interpreter_utils
import (
- "encoding/hex"
"fmt"
"strings"
"testing"
- "github.com/k0kubun/pp"
"github.com/kr/pretty"
"github.com/stretchr/testify/assert"
- "github.com/stretchr/testify/require"
- "github.com/onflow/cadence/ast"
- "github.com/onflow/cadence/errors"
"github.com/onflow/cadence/interpreter"
-
- "github.com/onflow/cadence/common"
)
-func init() {
- pp.ColoringEnabled = false
+func RequireValuesEqual(t testing.TB, inter *interpreter.Interpreter, expected, actual interpreter.Value) {
+ if !AssertValuesEqual(t, inter, expected, actual) {
+ t.FailNow()
+ }
}
-// TestLocation is used as the default location for programs in tests.
-const TestLocation = common.StringLocation("test")
-
-// ImportedLocation is used as the default location for imported programs in tests.
-const ImportedLocation = common.StringLocation("imported")
-
-// AssertEqualWithDiff asserts that two objects are equal.
-//
-// If the objects are not equal, this function prints a human-readable diff.
-func AssertEqualWithDiff(t *testing.T, expected, actual any) {
-
- // the maximum levels of a struct to recurse into
- // this prevents infinite recursion from circular references
- diff := pretty.Diff(expected, actual)
-
- if len(diff) != 0 {
- s := strings.Builder{}
-
- for i, d := range diff {
- if i == 0 {
- s.WriteString("diff : ")
- } else {
- s.WriteString(" ")
- }
+func AssertValueSlicesEqual(t testing.TB, inter *interpreter.Interpreter, expected, actual []interpreter.Value) bool {
+ if !assert.Equal(t, len(expected), len(actual)) {
+ return false
+ }
- s.WriteString(d)
- s.WriteString("\n")
+ for i, value := range expected {
+ if !AssertValuesEqual(t, inter, value, actual[i]) {
+ return false
}
-
- t.Errorf(
- "Not equal: \n"+
- "expected: %s\n"+
- "actual : %s\n\n"+
- "%s",
- pp.Sprint(expected),
- pp.Sprint(actual),
- s.String(),
- )
}
-}
-
-func DeploymentTransaction(name string, contract []byte) []byte {
- return []byte(fmt.Sprintf(
- `
- transaction {
-
- prepare(signer: auth(Contracts) &Account) {
- signer.contracts.add(name: "%s", code: "%s".decodeHex())
- }
- }
- `,
- name,
- hex.EncodeToString(contract),
- ))
-}
-
-func RemovalTransaction(name string) []byte {
- return []byte(fmt.Sprintf(
- `
- transaction {
- prepare(signer: auth(Contracts) &Account) {
- signer.contracts.remove(name: "%s")
- }
- }
- `,
- name,
- ))
-}
-
-func UpdateTransaction(name string, contract []byte) []byte {
- return []byte(fmt.Sprintf(
- `
- transaction {
-
- prepare(signer: auth(Contracts) &Account) {
- signer.contracts.update(name: "%s", code: "%s".decodeHex())
- }
- }
- `,
- name,
- hex.EncodeToString(contract),
- ))
+ return true
}
func ValuesAreEqual(inter *interpreter.Interpreter, expected, actual interpreter.Value) bool {
@@ -173,59 +97,6 @@ func AssertValuesEqual(t testing.TB, interpreter *interpreter.Interpreter, expec
return true
}
-func RequireValuesEqual(t testing.TB, inter *interpreter.Interpreter, expected, actual interpreter.Value) {
- if !AssertValuesEqual(t, inter, expected, actual) {
- t.FailNow()
- }
-}
-
-func AssertValueSlicesEqual(t testing.TB, inter *interpreter.Interpreter, expected, actual []interpreter.Value) bool {
- if !assert.Equal(t, len(expected), len(actual)) {
- return false
- }
-
- for i, value := range expected {
- if !AssertValuesEqual(t, inter, value, actual[i]) {
- return false
- }
- }
-
- return true
-}
-
-// RequireError is a wrapper around require.Error which also ensures
-// that the error message, the secondary message (if any),
-// and the error notes' (if any) messages can be successfully produced
-func RequireError(t *testing.T, err error) {
- require.Error(t, err)
-
- _ = err.Error()
-
- if hasImportLocation, ok := err.(common.HasLocation); ok {
- location := hasImportLocation.ImportLocation()
- assert.NotNil(t, location)
- }
-
- if hasPosition, ok := err.(ast.HasPosition); ok {
- _ = hasPosition.StartPosition()
- _ = hasPosition.EndPosition(nil)
- }
-
- if hasErrorNotes, ok := err.(errors.ErrorNotes); ok {
- for _, note := range hasErrorNotes.ErrorNotes() {
- _ = note.Message()
- }
- }
-
- if hasSecondaryError, ok := err.(errors.SecondaryError); ok {
- _ = hasSecondaryError.SecondaryError()
- }
-
- if hasSuggestedFixes, ok := err.(errors.HasSuggestedFixes[ast.TextEdit]); ok {
- _ = hasSuggestedFixes.SuggestFixes("")
- }
-}
-
func ArrayElements(inter *interpreter.Interpreter, array *interpreter.ArrayValue) []interpreter.Value {
count := array.Count()
result := make([]interpreter.Value, count)
diff --git a/tests/runtime_utils/location.go b/test_utils/runtime_utils/location.go
similarity index 93%
rename from tests/runtime_utils/location.go
rename to test_utils/runtime_utils/location.go
index 8ae9b3614e..f9528eb4f6 100644
--- a/tests/runtime_utils/location.go
+++ b/test_utils/runtime_utils/location.go
@@ -49,13 +49,7 @@ func NewScriptLocationGenerator() func() common.ScriptLocation {
return NewLocationGenerator[common.ScriptLocation]()
}
-func NewSingleIdentifierLocationResolver(t testing.TB) func(
- identifiers []runtime.Identifier,
- location runtime.Location,
-) (
- []runtime.ResolvedLocation,
- error,
-) {
+func NewSingleIdentifierLocationResolver(t testing.TB) sema.LocationHandlerFunc {
return func(
identifiers []runtime.Identifier,
location runtime.Location,
diff --git a/tests/runtime_utils/testinterface.go b/test_utils/runtime_utils/testinterface.go
similarity index 99%
rename from tests/runtime_utils/testinterface.go
rename to test_utils/runtime_utils/testinterface.go
index afb24d97ca..9b3b8199e3 100644
--- a/tests/runtime_utils/testinterface.go
+++ b/test_utils/runtime_utils/testinterface.go
@@ -40,13 +40,7 @@ import (
type TestRuntimeInterface struct {
Storage TestLedger
- OnResolveLocation func(
- identifiers []runtime.Identifier,
- location runtime.Location,
- ) (
- []runtime.ResolvedLocation,
- error,
- )
+ OnResolveLocation sema.LocationHandlerFunc
OnGetCode func(_ runtime.Location) ([]byte, error)
OnGetAndSetProgram func(
location runtime.Location,
diff --git a/tests/runtime_utils/testledger.go b/test_utils/runtime_utils/testledger.go
similarity index 100%
rename from tests/runtime_utils/testledger.go
rename to test_utils/runtime_utils/testledger.go
diff --git a/tests/runtime_utils/testruntime.go b/test_utils/runtime_utils/testruntime.go
similarity index 89%
rename from tests/runtime_utils/testruntime.go
rename to test_utils/runtime_utils/testruntime.go
index 5ea11f137d..81f1f057b5 100644
--- a/tests/runtime_utils/testruntime.go
+++ b/test_utils/runtime_utils/testruntime.go
@@ -38,19 +38,12 @@ func NewTestInterpreterRuntimeWithConfig(config runtime.Config) TestInterpreterR
var DefaultTestInterpreterConfig = runtime.Config{
AtreeValidationEnabled: true,
- AttachmentsEnabled: true,
}
func NewTestInterpreterRuntime() TestInterpreterRuntime {
return NewTestInterpreterRuntimeWithConfig(DefaultTestInterpreterConfig)
}
-func NewTestInterpreterRuntimeWithAttachments() TestInterpreterRuntime {
- config := DefaultTestInterpreterConfig
- config.AttachmentsEnabled = true
- return NewTestInterpreterRuntimeWithConfig(config)
-}
-
func (r TestInterpreterRuntime) ExecuteTransaction(script runtime.Script, context runtime.Context) error {
i := context.Interface.(*TestRuntimeInterface)
i.onTransactionExecutionStart()
diff --git a/test_utils/runtime_utils/transactions.go b/test_utils/runtime_utils/transactions.go
new file mode 100644
index 0000000000..72f8af976c
--- /dev/null
+++ b/test_utils/runtime_utils/transactions.go
@@ -0,0 +1,68 @@
+/*
+ * Cadence - The resource-oriented smart contract programming language
+ *
+ * Copyright Flow Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package runtime_utils
+
+import (
+ "encoding/hex"
+ "fmt"
+)
+
+func DeploymentTransaction(name string, contract []byte) []byte {
+ return []byte(fmt.Sprintf(
+ `
+ transaction {
+
+ prepare(signer: auth(Contracts) &Account) {
+ signer.contracts.add(name: "%s", code: "%s".decodeHex())
+ }
+ }
+ `,
+ name,
+ hex.EncodeToString(contract),
+ ))
+}
+
+func RemovalTransaction(name string) []byte {
+ return []byte(fmt.Sprintf(
+ `
+ transaction {
+
+ prepare(signer: auth(Contracts) &Account) {
+ signer.contracts.remove(name: "%s")
+ }
+ }
+ `,
+ name,
+ ))
+}
+
+func UpdateTransaction(name string, contract []byte) []byte {
+ return []byte(fmt.Sprintf(
+ `
+ transaction {
+
+ prepare(signer: auth(Contracts) &Account) {
+ signer.contracts.update(name: "%s", code: "%s".decodeHex())
+ }
+ }
+ `,
+ name,
+ hex.EncodeToString(contract),
+ ))
+}
diff --git a/tests/checker/utils.go b/test_utils/sema_utils/utils.go
similarity index 93%
rename from tests/checker/utils.go
rename to test_utils/sema_utils/utils.go
index f0c1e91442..220d0e653f 100644
--- a/tests/checker/utils.go
+++ b/test_utils/sema_utils/utils.go
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-package checker
+package sema_utils
import (
"flag"
@@ -25,7 +25,6 @@ import (
"testing"
gopretty "github.com/kr/pretty"
-
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -33,16 +32,11 @@ import (
"github.com/onflow/cadence/parser"
"github.com/onflow/cadence/pretty"
"github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func ParseAndCheck(t testing.TB, code string) (*sema.Checker, error) {
- return ParseAndCheckWithOptions(t, code, ParseAndCheckOptions{
- // allow attachments is on by default for testing purposes
- Config: &sema.Config{
- AttachmentsEnabled: true,
- },
- })
+ return ParseAndCheckWithOptions(t, code, ParseAndCheckOptions{})
}
type ParseAndCheckOptions struct {
@@ -74,7 +68,7 @@ func ParseAndCheckWithOptionsAndMemoryMetering(
) (*sema.Checker, error) {
if options.Location == nil {
- options.Location = utils.TestLocation
+ options.Location = TestLocation
}
program, err := parser.ParseProgram(memoryGauge, []byte(code), options.ParseOptions)
@@ -175,7 +169,7 @@ func RequireCheckerErrors(t *testing.T, err error, count int) []error {
return nil
}
- utils.RequireError(t, err)
+ RequireError(t, err)
var checkerErr *sema.CheckerError
require.ErrorAs(t, err, &checkerErr)
@@ -187,7 +181,7 @@ func RequireCheckerErrors(t *testing.T, err error, count int) []error {
// Get the error message, to check that it can be successfully generated
for _, checkerErr := range errs {
- utils.RequireError(t, checkerErr)
+ RequireError(t, checkerErr)
}
return errs
diff --git a/tests/checker/nft_test.go b/tests/checker/nft_test.go
deleted file mode 100644
index 41374e7903..0000000000
--- a/tests/checker/nft_test.go
+++ /dev/null
@@ -1,992 +0,0 @@
-/*
- * Cadence - The resource-oriented smart contract programming language
- *
- * Copyright Flow Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package checker
-
-// TODO: re-enable this test with the v2 fungible token contract
-/*
-const realNonFungibleTokenContractInterface = `
-
-// The main NFT contract interface. Other NFT contracts will
-// import and implement this interface
-//
-access(all) contract interface NonFungibleToken {
-
- // The total number of tokens of this type in existence
- access(all) var totalSupply: UInt64
-
- // Event that emitted when the NFT contract is initialized
- //
- access(all) event ContractInitialized()
-
- // Event that is emitted when a token is withdrawn,
- // indicating the owner of the collection that it was withdrawn from.
- //
- // If the collection is not in an account's storage, from will be nil.
- //
- access(all) event Withdraw(id: UInt64, from: Address?)
-
- // Event that emitted when a token is deposited to a collection.
- //
- // It indicates the owner of the collection that it was deposited to.
- //
- access(all) event Deposit(id: UInt64, to: Address?)
-
- // Interface that the NFTs have to conform to
- //
- access(all) resource interface INFT {
- // The unique ID that each NFT has
- access(all) let id: UInt64
- }
-
- // Requirement that all conforming NFT smart contracts have
- // to define a resource called NFT that conforms to INFT
- access(all) resource NFT: INFT {
- access(all) let id: UInt64
- }
-
- // entitles references to withdraw:
- // TODO: https://github.com/onflow/cadence/issues/2503
- entitlement Withdrawable
-
- // Interface to mediate withdraws from the Collection
- //
- access(all) resource interface Provider {
- // withdraw removes an NFT from the collection and moves it to the caller
- access(Withdrawable) fun withdraw(withdrawID: UInt64): @NFT {
- post {
- result.id == withdrawID: "The ID of the withdrawn token must be the same as the requested ID"
- }
- }
- }
-
- // Interface to mediate deposits to the Collection
- //
- access(all) resource interface Receiver {
-
- // deposit takes an NFT as an argument and adds it to the Collection
- //
- access(all) fun deposit(token: @NFT)
- }
-
- // Interface that an account would commonly
- // publish for their collection
- access(all) resource interface CollectionPublic {
- access(all) fun deposit(token: @NFT)
- access(all) fun getIDs(): [UInt64]
- access(all) fun borrowNFT(id: UInt64): &NFT
- }
-
- // Requirement for the the concrete resource type
- // to be declared in the implementing contract
- //
- access(all) resource Collection: Provider, Receiver, CollectionPublic {
-
- // Dictionary to hold the NFTs in the Collection
- access(all) var ownedNFTs: @{UInt64: NFT}
-
- // withdraw removes an NFT from the collection and moves it to the caller
- access(Withdrawable) fun withdraw(withdrawID: UInt64): @NFT
-
- // deposit takes a NFT and adds it to the collections dictionary
- // and adds the ID to the id array
- access(all) fun deposit(token: @NFT)
-
- // getIDs returns an array of the IDs that are in the collection
- access(all) fun getIDs(): [UInt64]
-
- // Returns a borrowed reference to an NFT in the collection
- // so that the caller can read data and call methods from it
- access(all) fun borrowNFT(id: UInt64): &NFT {
- pre {
- self.ownedNFTs[id] != nil: "NFT does not exist in the collection!"
- }
- }
- }
-
- // createEmptyCollection creates an empty Collection
- // and returns it to the caller so that they can own NFTs
- access(all) fun createEmptyCollection(): @Collection {
- post {
- result.ownedNFTs.length == 0: "The created collection must be empty!"
- }
- }
-}
-`
-const topShotContract = `
-
-import NonFungibleToken from 0x1
-
-access(all) contract TopShot: NonFungibleToken {
-
- // -----------------------------------------------------------------------
- // TopShot contract Events
- // -----------------------------------------------------------------------
-
- // Emitted when the TopShot contract is created
- access(all) event ContractInitialized()
-
- // Emitted when a new Play struct is created
- access(all) event PlayCreated(id: UInt32, metadata: {String:String})
- // Emitted when a new series has been triggered by an admin
- access(all) event NewSeriesStarted(newCurrentSeries: UInt32)
-
- // Events for Set-Related actions
- //
- // Emitted when a new Set is created
- access(all) event SetCreated(setID: UInt32, series: UInt32)
- // Emitted when a new Play is added to a Set
- access(all) event PlayAddedToSet(setID: UInt32, playID: UInt32)
- // Emitted when a Play is retired from a Set and cannot be used to mint
- access(all) event PlayRetiredFromSet(setID: UInt32, playID: UInt32, numMoments: UInt32)
- // Emitted when a Set is locked, meaning Plays cannot be added
- access(all) event SetLocked(setID: UInt32)
- // Emitted when a Moment is minted from a Set
- access(all) event MomentMinted(momentID: UInt64, playID: UInt32, setID: UInt32, serialNumber: UInt32)
-
- // Events for Collection-related actions
- //
- // Emitted when a moment is withdrawn from a Collection
- access(all) event Withdraw(id: UInt64, from: Address?)
- // Emitted when a moment is deposited into a Collection
- access(all) event Deposit(id: UInt64, to: Address?)
-
- // Emitted when a Moment is destroyed
- access(all) event MomentDestroyed(id: UInt64)
-
- // -----------------------------------------------------------------------
- // TopShot contract-level fields.
- // These contain actual values that are stored in the smart contract.
- // -----------------------------------------------------------------------
-
- // Series that this Set belongs to.
- // Series is a concept that indicates a group of Sets through time.
- // Many Sets can exist at a time, but only one series.
- access(all) var currentSeries: UInt32
-
- // Variable size dictionary of Play structs
- access(self) var playDatas: {UInt32: Play}
-
- // Variable size dictionary of SetData structs
- access(self) var setDatas: {UInt32: SetData}
-
- // Variable size dictionary of Set resources
- access(self) var sets: @{UInt32: Set}
-
- // The ID that is used to create Plays.
- // Every time a Play is created, playID is assigne
- // to the new Play's ID and then is incremented by 1.
- access(all) var nextPlayID: UInt32
-
- // The ID that is used to create Sets. Every time a Set is created
- // setID is assigned to the new set's ID and then is incremented by 1.
- access(all) var nextSetID: UInt32
-
- // The total number of Top shot Moment NFTs that have been created
- // Because NFTs can be destroyed, it doesn't necessarily mean that this
- // reflects the total number of NFTs in existence, just the number that
- // have been minted to date. Also used as global moment IDs for minting.
- access(all) var totalSupply: UInt64
-
- // -----------------------------------------------------------------------
- // TopShot contract-level Composite Type definitions
- // -----------------------------------------------------------------------
- // These are just *definitions* for Types that this contract
- // and other accounts can use. These definitions do not contain
- // actual stored values, but an instance (or object) of one of these Types
- // can be created by this contract that contains stored values.
- // -----------------------------------------------------------------------
-
- // Play is a Struct that holds metadata associated
- // with a specific NBA play, like the legendary moment when
- // Ray Allen hit the 3 to tie the Heat and Spurs in the 2013 finals game 6
- // or when Lance Stephenson blew in the ear of Lebron James.
- //
- // Moment NFTs will all reference a single play as the owner of
- // its metadata. The plays are publicly accessible, so anyone can
- // read the metadata associated with a specific play ID
- //
- access(all) struct Play {
-
- // The unique ID for the Play
- access(all) let playID: UInt32
-
- // Stores all the metadata about the play as a string mapping
- // This is not the long term way NFT metadata will be stored. It's a temporary
- // construct while we figure out a better way to do metadata.
- //
- access(all) let metadata: {String: String}
-
- init(metadata: {String: String}) {
- pre {
- metadata.length != 0: "New Play metadata cannot be empty"
- }
- self.playID = TopShot.nextPlayID
- self.metadata = metadata
-
- // Increment the ID so that it isn't used again
- TopShot.nextPlayID = TopShot.nextPlayID + UInt32(1)
-
- emit PlayCreated(id: self.playID, metadata: metadata)
- }
- }
-
- // A Set is a grouping of Plays that have occurred in the real world
- // that make up a related group of collectibles, like sets of baseball
- // or Magic cards. A Play can exist in multiple different sets.
- //
- // SetData is a struct that is stored in a field of the contract.
- // Anyone can query the constant information
- // about a set by calling various getters located
- // at the end of the contract. Only the admin has the ability
- // to modify any data in the private Set resource.
- //
- access(all) struct SetData {
-
- // Unique ID for the Set
- access(all) let setID: UInt32
-
- // Name of the Set
- // ex. "Times when the Toronto Raptors choked in the playoffs"
- access(all) let name: String
-
- // Series that this Set belongs to.
- // Series is a concept that indicates a group of Sets through time.
- // Many Sets can exist at a time, but only one series.
- access(all) let series: UInt32
-
- init(name: String) {
- pre {
- name.length > 0: "New Set name cannot be empty"
- }
- self.setID = TopShot.nextSetID
- self.name = name
- self.series = TopShot.currentSeries
-
- // Increment the setID so that it isn't used again
- TopShot.nextSetID = TopShot.nextSetID + UInt32(1)
-
- emit SetCreated(setID: self.setID, series: self.series)
- }
- }
-
- // Set is a resource type that contains the functions to add and remove
- // Plays from a set and mint Moments.
- //
- // It is stored in a private field in the contract so that
- // the admin resource can call its methods.
- //
- // The admin can add Plays to a Set so that the set can mint Moments
- // that reference that playdata.
- // The Moments that are minted by a Set will be listed as belonging to
- // the Set that minted it, as well as the Play it references.
- //
- // Admin can also retire Plays from the Set, meaning that the retired
- // Play can no longer have Moments minted from it.
- //
- // If the admin locks the Set, no more Plays can be added to it, but
- // Moments can still be minted.
- //
- // If retireAll() and lock() are called back-to-back,
- // the Set is closed off forever and nothing more can be done with it.
- access(all) resource Set {
-
- // Unique ID for the set
- access(all) let setID: UInt32
-
- // Array of plays that are a part of this set.
- // When a play is added to the set, its ID gets appended here.
- // The ID does not get removed from this array when a Play is retired.
- access(all) var plays: [UInt32]
-
- // Map of Play IDs that Indicates if a Play in this Set can be minted.
- // When a Play is added to a Set, it is mapped to false (not retired).
- // When a Play is retired, this is set to true and cannot be changed.
- access(all) var retired: {UInt32: Bool}
-
- // Indicates if the Set is currently locked.
- // When a Set is created, it is unlocked
- // and Plays are allowed to be added to it.
- // When a set is locked, Plays cannot be added.
- // A Set can never be changed from locked to unlocked,
- // the decision to lock a Set it is final.
- // If a Set is locked, Plays cannot be added, but
- // Moments can still be minted from Plays
- // that exist in the Set.
- access(all) var locked: Bool
-
- // Mapping of Play IDs that indicates the number of Moments
- // that have been minted for specific Plays in this Set.
- // When a Moment is minted, this value is stored in the Moment to
- // show its place in the Set, eg. 13 of 60.
- access(all) var numberMintedPerPlay: {UInt32: UInt32}
-
- init(name: String) {
- self.setID = TopShot.nextSetID
- self.plays = []
- self.retired = {}
- self.locked = false
- self.numberMintedPerPlay = {}
-
- // Create a new SetData for this Set and store it in contract storage
- TopShot.setDatas[self.setID] = SetData(name: name)
- }
-
- // addPlay adds a play to the set
- //
- // Parameters: playID: The ID of the Play that is being added
- //
- // Pre-Conditions:
- // The Play needs to be an existing play
- // The Set needs to be not locked
- // The Play can't have already been added to the Set
- //
- access(all) fun addPlay(playID: UInt32) {
- pre {
- TopShot.playDatas[playID] != nil: "Cannot add the Play to Set: Play doesn't exist."
- !self.locked: "Cannot add the play to the Set after the set has been locked."
- self.numberMintedPerPlay[playID] == nil: "The play has already beed added to the set."
- }
-
- // Add the Play to the array of Plays
- self.plays.append(playID)
-
- // Open the Play up for minting
- self.retired[playID] = false
-
- // Initialize the Moment count to zero
- self.numberMintedPerPlay[playID] = 0
-
- emit PlayAddedToSet(setID: self.setID, playID: playID)
- }
-
- // addPlays adds multiple Plays to the Set
- //
- // Parameters: playIDs: The IDs of the Plays that are being added
- // as an array
- //
- access(all) fun addPlays(playIDs: [UInt32]) {
- for play in playIDs {
- self.addPlay(playID: play)
- }
- }
-
- // retirePlay retires a Play from the Set so that it can't mint new Moments
- //
- // Parameters: playID: The ID of the Play that is being retired
- //
- // Pre-Conditions:
- // The Play is part of the Set and not retired (available for minting).
- //
- access(all) fun retirePlay(playID: UInt32) {
- pre {
- self.retired[playID] != nil: "Cannot retire the Play: Play doesn't exist in this set!"
- }
-
- if !self.retired[playID]! {
- self.retired[playID] = true
-
- emit PlayRetiredFromSet(setID: self.setID, playID: playID, numMoments: self.numberMintedPerPlay[playID]!)
- }
- }
-
- // retireAll retires all the plays in the Set
- // Afterwards, none of the retired Plays will be able to mint new Moments
- //
- access(all) fun retireAll() {
- for play in self.plays {
- self.retirePlay(playID: play)
- }
- }
-
- // lock() locks the Set so that no more Plays can be added to it
- //
- // Pre-Conditions:
- // The Set should not be locked
- access(all) fun lock() {
- if !self.locked {
- self.locked = true
- emit SetLocked(setID: self.setID)
- }
- }
-
- // mintMoment mints a new Moment and returns the newly minted Moment
- //
- // Parameters: playID: The ID of the Play that the Moment references
- //
- // Pre-Conditions:
- // The Play must exist in the Set and be allowed to mint new Moments
- //
- // Returns: The NFT that was minted
- //
- access(all) fun mintMoment(playID: UInt32): @NFT {
- pre {
- self.retired[playID] != nil: "Cannot mint the moment: This play doesn't exist."
- !self.retired[playID]!: "Cannot mint the moment from this play: This play has been retired."
- }
-
- // Gets the number of Moments that have been minted for this Play
- // to use as this Moment's serial number
- let numInPlay = self.numberMintedPerPlay[playID]!
-
- // Mint the new moment
- let newMoment: @NFT <- create NFT(serialNumber: numInPlay + UInt32(1),
- playID: playID,
- setID: self.setID)
-
- // Increment the count of Moments minted for this Play
- self.numberMintedPerPlay[playID] = numInPlay + UInt32(1)
-
- return <-newMoment
- }
-
- // batchMintMoment mints an arbitrary quantity of Moments
- // and returns them as a Collection
- //
- // Parameters: playID: the ID of the Play that the Moments are minted for
- // quantity: The quantity of Moments to be minted
- //
- // Returns: Collection object that contains all the Moments that were minted
- //
- access(all) fun batchMintMoment(playID: UInt32, quantity: UInt64): @Collection {
- let newCollection <- create Collection()
-
- var i: UInt64 = 0
- while i < quantity {
- newCollection.deposit(token: <-self.mintMoment(playID: playID))
- i = i + UInt64(1)
- }
-
- return <-newCollection
- }
- }
-
- access(all) struct MomentData {
-
- // The ID of the Set that the Moment comes from
- access(all) let setID: UInt32
-
- // The ID of the Play that the Moment references
- access(all) let playID: UInt32
-
- // The place in the edition that this Moment was minted
- // Otherwise know as the serial number
- access(all) let serialNumber: UInt32
-
- init(setID: UInt32, playID: UInt32, serialNumber: UInt32) {
- self.setID = setID
- self.playID = playID
- self.serialNumber = serialNumber
- }
-
- }
-
- // The resource that represents the Moment NFTs
- //
- access(all) resource NFT: NonFungibleToken.INFT {
-
- // Global unique moment ID
- access(all) let id: UInt64
-
- // Struct of Moment metadata
- access(all) let data: MomentData
-
- init(serialNumber: UInt32, playID: UInt32, setID: UInt32) {
- // Increment the global Moment IDs
- TopShot.totalSupply = TopShot.totalSupply + UInt64(1)
-
- self.id = TopShot.totalSupply
-
- // Set the metadata struct
- self.data = MomentData(setID: setID, playID: playID, serialNumber: serialNumber)
-
- emit MomentMinted(momentID: self.id, playID: playID, setID: self.data.setID, serialNumber: self.data.serialNumber)
- }
- }
-
- // Admin is a special authorization resource that
- // allows the owner to perform important functions to modify the
- // various aspects of the Plays, Sets, and Moments
- //
- access(all) resource Admin {
-
- // createPlay creates a new Play struct
- // and stores it in the Plays dictionary in the TopShot smart contract
- //
- // Parameters: metadata: A dictionary mapping metadata titles to their data
- // example: {"Player Name": "Kevin Durant", "Height": "7 feet"}
- // (because we all know Kevin Durant is not 6'9")
- //
- // Returns: the ID of the new Play object
- //
- access(all) fun createPlay(metadata: {String: String}): UInt32 {
- // Create the new Play
- var newPlay = Play(metadata: metadata)
- let newID = newPlay.playID
-
- // Store it in the contract storage
- TopShot.playDatas[newID] = newPlay
-
- return newID
- }
-
- // createSet creates a new Set resource and stores it
- // in the sets mapping in the TopShot contract
- //
- // Parameters: name: The name of the Set
- //
- access(all) fun createSet(name: String) {
- // Create the new Set
- var newSet <- create Set(name: name)
-
- // Store it in the sets mapping field
- TopShot.sets[newSet.setID] <-! newSet
- }
-
- // borrowSet returns a reference to a set in the TopShot
- // contract so that the admin can call methods on it
- //
- // Parameters: setID: The ID of the Set that you want to
- // get a reference to
- //
- // Returns: A reference to the Set with all of the fields
- // and methods exposed
- //
- access(all) fun borrowSet(setID: UInt32): &Set {
- pre {
- TopShot.sets[setID] != nil: "Cannot borrow Set: The Set doesn't exist"
- }
-
- // Get a reference to the Set and return it
- // use & to indicate the reference to the object and type
- return (&TopShot.sets[setID] as &Set?)!
- }
-
- // startNewSeries ends the current series by incrementing
- // the series number, meaning that Moments minted after this
- // will use the new series number
- //
- // Returns: The new series number
- //
- access(all) fun startNewSeries(): UInt32 {
- // End the current series and start a new one
- // by incrementing the TopShot series number
- TopShot.currentSeries = TopShot.currentSeries + UInt32(1)
-
- emit NewSeriesStarted(newCurrentSeries: TopShot.currentSeries)
-
- return TopShot.currentSeries
- }
-
- // createNewAdmin creates a new Admin resource
- //
- access(all) fun createNewAdmin(): @Admin {
- return <-create Admin()
- }
- }
-
- // This is the interface that users can cast their Moment Collection as
- // to allow others to deposit Moments into their Collection. It also allows for reading
- // the IDs of Moments in the Collection.
- access(all) resource interface MomentCollectionPublic {
- access(all) fun deposit(token: @NonFungibleToken.NFT)
- access(all) fun batchDeposit(tokens: @NonFungibleToken.Collection)
- access(all) fun getIDs(): [UInt64]
- access(all) fun borrowNFT(id: UInt64): &NonFungibleToken.NFT
- access(all) fun borrowMoment(id: UInt64): &TopShot.NFT? {
- // If the result isn't nil, the id of the returned reference
- // should be the same as the argument to the function
- post {
- (result == nil) || (result?.id == id):
- "Cannot borrow Moment reference: The ID of the returned reference is incorrect"
- }
- }
- }
-
- // Collection is a resource that every user who owns NFTs
- // will store in their account to manage their NFTS
- //
- access(all) resource Collection: MomentCollectionPublic, NonFungibleToken.Provider, NonFungibleToken.Receiver, NonFungibleToken.CollectionPublic {
- // Dictionary of Moment conforming tokens
- // NFT is a resource type with a UInt64 ID field
- access(all) var ownedNFTs: @{UInt64: NonFungibleToken.NFT}
-
- init() {
- self.ownedNFTs <- {}
- }
-
- // withdraw removes an Moment from the Collection and moves it to the caller
- //
- // Parameters: withdrawID: The ID of the NFT
- // that is to be removed from the Collection
- //
- // returns: @NonFungibleToken.NFT the token that was withdrawn
- access(NonFungibleToken.Withdrawable) fun withdraw(withdrawID: UInt64): @NonFungibleToken.NFT {
-
- // Remove the nft from the Collection
- let token <- self.ownedNFTs.remove(key: withdrawID)
- ?? panic("Cannot withdraw: Moment does not exist in the collection")
-
- emit Withdraw(id: token.id, from: self.owner?.address)
-
- // Return the withdrawn token
- return <-token
- }
-
- // batchWithdraw withdraws multiple tokens and returns them as a Collection
- //
- // Parameters: ids: An array of IDs to withdraw
- //
- // Returns: @NonFungibleToken.Collection: A collection that contains
- // the withdrawn moments
- //
- access(all) fun batchWithdraw(ids: [UInt64]): @NonFungibleToken.Collection {
- // Create a new empty Collection
- var batchCollection <- create Collection()
-
- // Iterate through the ids and withdraw them from the Collection
- for id in ids {
- batchCollection.deposit(token: <-self.withdraw(withdrawID: id))
- }
-
- // Return the withdrawn tokens
- return <-batchCollection
- }
-
- // deposit takes a Moment and adds it to the Collections dictionary
- //
- // Parameters: token: the NFT to be deposited in the collection
- //
- access(all) fun deposit(token: @NonFungibleToken.NFT) {
-
- // Cast the deposited token as a TopShot NFT to make sure
- // it is the correct type
- let token <- token as! @TopShot.NFT
-
- // Get the token's ID
- let id = token.id
-
- // Add the new token to the dictionary
- let oldToken <- self.ownedNFTs[id] <- token
-
- // Only emit a deposit event if the Collection
- // is in an account's storage
- if self.owner?.address != nil {
- emit Deposit(id: id, to: self.owner?.address)
- }
-
- // Destroy the empty old token that was "removed"
- destroy oldToken
- }
-
- // batchDeposit takes a Collection object as an argument
- // and deposits each contained NFT into this Collection
- access(all) fun batchDeposit(tokens: @NonFungibleToken.Collection) {
-
- // Get an array of the IDs to be deposited
- let keys = tokens.getIDs()
-
- // Iterate through the keys in the collection and deposit each one
- for key in keys {
- self.deposit(token: <-tokens.withdraw(withdrawID: key))
- }
-
- // Destroy the empty Collection
- destroy tokens
- }
-
- // getIDs returns an array of the IDs that are in the Collection
- access(all) fun getIDs(): [UInt64] {
- return self.ownedNFTs.keys
- }
-
- // borrowNFT Returns a borrowed reference to a Moment in the Collection
- // so that the caller can read its ID
- //
- // Parameters: id: The ID of the NFT to get the reference for
- //
- // Returns: A reference to the NFT
- //
- // Note: This only allows the caller to read the ID of the NFT,
- // not any topshot specific data. Please use borrowMoment to
- // read Moment data.
- //
- access(all) fun borrowNFT(id: UInt64): &NonFungibleToken.NFT {
- return (&self.ownedNFTs[id] as &NonFungibleToken.NFT?)!
- }
-
- // borrowMoment returns a borrowed reference to a Moment
- // so that the caller can read data and call methods from it.
- // They can use this to read its setID, playID, serialNumber,
- // or any of the setData or Play data associated with it by
- // getting the setID or playID and reading those fields from
- // the smart contract.
- //
- // Parameters: id: The ID of the NFT to get the reference for
- //
- // Returns: A reference to the NFT
- access(all) fun borrowMoment(id: UInt64): &TopShot.NFT? {
- if self.ownedNFTs[id] != nil {
- let ref = (&self.ownedNFTs[id] as &NonFungibleToken.NFT?)!
- return ref as! &TopShot.NFT
- } else {
- return nil
- }
- }
- }
-
- // -----------------------------------------------------------------------
- // TopShot contract-level function definitions
- // -----------------------------------------------------------------------
-
- // createEmptyCollection creates a new, empty Collection object so that
- // a user can store it in their account storage.
- // Once they have a Collection in their storage, they are able to receive
- // Moments in transactions.
- //
- access(all) fun createEmptyCollection(): @NonFungibleToken.Collection {
- return <-create TopShot.Collection()
- }
-
- // getAllPlays returns all the plays in topshot
- //
- // Returns: An array of all the plays that have been created
- access(all) fun getAllPlays(): [TopShot.Play] {
- return TopShot.playDatas.values
- }
-
- // getPlayMetaData returns all the metadata associated with a specific Play
- //
- // Parameters: playID: The id of the Play that is being searched
- //
- // Returns: The metadata as a String to String mapping optional
- access(all) fun getPlayMetaData(playID: UInt32): {String: String}? {
- return self.playDatas[playID]?.metadata
- }
-
- // getPlayMetaDataByField returns the metadata associated with a
- // specific field of the metadata
- // Ex: field: "Team" will return something
- // like "Memphis Grizzlies"
- //
- // Parameters: playID: The id of the Play that is being searched
- // field: The field to search for
- //
- // Returns: The metadata field as a String Optional
- access(all) fun getPlayMetaDataByField(playID: UInt32, field: String): String? {
- // Don't force a revert if the playID or field is invalid
- if let play = TopShot.playDatas[playID] {
- return play.metadata[field]
- } else {
- return nil
- }
- }
-
- // getSetName returns the name that the specified Set
- // is associated with.
- //
- // Parameters: setID: The id of the Set that is being searched
- //
- // Returns: The name of the Set
- access(all) fun getSetName(setID: UInt32): String? {
- // Don't force a revert if the setID is invalid
- return TopShot.setDatas[setID]?.name
- }
-
- // getSetSeries returns the series that the specified Set
- // is associated with.
- //
- // Parameters: setID: The id of the Set that is being searched
- //
- // Returns: The series that the Set belongs to
- access(all) fun getSetSeries(setID: UInt32): UInt32? {
- // Don't force a revert if the setID is invalid
- return TopShot.setDatas[setID]?.series
- }
-
- // getSetIDsByName returns the IDs that the specified Set name
- // is associated with.
- //
- // Parameters: setName: The name of the Set that is being searched
- //
- // Returns: An array of the IDs of the Set if it exists, or nil if doesn't
- access(all) fun getSetIDsByName(setName: String): [UInt32]? {
- var setIDs: [UInt32] = []
-
- // Iterate through all the setDatas and search for the name
- for setData in TopShot.setDatas.values {
- if setName == setData.name {
- // If the name is found, return the ID
- setIDs.append(setData.setID)
- }
- }
-
- // If the name isn't found, return nil
- // Don't force a revert if the setName is invalid
- if setIDs.length == 0 {
- return nil
- } else {
- return setIDs
- }
- }
-
- // getPlaysInSet returns the list of Play IDs that are in the Set
- //
- // Parameters: setID: The id of the Set that is being searched
- //
- // Returns: An array of Play IDs
- access(all) fun getPlaysInSet(setID: UInt32): [UInt32]? {
- // Don't force a revert if the setID is invalid
- return TopShot.sets[setID]?.plays
- }
-
- // isEditionRetired returns a boolean that indicates if a Set/Play combo
- // (otherwise known as an edition) is retired.
- // If an edition is retired, it still remains in the Set,
- // but Moments can no longer be minted from it.
- //
- // Parameters: setID: The id of the Set that is being searched
- // playID: The id of the Play that is being searched
- //
- // Returns: Boolean indicating if the edition is retired or not
- access(all) fun isEditionRetired(setID: UInt32, playID: UInt32): Bool? {
- // Don't force a revert if the set or play ID is invalid
- // Remove the set from the dictionary to get its field
- if let setToRead <- TopShot.sets.remove(key: setID) {
-
- // See if the Play is retired from this Set
- let retired = setToRead.retired[playID]
-
- // Put the Set back in the contract storage
- TopShot.sets[setID] <-! setToRead
-
- // Return the retired status
- return retired
- } else {
-
- // If the Set wasn't found, return nil
- return nil
- }
- }
-
- // isSetLocked returns a boolean that indicates if a Set
- // is locked. If it's locked,
- // new Plays can no longer be added to it,
- // but Moments can still be minted from Plays the set contains.
- //
- // Parameters: setID: The id of the Set that is being searched
- //
- // Returns: Boolean indicating if the Set is locked or not
- access(all) fun isSetLocked(setID: UInt32): Bool? {
- // Don't force a revert if the setID is invalid
- return TopShot.sets[setID]?.locked
- }
-
- // getNumMomentsInEdition return the number of Moments that have been
- // minted from a certain edition.
- //
- // Parameters: setID: The id of the Set that is being searched
- // playID: The id of the Play that is being searched
- //
- // Returns: The total number of Moments
- // that have been minted from an edition
- access(all) fun getNumMomentsInEdition(setID: UInt32, playID: UInt32): UInt32? {
- // Don't force a revert if the Set or play ID is invalid
- // Remove the Set from the dictionary to get its field
- if let setToRead <- TopShot.sets.remove(key: setID) {
-
- // Read the numMintedPerPlay
- let amount = setToRead.numberMintedPerPlay[playID]
-
- // Put the Set back into the Sets dictionary
- TopShot.sets[setID] <-! setToRead
-
- return amount
- } else {
- // If the set wasn't found return nil
- return nil
- }
- }
-
- // -----------------------------------------------------------------------
- // TopShot initialization function
- // -----------------------------------------------------------------------
- //
- init() {
- // Initialize contract fields
- self.currentSeries = 0
- self.playDatas = {}
- self.setDatas = {}
- self.sets <- {}
- self.nextPlayID = 1
- self.nextSetID = 1
- self.totalSupply = 0
-
- // Put a new Collection in storage
- self.account.storage.save<@Collection>(<- create Collection(), to: /storage/MomentCollection)
-
- // Create a public capability for the Collection
- let cap = self.account.capabilities.storage.issue<&{MomentCollectionPublic}>(/storage/MomentCollection)
- self.account.capabilities.publish(cap, at: /public/MomentCollection)
-
- // Put the Minter in storage
- self.account.storage.save<@Admin>(<- create Admin(), to: /storage/TopShotAdmin)
-
- emit ContractInitialized()
- }
-}
-`
- func TestCheckTopShotContract(t *testing.T) {
-
- t.Parallel()
-
- nftChecker, err := ParseAndCheckWithOptions(t,
- realNonFungibleTokenContractInterface,
- ParseAndCheckOptions{
- Location: common.AddressLocation{
- Address: common.MustBytesToAddress([]byte{0x1}),
- Name: "NonFungibleToken",
- },
- },
- )
- require.NoError(t, err)
-
- baseValueActivation := sema.NewVariableActivation(sema.BaseValueActivation)
- baseValueActivation.DeclareValue(stdlib.PanicFunction)
-
- _, err = ParseAndCheckWithOptions(t,
- topShotContract,
- ParseAndCheckOptions{
- Location: common.AddressLocation{
- Address: common.MustBytesToAddress([]byte{0x2}),
- Name: "TopShot",
- },
- Config: &sema.Config{
- ImportHandler: func(_ *sema.Checker, _ common.Location, _ ast.Range) (sema.Import, error) {
- return sema.ElaborationImport{
- Elaboration: nftChecker.Elaboration,
- }, nil
- },
- BaseValueActivationHandler: func(_ common.Location) *sema.VariableActivation {
- return baseValueActivation
- },
- },
- },
- )
- require.NoError(t, err)
-} */
diff --git a/tests/examples/examples.go b/tests/examples/examples.go
deleted file mode 100644
index 7a96b68337..0000000000
--- a/tests/examples/examples.go
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Cadence - The resource-oriented smart contract programming language
- *
- * Copyright Flow Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package examples
-
-const FungibleTokenContractInterface = `
- access(all) contract interface FungibleToken {
-
- access(all) resource interface Provider {
-
- access(all) fun withdraw(amount: Int): @Vault
- }
-
- access(all) resource interface Receiver {
-
- access(all) fun deposit(vault: @Vault)
- }
-
- access(all) resource Vault: Provider, Receiver {
-
- access(all) balance: Int
-
- init(balance: Int)
- }
-
- access(all) fun absorb(vault: @Vault)
-
- access(all) fun sprout(balance: Int): @Vault
- }
-`
-
-const ExampleFungibleTokenContract = `
- access(all) contract ExampleToken: FungibleToken {
-
- access(all) resource Vault: FungibleToken.Receiver, FungibleToken.Provider {
-
- access(all) var balance: Int
-
- init(balance: Int) {
- self.balance = balance
- }
-
- access(all) fun withdraw(amount: Int): @FungibleToken.Vault {
- self.balance = self.balance - amount
- return <-create Vault(balance: amount)
- }
-
- access(all) fun deposit(vault: @FungibleToken.Vault) {
- if let exampleVault <- vault as? @Vault {
- self.balance = self.balance + exampleVault.balance
- destroy exampleVault
- } else {
- destroy vault
- panic("deposited vault is not an ExampleToken.Vault")
- }
- }
- }
-
- access(all) fun absorb(vault: @FungibleToken.Vault) {
- destroy vault
- }
-
- access(all) fun sprout(balance: Int): @FungibleToken.Vault {
- return <-create Vault(balance: balance)
- }
- }
-`
diff --git a/tools/analysis/analysis.go b/tools/analysis/analysis.go
index 5f8be88377..eb179774de 100644
--- a/tools/analysis/analysis.go
+++ b/tools/analysis/analysis.go
@@ -22,8 +22,11 @@ import (
"github.com/onflow/cadence/common"
)
-func Load(config *Config, locations ...common.Location) (Programs, error) {
- programs := make(Programs, len(locations))
+func Load(config *Config, locations ...common.Location) (*Programs, error) {
+ programs := &Programs{
+ Programs: make(map[common.Location]*Program, len(locations)),
+ CryptoContractElaboration: config.CryptoContractElaboration,
+ }
for _, location := range locations {
err := programs.Load(config, location)
if err != nil {
diff --git a/tools/analysis/analysis_test.go b/tools/analysis/analysis_test.go
index c1eb69fa25..da09e6dd74 100644
--- a/tools/analysis/analysis_test.go
+++ b/tools/analysis/analysis_test.go
@@ -29,7 +29,7 @@ import (
"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/test_utils/sema_utils"
"github.com/onflow/cadence/tools/analysis"
)
@@ -89,8 +89,8 @@ func TestNeedSyntaxAndImport(t *testing.T) {
programs, err := analysis.Load(config, txLocation)
require.NoError(t, err)
- require.NotNil(t, programs[txLocation])
- require.NotNil(t, programs[contractLocation])
+ require.NotNil(t, programs.Get(txLocation))
+ require.NotNil(t, programs.Get(contractLocation))
type locationRange struct {
location common.Location
@@ -99,7 +99,7 @@ func TestNeedSyntaxAndImport(t *testing.T) {
var locationRanges []locationRange
- for _, program := range programs {
+ for _, program := range programs.Programs {
require.NotNil(t, program.Program)
require.NotNil(t, program.Checker)
@@ -309,7 +309,10 @@ func TestHandledParserError(t *testing.T) {
require.Equal(t, 1, handlerCalls)
var parserError parser.Error
- require.ErrorAs(t, programs[contractLocation].LoadError, &parserError)
+ require.ErrorAs(t,
+ programs.Get(contractLocation).LoadError,
+ &parserError,
+ )
}
func TestHandledCheckerError(t *testing.T) {
@@ -361,7 +364,10 @@ func TestHandledCheckerError(t *testing.T) {
require.NoError(t, err)
var checkerError *sema.CheckerError
- require.ErrorAs(t, programs[contractLocation].LoadError, &checkerError)
+ require.ErrorAs(t,
+ programs.Get(contractLocation).LoadError,
+ &checkerError,
+ )
}
// Tests that an error handled by the custom error handler is not returned
@@ -429,12 +435,21 @@ func TestHandledLoadErrorImportedProgram(t *testing.T) {
require.NoError(t, err)
var checkerError *sema.CheckerError
- require.ErrorAs(t, programs[contract1Location].LoadError, &checkerError)
- require.ErrorAs(t, programs[contract2Location].LoadError, &checkerError)
+ require.ErrorAs(t,
+ programs.Get(contract1Location).LoadError,
+ &checkerError,
+ )
+ require.ErrorAs(t,
+ programs.Get(contract2Location).LoadError,
+ &checkerError,
+ )
// Validate that parent checker receives the imported program error despite it being handled
var importedProgramErr *sema.ImportedProgramError
- require.ErrorAs(t, programs[contract1Location].LoadError, &importedProgramErr)
+ require.ErrorAs(t,
+ programs.Get(contract1Location).LoadError,
+ &importedProgramErr,
+ )
}
func TestStdlib(t *testing.T) {
@@ -543,7 +558,7 @@ func TestCyclicImports(t *testing.T) {
var checkerError *sema.CheckerError
require.ErrorAs(t, err, &checkerError)
- errs := checker.RequireCheckerErrors(t, checkerError, 1)
+ errs := RequireCheckerErrors(t, checkerError, 1)
var importedProgramErr *sema.ImportedProgramError
require.ErrorAs(t, errs[0], &importedProgramErr)
@@ -551,6 +566,6 @@ func TestCyclicImports(t *testing.T) {
var nestedCheckerErr *sema.CheckerError
require.ErrorAs(t, importedProgramErr.Err, &nestedCheckerErr)
- errs = checker.RequireCheckerErrors(t, nestedCheckerErr, 1)
+ errs = RequireCheckerErrors(t, nestedCheckerErr, 1)
require.IsType(t, &sema.CyclicImportsError{}, errs[0])
}
diff --git a/tools/analysis/config.go b/tools/analysis/config.go
index c545e669bb..b85c91340a 100644
--- a/tools/analysis/config.go
+++ b/tools/analysis/config.go
@@ -45,6 +45,8 @@ type Config struct {
HandleParserError func(err ParsingCheckingError, program *ast.Program) error
// HandleCheckerError is called when a checker error occurs instead of returning it
HandleCheckerError func(err ParsingCheckingError, checker *sema.Checker) error
+ // CryptoContractElaboration is the elaboration of the Crypto contract
+ CryptoContractElaboration *sema.Elaboration
}
func NewSimpleConfig(
diff --git a/tools/analysis/programs.go b/tools/analysis/programs.go
index 83b03f36d6..1ebf557961 100644
--- a/tools/analysis/programs.go
+++ b/tools/analysis/programs.go
@@ -19,6 +19,8 @@
package analysis
import (
+ "fmt"
+
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/parser"
@@ -26,11 +28,15 @@ import (
"github.com/onflow/cadence/stdlib"
)
-type Programs map[common.Location]*Program
+type Programs struct {
+ Programs map[common.Location]*Program
+ CryptoContractElaboration *sema.Elaboration
+ CryptoContractLocation func() common.Location
+}
type importResolutionResults map[common.Location]bool
-func (programs Programs) Load(config *Config, location common.Location) error {
+func (programs *Programs) Load(config *Config, location common.Location) error {
return programs.load(
config,
location,
@@ -43,14 +49,14 @@ func (programs Programs) Load(config *Config, location common.Location) error {
)
}
-func (programs Programs) load(
+func (programs *Programs) load(
config *Config,
location common.Location,
importingLocation common.Location,
importRange ast.Range,
seenImports importResolutionResults,
) error {
- if programs[location] != nil {
+ if programs.Programs[location] != nil {
return nil
}
@@ -104,7 +110,7 @@ func (programs Programs) load(
}
}
- programs[location] = &Program{
+ programs.Programs[location] = &Program{
Location: location,
Code: code,
Program: program,
@@ -115,7 +121,7 @@ func (programs Programs) load(
return nil
}
-func (programs Programs) check(
+func (programs *Programs) check(
config *Config,
program *ast.Program,
location common.Location,
@@ -153,10 +159,29 @@ func (programs Programs) check(
var loadError error
switch importedLocation {
- case stdlib.CryptoCheckerLocation:
- cryptoChecker := stdlib.CryptoChecker()
- elaboration = cryptoChecker.Elaboration
+ case stdlib.CryptoContractLocation:
+ // If the elaboration for the crypto contract is available, take it.
+ elaboration = programs.CryptoContractElaboration
+ if elaboration != nil {
+ break
+ }
+
+ // Otherwise, if the location for the Crypto contract is provided,
+ // then resolve the source code from that location and continue as
+ // any other contract.
+ cryptoLocation := programs.CryptoContractLocation
+ if cryptoLocation == nil {
+ return nil, fmt.Errorf("cannot find crypto contract")
+ }
+ importedLocation = cryptoLocation()
+
+ // Memoize the crypto contract's elaboration, for subsequent uses.
+ defer func() {
+ programs.CryptoContractElaboration = elaboration
+ }()
+
+ fallthrough
default:
if seenImports[importedLocation] {
return nil, &sema.CyclicImportsError{
@@ -172,7 +197,7 @@ func (programs Programs) check(
return nil, err
}
- program := programs[importedLocation]
+ program := programs.Programs[importedLocation]
checker := program.Checker
// If the imported program has a checker, use its elaboration for the import
@@ -205,3 +230,7 @@ func (programs Programs) check(
return checker, nil
}
+
+func (programs *Programs) Get(location common.Location) *Program {
+ return programs.Programs[location]
+}
diff --git a/tools/ast-explorer/src/index.tsx b/tools/ast-explorer/src/index.tsx
index 265465b82d..d825d56bd4 100644
--- a/tools/ast-explorer/src/index.tsx
+++ b/tools/ast-explorer/src/index.tsx
@@ -24,9 +24,9 @@ import { Data, TreeView } from "./tree";
import { createRoot } from 'react-dom/client';
const defaultCode = `
-pub contract C {
- pub resource R {}
- pub fun createR(): @R {
+access(all) contract C {
+ access(all) resource R {}
+ access(all) fun createR(): @R {
return <- create R()
}
}
diff --git a/tools/compatibility-check/cmd/check_contracts/main.go b/tools/compatibility-check/cmd/check_contracts/main.go
index 4e472c2e00..ec6b008c41 100644
--- a/tools/compatibility-check/cmd/check_contracts/main.go
+++ b/tools/compatibility-check/cmd/check_contracts/main.go
@@ -24,16 +24,21 @@ import (
"github.com/rs/zerolog/log"
"github.com/onflow/cadence/tools/compatibility_check"
+
+ "github.com/onflow/flow-go/model/flow"
)
func main() {
- if len(os.Args) < 2 {
- log.Error().Msg("not enough arguments. Usage: csv_path output_path")
+ if len(os.Args) < 3 {
+ log.Error().Msg("not enough arguments. Usage: ")
return
}
- csvPath := os.Args[1]
- outputPath := os.Args[2]
+ chainName := os.Args[1]
+ csvPath := os.Args[2]
+ outputPath := os.Args[3]
+
+ chain := flow.ChainID(chainName).Chain()
csvFile, err := os.Open(csvPath)
if err != nil {
@@ -53,6 +58,6 @@ func main() {
_ = outputFile.Close()
}()
- checker := compatibility_check.NewContractChecker(outputFile)
+ checker := compatibility_check.NewContractChecker(chain, outputFile)
checker.CheckCSV(csvFile)
}
diff --git a/tools/compatibility-check/contracts_checker.go b/tools/compatibility-check/contracts_checker.go
index 4964e4edbc..99bd2149c4 100644
--- a/tools/compatibility-check/contracts_checker.go
+++ b/tools/compatibility-check/contracts_checker.go
@@ -19,32 +19,39 @@
package compatibility_check
import (
+ "encoding/csv"
"fmt"
"io"
"log"
"reflect"
"strings"
- "encoding/csv"
-
"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"
"github.com/onflow/cadence/tools/analysis"
+
+ "github.com/onflow/flow-go/fvm/systemcontracts"
+ "github.com/onflow/flow-go/model/flow"
+
+ "github.com/onflow/flow-core-contracts/lib/go/contracts"
)
const LoadMode = analysis.NeedTypes
type ContractsChecker struct {
+ chain flow.Chain
Codes map[common.Location][]byte
outputWriter io.StringWriter
}
-func NewContractChecker(outputWriter io.StringWriter) *ContractsChecker {
+func NewContractChecker(chain flow.Chain, outputWriter io.StringWriter) *ContractsChecker {
checker := &ContractsChecker{
Codes: map[common.Location][]byte{},
outputWriter: outputWriter,
+ chain: chain,
}
return checker
@@ -117,7 +124,23 @@ func (c *ContractsChecker) analyze(
config *analysis.Config,
locations []common.Location,
) {
- programs := make(analysis.Programs, len(locations))
+
+ sc := systemcontracts.SystemContractsForChain(c.chain.ChainID())
+
+ cryptoContractLocation := common.AddressLocation{
+ Address: common.Address(sc.Crypto.Address),
+ Name: string(stdlib.CryptoContractLocation),
+ }
+
+ // TODO: Remove once the Crypto contract is available on-chain.
+ c.Codes[cryptoContractLocation] = contracts.Crypto()
+
+ programs := analysis.Programs{
+ Programs: make(map[common.Location]*analysis.Program, len(locations)),
+ CryptoContractLocation: func() common.Location {
+ return cryptoContractLocation
+ },
+ }
log.Println("Checking contracts ...")
diff --git a/tools/compatibility-check/contracts_checker_test.go b/tools/compatibility-check/contracts_checker_test.go
index 55d25d844a..bef2e761f7 100644
--- a/tools/compatibility-check/contracts_checker_test.go
+++ b/tools/compatibility-check/contracts_checker_test.go
@@ -23,14 +23,20 @@ import (
"testing"
"github.com/stretchr/testify/assert"
+
+ "github.com/onflow/flow-go/model/flow"
)
func TestCyclicImport(t *testing.T) {
+ t.Parallel()
+
var output bytes.Buffer
var input bytes.Buffer
- checker := NewContractChecker(&output)
+ chain := flow.Testnet.Chain()
+
+ checker := NewContractChecker(chain, &output)
input.Write([]byte(`location,code
A.0000000000000001.Foo,"import Bar from 0x0000000000000001
@@ -49,3 +55,30 @@ access(all) contract Foo {}"
assert.Contains(t, outputStr, "Bar:16(1:16):*sema.ImportedProgramError")
assert.Contains(t, outputStr, "Baz:16(1:16):*sema.ImportedProgramError")
}
+
+func TestCryptoImport(t *testing.T) {
+
+ t.Parallel()
+
+ var output bytes.Buffer
+ var input bytes.Buffer
+
+ chainID := flow.Testnet
+
+ checker := NewContractChecker(chainID.Chain(), &output)
+
+ contractsCSV := `location,code
+A.0000000000000001.Foo,"import Crypto
+access(all) contract Foo {}"
+A.0000000000000001.Bar,"import Crypto
+access(all) contract Bar {}"
+`
+
+ input.Write([]byte(contractsCSV))
+
+ checker.CheckCSV(&input)
+
+ outputStr := output.String()
+
+ assert.Empty(t, outputStr)
+}
diff --git a/tools/compatibility-check/go.mod b/tools/compatibility-check/go.mod
index b784d39da9..44484aee7a 100644
--- a/tools/compatibility-check/go.mod
+++ b/tools/compatibility-check/go.mod
@@ -3,38 +3,89 @@ module github.com/onflow/cadence/tools/compatibility_check
go 1.22
require (
- github.com/onflow/cadence v1.0.1-0.20241017195911-152088fcbb15
- github.com/rs/zerolog v1.26.1
+ github.com/onflow/cadence v1.1.1-0.20241018202510-7f1b6fbc57c2
+ github.com/rs/zerolog v1.29.0
github.com/stretchr/testify v1.9.0
)
require (
github.com/SaveTheRbtz/mph v0.1.1-0.20240117162131-4166ec7869bc // indirect
- github.com/bits-and-blooms/bitset v1.5.0 // indirect
+ github.com/bits-and-blooms/bitset v1.10.0 // indirect
+ github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
+ github.com/coreos/go-semver v0.3.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
+ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
+ github.com/ethereum/go-ethereum v1.13.10 // indirect
+ github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fxamacker/cbor/v2 v2.4.1-0.20230228173756-c0c9f774e40c // indirect
github.com/fxamacker/circlehash v0.3.0 // indirect
+ github.com/golang/protobuf v1.5.4 // indirect
+ github.com/hashicorp/hcl v1.0.0 // indirect
+ github.com/holiman/uint256 v1.3.0 // indirect
+ github.com/inconshreveable/mousetrap v1.1.0 // indirect
+ github.com/ipfs/go-cid v0.4.1 // indirect
github.com/k0kubun/pp v3.0.1+incompatible // indirect
- github.com/klauspost/cpuid/v2 v2.2.0 // indirect
+ github.com/kevinburke/go-bindata v3.24.0+incompatible // indirect
+ github.com/klauspost/cpuid/v2 v2.2.6 // 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/logrusorgru/aurora/v4 v4.0.0 // indirect
+ github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
+ github.com/minio/sha256-simd v1.0.1 // indirect
+ github.com/mitchellh/mapstructure v1.5.0 // indirect
+ github.com/mr-tron/base58 v1.2.0 // indirect
+ github.com/multiformats/go-base32 v0.1.0 // indirect
+ github.com/multiformats/go-base36 v0.2.0 // indirect
+ github.com/multiformats/go-multibase v0.2.0 // indirect
+ github.com/multiformats/go-multihash v0.2.3 // indirect
+ github.com/multiformats/go-varint v0.0.7 // indirect
github.com/onflow/atree v0.8.0 // indirect
+ github.com/onflow/crypto v0.25.2 // indirect
+ github.com/onflow/flow-core-contracts/lib/go/contracts v1.4.0 // indirect
+ github.com/onflow/flow-core-contracts/lib/go/templates v1.3.3-0.20241017220455-79fdc6c8ba53 // indirect
+ github.com/onflow/flow-ft/lib/go/contracts v1.0.1 // indirect
+ github.com/onflow/flow-ft/lib/go/templates v1.0.1 // indirect
+ github.com/onflow/flow-go v0.38.0-preview.0.0.20241018215103-774056466e36 // indirect
+ github.com/onflow/flow-go-sdk v1.1.0 // indirect
+ github.com/onflow/flow-nft/lib/go/contracts v1.2.2 // indirect
+ github.com/onflow/flow-nft/lib/go/templates v1.2.1 // indirect
+ github.com/onflow/flow/protobuf/go/flow v0.4.7 // indirect
+ github.com/onflow/go-ethereum v1.14.7 // indirect
+ github.com/pelletier/go-toml/v2 v2.0.6 // indirect
+ github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
+ github.com/psiemens/sconfig v0.1.0 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
- github.com/rogpeppe/go-internal v1.9.0 // indirect
+ github.com/rogpeppe/go-internal v1.10.0 // indirect
+ github.com/spaolacci/murmur3 v1.1.0 // indirect
+ github.com/spf13/afero v1.10.0 // indirect
+ github.com/spf13/cast v1.5.0 // indirect
+ github.com/spf13/cobra v1.8.0 // indirect
+ github.com/spf13/jwalterweatherman v1.1.0 // indirect
+ github.com/spf13/pflag v1.0.5 // indirect
+ github.com/spf13/viper v1.15.0 // indirect
+ github.com/subosito/gotenv v1.4.2 // 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/vmihailenco/msgpack v4.0.4+incompatible // indirect
+ github.com/vmihailenco/msgpack/v4 v4.3.11 // indirect
+ github.com/vmihailenco/tagparser v0.1.1 // 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-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
+ go.opentelemetry.io/otel v1.24.0 // indirect
+ golang.org/x/crypto v0.26.0 // indirect
+ golang.org/x/exp v0.0.0-20240119083558-1b970713d09a // indirect
+ golang.org/x/sys v0.23.0 // indirect
+ golang.org/x/text v0.17.0 // indirect
+ golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
+ gonum.org/v1/gonum v0.14.0 // indirect
+ google.golang.org/appengine v1.6.8 // indirect
+ google.golang.org/protobuf v1.33.0 // indirect
+ gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
+ lukechampine.com/blake3 v1.3.0 // indirect
)
+
+replace github.com/onflow/cadence => ../../
diff --git a/tools/compatibility-check/go.sum b/tools/compatibility-check/go.sum
index 7b7106c856..ee2555e618 100644
--- a/tools/compatibility-check/go.sum
+++ b/tools/compatibility-check/go.sum
@@ -1,137 +1,769 @@
+cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
+cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU=
+cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
+cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY=
+cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc=
+cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0=
+cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To=
+cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4=
+cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M=
+cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc=
+cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk=
+cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs=
+cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc=
+cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY=
+cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI=
+cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk=
+cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY=
+cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o=
+cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE=
+cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc=
+cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
+cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
+cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
+cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
+cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
+cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
+cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw=
+cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA=
+cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU=
+cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw=
+cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos=
+cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
+cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
+cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
+cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
+dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
+github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
+github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
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/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
+github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
+github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
+github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
+github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
github.com/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/bits-and-blooms/bitset v1.10.0 h1:ePXTeiPEazB5+opbv5fr8umg2R/1NlzgDsyepwsSr88=
+github.com/bits-and-blooms/bitset v1.10.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8=
+github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ=
+github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04=
+github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
+github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
+github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
+github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
+github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
+github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc=
+github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
+github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk=
+github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
+github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
+github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk=
+github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
+github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM=
+github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk=
+github.com/coreos/go-systemd v0.0.0-20190321100706-95778dfbb74e/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4=
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
+github.com/coreos/go-systemd/v22 v22.3.3-0.20220203105225-a9a7ef127534/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
+github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA=
+github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE=
+github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
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=
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/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs=
+github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
+github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
+github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no=
+github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
+github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
+github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98=
+github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po=
+github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
+github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
+github.com/ethereum/go-ethereum v1.13.10 h1:Ppdil79nN+Vc+mXfge0AuUgmKWuVv4eMqzoIVSdqZek=
+github.com/ethereum/go-ethereum v1.13.10/go.mod h1:sc48XYQxCzH3fG9BcrXCOOgQk2JfZzNAmIKnceogzsA=
+github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
+github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
+github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
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/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
+github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
+github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
+github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
+github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
+github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
+github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk=
+github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
+github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
+github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4=
+github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
+github.com/golang/groupcache v0.0.0-20190129154638-5b532d6fd5ef/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
+github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
+github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
+github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
+github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y=
+github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
+github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
+github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw=
+github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4=
+github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
+github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
+github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
+github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
+github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
+github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
+github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
+github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
+github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
+github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
+github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
+github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
+github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
+github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
+github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
+github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
+github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
+github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
+github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
+github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg=
+github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
+github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
+github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
+github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
+github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
+github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
+github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
+github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
+github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
+github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
+github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
+github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
+github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
+github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
+github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
+github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
+github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
+github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
+github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
+github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
+github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
+github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
+github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
+github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
+github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
+github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
+github.com/holiman/uint256 v1.3.0 h1:4wdcm/tnd0xXdu7iS3ruNvxkWwrb4aeBQv19ayYn8F4=
+github.com/holiman/uint256 v1.3.0/go.mod h1:EOMSn4q6Nyt9P6efbI3bueV4e1b3dGlUCXeiRV4ng7E=
+github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
+github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
+github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
+github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
+github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
+github.com/ipfs/go-cid v0.4.1 h1:A/T3qGvxi4kpKWWcPC/PgbvDA2bjVLO7n4UeVwnbs/s=
+github.com/ipfs/go-cid v0.4.1/go.mod h1:uQHwDeX4c6CtyrFwdqyhpNcxVewur1M7l7fNU7LKwZk=
+github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
+github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
+github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
+github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/k0kubun/pp v3.0.1+incompatible h1:3tqvf7QgUnZ5tXO6pNAZlrvHgl6DvifjDrd9g2S9Z40=
github.com/k0kubun/pp v3.0.1+incompatible/go.mod h1:GWse8YhT0p8pT4ir3ZgBbfZild3tgzSScAn6HmfYukg=
+github.com/kevinburke/go-bindata v3.24.0+incompatible h1:qajFA3D0pH94OTLU4zcCCKCDgR+Zr2cZK/RPJHDdFoY=
+github.com/kevinburke/go-bindata v3.24.0+incompatible/go.mod h1:/pEEZ72flUW2p0yi30bslSp9YqD9pysLxunQDdb2CPM=
+github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
+github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
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/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/48xc=
+github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
+github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
+github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
+github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
+github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
+github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
+github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
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/leanovate/gopter v0.2.9/go.mod h1:U2L/78B+KVFIx2VmW6onHJQzXtFb+p5y3y2Sh+Jxxv8=
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/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
+github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
+github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
+github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
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.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
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/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
+github.com/minio/sha256-simd v1.0.1 h1:6kaan5IFmwTNynnKKpDHe6FWHohJOHhCPchzK49dzMM=
+github.com/minio/sha256-simd v1.0.1/go.mod h1:Pz6AKMiUdngCLpeTL/RJY1M9rUuPMYujV5xJjtbRSN8=
+github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0=
+github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
+github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY=
+github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo=
+github.com/mr-tron/base58 v1.2.0 h1:T/HDJBh4ZCPbU39/+c3rRvE0uKBQlU27+QI8LJ4t64o=
+github.com/mr-tron/base58 v1.2.0/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc=
+github.com/multiformats/go-base32 v0.1.0 h1:pVx9xoSPqEIQG8o+UbAe7DNi51oej1NtK+aGkbLYxPE=
+github.com/multiformats/go-base32 v0.1.0/go.mod h1:Kj3tFY6zNr+ABYMqeUNeGvkIC/UYgtWibDcT0rExnbI=
+github.com/multiformats/go-base36 v0.2.0 h1:lFsAbNOGeKtuKozrtBsAkSVhv1p9D0/qedU9rQyccr0=
+github.com/multiformats/go-base36 v0.2.0/go.mod h1:qvnKE++v+2MWCfePClUEjE78Z7P2a1UV0xHgWc0hkp4=
+github.com/multiformats/go-multibase v0.2.0 h1:isdYCVLvksgWlMW9OZRYJEa9pZETFivncJHmHnnd87g=
+github.com/multiformats/go-multibase v0.2.0/go.mod h1:bFBZX4lKCA/2lyOFSAoKH5SS6oPyjtnzK/XTFDPkNuk=
+github.com/multiformats/go-multihash v0.2.3 h1:7Lyc8XfX/IY2jWb/gI7JP+o7JEq9hOa7BFvVU9RSh+U=
+github.com/multiformats/go-multihash v0.2.3/go.mod h1:dXgKXCXjBzdscBLk9JkjINiEsCKRVch90MdaGiKsvSM=
+github.com/multiformats/go-varint v0.0.7 h1:sWSGR+f/eu5ABZA2ZpYKBILXTTs9JWpdEM/nEGOHFS8=
+github.com/multiformats/go-varint v0.0.7/go.mod h1:r8PUYw/fD/SjBCiKOoDlGF6QawOELpZAu9eioSos/OU=
+github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
+github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
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/onflow/crypto v0.25.0 h1:BeWbLsh3ZD13Ej+Uky6kg1PL1ZIVBDVX+2MVBNwqddg=
+github.com/onflow/crypto v0.25.0/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI=
+github.com/onflow/crypto v0.25.2 h1:GjHunqVt+vPcdqhxxhAXiMIF3YiLX7gTuTR5O+VG2ns=
+github.com/onflow/crypto v0.25.2/go.mod h1:fY7eLqUdMKV8EGOw301unP8h7PvLVy8/6gVR++/g0BY=
+github.com/onflow/flow v0.3.4 h1:FXUWVdYB90f/rjNcY0Owo30gL790tiYff9Pb/sycXYE=
+github.com/onflow/flow-core-contracts/lib/go/contracts v1.4.0 h1:R86HaOuk6vpuECZnriEUE7bw9inC2AtdSn8lL/iwQLQ=
+github.com/onflow/flow-core-contracts/lib/go/contracts v1.4.0/go.mod h1:9asTBnB6Tw2UlVVtQKyS/egYv3xr4zVlJnJ75z1dfac=
+github.com/onflow/flow-core-contracts/lib/go/templates v1.3.3-0.20241017220455-79fdc6c8ba53 h1:swCMX7k//QjHatAZ3URX4GhfUWmLc6S/tmaw2mS/0ZU=
+github.com/onflow/flow-core-contracts/lib/go/templates v1.3.3-0.20241017220455-79fdc6c8ba53/go.mod h1:pN768Al/wLRlf3bwugv9TyxniqJxMu4sxnX9eQJam64=
+github.com/onflow/flow-ft/lib/go/contracts v1.0.1 h1:Ts5ob+CoCY2EjEd0W6vdLJ7hLL3SsEftzXG2JlmSe24=
+github.com/onflow/flow-ft/lib/go/contracts v1.0.1/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A=
+github.com/onflow/flow-ft/lib/go/templates v1.0.1 h1:FDYKAiGowABtoMNusLuRCILIZDtVqJ/5tYI4VkF5zfM=
+github.com/onflow/flow-ft/lib/go/templates v1.0.1/go.mod h1:uQ8XFqmMK2jxyBSVrmyuwdWjTEb+6zGjRYotfDJ5pAE=
+github.com/onflow/flow-go v0.38.0-preview.0.0.20241018215103-774056466e36 h1:Bt7WUgRd3C3o93A9KL+cuLwxzrMgfpqKGxTTZF97RJY=
+github.com/onflow/flow-go v0.38.0-preview.0.0.20241018215103-774056466e36/go.mod h1:ZWA2u8gALTYLl5L9M+2ylotWu90kfDmm5RnLNezew/c=
+github.com/onflow/flow-go-sdk v1.1.0 h1:DT8P3B3oAicOOXugdev4s1IEKHsiLS9T7MovFcTzB2s=
+github.com/onflow/flow-go-sdk v1.1.0/go.mod h1:21g1pqP9Wy8RBXdenNsjzADwbtWNOViUCnfNZwr3trM=
+github.com/onflow/flow-nft/lib/go/contracts v1.2.2 h1:XFERNVUDGbZ4ViZjt7P1cGD80mO1PzUJYPfdhXFsGbQ=
+github.com/onflow/flow-nft/lib/go/contracts v1.2.2/go.mod h1:eZ9VMMNfCq0ho6kV25xJn1kXeCfxnkhj3MwF3ed08gY=
+github.com/onflow/flow-nft/lib/go/templates v1.2.1 h1:SAALMZPDw9Eb9p5kSLnmnFxjyig1MLiT4JUlLp0/bSE=
+github.com/onflow/flow-nft/lib/go/templates v1.2.1/go.mod h1:W6hOWU0xltPqNpv9gQX8Pj8Jtf0OmRxc1XX2V0kzJaI=
+github.com/onflow/flow/protobuf/go/flow v0.4.7 h1:iP6DFx4wZ3ETORsyeqzHu7neFT3d1CXF6wdK+AOOjmc=
+github.com/onflow/flow/protobuf/go/flow v0.4.7/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk=
+github.com/onflow/go-ethereum v1.14.7 h1:gg3awYqI02e3AypRdpJKEvNTJ6kz/OhAqRti0h54Wlc=
+github.com/onflow/go-ethereum v1.14.7/go.mod h1:zV14QLrXyYu5ucvcwHUA0r6UaqveqbXaehAVQJlSW+I=
+github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
+github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU=
+github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek=
github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
+github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg=
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/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
+github.com/prometheus/client_golang v0.9.3/go.mod h1:/TN21ttK/J9q6uSwhBd54HahCDft0ttaMvbicHlPoso=
+github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
+github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/prometheus/common v0.0.0-20181113130724-41aa239b4cce/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro=
+github.com/prometheus/common v0.4.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
+github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
+github.com/prometheus/procfs v0.0.0-20190507164030-5867b95ac084/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA=
+github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU=
+github.com/psiemens/sconfig v0.1.0 h1:xfWqW+TRpih7mXZIqKYTmpRhlZLQ1kbxV8EjllPv76s=
+github.com/psiemens/sconfig v0.1.0/go.mod h1:+MLKqdledP/8G3rOBpknbLh0IclCf4WneJUtS26JB2U=
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
+github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
+github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
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/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ=
+github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog=
github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
+github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.26.1 h1:/ihwxqH+4z8UxyI70wM1z9yCvkWcfz/a3mj48k/Zngc=
github.com/rs/zerolog v1.26.1/go.mod h1:/wSSJWX7lVrsOwlbyTRSOJvqRlc+WjWlfes+CiJ+tmc=
+github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0=
+github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
+github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
+github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
+github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
+github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
+github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI=
+github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
+github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
+github.com/spf13/afero v1.10.0 h1:EaGW2JJh15aKOejeuJ+wpFSHnbd7GE6Wvp3TsNhb6LY=
+github.com/spf13/afero v1.10.0/go.mod h1:UBogFpq8E9Hx+xc5CNTTEpTnuHVmXDwZcZcE1eb/UhQ=
+github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
+github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
+github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU=
+github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
+github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
+github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
+github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
+github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
+github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
+github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
+github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
+github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
+github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
+github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE=
+github.com/spf13/viper v1.15.0 h1:js3yy885G8xwJa6iOISGFwd+qlUo5AvyXb7CiihdtiU=
+github.com/spf13/viper v1.15.0/go.mod h1:fFcTBJxvhhzSJiZy8n+PeW6t8l+KeT/uTARa0jHOQLA=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
-github.com/stretchr/objx v0.4.0 h1:M2gUjqZET1qApGOWNSnZ49BAIMX4F/1plDv3+l31EJ4=
+github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
+github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
+github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
+github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
+github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
+github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
+github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
+github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
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.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
+github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
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/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8=
+github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
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/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
github.com/turbolent/prettier v0.0.0-20220320183459-661cc755135d h1:5JInRQbk5UBX8JfUvKh2oYTLMVwj3p6n+wapDDm7hko=
github.com/turbolent/prettier v0.0.0-20220320183459-661cc755135d/go.mod h1:Nlx5Y115XQvNcIdIy7dZXaNSUpzwBSge4/Ivk93/Yog=
+github.com/ugorji/go v1.1.4/go.mod h1:uQMGLiO92mf5W77hV/PUCpI3pbzQx3CRekS0kk+RGrc=
+github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0=
+github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI=
+github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
+github.com/vmihailenco/msgpack/v4 v4.3.11 h1:Q47CePddpNGNhk4GCnAx9DDtASi2rasatE0cd26cZoE=
+github.com/vmihailenco/msgpack/v4 v4.3.11/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4=
+github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37wVyIuWY=
+github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
+github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
+github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q=
+github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
+github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
+github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
+github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
-github.com/zeebo/assert v1.1.0 h1:hU1L1vLTHsnO8x8c9KAR5GmM5QscxHg5RNU5z5qbUWY=
+github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
github.com/zeebo/assert v1.1.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
+github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ=
+github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0=
github.com/zeebo/blake3 v0.2.3 h1:TFoLXsjeXqRNFxSbk35Dk4YtszE/MQQGK10BH4ptoTg=
github.com/zeebo/blake3 v0.2.3/go.mod h1:mjJjZpnsyIVtVgTOSpJ9vmRE4wgDeyt2HU3qXvvKCaQ=
github.com/zeebo/pcg v1.0.1 h1:lyqfGeWiv4ahac6ttHs+I5hwtH/+1mrhlCtVNQM2kHo=
github.com/zeebo/pcg v1.0.1/go.mod h1:09F0S9iiKrwn9rlI5yjLkmrug154/YRW6KnnXVDM/l4=
+go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
+go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
+go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
+go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
+go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
+go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
+go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
go.opentelemetry.io/otel v1.8.0 h1:zcvBFizPbpa1q7FehvFiHbQwGzmPILebO0tyqIR5Djg=
go.opentelemetry.io/otel v1.8.0/go.mod h1:2pkj+iMj0o03Y+cW6/m8Y4WkRdYN3AvCXCnzRMp9yvM=
+go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo=
+go.opentelemetry.io/otel v1.24.0/go.mod h1:W7b9Ozg4nkF5tWI5zsXkaKKDjdVjpD4oAt9Qi/MArHo=
+go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE=
go.uber.org/goleak v1.1.10 h1:z+mqJhf6ss6BSfSM671tgKyZBFPTTJM+HLxnhPC3wu0=
+go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A=
+go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0=
+go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
+golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
+golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
+golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
+golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
+golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
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/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
+golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
+golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
+golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
+golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
+golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek=
+golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY=
+golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
+golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
+golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
+golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
+golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
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/exp v0.0.0-20240119083558-1b970713d09a h1:Q8/wZp0KX97QFTc2ywcOE0YRjZPVIx+MXInMzdvQqcA=
+golang.org/x/exp v0.0.0-20240119083558-1b970713d09a/go.mod h1:idGWGoKP1toJGkd5/ig9ZLuPcZBC3ewk7SzmH0uou08=
+golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
+golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
+golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
+golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
+golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs=
+golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b h1:Wh+f8QHJXR411sJR8/vRBTZ7YapZaRvUcLFFJhusH0k=
+golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
+golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
+golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE=
+golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o=
+golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc=
+golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY=
+golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
+golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
+golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
+golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
-golang.org/x/mod v0.6.0 h1:b9gGHsz9/HhJ3HF5DHQytPpuwocVTChQJK3AvoLRD5I=
+golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
+golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
+golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
+golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
+golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
+golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
+golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
+golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
+golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
+golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
+golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
+golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
+golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
+golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
+golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
+golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
+golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
+golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
+golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
+golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
+golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
+golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
+golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
+golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
+golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/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-20220722155257-8c9f86f7a55f/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.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.5.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/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM=
+golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
+golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
+golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
+golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
golang.org/x/text v0.4.0 h1:BrVqGRd7+k1DiOgtnFvAkoQEWQvBc25ouMJM6429SFg=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
+golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
+golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
+golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+golang.org/x/tools v0.0.0-20180221164845-07fd8470d635/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
+golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
+golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
+golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
+golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
+golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
+golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
+golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
+golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
+golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
+golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
+golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
+golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
+golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28=
+golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
+golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw=
+golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8=
+golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
+golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
+golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
+golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
+golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
+golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
+golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
+golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE=
+golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
+golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
+golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
+golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
+golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
+golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0=
golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo=
-golang.org/x/tools v0.2.0 h1:G6AHpWxTMGY1KyEYoAQ5WTtIekUUvDNjan3ugu60JvE=
+golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
+golang.org/x/tools v0.16.0 h1:GO788SKMRunPIBCXiQyo2AaexLstOrVhuAL5YwsckQM=
+golang.org/x/tools v0.16.0/go.mod h1:kYVVN6I1mBNoB1OX+noeBjbRk4IUEPa7JJ+TJMEooJ0=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
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=
+golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU=
+golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90=
+gonum.org/v1/gonum v0.6.1 h1:/LSrTrgZtpbXyAR6+0e152SROCkJJSh7goYWVmdPFGc=
+gonum.org/v1/gonum v0.6.1/go.mod h1:9mxDZsDKxgMAuccQkewq682L+0eCu4dCN2yonUJTCLU=
+gonum.org/v1/gonum v0.14.0 h1:2NiG67LD1tEH0D7kM+ps2V+fXmsAnpUeec7n8tcr4S0=
+gonum.org/v1/gonum v0.14.0/go.mod h1:AoWeoz0becf9QMWtE8iWXNXc27fK4fNeHNf/oMejGfU=
+google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
+google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
+google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
+google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
+google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
+google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
+google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI=
+google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
+google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
+google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
+google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
+google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE=
+google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
+google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE=
+google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM=
+google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc=
+google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg=
+google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE=
+google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8=
+google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
+google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
+google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
+google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
+google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
+google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM=
+google.golang.org/appengine v1.6.8/go.mod h1:1jJ3jBArFh5pcgW8gCtRJnepW8FzD1V44FJffLiz/Ds=
+google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
+google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
+google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
+google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
+google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
+google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
+google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc=
+google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8=
+google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
+google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
+google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
+google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
+google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
+google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc=
+google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA=
+google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c=
+google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U=
+google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo=
+google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA=
+google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
+google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
+google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
+google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
+google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
+google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg=
+google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY=
+google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
+google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
+google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk=
+google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60=
+google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk=
+google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
+google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
+google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak=
+google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
+google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
+google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
+google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
+google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
+google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
+google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
+google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
+google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
+google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
+google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
+google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
+google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
+google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
+google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
+gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
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/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
+gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
+gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
+gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
+gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
+gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
-lukechampine.com/blake3 v1.1.7 h1:GgRMhmdsuK8+ii6UZFDL8Nb+VyMwadAgcJyfYHxG6n0=
+honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
+honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
+honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
+lukechampine.com/blake3 v1.3.0 h1:sJ3XhFINmHSrYCgl958hscfIa3bw8x4DqMP3u1YvoYE=
+lukechampine.com/blake3 v1.3.0/go.mod h1:0OFRp7fBtAylGVCO40o87sbupkyIGgbpv1+M1k1LM6k=
+rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
+rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
+rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
diff --git a/tools/storage-explorer/addresses.go b/tools/storage-explorer/addresses.go
index 6fb06cdc47..8a291d7a75 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/common"
+ "github.com/onflow/cadence/runtime/common"
)
func addressesJSON(registersByAccount *registers.ByAccount) ([]byte, error) {
diff --git a/tools/storage-explorer/go.mod b/tools/storage-explorer/go.mod
index e29530edb8..f706377729 100644
--- a/tools/storage-explorer/go.mod
+++ b/tools/storage-explorer/go.mod
@@ -4,7 +4,7 @@ go 1.22
require (
github.com/gorilla/mux v1.8.1
- github.com/onflow/atree v0.8.0-rc.6
+ github.com/onflow/atree v0.8.0
github.com/onflow/cadence v1.0.0-preview.52
github.com/onflow/flow-go v0.37.10
github.com/rs/zerolog v1.32.0
@@ -214,5 +214,3 @@ require (
lukechampine.com/blake3 v1.3.0 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)
-
-replace github.com/onflow/cadence => ../..
diff --git a/tools/storage-explorer/go.sum b/tools/storage-explorer/go.sum
index 54aea1efc8..728dc28555 100644
--- a/tools/storage-explorer/go.sum
+++ b/tools/storage-explorer/go.sum
@@ -970,7 +970,6 @@ github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
github.com/OneOfOne/xxhash v1.2.8 h1:31czK/TI9sNkxIKfaUfGlU47BAxQ0ztGgd9vPyqimf8=
github.com/OneOfOne/xxhash v1.2.8/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q=
-github.com/PuerkitoBio/goquery v1.5.0/go.mod h1:qD2PgZ9lccMbQlc7eEOjaeRlFQON7xY8kdmcsrnKqMg=
github.com/SaveTheRbtz/mph v0.1.1-0.20240117162131-4166ec7869bc h1:DCHzPQOcU/7gwDTWbFQZc5qHMPS1g0xTO56k8NXsv9M=
github.com/SaveTheRbtz/mph v0.1.1-0.20240117162131-4166ec7869bc/go.mod h1:LJM5a3zcIJ/8TmZwlUczvROEJT8ntOdhdG9jjcR1B0I=
github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398/go.mod h1:a1uqRtAwp2Xwc6WNPJEufxJ7fx3npB4UV/JOLmbu5I0=
@@ -998,7 +997,6 @@ github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah
github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM=
github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8=
github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
-github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y=
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0=
github.com/apache/arrow/go/v10 v10.0.1/go.mod h1:YvhnlEePVnBS4+0z3fhPfUy7W1Ikj0Ih0vcRo/gZ1M0=
@@ -1663,8 +1661,6 @@ github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbk
github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0=
github.com/iris-contrib/i18n v0.0.0-20171121225848-987a633949d0/go.mod h1:pMCz62A0xJL6I+umB2YTlFRwWXaDFA0jy+5HzGiJjqI=
github.com/iris-contrib/schema v0.0.1/go.mod h1:urYA3uvUNG1TIIjOSCzHr9/LmbQo8LrOcOqfqxa4hXw=
-github.com/itchyny/gojq v0.12.14/go.mod h1:y1G7oO7XkcR1LPZO59KyoCRy08T3j9vDYRV0GgYSS+s=
-github.com/itchyny/timefmt-go v0.1.5/go.mod h1:nEP7L+2YmAbT2kZ2HfSs1d8Xtw9LY8D2stDBckWakZ8=
github.com/jackpal/go-nat-pmp v1.0.2 h1:KzKSgb7qkJvOUTqYl9/Hg/me3pWgBmERKrTGD7BdWus=
github.com/jackpal/go-nat-pmp v1.0.2/go.mod h1:QPH045xvCAeXUZOxsnwmrtiCoxIr9eob+4orBN1SBKc=
github.com/jbenet/go-cienv v0.1.0/go.mod h1:TqNnHUmJgXau0nCzC7kXWeotg3J9W34CUv5Djy1+FlA=
@@ -1734,7 +1730,6 @@ github.com/klauspost/cpuid/v2 v2.2.6 h1:ndNyv040zDGIDh8thGkXYjnFtiN02M1PVVF+JE/4
github.com/klauspost/cpuid/v2 v2.2.6/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
github.com/klauspost/crc32 v0.0.0-20161016154125-cb6bfca970f6/go.mod h1:+ZoRqAPRLkC4NPOvfYeR5KNOrY6TD+/sAC3HXPZgDYg=
github.com/klauspost/pgzip v1.0.2-0.20170402124221-0bf5dcad4ada/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs=
-github.com/kodova/html-to-markdown v1.0.1/go.mod h1:NhDrT7QdSrdpezFg/0EQx9zeobCHR5oAguzrKrC6mVU=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
@@ -1908,8 +1903,11 @@ github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn
github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec=
github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY=
github.com/onflow/atree v0.6.1-0.20230711151834-86040b30171f/go.mod h1:xvP61FoOs95K7IYdIYRnNcYQGf4nbF/uuJ0tHf4DRuM=
-github.com/onflow/atree v0.8.0-rc.6 h1:GWgaylK24b5ta2Hq+TvyOF7X5tZLiLzMMn7lEt59fsA=
-github.com/onflow/atree v0.8.0-rc.6/go.mod h1:yccR+LR7xc1Jdic0mrjocbHvUD7lnVvg8/Ct1AA5zBo=
+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 v1.0.0-M3/go.mod h1:odXGZZ/wGNA5mwT8bC9v8u8EXACHllB2ABSZK65TGL8=
+github.com/onflow/cadence v1.0.0-preview.52 h1:hZ92e6lL2+PQa3C1i5jJh0zZYFdW89+X1MS0Bkd6Ayo=
+github.com/onflow/cadence v1.0.0-preview.52/go.mod h1:7wvvecnAZtYOspLOS3Lh+FuAmMeSrXhAWiycC3kQ1UU=
github.com/onflow/crypto v0.25.0/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI=
github.com/onflow/crypto v0.25.2 h1:GjHunqVt+vPcdqhxxhAXiMIF3YiLX7gTuTR5O+VG2ns=
github.com/onflow/crypto v0.25.2/go.mod h1:fY7eLqUdMKV8EGOw301unP8h7PvLVy8/6gVR++/g0BY=
@@ -2372,7 +2370,6 @@ golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA=
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
-golang.org/x/net v0.0.0-20180218175443-cbe0f9307d01/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -2392,7 +2389,6 @@ golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
-golang.org/x/net v0.0.0-20191109021931-daa7c04131f5/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
diff --git a/tools/storage-explorer/main.go b/tools/storage-explorer/main.go
index 62f55539ae..fe4f80504f 100644
--- a/tools/storage-explorer/main.go
+++ b/tools/storage-explorer/main.go
@@ -35,10 +35,11 @@ import (
"github.com/onflow/flow-go/model/flow"
"github.com/rs/zerolog"
- "github.com/onflow/cadence/common"
+ "github.com/onflow/cadence/runtime/interpreter"
+
jsoncdc "github.com/onflow/cadence/encoding/json"
- "github.com/onflow/cadence/interpreter"
"github.com/onflow/cadence/runtime"
+ "github.com/onflow/cadence/runtime/common"
)
func main() {
diff --git a/tools/storage-explorer/storagemaps.go b/tools/storage-explorer/storagemaps.go
index e173291865..ba0ca4ed91 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/stdlib"
+ "github.com/onflow/cadence/runtime/common"
+ "github.com/onflow/cadence/runtime/interpreter"
+ "github.com/onflow/cadence/runtime/stdlib"
)
type KnownStorageMap struct {
diff --git a/tools/storage-explorer/type.go b/tools/storage-explorer/type.go
index 7d1b413078..24a7a93416 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/sema"
+ "github.com/onflow/cadence/runtime/interpreter"
+ "github.com/onflow/cadence/runtime/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 a7545ae5d3..9355456417 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/sema"
+ "github.com/onflow/cadence/runtime/interpreter"
+ "github.com/onflow/cadence/runtime/sema"
)
type Value interface {
diff --git a/tools/update/config.yaml b/tools/update/config.yaml
index 3f6508e376..f41178de50 100644
--- a/tools/update/config.yaml
+++ b/tools/update/config.yaml
@@ -113,6 +113,6 @@ repos:
- onflow/cadence-tools/test
- onflow/cadence-tools/lint
- onflow/cadence-tools/languageserver
- - onflow/flixkit-go
+ - onflow/flixkit-go/v2
- onflow/flowkit/v2
- onflow/flow-evm-gateway
diff --git a/types_test.go b/types_test.go
index 27f0edd4c9..45412ae7c5 100644
--- a/types_test.go
+++ b/types_test.go
@@ -26,7 +26,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
func TestType_ID(t *testing.T) {
@@ -85,7 +85,7 @@ func TestType_ID(t *testing.T) {
},
{
&StructType{
- Location: utils.TestLocation,
+ Location: TestLocation,
QualifiedIdentifier: "Foo",
},
"S.test.Foo",
@@ -98,7 +98,7 @@ func TestType_ID(t *testing.T) {
},
{
&StructInterfaceType{
- Location: utils.TestLocation,
+ Location: TestLocation,
QualifiedIdentifier: "FooI",
},
"S.test.FooI",
@@ -111,7 +111,7 @@ func TestType_ID(t *testing.T) {
},
{
&ResourceType{
- Location: utils.TestLocation,
+ Location: TestLocation,
QualifiedIdentifier: "Bar",
},
"S.test.Bar",
@@ -124,7 +124,7 @@ func TestType_ID(t *testing.T) {
},
{
&ResourceInterfaceType{
- Location: utils.TestLocation,
+ Location: TestLocation,
QualifiedIdentifier: "BarI",
},
"S.test.BarI",
@@ -133,7 +133,7 @@ func TestType_ID(t *testing.T) {
&IntersectionType{
Types: []Type{
&ResourceInterfaceType{
- Location: utils.TestLocation,
+ Location: TestLocation,
QualifiedIdentifier: "FooI",
},
},
@@ -167,7 +167,7 @@ func TestType_ID(t *testing.T) {
},
{
&EventType{
- Location: utils.TestLocation,
+ Location: TestLocation,
QualifiedIdentifier: "Event",
},
"S.test.Event",
@@ -180,7 +180,7 @@ func TestType_ID(t *testing.T) {
},
{
&EnumType{
- Location: utils.TestLocation,
+ Location: TestLocation,
QualifiedIdentifier: "Enum",
},
"S.test.Enum",
@@ -193,7 +193,7 @@ func TestType_ID(t *testing.T) {
},
{
&ContractType{
- Location: utils.TestLocation,
+ Location: TestLocation,
QualifiedIdentifier: "Contract",
},
"S.test.Contract",
@@ -206,7 +206,7 @@ func TestType_ID(t *testing.T) {
},
{
&ContractInterfaceType{
- Location: utils.TestLocation,
+ Location: TestLocation,
QualifiedIdentifier: "ContractI",
},
"S.test.ContractI",
@@ -2287,7 +2287,7 @@ func TestDecodeFields(t *testing.T) {
NewStruct([]Value{
NewInt(42),
}).WithType(NewStructType(
- utils.TestLocation,
+ TestLocation,
"NestedStruct",
[]Field{
{
@@ -2299,7 +2299,7 @@ func TestDecodeFields(t *testing.T) {
)),
},
).WithType(NewEventType(
- utils.TestLocation,
+ TestLocation,
"SimpleEvent",
[]Field{
{
diff --git a/values_test.go b/values_test.go
index d70200a911..ac5ea3b067 100644
--- a/values_test.go
+++ b/values_test.go
@@ -29,7 +29,7 @@ import (
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/sema"
- "github.com/onflow/cadence/tests/utils"
+ . "github.com/onflow/cadence/test_utils/common_utils"
)
type valueTestCase struct {
@@ -242,7 +242,7 @@ func newValueTestCases() map[string]valueTestCase {
"struct": {
value: NewStruct([]Value{String("bar")}),
exampleType: NewStructType(
- utils.TestLocation,
+ TestLocation,
"FooStruct",
[]Field{
{
@@ -260,7 +260,7 @@ func newValueTestCases() map[string]valueTestCase {
"resource": {
value: NewResource([]Value{NewInt(1)}),
exampleType: NewResourceType(
- utils.TestLocation,
+ TestLocation,
"FooResource",
[]Field{
{
@@ -283,7 +283,7 @@ func newValueTestCases() map[string]valueTestCase {
},
),
exampleType: NewEventType(
- utils.TestLocation,
+ TestLocation,
"FooEvent",
[]Field{
{
@@ -305,7 +305,7 @@ func newValueTestCases() map[string]valueTestCase {
"contract": {
value: NewContract([]Value{String("bar")}),
exampleType: NewContractType(
- utils.TestLocation,
+ TestLocation,
"FooContract",
[]Field{
{
@@ -323,7 +323,7 @@ func newValueTestCases() map[string]valueTestCase {
"enum": {
value: NewEnum([]Value{UInt8(1)}),
exampleType: NewEnumType(
- utils.TestLocation,
+ TestLocation,
"FooEnum",
nil,
[]Field{
@@ -342,7 +342,7 @@ func newValueTestCases() map[string]valueTestCase {
"attachment": {
value: NewAttachment([]Value{NewInt(1)}),
exampleType: NewAttachmentType(
- utils.TestLocation,
+ TestLocation,
"FooAttachment",
nil,
[]Field{
@@ -960,7 +960,7 @@ func TestEvent_GetFieldByName(t *testing.T) {
assert.Nil(t, SearchFieldByName(simpleEvent, "a"))
simpleEventWithType := simpleEvent.WithType(NewEventType(
- utils.TestLocation,
+ TestLocation,
"SimpleEvent",
[]Field{
{
diff --git a/version.go b/version.go
index ec1468a4d3..e72ee43566 100644
--- a/version.go
+++ b/version.go
@@ -21,4 +21,4 @@
package cadence
-const Version = "v1.0.0"
+const Version = "v1.2.1"