From 1237c719e31e484efb07e6adc31781dd46a7b2c6 Mon Sep 17 00:00:00 2001 From: Ekaterina Pavlova Date: Mon, 25 Dec 2023 13:01:36 +0300 Subject: [PATCH] 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 --- cli/smartcontract/contract_test.go | 6 +++--- cli/smartcontract/generate_test.go | 18 +++++++++--------- cli/smartcontract/testdata/gas/gas.go | 4 ++-- cli/smartcontract/testdata/nameservice/nns.go | 4 ++-- cli/smartcontract/testdata/nex/nex.go | 4 ++-- cli/smartcontract/testdata/nonepiter/iter.go | 4 ++-- .../rpcbindings/notifications/rpcbindings.out | 4 ++-- .../notifications/rpcbindings_extended.out | 4 ++-- .../notifications/rpcbindings_guessed.out | 4 ++-- .../rpcbindings/structs/rpcbindings.out | 4 ++-- .../structs/rpcbindings_dynamic_hash.out | 4 ++-- .../testdata/rpcbindings/types/rpcbindings.out | 4 ++-- .../types/rpcbindings_dynamic_hash.out | 4 ++-- cli/smartcontract/testdata/verifyrpc/verify.go | 4 ++-- pkg/smartcontract/binding/generate.go | 4 ++-- pkg/smartcontract/rpcbinding/binding.go | 6 +++--- pkg/smartcontract/zkpbinding/binding.go | 6 +++--- 17 files changed, 44 insertions(+), 44 deletions(-) diff --git a/cli/smartcontract/contract_test.go b/cli/smartcontract/contract_test.go index 8072d505b..a263413cc 100644 --- a/cli/smartcontract/contract_test.go +++ b/cli/smartcontract/contract_test.go @@ -176,9 +176,9 @@ 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 --out --hash [--config ]; DO NOT EDIT. + require.Equal(t, `// Code generated by neo-go contract generate-wrapper --manifest --out --hash [--config ]; DO NOT EDIT. + +// Package testcontract contains wrappers for testcontract contract. package testcontract import ( diff --git a/cli/smartcontract/generate_test.go b/cli/smartcontract/generate_test.go index 4f09544a5..edd31b327 100644 --- a/cli/smartcontract/generate_test.go +++ b/cli/smartcontract/generate_test.go @@ -151,9 +151,9 @@ callflags: "--hash", h.StringLE(), })) - const expected = `// Package wrapper contains wrappers for MyContract contract. -// -// Code generated by neo-go contract generate-wrapper --manifest --out --hash [--config ]; DO NOT EDIT. + const expected = `// Code generated by neo-go contract generate-wrapper --manifest --out --hash [--config ]; DO NOT EDIT. + +// Package wrapper contains wrappers for MyContract contract. package wrapper import ( @@ -267,9 +267,9 @@ 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 --out --hash [--config ]; DO NOT EDIT. + require.Equal(t, `// Code generated by neo-go contract generate-wrapper --manifest --out --hash [--config ]; DO NOT EDIT. + +// Package myspacecontract contains wrappers for My space contract contract. package myspacecontract import ( @@ -293,9 +293,9 @@ 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 --out [--hash ] [--config ]; DO NOT EDIT. + require.Equal(t, `// Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. + +// Package myspacecontract contains RPC wrappers for My space contract contract. package myspacecontract import ( diff --git a/cli/smartcontract/testdata/gas/gas.go b/cli/smartcontract/testdata/gas/gas.go index 36d2d880d..b5fb268a1 100644 --- a/cli/smartcontract/testdata/gas/gas.go +++ b/cli/smartcontract/testdata/gas/gas.go @@ -1,6 +1,6 @@ -// Package gastoken contains RPC wrappers for GasToken contract. -// // Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. + +// Package gastoken contains RPC wrappers for GasToken contract. package gastoken import ( diff --git a/cli/smartcontract/testdata/nameservice/nns.go b/cli/smartcontract/testdata/nameservice/nns.go index 901b5a8bb..999e34cf2 100644 --- a/cli/smartcontract/testdata/nameservice/nns.go +++ b/cli/smartcontract/testdata/nameservice/nns.go @@ -1,6 +1,6 @@ -// Package nameservice contains RPC wrappers for NameService contract. -// // Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. + +// Package nameservice contains RPC wrappers for NameService contract. package nameservice import ( diff --git a/cli/smartcontract/testdata/nex/nex.go b/cli/smartcontract/testdata/nex/nex.go index 8a4a3edd8..078c7940a 100644 --- a/cli/smartcontract/testdata/nex/nex.go +++ b/cli/smartcontract/testdata/nex/nex.go @@ -1,6 +1,6 @@ -// Package nextoken contains RPC wrappers for NEX Token contract. -// // Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. + +// Package nextoken contains RPC wrappers for NEX Token contract. package nextoken import ( diff --git a/cli/smartcontract/testdata/nonepiter/iter.go b/cli/smartcontract/testdata/nonepiter/iter.go index 6a9f0322e..bf8e7c2ac 100644 --- a/cli/smartcontract/testdata/nonepiter/iter.go +++ b/cli/smartcontract/testdata/nonepiter/iter.go @@ -1,6 +1,6 @@ -// Package nonnepxxcontractwithiterators contains RPC wrappers for Non-NEPXX contract with iterators contract. -// // Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. + +// Package nonnepxxcontractwithiterators contains RPC wrappers for Non-NEPXX contract with iterators contract. package nonnepxxcontractwithiterators import ( diff --git a/cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings.out b/cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings.out index 957f75b32..5b72cbd06 100644 --- a/cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings.out +++ b/cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings.out @@ -1,6 +1,6 @@ -// Package structs contains RPC wrappers for Notifications contract. -// // Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. + +// Package structs contains RPC wrappers for Notifications contract. package structs import ( diff --git a/cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings_extended.out b/cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings_extended.out index ae30f5650..15bb84f9b 100755 --- a/cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings_extended.out +++ b/cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings_extended.out @@ -1,6 +1,6 @@ -// Package structs contains RPC wrappers for Notifications contract. -// // Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. + +// Package structs contains RPC wrappers for Notifications contract. package structs import ( diff --git a/cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings_guessed.out b/cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings_guessed.out index f3cf84aee..aec39c0f3 100755 --- a/cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings_guessed.out +++ b/cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings_guessed.out @@ -1,6 +1,6 @@ -// Package structs contains RPC wrappers for Notifications contract. -// // Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. + +// Package structs contains RPC wrappers for Notifications contract. package structs import ( diff --git a/cli/smartcontract/testdata/rpcbindings/structs/rpcbindings.out b/cli/smartcontract/testdata/rpcbindings/structs/rpcbindings.out index 5c7a5476b..0b38a3f25 100644 --- a/cli/smartcontract/testdata/rpcbindings/structs/rpcbindings.out +++ b/cli/smartcontract/testdata/rpcbindings/structs/rpcbindings.out @@ -1,6 +1,6 @@ -// Package structs contains RPC wrappers for Types contract. -// // Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. + +// Package structs contains RPC wrappers for Types contract. package structs import ( diff --git a/cli/smartcontract/testdata/rpcbindings/structs/rpcbindings_dynamic_hash.out b/cli/smartcontract/testdata/rpcbindings/structs/rpcbindings_dynamic_hash.out index 3687bb174..0f9346d0f 100755 --- a/cli/smartcontract/testdata/rpcbindings/structs/rpcbindings_dynamic_hash.out +++ b/cli/smartcontract/testdata/rpcbindings/structs/rpcbindings_dynamic_hash.out @@ -1,6 +1,6 @@ -// Package structs contains RPC wrappers for Types contract. -// // Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. + +// Package structs contains RPC wrappers for Types contract. package structs import ( diff --git a/cli/smartcontract/testdata/rpcbindings/types/rpcbindings.out b/cli/smartcontract/testdata/rpcbindings/types/rpcbindings.out index 2bfab59a5..7513db9ea 100644 --- a/cli/smartcontract/testdata/rpcbindings/types/rpcbindings.out +++ b/cli/smartcontract/testdata/rpcbindings/types/rpcbindings.out @@ -1,6 +1,6 @@ -// Package types contains RPC wrappers for Types contract. -// // Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. + +// Package types contains RPC wrappers for Types contract. package types import ( diff --git a/cli/smartcontract/testdata/rpcbindings/types/rpcbindings_dynamic_hash.out b/cli/smartcontract/testdata/rpcbindings/types/rpcbindings_dynamic_hash.out index 749c12b8d..420c7b2a7 100755 --- a/cli/smartcontract/testdata/rpcbindings/types/rpcbindings_dynamic_hash.out +++ b/cli/smartcontract/testdata/rpcbindings/types/rpcbindings_dynamic_hash.out @@ -1,6 +1,6 @@ -// Package types contains RPC wrappers for Types contract. -// // Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. + +// Package types contains RPC wrappers for Types contract. package types import ( diff --git a/cli/smartcontract/testdata/verifyrpc/verify.go b/cli/smartcontract/testdata/verifyrpc/verify.go index 3bda46f3f..59e82a5fe 100644 --- a/cli/smartcontract/testdata/verifyrpc/verify.go +++ b/cli/smartcontract/testdata/verifyrpc/verify.go @@ -1,6 +1,6 @@ -// Package verify contains RPC wrappers for verify contract. -// // Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. + +// Package verify contains RPC wrappers for verify contract. package verify import ( diff --git a/pkg/smartcontract/binding/generate.go b/pkg/smartcontract/binding/generate.go index 37bc145f4..b38ee416c 100644 --- a/pkg/smartcontract/binding/generate.go +++ b/pkg/smartcontract/binding/generate.go @@ -33,9 +33,9 @@ func {{.Name}}({{range $index, $arg := .Arguments -}} {{- end}} } {{- end -}} -// Package {{.PackageName}} contains wrappers for {{.ContractName}} contract. -// // Code generated by neo-go contract generate-wrapper --manifest --out --hash [--config ]; DO NOT EDIT. + +// Package {{.PackageName}} contains wrappers for {{.ContractName}} contract. package {{.PackageName}} import ( diff --git a/pkg/smartcontract/rpcbinding/binding.go b/pkg/smartcontract/rpcbinding/binding.go index de801a5de..02f363496 100644 --- a/pkg/smartcontract/rpcbinding/binding.go +++ b/pkg/smartcontract/rpcbinding/binding.go @@ -112,9 +112,9 @@ 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 --out [--hash ] [--config ]; DO NOT EDIT. + bindingDefinition = `// Code generated by neo-go contract generate-rpcwrapper --manifest --out [--hash ] [--config ]; DO NOT EDIT. + +// Package {{.PackageName}} contains RPC wrappers for {{.ContractName}} contract. package {{.PackageName}} import ( diff --git a/pkg/smartcontract/zkpbinding/binding.go b/pkg/smartcontract/zkpbinding/binding.go index 751031b3b..4cca65fbd 100644 --- a/pkg/smartcontract/zkpbinding/binding.go +++ b/pkg/smartcontract/zkpbinding/binding.go @@ -60,7 +60,9 @@ const ( // verification contract is circuit-specific, i.e. corresponds to a specific // single constraint system. Thus, every new circuit requires vew verification // contract to be generated and deployed to the chain. - goVerificationTmpl = `// Package main contains verification smart contract that uses Neo BLS12-381 + goVerificationTmpl = `//Code generated by neo-go zkpbinding.GenerateVerifier; DO NOT EDIT. + +// Package main contains verification smart contract that uses Neo BLS12-381 // curves interoperability functionality to verify provided proof against provided // public input. The contract contains a single 'verifyProof' method that accepts // a proof represented as three BLS12-381 curve points and public witnesses @@ -74,8 +76,6 @@ const ( // go.sum files required for compilation. Please, refer to the NeoGo ZKP example // to see how to verify proofs via the Verifier contract: // https://github.com/nspcc-dev/neo-go/tree/master/examples/zkp/cubic_circuit. -// -// Code generated by neo-go zkpbinding.GenerateVerifier; DO NOT EDIT. package main import (