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

smartcontract: fix go version mismatch in TestContractInitAndCompile #3318

Merged
merged 2 commits into from
Feb 19, 2024

Conversation

AliceInHunterland
Copy link
Contributor

It is necessary to update dependencies in the test for go1.18 and above to match with the interop module.

Close #3152

Copy link

codecov bot commented Feb 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (71fb759) 84.89% compared to head (5128b84) 84.94%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3318      +/-   ##
==========================================
+ Coverage   84.89%   84.94%   +0.05%     
==========================================
  Files         328      328              
  Lines       44747    44750       +3     
==========================================
+ Hits        37987    38015      +28     
+ Misses       5251     5223      -28     
- Partials     1509     1512       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

cli/smartcontract/contract_test.go Outdated Show resolved Hide resolved
@AliceInHunterland AliceInHunterland force-pushed the TestContractInitAndCompile branch 2 times, most recently from 114e939 to d5483b0 Compare February 15, 2024 17:47
cli/smartcontract/smart_contract.go Outdated Show resolved Hide resolved
cli/smartcontract/smart_contract.go Outdated Show resolved Hide resolved
)`)
)

go 1.19`)
Copy link
Member

Choose a reason for hiding this comment

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

@roman-khimov, we need your approve for this hard-coded go version in our SC template. We'll need to update it every time we bump minimum required Go version, but in general I think it's good that we have it here.

Copy link
Member

Choose a reason for hiding this comment

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

It's OK to have it (all regular go.mod files have some go definition).

But why after require?

Copy link
Member

@AnnaShaleva AnnaShaleva Feb 19, 2024

Choose a reason for hiding this comment

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

I thought it's kind of standard to have it in the end of go.mod:

neo-go/go.mod

Lines 70 to 80 in 71fb759

golang.org/x/mod v0.12.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/sys v0.15.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230803162519-f966b187b2e5 // indirect
google.golang.org/grpc v1.57.1 // indirect
google.golang.org/protobuf v1.31.0 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)
go 1.19

But according to https://go.dev/doc/modules/gomod-ref, it should be put before require, thus @AliceInHunterland, let's update the current PR and NeoGo gomod file (in a separate commit).

Needs to updated dependencies inside the test for go1.18 and higher to
match with interop module.

Close #3152

Signed-off-by: Ekaterina Pavlova <[email protected]>
According to https://go.dev/doc/modules/gomod-ref go version should be
placed before `require` section.

Signed-off-by: Ekaterina Pavlova <[email protected]>
@roman-khimov roman-khimov merged commit f94df6c into master Feb 19, 2024
18 of 19 checks passed
@roman-khimov roman-khimov deleted the TestContractInitAndCompile branch February 19, 2024 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failing TestContractInitAndCompile due to unexpected go version
3 participants