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 v0.14.5, Go SDK v0.17.0, and Flow Go v0.15.3-patch.5 #6

Merged
merged 5 commits into from
Apr 14, 2021
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fetch-depth: 0
- uses: actions/setup-go@v1
with:
go-version: '1.14.5'
go-version: '1.16.2'
- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
Expand Down
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,4 @@ check-headers:

.PHONY: check-tidy
check-tidy: generate
go mod tidy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where did this go? Shouldn't check-tidy run go mod tidy?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unfortunately breaking CI right now, see 99designs/gqlgen#1483: The go generate steps requires entries in go.sum, and reports errors if they are missing. go mod tidy then removes them. So it is currently impossible to commit code that satisfies both

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😭

git diff --exit-code
7 changes: 4 additions & 3 deletions compute/computer.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package compute
import (
"github.com/google/uuid"
"github.com/onflow/cadence"
"github.com/onflow/flow-go/fvm/programs"
"github.com/pkg/errors"
"github.com/rs/zerolog"

Expand Down Expand Up @@ -57,7 +58,7 @@ type AccountStates map[model.Address]model.AccountState

func NewComputer(logger zerolog.Logger, cacheSize int) (*Computer, error) {
rt := runtime.NewInterpreterRuntime()
vm := fvm.New(rt)
vm := fvm.NewVirtualMachine(rt)

vmCtx := fvm.NewContext(
logger,
Expand Down Expand Up @@ -109,7 +110,7 @@ func (c *Computer) ExecuteTransaction(

view := ledger.NewView()

err = c.vm.Run(ctx, proc, view)
err = c.vm.Run(ctx, proc, view, programs.NewEmptyPrograms())
if err != nil {
return nil, errors.Wrap(err, "vm failed to execute transaction")
}
Expand Down Expand Up @@ -153,7 +154,7 @@ func (c *Computer) ExecuteScript(
proc := fvm.Script([]byte(script)).
WithArguments(rawArguments...)

err = c.vm.Run(c.vmCtx, proc, view)
err = c.vm.Run(c.vmCtx, proc, view, programs.NewEmptyPrograms())
if err != nil {
return nil, errors.Wrap(err, "vm failed to execute script")
}
Expand Down
4 changes: 2 additions & 2 deletions compute/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/onflow/cadence/runtime"
"github.com/onflow/cadence/runtime/ast"
runtimeErrors "github.com/onflow/cadence/runtime/errors"
"github.com/onflow/flow-go/fvm"
errors2 "github.com/onflow/flow-go/fvm/errors"
turbolent marked this conversation as resolved.
Show resolved Hide resolved

"github.com/dapperlabs/flow-playground-api/model"
)
Expand All @@ -36,7 +36,7 @@ func ExtractProgramErrors(err error) (result []model.ProgramError) {
}

// TODO: remove once fvm.ExecutionError implements Wrapper
executionError, ok := err.(*fvm.ExecutionError)
executionError, ok := err.(*errors2.ExecutionError)
if !ok {
return
}
Expand Down
13 changes: 6 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@ require (
github.com/gorilla/websocket v1.4.2
github.com/hashicorp/golang-lru v0.5.4
github.com/kelseyhightower/envconfig v1.4.0
github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect
github.com/mitchellh/mapstructure v1.1.2
github.com/onflow/cadence v0.12.5
github.com/onflow/flow-go v0.13.2-0.20210122234808-f166b2a7aa23
github.com/onflow/flow-go-sdk v0.14.2
github.com/onflow/cadence v0.14.5
github.com/onflow/flow-go v0.15.3-patch.5
github.com/onflow/flow-go-sdk v0.17.0
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.5.1
github.com/prometheus/client_golang v1.7.1
github.com/rs/cors v1.6.0
github.com/rs/zerolog v1.19.0
github.com/sirupsen/logrus v1.4.2
github.com/stretchr/testify v1.6.1
github.com/sirupsen/logrus v1.6.0
github.com/stretchr/testify v1.7.0
github.com/vektah/gqlparser v1.2.0
golang.org/x/sys v0.0.0-20210122093101-04d7465088b8 // indirect
)
Loading