From d1dac817a45feeb7914a1579ac63a1e2b8ef2185 Mon Sep 17 00:00:00 2001 From: Ian Pun Date: Mon, 5 Feb 2024 15:59:46 -0800 Subject: [PATCH 1/2] use new flowkit import --- languageserver/go.mod | 6 +++--- languageserver/go.sum | 12 ++++++------ languageserver/integration/commands.go | 2 +- languageserver/integration/flow.go | 12 ++++++------ languageserver/integration/integration.go | 2 +- languageserver/integration/mock_state_test.go | 2 +- languageserver/integration/resolvers.go | 4 ++-- languageserver/integration/state.go | 2 +- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/languageserver/go.mod b/languageserver/go.mod index 12117651..c917913a 100644 --- a/languageserver/go.mod +++ b/languageserver/go.mod @@ -10,8 +10,8 @@ require ( github.com/onflow/cadence v1.0.0-M4 github.com/onflow/cadence-tools/lint v1.0.0-M1 github.com/onflow/cadence-tools/test v1.0.0-M1 - github.com/onflow/flow-cli/flowkit v1.11.1-0.20240130210637-a22f7c578d37 github.com/onflow/flow-go-sdk v1.0.0-M1 + github.com/onflow/flowkit v1.13.0 github.com/sourcegraph/jsonrpc2 v0.1.0 github.com/spf13/afero v1.10.0 github.com/spf13/pflag v1.0.5 @@ -132,8 +132,8 @@ require ( github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/onflow/atree v0.6.1-0.20230711151834-86040b30171f // indirect github.com/onflow/crypto v0.25.0 // indirect - github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.1-0.20240125214229-b7a95136dd0d // indirect - github.com/onflow/flow-core-contracts/lib/go/templates v0.15.1-0.20240125214229-b7a95136dd0d // indirect + github.com/onflow/flow-core-contracts/lib/go/contracts v1.2.4-0.20231016154253-a00dbf7c061f // indirect + github.com/onflow/flow-core-contracts/lib/go/templates v1.2.4-0.20231016154253-a00dbf7c061f // indirect github.com/onflow/flow-emulator v1.0.0-M1 // indirect github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240125205519-2e80d9b4bd01 // indirect github.com/onflow/flow-go v0.33.2-0.20240126211806-97279f96695f // indirect diff --git a/languageserver/go.sum b/languageserver/go.sum index 1117f583..ba8d729f 100644 --- a/languageserver/go.sum +++ b/languageserver/go.sum @@ -1842,12 +1842,10 @@ github.com/onflow/cadence-tools/test v1.0.0-M1 h1:l+hCgUR/13rHkF1j8TumhhpWn4tmNA github.com/onflow/cadence-tools/test v1.0.0-M1/go.mod h1:xRfnM0BUo3YvGwFme2G7z1Q58UOsb0V/FvJW7VhERao= 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/flow-cli/flowkit v1.11.1-0.20240130210637-a22f7c578d37 h1:WTg5PAhuvVRd3izYGtqSElnFd65jjit99zih5kPMb0I= -github.com/onflow/flow-cli/flowkit v1.11.1-0.20240130210637-a22f7c578d37/go.mod h1:aJ850vu0mX9HIr/KTTlGfeLxSZ+sn4Knc6Njp5vIeIA= -github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.1-0.20240125214229-b7a95136dd0d h1:Afcfk/9jAQZ1v5PLGdP68FG/0yPPM60fn9Eq8ChBGS0= -github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.1-0.20240125214229-b7a95136dd0d/go.mod h1:Ts/HN+N0RaYJ6oPCqR1JPaMVFiVaMdKTSUH4OdSjjs0= -github.com/onflow/flow-core-contracts/lib/go/templates v0.15.1-0.20240125214229-b7a95136dd0d h1:IQJpP3VLLjT4R8ItBpr+Mmp0IOnC/8iBcM0/67JNB9c= -github.com/onflow/flow-core-contracts/lib/go/templates v0.15.1-0.20240125214229-b7a95136dd0d/go.mod h1:MZ2j5YVTQiSE0B99zuaYhxvGG5GcvimWpQK1Fw/1QBg= +github.com/onflow/flow-core-contracts/lib/go/contracts v1.2.4-0.20231016154253-a00dbf7c061f h1:S8yIZw9LFXfYD1V5H9BiixihHw3GrXVPrmfplSzYaww= +github.com/onflow/flow-core-contracts/lib/go/contracts v1.2.4-0.20231016154253-a00dbf7c061f/go.mod h1:jM6GMAL+m0hjusUgiYDNrixPQ6b9s8xjoJQoEu5bHQI= +github.com/onflow/flow-core-contracts/lib/go/templates v1.2.4-0.20231016154253-a00dbf7c061f h1:Ep+Mpo2miWMe4pjPGIaEvEzshRep30dvNgxqk+//FrQ= +github.com/onflow/flow-core-contracts/lib/go/templates v1.2.4-0.20231016154253-a00dbf7c061f/go.mod h1:ZeLxwaBkzuSInESGjL8/IPZWezF+YOYsYbMrZlhN+q4= github.com/onflow/flow-emulator v1.0.0-M1 h1:0hBEmvm73F+5HhN5ugkOP3UyN+Ea9yGWflEmoeGzgdw= github.com/onflow/flow-emulator v1.0.0-M1/go.mod h1:JFJCeQVyhCQVD2Tq4QhctIXK6j5U6aU15yoEwMJt5AQ= github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240125205519-2e80d9b4bd01 h1:8iKk5RuFvhe7NQyAO3c+xiVvv38RB/yopHdWxp4AbL8= @@ -1861,6 +1859,8 @@ github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240125205553-d2b571fb3fad github.com/onflow/flow/protobuf/go/flow v0.3.2-0.20231121210617-52ee94b830c2/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= github.com/onflow/flow/protobuf/go/flow v0.3.2-0.20231213135419-ae911cc351a2 h1:+rT+UsfTR39JZO8ht2+4fkaWfHw74SCj1fyz1lWuX8A= github.com/onflow/flow/protobuf/go/flow v0.3.2-0.20231213135419-ae911cc351a2/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= +github.com/onflow/flowkit v1.13.0 h1:a8XIDxz/k54nw2UAN3BxVeXnflwUzZaxocSxhA5IFiw= +github.com/onflow/flowkit v1.13.0/go.mod h1:V1vMr/51HpLT8oWw/zoFsLs33ibG8FNeoNbA5SGTHf8= github.com/onflow/sdks v0.5.1-0.20230912225508-b35402f12bba h1:rIehuhO6bj4FkwE4VzwEjX7MoAlOhUJENBJLqDqVxAo= github.com/onflow/sdks v0.5.1-0.20230912225508-b35402f12bba/go.mod h1:F0dj0EyHC55kknLkeD10js4mo14yTdMotnWMslPirrU= github.com/onflow/wal v0.0.0-20230529184820-bc9f8244608d h1:gAEqYPn3DS83rHIKEpsajnppVD1+zwuYPFyeDVFaQvg= diff --git a/languageserver/integration/commands.go b/languageserver/integration/commands.go index 30ee6c1b..9aa97ac9 100644 --- a/languageserver/integration/commands.go +++ b/languageserver/integration/commands.go @@ -23,7 +23,7 @@ import ( "fmt" "net/url" - "github.com/onflow/flow-cli/flowkit/arguments" + "github.com/onflow/flowkit/arguments" "github.com/onflow/flow-go-sdk" diff --git a/languageserver/integration/flow.go b/languageserver/integration/flow.go index 3c7afb25..96b1c13b 100644 --- a/languageserver/integration/flow.go +++ b/languageserver/integration/flow.go @@ -25,16 +25,16 @@ import ( "os" "path/filepath" - "github.com/onflow/flow-cli/flowkit/accounts" - "github.com/onflow/flow-cli/flowkit/transactions" + "github.com/onflow/flowkit/accounts" + "github.com/onflow/flowkit/transactions" "github.com/onflow/cadence" - "github.com/onflow/flow-cli/flowkit" - "github.com/onflow/flow-cli/flowkit/config" - "github.com/onflow/flow-cli/flowkit/gateway" - "github.com/onflow/flow-cli/flowkit/output" "github.com/onflow/flow-go-sdk" "github.com/onflow/flow-go-sdk/crypto" + "github.com/onflow/flowkit" + "github.com/onflow/flowkit/config" + "github.com/onflow/flowkit/gateway" + "github.com/onflow/flowkit/output" ) //go:generate go run github.com/vektra/mockery/cmd/mockery --name flowClient --filename mock_flow_test.go --inpkg diff --git a/languageserver/integration/integration.go b/languageserver/integration/integration.go index 083032a3..9ce3870c 100644 --- a/languageserver/integration/integration.go +++ b/languageserver/integration/integration.go @@ -24,7 +24,7 @@ import ( "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/flow-cli/flowkit" + "github.com/onflow/flowkit" "github.com/spf13/afero" "github.com/onflow/cadence-tools/languageserver/protocol" diff --git a/languageserver/integration/mock_state_test.go b/languageserver/integration/mock_state_test.go index f2f9a203..95add5d9 100644 --- a/languageserver/integration/mock_state_test.go +++ b/languageserver/integration/mock_state_test.go @@ -3,7 +3,7 @@ package integration import ( - flowkit "github.com/onflow/flow-cli/flowkit" + flowkit "github.com/onflow/flowkit" mock "github.com/stretchr/testify/mock" ) diff --git a/languageserver/integration/resolvers.go b/languageserver/integration/resolvers.go index e3c2cc60..b1566b0e 100644 --- a/languageserver/integration/resolvers.go +++ b/languageserver/integration/resolvers.go @@ -25,9 +25,9 @@ import ( "github.com/onflow/cadence/runtime/common" "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/flow-cli/flowkit" - "github.com/onflow/flow-cli/flowkit/config" "github.com/onflow/flow-go-sdk" + "github.com/onflow/flowkit" + "github.com/onflow/flowkit/config" ) type resolvers struct { diff --git a/languageserver/integration/state.go b/languageserver/integration/state.go index 518b3b86..753d9f46 100644 --- a/languageserver/integration/state.go +++ b/languageserver/integration/state.go @@ -22,7 +22,7 @@ import ( "fmt" "path/filepath" - "github.com/onflow/flow-cli/flowkit" + "github.com/onflow/flowkit" ) //go:generate go run github.com/vektra/mockery/cmd/mockery --name flowState --filename mock_state_test.go --inpkg From 370fead53ec0ef06189035826681f422f9911d94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20M=C3=BCller?= Date: Wed, 14 Feb 2024 14:00:15 -0800 Subject: [PATCH 2/2] update to Cadence v1.0.0-M7 and flowkit/v2 ee40994a815f --- languageserver/go.mod | 29 ++++++----- languageserver/go.sum | 50 ++++++++++--------- languageserver/integration/commands.go | 7 ++- languageserver/integration/commands_test.go | 2 +- languageserver/integration/diagnostics.go | 3 -- languageserver/integration/flow.go | 17 +++---- languageserver/integration/integration.go | 28 +++++------ languageserver/integration/mock_state_test.go | 2 +- languageserver/integration/resolvers.go | 4 +- languageserver/integration/resolvers_test.go | 4 +- languageserver/integration/state.go | 32 ++++++------ languageserver/protocol/json.go | 1 - 12 files changed, 89 insertions(+), 90 deletions(-) diff --git a/languageserver/go.mod b/languageserver/go.mod index c917913a..a440288e 100644 --- a/languageserver/go.mod +++ b/languageserver/go.mod @@ -7,11 +7,11 @@ require ( github.com/google/uuid v1.5.0 github.com/mattn/go-isatty v0.0.20 github.com/mitchellh/mapstructure v1.5.0 - github.com/onflow/cadence v1.0.0-M4 - github.com/onflow/cadence-tools/lint v1.0.0-M1 - github.com/onflow/cadence-tools/test v1.0.0-M1 - github.com/onflow/flow-go-sdk v1.0.0-M1 - github.com/onflow/flowkit v1.13.0 + github.com/onflow/cadence v1.0.0-M7 + github.com/onflow/cadence-tools/lint v1.0.0-M4 + github.com/onflow/cadence-tools/test v1.0.0-M3 + github.com/onflow/flow-go-sdk v1.0.0-M4 + github.com/onflow/flowkit/v2 v2.0.0-stable-cadence-alpha.2.0.20240214213743-ee40994a815f github.com/sourcegraph/jsonrpc2 v0.1.0 github.com/spf13/afero v1.10.0 github.com/spf13/pflag v1.0.5 @@ -19,6 +19,11 @@ require ( golang.org/x/exp v0.0.0-20240103183307-be819d1f06fc ) +require ( + github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240206003101-928bf99024d7 // indirect + github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240206003101-928bf99024d7 // indirect +) + require ( cloud.google.com/go/compute v1.23.1 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect @@ -116,7 +121,7 @@ require ( 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-runewidth v0.0.14 // indirect + github.com/mattn/go-runewidth v0.0.15 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/minio/sha256-simd v1.0.1 // indirect github.com/mmcloughlin/addchain v0.4.0 // indirect @@ -132,13 +137,11 @@ require ( github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/onflow/atree v0.6.1-0.20230711151834-86040b30171f // indirect github.com/onflow/crypto v0.25.0 // indirect - github.com/onflow/flow-core-contracts/lib/go/contracts v1.2.4-0.20231016154253-a00dbf7c061f // indirect - github.com/onflow/flow-core-contracts/lib/go/templates v1.2.4-0.20231016154253-a00dbf7c061f // indirect - github.com/onflow/flow-emulator v1.0.0-M1 // indirect - github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240125205519-2e80d9b4bd01 // indirect - github.com/onflow/flow-go v0.33.2-0.20240126211806-97279f96695f // indirect - github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240125205553-d2b571fb3fad // indirect - github.com/onflow/flow/protobuf/go/flow v0.3.2-0.20231213135419-ae911cc351a2 // indirect + github.com/onflow/flow-emulator v1.0.0-M5 // indirect + github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240205224107-320aa3cf09e0 // indirect + github.com/onflow/flow-go v0.33.2-0.20240214203221-b11eeaa896bd // indirect + github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240205233530-86ee8c352fa6 // indirect + github.com/onflow/flow/protobuf/go/flow v0.3.7 // indirect github.com/onflow/sdks v0.5.1-0.20230912225508-b35402f12bba // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect diff --git a/languageserver/go.sum b/languageserver/go.sum index ba8d729f..3c963147 100644 --- a/languageserver/go.sum +++ b/languageserver/go.sum @@ -1745,8 +1745,9 @@ github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzp github.com/mattn/go-runewidth v0.0.6/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mattn/go-runewidth v0.0.14 h1:+xnbZSEeDbOIg5/mE6JF0w6n9duR1l3/WmbinWVwUuU= github.com/mattn/go-runewidth v0.0.14/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/mattn/go-runewidth v0.0.15 h1:UNAjwbU9l54TA3KzvqLGxwWjHmMgBUVhBiTjelZgg3U= +github.com/mattn/go-runewidth v0.0.15/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.11.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/mattn/go-sqlite3 v1.14.5/go.mod h1:WVKg1VTActs4Qso6iwGbiFih2UIHo0ENGwNd0Lj+XmI= github.com/mattn/go-sqlite3 v1.14.14/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU= @@ -1834,33 +1835,34 @@ github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6 github.com/onflow/atree v0.6.1-0.20230711151834-86040b30171f h1:Z8/PgTqOgOg02MTRpTBYO2k16FE6z4wEOtaC2WBR9Xo= github.com/onflow/atree v0.6.1-0.20230711151834-86040b30171f/go.mod h1:xvP61FoOs95K7IYdIYRnNcYQGf4nbF/uuJ0tHf4DRuM= github.com/onflow/cadence v1.0.0-M3/go.mod h1:odXGZZ/wGNA5mwT8bC9v8u8EXACHllB2ABSZK65TGL8= -github.com/onflow/cadence v1.0.0-M4 h1:/nt3j7vpYDxuI0ghIgAJrb2R01ijvJYZLAkKt+zbpTY= -github.com/onflow/cadence v1.0.0-M4/go.mod h1:odXGZZ/wGNA5mwT8bC9v8u8EXACHllB2ABSZK65TGL8= -github.com/onflow/cadence-tools/lint v1.0.0-M1 h1:M92+hX+pr28fR4f117WP69qRG80oL3RCVoYC6o68Bzk= -github.com/onflow/cadence-tools/lint v1.0.0-M1/go.mod h1:M2cmhrWu4sG2J8WjLL69njk2ITo1Wne5tBzG2m+en0g= -github.com/onflow/cadence-tools/test v1.0.0-M1 h1:l+hCgUR/13rHkF1j8TumhhpWn4tmNA8ra50iCCdS5Ao= -github.com/onflow/cadence-tools/test v1.0.0-M1/go.mod h1:xRfnM0BUo3YvGwFme2G7z1Q58UOsb0V/FvJW7VhERao= +github.com/onflow/cadence v1.0.0-M7 h1:hb4LK9lUbFdnDdfU8oqJGSVJtmkOzxwKomhmDcP/Faw= +github.com/onflow/cadence v1.0.0-M7/go.mod h1:a4mccDU90hmuxCLUFzs9J/ANG/rYbFa36h4Z0bBAqNU= +github.com/onflow/cadence-tools/lint v1.0.0-M4 h1:XeBX+/2TKbe04nyMjUbSD9aHcF5+H6UOAgsuLTmo1DA= +github.com/onflow/cadence-tools/lint v1.0.0-M4/go.mod h1:vgKOF14/NwWktjsRKHlWEz8z/3uQu5nuqDzQOm+u2qY= +github.com/onflow/cadence-tools/test v1.0.0-M3 h1:ZbKoMhXsvafJIOO/MVE7lV5INXfq2IL0Z+W2MsJnKwY= +github.com/onflow/cadence-tools/test v1.0.0-M3/go.mod h1:Yk6OyiRMNseM6C13FpNUxTJ7GekYZMzdX5D2B10y4N8= 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/flow-core-contracts/lib/go/contracts v1.2.4-0.20231016154253-a00dbf7c061f h1:S8yIZw9LFXfYD1V5H9BiixihHw3GrXVPrmfplSzYaww= -github.com/onflow/flow-core-contracts/lib/go/contracts v1.2.4-0.20231016154253-a00dbf7c061f/go.mod h1:jM6GMAL+m0hjusUgiYDNrixPQ6b9s8xjoJQoEu5bHQI= -github.com/onflow/flow-core-contracts/lib/go/templates v1.2.4-0.20231016154253-a00dbf7c061f h1:Ep+Mpo2miWMe4pjPGIaEvEzshRep30dvNgxqk+//FrQ= -github.com/onflow/flow-core-contracts/lib/go/templates v1.2.4-0.20231016154253-a00dbf7c061f/go.mod h1:ZeLxwaBkzuSInESGjL8/IPZWezF+YOYsYbMrZlhN+q4= -github.com/onflow/flow-emulator v1.0.0-M1 h1:0hBEmvm73F+5HhN5ugkOP3UyN+Ea9yGWflEmoeGzgdw= -github.com/onflow/flow-emulator v1.0.0-M1/go.mod h1:JFJCeQVyhCQVD2Tq4QhctIXK6j5U6aU15yoEwMJt5AQ= -github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240125205519-2e80d9b4bd01 h1:8iKk5RuFvhe7NQyAO3c+xiVvv38RB/yopHdWxp4AbL8= -github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240125205519-2e80d9b4bd01/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A= -github.com/onflow/flow-go v0.33.2-0.20240126211806-97279f96695f h1:F1y95CpteZn0i4v0FDGjKiqI13Xlir3hX4x0C1xMRoc= -github.com/onflow/flow-go v0.33.2-0.20240126211806-97279f96695f/go.mod h1:9q+c+fuTpc/emueM/2bI/Ih2jw3V+9WS3Eu+pWBuLW0= -github.com/onflow/flow-go-sdk v1.0.0-M1 h1:mke/ebYwNRRWPZqcwCV56Alx0A8psew43ZbSEUQ4TL8= +github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240206003101-928bf99024d7 h1:OI/4F2NK/X/4x3dTUFFDGtuOsSa9pX+jjBeSEcBrY/M= +github.com/onflow/flow-core-contracts/lib/go/contracts v0.15.2-0.20240206003101-928bf99024d7/go.mod h1:GK+Ik1K3L3v8xmHmRQv5yxJz81lYhdYSNm0PQ63Xrws= +github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240206003101-928bf99024d7 h1:WAx8ftVz1BeXiKvQ9gLKEf1J3NBWK26Pbczd0iH4C6I= +github.com/onflow/flow-core-contracts/lib/go/templates v0.15.2-0.20240206003101-928bf99024d7/go.mod h1:MZ2j5YVTQiSE0B99zuaYhxvGG5GcvimWpQK1Fw/1QBg= +github.com/onflow/flow-emulator v1.0.0-M5 h1:yPx6je/ahdYvd4b80bMXJ0AT4k2eogEGsQCOI+83V2I= +github.com/onflow/flow-emulator v1.0.0-M5/go.mod h1:CBp/YrgR2PeOdqhQMbfAiznGayNoJuFQTfLV9EJFtEc= +github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240205224107-320aa3cf09e0 h1:u6/YcUvO8jU0f3Evb/6agzXqeOo+VbL2a3mmj/5ifRs= +github.com/onflow/flow-ft/lib/go/contracts v0.7.1-0.20240205224107-320aa3cf09e0/go.mod h1:PwsL8fC81cjnUnTfmyL/HOIyHnyaw/JA474Wfj2tl6A= +github.com/onflow/flow-go v0.33.2-0.20240214203221-b11eeaa896bd h1:x9eOt5rdDSr00aKwoyUWyJ4m8WlUwgYoV94oSEWPhiM= +github.com/onflow/flow-go v0.33.2-0.20240214203221-b11eeaa896bd/go.mod h1:45DIkRx5a+qiV83fpJ+fra9WtRiF4bTqd7XMxahRdnc= github.com/onflow/flow-go-sdk v1.0.0-M1/go.mod h1:TDW0MNuCs4SvqYRUzkbRnRmHQL1h4X8wURsCw9P9beo= -github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240125205553-d2b571fb3fad h1:I6LD9BOsilGbiqhGjP86FIIXJe0YdUz75d/oWdHFzDI= -github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240125205553-d2b571fb3fad/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE= +github.com/onflow/flow-go-sdk v1.0.0-M4 h1:dGtgZvaIfBR5/9I9nm5nLm69V5pLcSz9vXmzCb1lyzM= +github.com/onflow/flow-go-sdk v1.0.0-M4/go.mod h1:HIGOKJVR47QNs81sPHmZDVcLr+syNkmbgEMLQGDmmEo= +github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240205233530-86ee8c352fa6 h1:/2vvjKkWG/3cKP3IpgiGNqXi0yskn4GmNTjmeCwMoz8= +github.com/onflow/flow-nft/lib/go/contracts v1.1.1-0.20240205233530-86ee8c352fa6/go.mod h1:2gpbza+uzs1k7x31hkpBPlggIRkI53Suo0n2AyA2HcE= github.com/onflow/flow/protobuf/go/flow v0.3.2-0.20231121210617-52ee94b830c2/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= -github.com/onflow/flow/protobuf/go/flow v0.3.2-0.20231213135419-ae911cc351a2 h1:+rT+UsfTR39JZO8ht2+4fkaWfHw74SCj1fyz1lWuX8A= -github.com/onflow/flow/protobuf/go/flow v0.3.2-0.20231213135419-ae911cc351a2/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= -github.com/onflow/flowkit v1.13.0 h1:a8XIDxz/k54nw2UAN3BxVeXnflwUzZaxocSxhA5IFiw= -github.com/onflow/flowkit v1.13.0/go.mod h1:V1vMr/51HpLT8oWw/zoFsLs33ibG8FNeoNbA5SGTHf8= +github.com/onflow/flow/protobuf/go/flow v0.3.7 h1:+6sBdlE/u4ZMTVB9U1lA6Xn2Bd48lOOX96Bv9dNubsk= +github.com/onflow/flow/protobuf/go/flow v0.3.7/go.mod h1:NA2pX2nw8zuaxfKphhKsk00kWLwfd+tv8mS23YXO4Sk= +github.com/onflow/flowkit/v2 v2.0.0-stable-cadence-alpha.2.0.20240214213743-ee40994a815f h1:GjStQGlfhxbZiOZy8vFRSNUrNoD1u3Q8f5mhfyZ1vhc= +github.com/onflow/flowkit/v2 v2.0.0-stable-cadence-alpha.2.0.20240214213743-ee40994a815f/go.mod h1:Ck+iZGJYerviTQ3SyqoUNLNXdRUJiI5iMxfM9YugtK0= github.com/onflow/sdks v0.5.1-0.20230912225508-b35402f12bba h1:rIehuhO6bj4FkwE4VzwEjX7MoAlOhUJENBJLqDqVxAo= github.com/onflow/sdks v0.5.1-0.20230912225508-b35402f12bba/go.mod h1:F0dj0EyHC55kknLkeD10js4mo14yTdMotnWMslPirrU= github.com/onflow/wal v0.0.0-20230529184820-bc9f8244608d h1:gAEqYPn3DS83rHIKEpsajnppVD1+zwuYPFyeDVFaQvg= diff --git a/languageserver/integration/commands.go b/languageserver/integration/commands.go index 9aa97ac9..8bf47f84 100644 --- a/languageserver/integration/commands.go +++ b/languageserver/integration/commands.go @@ -23,9 +23,8 @@ import ( "fmt" "net/url" - "github.com/onflow/flowkit/arguments" - "github.com/onflow/flow-go-sdk" + "github.com/onflow/flowkit/v2/arguments" "github.com/onflow/cadence-tools/languageserver/server" ) @@ -42,7 +41,7 @@ const ( type commands struct { client flowClient - state flowState + state flowState } func (c *commands) getAll() []server.Command { @@ -51,7 +50,7 @@ func (c *commands) getAll() []server.Command { Name: CommandReloadConfig, Handler: c.reloadConfig, }} - + // Commands only available when client is enabled if c.client != nil { commands = append(commands, []server.Command{ diff --git a/languageserver/integration/commands_test.go b/languageserver/integration/commands_test.go index 9d7c2437..697cc914 100644 --- a/languageserver/integration/commands_test.go +++ b/languageserver/integration/commands_test.go @@ -236,4 +236,4 @@ func Test_ReloadConfig(t *testing.T) { assert.Equal(t, nil, resp) state.AssertCalled(t, "Reload") }) -} \ No newline at end of file +} diff --git a/languageserver/integration/diagnostics.go b/languageserver/integration/diagnostics.go index a95aa314..4a518b6c 100644 --- a/languageserver/integration/diagnostics.go +++ b/languageserver/integration/diagnostics.go @@ -31,7 +31,6 @@ import ( // // For example, this function will return diagnostics for declarations that are // syntactically and semantically valid, but unsupported by the extension. -// func diagnostics( _ protocol.DocumentURI, _ int32, @@ -48,7 +47,6 @@ func diagnostics( // transactionDeclarationCountDiagnostics reports diagnostics // if there are more than 1 transaction declarations, as deployment will fail -// func transactionDeclarationCountDiagnostics(checker *sema.Checker) []protocol.Diagnostic { var diagnostics []protocol.Diagnostic @@ -76,7 +74,6 @@ func transactionDeclarationCountDiagnostics(checker *sema.Checker) []protocol.Di // compositeOrInterfaceDeclarationCountDiagnostics reports diagnostics // if there are more than one composite or interface declaration, as deployment will fail -// func compositeOrInterfaceDeclarationCountDiagnostics(checker *sema.Checker) []protocol.Diagnostic { var diagnostics []protocol.Diagnostic diff --git a/languageserver/integration/flow.go b/languageserver/integration/flow.go index 96b1c13b..614db0a9 100644 --- a/languageserver/integration/flow.go +++ b/languageserver/integration/flow.go @@ -25,16 +25,15 @@ import ( "os" "path/filepath" - "github.com/onflow/flowkit/accounts" - "github.com/onflow/flowkit/transactions" - "github.com/onflow/cadence" "github.com/onflow/flow-go-sdk" "github.com/onflow/flow-go-sdk/crypto" - "github.com/onflow/flowkit" - "github.com/onflow/flowkit/config" - "github.com/onflow/flowkit/gateway" - "github.com/onflow/flowkit/output" + "github.com/onflow/flowkit/v2" + "github.com/onflow/flowkit/v2/accounts" + "github.com/onflow/flowkit/v2/config" + "github.com/onflow/flowkit/v2/gateway" + "github.com/onflow/flowkit/v2/output" + "github.com/onflow/flowkit/v2/transactions" ) //go:generate go run github.com/vektra/mockery/cmd/mockery --name flowClient --filename mock_flow_test.go --inpkg @@ -233,7 +232,7 @@ func (f *flowkitClient) DeployContract( // Changes in https://github.com/onflow/flow-cli/pull/1247 add contracts // to the state when AddContract is called, but this causes an error to // be thrown here because LS-managed accounts are not in the state. - // + // // This code adds the account to the state before deploying the contract f.state.getState().Accounts().AddOrUpdate(signer) @@ -390,7 +389,7 @@ func (f *flowkitClient) createSigner(address flow.Address) (*accounts.Account, e return &accounts.Account{ Address: address, Key: accountKey, - Name: fmt.Sprintf("%s [LS]", account.Name), + Name: fmt.Sprintf("%s [LS]", account.Name), }, nil } diff --git a/languageserver/integration/integration.go b/languageserver/integration/integration.go index 9ce3870c..683c12dc 100644 --- a/languageserver/integration/integration.go +++ b/languageserver/integration/integration.go @@ -24,7 +24,7 @@ import ( "github.com/onflow/cadence/runtime/sema" - "github.com/onflow/flowkit" + "github.com/onflow/flowkit/v2" "github.com/spf13/afero" "github.com/onflow/cadence-tools/languageserver/protocol" @@ -36,16 +36,16 @@ func NewFlowIntegration(s *server.Server, enableFlowClient bool) (*FlowIntegrati state := newFlowkitState(loader) integration := &FlowIntegration{ - entryPointInfo: map[protocol.DocumentURI]*entryPointInfo{}, - contractInfo: map[protocol.DocumentURI]*contractInfo{}, - enableFlowClient: enableFlowClient, - loader: loader, - state: state, + entryPointInfo: map[protocol.DocumentURI]*entryPointInfo{}, + contractInfo: map[protocol.DocumentURI]*contractInfo{}, + enableFlowClient: enableFlowClient, + loader: loader, + state: state, } resolve := resolvers{ loader: loader, - state: state, + state: state, } options := []server.Option{ @@ -81,13 +81,13 @@ func NewFlowIntegration(s *server.Server, enableFlowClient bool) (*FlowIntegrati } type FlowIntegration struct { - entryPointInfo map[protocol.DocumentURI]*entryPointInfo - contractInfo map[protocol.DocumentURI]*contractInfo + entryPointInfo map[protocol.DocumentURI]*entryPointInfo + contractInfo map[protocol.DocumentURI]*contractInfo - enableFlowClient bool - client flowClient - state *flowkitState - loader flowkit.ReaderWriter + enableFlowClient bool + client flowClient + state *flowkitState + loader flowkit.ReaderWriter } func (i *FlowIntegration) initialize(initializationOptions any) error { @@ -117,7 +117,7 @@ func (i *FlowIntegration) initialize(initializationOptions any) error { } // If client is enabled, initialize the client - if (i.enableFlowClient) { + if i.enableFlowClient { numberOfAccountsString, ok := optsMap["numberOfAccounts"].(string) if !ok || numberOfAccountsString == "" { return errors.New("initialization options: invalid account number value, should be passed as a string") diff --git a/languageserver/integration/mock_state_test.go b/languageserver/integration/mock_state_test.go index 95add5d9..0689f324 100644 --- a/languageserver/integration/mock_state_test.go +++ b/languageserver/integration/mock_state_test.go @@ -3,7 +3,7 @@ package integration import ( - flowkit "github.com/onflow/flowkit" + flowkit "github.com/onflow/flowkit/v2" mock "github.com/stretchr/testify/mock" ) diff --git a/languageserver/integration/resolvers.go b/languageserver/integration/resolvers.go index b1566b0e..6735d31e 100644 --- a/languageserver/integration/resolvers.go +++ b/languageserver/integration/resolvers.go @@ -26,8 +26,8 @@ import ( "github.com/onflow/cadence/runtime/common" "github.com/onflow/cadence/runtime/sema" "github.com/onflow/flow-go-sdk" - "github.com/onflow/flowkit" - "github.com/onflow/flowkit/config" + "github.com/onflow/flowkit/v2" + "github.com/onflow/flowkit/v2/config" ) type resolvers struct { diff --git a/languageserver/integration/resolvers_test.go b/languageserver/integration/resolvers_test.go index c38624c0..2195a4e7 100644 --- a/languageserver/integration/resolvers_test.go +++ b/languageserver/integration/resolvers_test.go @@ -114,7 +114,7 @@ func Test_SimpleImport(t *testing.T) { mock := &mockFlowState{} resolver := resolvers{ loader: af, - state: mock, + state: mock, } mock.On("GetCodeByName", "Test").Return(code, nil) @@ -131,4 +131,4 @@ func Test_SimpleImport(t *testing.T) { assert.EqualError(t, err, "couldn't find the contract by import identifier: Foo") assert.Empty(t, resolved) }) -} \ No newline at end of file +} diff --git a/languageserver/integration/state.go b/languageserver/integration/state.go index 753d9f46..d0d6ae43 100644 --- a/languageserver/integration/state.go +++ b/languageserver/integration/state.go @@ -22,34 +22,34 @@ import ( "fmt" "path/filepath" - "github.com/onflow/flowkit" + "github.com/onflow/flowkit/v2" ) //go:generate go run github.com/vektra/mockery/cmd/mockery --name flowState --filename mock_state_test.go --inpkg type flowState interface { - Load(configPath string) (error) - Reload() (error) + Load(configPath string) error + Reload() error GetCodeByName(name string) (string, error) - IsLoaded() (bool) - getConfigPath() (string) - getState() (*flowkit.State) + IsLoaded() bool + getConfigPath() string + getState() *flowkit.State } var _ flowState = &flowkitState{} type flowkitState struct { - loader flowkit.ReaderWriter - state *flowkit.State - configPath string + loader flowkit.ReaderWriter + state *flowkit.State + configPath string } -func newFlowkitState(loader flowkit.ReaderWriter) (*flowkitState) { +func newFlowkitState(loader flowkit.ReaderWriter) *flowkitState { return &flowkitState{ loader: loader, } } -func (s *flowkitState) Load(configPath string) (error) { +func (s *flowkitState) Load(configPath string) error { state, err := flowkit.Load([]string{configPath}, s.loader) if err != nil { return err @@ -60,7 +60,7 @@ func (s *flowkitState) Load(configPath string) (error) { return nil } -func (s *flowkitState) Reload() (error) { +func (s *flowkitState) Reload() error { if !s.IsLoaded() { return fmt.Errorf("state is not initialized") } @@ -92,15 +92,15 @@ func (s *flowkitState) GetCodeByName(name string) (string, error) { return code, nil } -func (s *flowkitState) IsLoaded() (bool) { +func (s *flowkitState) IsLoaded() bool { return s.state != nil && s.configPath != "" } -func (s *flowkitState) getConfigPath() (string) { +func (s *flowkitState) getConfigPath() string { return s.configPath } -func (s *flowkitState) getState() (*flowkit.State) { +func (s *flowkitState) getState() *flowkit.State { return s.state } @@ -116,4 +116,4 @@ func (s *flowkitState) getCodeFromLocation(name, location string) (string, error return "", err } return string(code), nil -} \ No newline at end of file +} diff --git a/languageserver/protocol/json.go b/languageserver/protocol/json.go index 9a8872a8..509385f5 100644 --- a/languageserver/protocol/json.go +++ b/languageserver/protocol/json.go @@ -16,7 +16,6 @@ * limitations under the License. */ - // Code generated for LSP. DO NOT EDIT. package protocol