Skip to content

Commit

Permalink
smartcontract: add DO NOT EDIT warning to autogenerated files
Browse files Browse the repository at this point in the history
Close #3139.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
  • Loading branch information
AnnaShaleva committed Oct 18, 2023
1 parent 1841d81 commit 9a46c9a
Show file tree
Hide file tree
Showing 17 changed files with 37 additions and 1 deletion.
2 changes: 2 additions & 0 deletions cli/smartcontract/contract_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ func Blocks() []*alias.Block {
bs, err := os.ReadFile(outPath)
require.NoError(t, err)
require.Equal(t, `// Package testcontract contains wrappers for testcontract contract.
//
// Code generated by neo-go contract generate-wrapper --manifest <file.json> --out <file.go> --hash <hash> [--config <config>]; DO NOT EDIT.
package testcontract
import (
Expand Down
6 changes: 6 additions & 0 deletions cli/smartcontract/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ callflags:
}))

const expected = `// Package wrapper contains wrappers for MyContract contract.
//
// Code generated by neo-go contract generate-wrapper --manifest <file.json> --out <file.go> --hash <hash> [--config <config>]; DO NOT EDIT.
package wrapper
import (
Expand Down Expand Up @@ -266,6 +268,8 @@ func TestGenerateValidPackageName(t *testing.T) {
data, err := os.ReadFile(outFile)
require.NoError(t, err)
require.Equal(t, `// Package myspacecontract contains wrappers for My space contract contract.
//
// Code generated by neo-go contract generate-wrapper --manifest <file.json> --out <file.go> --hash <hash> [--config <config>]; DO NOT EDIT.
package myspacecontract
import (
Expand All @@ -290,6 +294,8 @@ func Get() int {
data, err = os.ReadFile(outFile)
require.NoError(t, err)
require.Equal(t, `// Package myspacecontract contains RPC wrappers for My space contract contract.
//
// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
package myspacecontract
import (
Expand Down
2 changes: 2 additions & 0 deletions cli/smartcontract/testdata/gas/gas.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cli/smartcontract/testdata/nameservice/nns.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cli/smartcontract/testdata/nex/nex.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions cli/smartcontract/testdata/nonepiter/iter.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// Package structs contains RPC wrappers for Notifications contract.
//
// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
package structs

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// Package structs contains RPC wrappers for Notifications contract.
//
// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
package structs

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// Package structs contains RPC wrappers for Notifications contract.
//
// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
package structs

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// Package structs contains RPC wrappers for Types contract.
//
// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
package structs

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// Package structs contains RPC wrappers for Types contract.
//
// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
package structs

import (
Expand Down
2 changes: 2 additions & 0 deletions cli/smartcontract/testdata/rpcbindings/types/rpcbindings.out
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// Package types contains RPC wrappers for Types contract.
//
// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
package types

import (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// Package types contains RPC wrappers for Types contract.
//
// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
package types

import (
Expand Down
2 changes: 2 additions & 0 deletions cli/smartcontract/testdata/verifyrpc/verify.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/smartcontract/binding/generate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions pkg/smartcontract/rpcbinding/binding.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ func (c *Contract) {{.Name}}Unsigned({{range $index, $arg := .Arguments -}}
{{end}}`

bindingDefinition = `// Package {{.PackageName}} contains RPC wrappers for {{.ContractName}} contract.
//
// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
package {{.PackageName}}
import (
Expand Down
2 changes: 1 addition & 1 deletion pkg/smartcontract/zkpbinding/binding.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const (
// to see how to verify proofs via the Verifier contract:
// https://github.com/nspcc-dev/neo-go/tree/master/examples/zkp/cubic_circuit.
//
// This contract is automatically generated.
// Code generated by neo-go zkpbinding.GenerateVerifier; DO NOT EDIT.
package main
import (
Expand Down

0 comments on commit 9a46c9a

Please sign in to comment.