From 4e8105eb381f5fdc3722e2fa8e6be120cfe9c7fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Mon, 24 Jun 2024 14:39:43 -0700 Subject: [PATCH 1/3] Update to Cadence v1.0.0-preview.35 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 01a2efcc7..d14c8f38d 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/aws/aws-sdk-go-v2 v1.27.0 github.com/aws/aws-sdk-go-v2/config v1.27.15 github.com/aws/aws-sdk-go-v2/service/kms v1.31.0 - github.com/onflow/cadence v1.0.0-preview.34 + github.com/onflow/cadence v1.0.0-preview.35 github.com/onflow/crypto v0.25.1 github.com/onflow/flow/protobuf/go/flow v0.4.3 github.com/onflow/go-ethereum v1.13.4 diff --git a/go.sum b/go.sum index 3d7b65f49..75b242146 100644 --- a/go.sum +++ b/go.sum @@ -133,8 +133,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/onflow/atree v0.7.0-rc.2 h1:mZmVrl/zPlfI44EjV3FdR2QwIqT8nz1sCONUBFcML/U= github.com/onflow/atree v0.7.0-rc.2/go.mod h1:xvP61FoOs95K7IYdIYRnNcYQGf4nbF/uuJ0tHf4DRuM= -github.com/onflow/cadence v1.0.0-preview.34 h1:MJSli75W6LJVUqSx/tq4MQe64H1+EcQBD/sNgpOO4jE= -github.com/onflow/cadence v1.0.0-preview.34/go.mod h1:jOwvPSSLTr9TvaKMs7KKiBYMmpdpNNAFxBsjMlrqVD0= +github.com/onflow/cadence v1.0.0-preview.35 h1:HZgt/9Foa6sCSH9SNaIFUSXK6q2ZxETg0ivsZbf+hhU= +github.com/onflow/cadence v1.0.0-preview.35/go.mod h1:jOwvPSSLTr9TvaKMs7KKiBYMmpdpNNAFxBsjMlrqVD0= github.com/onflow/crypto v0.25.1 h1:0txy2PKPMM873JbpxQNbJmuOJtD56bfs48RQfm0ts5A= github.com/onflow/crypto v0.25.1/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI= github.com/onflow/flow/protobuf/go/flow v0.4.3 h1:gdY7Ftto8dtU+0wI+6ZgW4oE+z0DSDUMIDwVx8mqae8= From d02dbc7c1e940ff7ea513e8d2187e5d2ee045a5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Mon, 24 Jun 2024 15:07:11 -0700 Subject: [PATCH 2/3] use type constructors --- templates/accounts.go | 11 ++++++----- test/entities.go | 11 ++++++----- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/templates/accounts.go b/templates/accounts.go index 3b7076446..5fa17a4af 100644 --- a/templates/accounts.go +++ b/templates/accounts.go @@ -150,10 +150,10 @@ func AccountKeyToCadenceCryptoKey(key *flow.AccountKey) (cadence.Value, error) { hash, weight, cadence.NewBool(false), - }).WithType(&cadence.StructType{ - Location: common.IdentifierLocation("Crypto"), - QualifiedIdentifier: "Crypto.KeyListEntry", - Fields: []cadence.Field{{ + }).WithType(cadence.NewStructType( + common.IdentifierLocation("Crypto"), + "Crypto.KeyListEntry", + []cadence.Field{{ Identifier: "keyIndex", Type: cadence.IntType, }, { @@ -169,7 +169,8 @@ func AccountKeyToCadenceCryptoKey(key *flow.AccountKey) (cadence.Value, error) { Identifier: "isRevoked", Type: cadence.BoolType, }}, - }), nil + nil, + )), nil } // CreateAccount generates a transactions that creates a new account. diff --git a/test/entities.go b/test/entities.go index f762b186b..f396747e8 100644 --- a/test/entities.go +++ b/test/entities.go @@ -261,10 +261,10 @@ func (g *Events) New() flow.Event { location := common.StringLocation("test") - testEventType := &cadence.EventType{ - Location: location, - QualifiedIdentifier: identifier, - Fields: []cadence.Field{ + testEventType := cadence.NewEventType( + location, + identifier, + []cadence.Field{ { Identifier: "a", Type: cadence.IntType, @@ -274,7 +274,8 @@ func (g *Events) New() flow.Event { Type: cadence.StringType, }, }, - } + nil, + ) testEvent := cadence.NewEvent( []cadence.Value{ From 83b24b18fa255b5d3a07696a6b8981b6a22449b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Mon, 24 Jun 2024 15:07:22 -0700 Subject: [PATCH 3/3] update examples' dependencies --- examples/go.mod | 6 ++++-- examples/go.sum | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/go.mod b/examples/go.mod index e0765d4dc..25007ddcf 100644 --- a/examples/go.mod +++ b/examples/go.mod @@ -1,11 +1,13 @@ module github.com/onflow/flow-go-sdk/examples -go 1.21.0 +go 1.22 + +toolchain go1.22.4 replace github.com/onflow/flow-go-sdk => ../ require ( - github.com/onflow/cadence v1.0.0-preview.31 + github.com/onflow/cadence v1.0.0-preview.35 github.com/onflow/flow-cli/flowkit v1.11.0 github.com/onflow/flow-go-sdk v0.41.17 github.com/spf13/afero v1.11.0 diff --git a/examples/go.sum b/examples/go.sum index 2bf1e0718..073b1dbf3 100644 --- a/examples/go.sum +++ b/examples/go.sum @@ -112,6 +112,7 @@ github.com/onflow/cadence v1.0.0-preview.25/go.mod h1:fGhLBbuEmv5rh48qv0ZS0tUz53 github.com/onflow/cadence v1.0.0-preview.26/go.mod h1:fGhLBbuEmv5rh48qv0ZS0tUz53gxWsHpB4dPsF09h6E= github.com/onflow/cadence v1.0.0-preview.29/go.mod h1:3LM1VgE9HkJ815whY/F0LYWULwJa8p2nJiKyIIxpGAE= github.com/onflow/cadence v1.0.0-preview.31/go.mod h1:3LM1VgE9HkJ815whY/F0LYWULwJa8p2nJiKyIIxpGAE= +github.com/onflow/cadence v1.0.0-preview.35/go.mod h1:jOwvPSSLTr9TvaKMs7KKiBYMmpdpNNAFxBsjMlrqVD0= 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.1/go.mod h1:C8FbaX0x8y+FxWjbkHy0Q4EASCDR9bSPWZqlpCLYyVI=