Skip to content

Commit 1237c71

Browse files
smartcontract: fix DO NOT EDIT warning to autogenerated files
The text must appear as the first line of a properly formatted Go // comment, and that comment must appear before but not be attached to the package clause and before any /* */ comment. Closes #3254 Signed-off-by: Ekaterina Pavlova <[email protected]>
1 parent de98b39 commit 1237c71

File tree

17 files changed

+44
-44
lines changed

17 files changed

+44
-44
lines changed

cli/smartcontract/contract_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,9 @@ func Blocks() []*alias.Block {
176176

177177
bs, err := os.ReadFile(outPath)
178178
require.NoError(t, err)
179-
require.Equal(t, `// Package testcontract contains wrappers for testcontract contract.
180-
//
181-
// Code generated by neo-go contract generate-wrapper --manifest <file.json> --out <file.go> --hash <hash> [--config <config>]; DO NOT EDIT.
179+
require.Equal(t, `// Code generated by neo-go contract generate-wrapper --manifest <file.json> --out <file.go> --hash <hash> [--config <config>]; DO NOT EDIT.
180+
181+
// Package testcontract contains wrappers for testcontract contract.
182182
package testcontract
183183
184184
import (

cli/smartcontract/generate_test.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,9 @@ callflags:
151151
"--hash", h.StringLE(),
152152
}))
153153

154-
const expected = `// Package wrapper contains wrappers for MyContract contract.
155-
//
156-
// Code generated by neo-go contract generate-wrapper --manifest <file.json> --out <file.go> --hash <hash> [--config <config>]; DO NOT EDIT.
154+
const expected = `// Code generated by neo-go contract generate-wrapper --manifest <file.json> --out <file.go> --hash <hash> [--config <config>]; DO NOT EDIT.
155+
156+
// Package wrapper contains wrappers for MyContract contract.
157157
package wrapper
158158
159159
import (
@@ -267,9 +267,9 @@ func TestGenerateValidPackageName(t *testing.T) {
267267

268268
data, err := os.ReadFile(outFile)
269269
require.NoError(t, err)
270-
require.Equal(t, `// Package myspacecontract contains wrappers for My space contract contract.
271-
//
272-
// Code generated by neo-go contract generate-wrapper --manifest <file.json> --out <file.go> --hash <hash> [--config <config>]; DO NOT EDIT.
270+
require.Equal(t, `// Code generated by neo-go contract generate-wrapper --manifest <file.json> --out <file.go> --hash <hash> [--config <config>]; DO NOT EDIT.
271+
272+
// Package myspacecontract contains wrappers for My space contract contract.
273273
package myspacecontract
274274
275275
import (
@@ -293,9 +293,9 @@ func Get() int {
293293

294294
data, err = os.ReadFile(outFile)
295295
require.NoError(t, err)
296-
require.Equal(t, `// Package myspacecontract contains RPC wrappers for My space contract contract.
297-
//
298-
// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
296+
require.Equal(t, `// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
297+
298+
// Package myspacecontract contains RPC wrappers for My space contract contract.
299299
package myspacecontract
300300
301301
import (

cli/smartcontract/testdata/gas/gas.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/smartcontract/testdata/nameservice/nns.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/smartcontract/testdata/nex/nex.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/smartcontract/testdata/nonepiter/iter.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// Package structs contains RPC wrappers for Notifications contract.
2-
//
31
// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
2+
3+
// Package structs contains RPC wrappers for Notifications contract.
44
package structs
55

66
import (

cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings_extended.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// Package structs contains RPC wrappers for Notifications contract.
2-
//
31
// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
2+
3+
// Package structs contains RPC wrappers for Notifications contract.
44
package structs
55

66
import (

cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings_guessed.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// Package structs contains RPC wrappers for Notifications contract.
2-
//
31
// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
2+
3+
// Package structs contains RPC wrappers for Notifications contract.
44
package structs
55

66
import (

cli/smartcontract/testdata/rpcbindings/structs/rpcbindings.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// Package structs contains RPC wrappers for Types contract.
2-
//
31
// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
2+
3+
// Package structs contains RPC wrappers for Types contract.
44
package structs
55

66
import (

cli/smartcontract/testdata/rpcbindings/structs/rpcbindings_dynamic_hash.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// Package structs contains RPC wrappers for Types contract.
2-
//
31
// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
2+
3+
// Package structs contains RPC wrappers for Types contract.
44
package structs
55

66
import (

cli/smartcontract/testdata/rpcbindings/types/rpcbindings.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// Package types contains RPC wrappers for Types contract.
2-
//
31
// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
2+
3+
// Package types contains RPC wrappers for Types contract.
44
package types
55

66
import (

cli/smartcontract/testdata/rpcbindings/types/rpcbindings_dynamic_hash.out

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// Package types contains RPC wrappers for Types contract.
2-
//
31
// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
2+
3+
// Package types contains RPC wrappers for Types contract.
44
package types
55

66
import (

cli/smartcontract/testdata/verifyrpc/verify.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/smartcontract/binding/generate.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/smartcontract/rpcbinding/binding.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ func (c *Contract) {{.Name}}Unsigned({{range $index, $arg := .Arguments -}}
112112
}
113113
{{end}}`
114114

115-
bindingDefinition = `// Package {{.PackageName}} contains RPC wrappers for {{.ContractName}} contract.
116-
//
117-
// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
115+
bindingDefinition = `// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
116+
117+
// Package {{.PackageName}} contains RPC wrappers for {{.ContractName}} contract.
118118
package {{.PackageName}}
119119
120120
import (

pkg/smartcontract/zkpbinding/binding.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ const (
6060
// verification contract is circuit-specific, i.e. corresponds to a specific
6161
// single constraint system. Thus, every new circuit requires vew verification
6262
// contract to be generated and deployed to the chain.
63-
goVerificationTmpl = `// Package main contains verification smart contract that uses Neo BLS12-381
63+
goVerificationTmpl = `//Code generated by neo-go zkpbinding.GenerateVerifier; DO NOT EDIT.
64+
65+
// Package main contains verification smart contract that uses Neo BLS12-381
6466
// curves interoperability functionality to verify provided proof against provided
6567
// public input. The contract contains a single 'verifyProof' method that accepts
6668
// a proof represented as three BLS12-381 curve points and public witnesses
@@ -74,8 +76,6 @@ const (
7476
// go.sum files required for compilation. Please, refer to the NeoGo ZKP example
7577
// to see how to verify proofs via the Verifier contract:
7678
// https://github.com/nspcc-dev/neo-go/tree/master/examples/zkp/cubic_circuit.
77-
//
78-
// Code generated by neo-go zkpbinding.GenerateVerifier; DO NOT EDIT.
7979
package main
8080
8181
import (

0 commit comments

Comments
 (0)