Skip to content

Commit

Permalink
smartcontract: fix go version mismatch in TestContractInitAndCompile
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
AliceInHunterland committed Feb 15, 2024
1 parent 5fe4778 commit 114e939
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion cli/smartcontract/contract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
"github.com/nspcc-dev/neo-go/pkg/vm/vmstate"
"github.com/nspcc-dev/neo-go/pkg/wallet"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
)

// Keep contract NEFs consistent between runs.
Expand Down
6 changes: 3 additions & 3 deletions cli/smartcontract/smart_contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import (
"github.com/nspcc-dev/neo-go/pkg/vm"
"github.com/nspcc-dev/neo-go/pkg/wallet"
"github.com/urfave/cli"
"gopkg.in/yaml.v3"
)

// addressFlagName is a flag name used for address-related operations. It should be
Expand Down Expand Up @@ -374,9 +373,10 @@ func initSmartContract(ctx *cli.Context) error {
}

gm := []byte("module " + contractName + `
require (
go 1.18
require (
github.com/nspcc-dev/neo-go/pkg/interop ` + ver + `
)`)
)`)
if err := os.WriteFile(filepath.Join(basePath, "go.mod"), gm, 0644); err != nil {
return cli.NewExitError(err, 1)
}
Expand Down

0 comments on commit 114e939

Please sign in to comment.