Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Cadence v1.2.1 #1797

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 18 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ require (
github.com/gosuri/uilive v0.0.4
github.com/logrusorgru/aurora/v4 v4.0.0
github.com/manifoldco/promptui v0.9.0
github.com/onflow/cadence v1.0.0
github.com/onflow/cadence-tools/languageserver v1.0.0
github.com/onflow/cadence-tools/lint v1.0.0
github.com/onflow/cadence-tools/test v1.0.0
github.com/onflow/cadence v1.2.1
github.com/onflow/cadence-tools/languageserver v1.1.0
github.com/onflow/cadence-tools/lint v1.1.0
github.com/onflow/cadence-tools/test v1.1.0
github.com/onflow/fcl-dev-wallet v0.8.0
github.com/onflow/flixkit-go/v2 v2.0.1
github.com/onflow/flow-core-contracts/lib/go/templates v1.3.1
github.com/onflow/flow-emulator v1.0.1
github.com/onflow/flow-evm-gateway v0.36.5-0.20241005010031-1f3f5439d553
github.com/onflow/flow-go v0.38.0-preview.0.0.20241002124048-21cfe5aea5a8
github.com/onflow/flow-go-sdk v1.0.0
github.com/onflow/flowkit/v2 v2.0.1
github.com/onflow/flixkit-go/v2 v2.1.0
github.com/onflow/flow-core-contracts/lib/go/templates v1.4.0
github.com/onflow/flow-emulator v1.1.0
github.com/onflow/flow-evm-gateway v0.37.0
github.com/onflow/flow-go v0.38.0-preview.0.0.20241022154145-6a254edbec23
github.com/onflow/flow-go-sdk v1.2.2
github.com/onflow/flowkit/v2 v2.1.0
github.com/onflow/go-ethereum v1.14.7
github.com/onflowser/flowser/v3 v3.2.1-0.20240131200229-7d4d22715f48
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c
Expand Down Expand Up @@ -203,14 +203,15 @@ require (
github.com/multiformats/go-multistream v0.5.0 // indirect
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/olekukonko/tablewriter v0.0.5 // indirect
github.com/onflow/atree v0.8.0-rc.6 // 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.3.1 // indirect
github.com/onflow/flow-ft/lib/go/contracts v1.0.0 // indirect
github.com/onflow/flow-ft/lib/go/templates v1.0.0 // indirect
github.com/onflow/flow-nft/lib/go/contracts v1.2.1 // indirect
github.com/onflow/flow-nft/lib/go/templates v1.2.0 // indirect
github.com/onflow/flow-core-contracts/lib/go/contracts v1.4.0 // 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-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/nft-storefront/lib/go/contracts v1.0.0 // indirect
github.com/onflow/sdks v0.6.0-preview.1 // indirect
github.com/onflow/wal v1.0.2 // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
Expand Down
2,009 changes: 36 additions & 1,973 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion internal/cadence/cadence.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package cadence

import (
"github.com/onflow/cadence/runtime/cmd/execute"
"github.com/onflow/cadence/cmd/execute"
"github.com/spf13/cobra"

"github.com/onflow/flow-cli/internal/cadence/languageserver"
Expand Down
4 changes: 2 additions & 2 deletions internal/cadence/lint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ package cadence
import (
"testing"

"github.com/onflow/cadence/runtime/ast"
"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/tools/analysis"
"github.com/onflow/flowkit/v2"
"github.com/onflow/flowkit/v2/config"
Expand Down
20 changes: 7 additions & 13 deletions internal/cadence/linter.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,21 @@
package cadence

import (
"errors"
"fmt"
"path/filepath"
"strings"

"errors"

"github.com/onflow/flow-cli/internal/util"

cdclint "github.com/onflow/cadence-tools/lint"
cdctests "github.com/onflow/cadence-tools/test/helpers"
"github.com/onflow/cadence/runtime/ast"
"github.com/onflow/cadence/runtime/common"
cdcerrors "github.com/onflow/cadence/runtime/errors"
"github.com/onflow/cadence/runtime/parser"
"github.com/onflow/cadence/runtime/sema"
"github.com/onflow/cadence/runtime/stdlib"
"github.com/onflow/cadence/ast"
"github.com/onflow/cadence/common"
cdcerrors "github.com/onflow/cadence/errors"
"github.com/onflow/cadence/parser"
"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
"github.com/onflow/cadence/tools/analysis"
"github.com/onflow/flowkit/v2"
"golang.org/x/exp/maps"
Expand Down Expand Up @@ -190,11 +189,6 @@ func (l *linter) handleImport(
error,
) {
switch importedLocation {
case stdlib.CryptoCheckerLocation:
cryptoChecker := stdlib.CryptoChecker()
return sema.ElaborationImport{
Elaboration: cryptoChecker.Elaboration,
}, nil
case stdlib.TestContractLocation:
testChecker := stdlib.GetTestContractType().Checker
return sema.ElaborationImport{
Expand Down
2 changes: 1 addition & 1 deletion internal/super/dev.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"os"
"strings"

"github.com/onflow/cadence/runtime/parser"
"github.com/onflow/cadence/parser"
"github.com/onflow/flowkit/v2"
"github.com/onflow/flowkit/v2/output"
"github.com/spf13/cobra"
Expand Down
2 changes: 1 addition & 1 deletion internal/test/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import (
"strings"

cdcTests "github.com/onflow/cadence-tools/test"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/runtime/common"
"github.com/rs/zerolog"
"github.com/spf13/cobra"

Expand Down
4 changes: 2 additions & 2 deletions internal/test/test_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
"os"
"testing"

"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/runtime/stdlib"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/stdlib"
flowsdk "github.com/onflow/flow-go-sdk"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
Expand Down
11 changes: 5 additions & 6 deletions internal/util/checker_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,12 @@

import (
"github.com/onflow/cadence"
"github.com/onflow/cadence/common"
"github.com/onflow/cadence/errors"
"github.com/onflow/cadence/interpreter"
"github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/runtime/common"
"github.com/onflow/cadence/runtime/errors"
"github.com/onflow/cadence/runtime/interpreter"
"github.com/onflow/cadence/runtime/sema"
"github.com/onflow/cadence/runtime/stdlib"

"github.com/onflow/cadence/sema"
"github.com/onflow/cadence/stdlib"
"github.com/onflow/flow-go/fvm/evm"
evmstdlib "github.com/onflow/flow-go/fvm/evm/stdlib"
"github.com/onflow/flow-go/model/flow"
Expand All @@ -39,7 +38,7 @@
baseTypeActivationsByLocation map[common.Location]*sema.VariableActivation
}

var _ runtime.Environment = CheckerEnvironment{}

Check failure on line 41 in internal/util/checker_environment.go

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

cannot use CheckerEnvironment{} (value of type CheckerEnvironment) as "github.com/onflow/cadence/runtime".Environment value in variable declaration: CheckerEnvironment does not implement "github.com/onflow/cadence/runtime".Environment (missing method ResolveLocation)

Check failure on line 41 in internal/util/checker_environment.go

View workflow job for this annotation

GitHub Actions / lint

cannot use CheckerEnvironment{} (value of type CheckerEnvironment) as "github.com/onflow/cadence/runtime".Environment value in variable declaration: CheckerEnvironment does not implement "github.com/onflow/cadence/runtime".Environment (missing method ResolveLocation)

Check failure on line 41 in internal/util/checker_environment.go

View workflow job for this annotation

GitHub Actions / lint

cannot use CheckerEnvironment{} (value of type CheckerEnvironment) as "github.com/onflow/cadence/runtime".Environment value in variable declaration: CheckerEnvironment does not implement "github.com/onflow/cadence/runtime".Environment (missing method ResolveLocation)

Check failure on line 41 in internal/util/checker_environment.go

View workflow job for this annotation

GitHub Actions / lint

cannot use CheckerEnvironment{} (value of type CheckerEnvironment) as "github.com/onflow/cadence/runtime".Environment value in variable declaration: CheckerEnvironment does not implement "github.com/onflow/cadence/runtime".Environment (missing method ResolveLocation)

Check failure on line 41 in internal/util/checker_environment.go

View workflow job for this annotation

GitHub Actions / lint

cannot use CheckerEnvironment{} (value of type CheckerEnvironment) as "github.com/onflow/cadence/runtime".Environment value in variable declaration: CheckerEnvironment does not implement "github.com/onflow/cadence/runtime".Environment (missing method ResolveLocation)

func NewCheckerEnvironment() *CheckerEnvironment {
env := newCheckerEnvironment()
Expand Down Expand Up @@ -68,7 +67,7 @@

func (e CheckerEnvironment) SetupFVM(chainId flow.ChainID) {
// Set up the EVM standard library
evmstdlib.SetupEnvironment(e, nil, evm.ContractAccountAddress(chainId))

Check failure on line 70 in internal/util/checker_environment.go

View workflow job for this annotation

GitHub Actions / test (ubuntu-latest)

cannot use e (variable of type CheckerEnvironment) as "github.com/onflow/cadence/runtime".Environment value in argument to evmstdlib.SetupEnvironment: CheckerEnvironment does not implement "github.com/onflow/cadence/runtime".Environment (missing method ResolveLocation)

Check failure on line 70 in internal/util/checker_environment.go

View workflow job for this annotation

GitHub Actions / lint

cannot use e (variable of type CheckerEnvironment) as "github.com/onflow/cadence/runtime".Environment value in argument to evmstdlib.SetupEnvironment: CheckerEnvironment does not implement "github.com/onflow/cadence/runtime".Environment (missing method ResolveLocation) (typecheck)

Check failure on line 70 in internal/util/checker_environment.go

View workflow job for this annotation

GitHub Actions / lint

cannot use e (variable of type CheckerEnvironment) as "github.com/onflow/cadence/runtime".Environment value in argument to evmstdlib.SetupEnvironment: CheckerEnvironment does not implement "github.com/onflow/cadence/runtime".Environment (missing method ResolveLocation)) (typecheck)

Check failure on line 70 in internal/util/checker_environment.go

View workflow job for this annotation

GitHub Actions / lint

cannot use e (variable of type CheckerEnvironment) as "github.com/onflow/cadence/runtime".Environment value in argument to evmstdlib.SetupEnvironment: CheckerEnvironment does not implement "github.com/onflow/cadence/runtime".Environment (missing method ResolveLocation)) (typecheck)
}

func (e CheckerEnvironment) GetBaseValueActivation(location common.Location) (baseValueActivation *sema.VariableActivation) {
Expand Down
Loading