From 6476241b3ae0755edb3708d741a7458496cee888 Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Wed, 18 Oct 2023 20:32:51 +0300 Subject: [PATCH] smartcontract: add `DO NOT EDIT` warning to autogenerated files Close #3139. Signed-off-by: Anna Shaleva --- cli/smartcontract/contract_test.go | 2 ++ cli/smartcontract/generate_test.go | 6 ++++++ cli/smartcontract/testdata/gas/gas.go | 2 ++ cli/smartcontract/testdata/nameservice/nns.go | 2 ++ cli/smartcontract/testdata/nex/nex.go | 2 ++ cli/smartcontract/testdata/nonepiter/iter.go | 2 ++ .../testdata/rpcbindings/notifications/rpcbindings.out | 2 ++ .../rpcbindings/notifications/rpcbindings_extended.out | 2 ++ .../rpcbindings/notifications/rpcbindings_guessed.out | 2 ++ .../testdata/rpcbindings/structs/rpcbindings.out | 2 ++ .../rpcbindings/structs/rpcbindings_dynamic_hash.out | 2 ++ .../testdata/rpcbindings/types/rpcbindings.out | 2 ++ .../testdata/rpcbindings/types/rpcbindings_dynamic_hash.out | 2 ++ cli/smartcontract/testdata/verifyrpc/verify.go | 2 ++ pkg/smartcontract/binding/generate.go | 2 ++ pkg/smartcontract/rpcbinding/binding.go | 2 ++ pkg/smartcontract/zkpbinding/binding.go | 2 +- 17 files changed, 37 insertions(+), 1 deletion(-) diff --git a/cli/smartcontract/contract_test.go b/cli/smartcontract/contract_test.go index 4b53e7fba..fca6808f3 100644 --- a/cli/smartcontract/contract_test.go +++ b/cli/smartcontract/contract_test.go @@ -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 --out --hash [--config ]; DO NOT EDIT. package testcontract import ( diff --git a/cli/smartcontract/generate_test.go b/cli/smartcontract/generate_test.go index 4354ea4cc..dffc1892e 100644 --- a/cli/smartcontract/generate_test.go +++ b/cli/smartcontract/generate_test.go @@ -152,6 +152,8 @@ callflags: })) const expected = `// Package wrapper contains wrappers for MyContract contract. +// +// Code generated by neo-go contract generate-wrapper --manifest --out --hash [--config ]; DO NOT EDIT. package wrapper import ( @@ -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 --out --hash [--config ]; DO NOT EDIT. package myspacecontract import ( @@ -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 --out [--hash ] [--config ]; DO NOT EDIT. package myspacecontract import ( diff --git a/cli/smartcontract/testdata/gas/gas.go b/cli/smartcontract/testdata/gas/gas.go index ca890f291..36d2d880d 100644 --- a/cli/smartcontract/testdata/gas/gas.go +++ b/cli/smartcontract/testdata/gas/gas.go @@ -1,4 +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 import ( diff --git a/cli/smartcontract/testdata/nameservice/nns.go b/cli/smartcontract/testdata/nameservice/nns.go index aec40e3b8..901b5a8bb 100644 --- a/cli/smartcontract/testdata/nameservice/nns.go +++ b/cli/smartcontract/testdata/nameservice/nns.go @@ -1,4 +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 import ( diff --git a/cli/smartcontract/testdata/nex/nex.go b/cli/smartcontract/testdata/nex/nex.go index 089d10f79..8a4a3edd8 100644 --- a/cli/smartcontract/testdata/nex/nex.go +++ b/cli/smartcontract/testdata/nex/nex.go @@ -1,4 +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 import ( diff --git a/cli/smartcontract/testdata/nonepiter/iter.go b/cli/smartcontract/testdata/nonepiter/iter.go index c296ade05..6a9f0322e 100644 --- a/cli/smartcontract/testdata/nonepiter/iter.go +++ b/cli/smartcontract/testdata/nonepiter/iter.go @@ -1,4 +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 import ( diff --git a/cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings.out b/cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings.out index 399e0e283..fb2c3b20b 100644 --- a/cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings.out +++ b/cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings.out @@ -1,4 +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 import ( diff --git a/cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings_extended.out b/cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings_extended.out index 1276a8238..b1b07aa12 100755 --- a/cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings_extended.out +++ b/cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings_extended.out @@ -1,4 +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 import ( diff --git a/cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings_guessed.out b/cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings_guessed.out index 025a47ee7..b71c3d103 100755 --- a/cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings_guessed.out +++ b/cli/smartcontract/testdata/rpcbindings/notifications/rpcbindings_guessed.out @@ -1,4 +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 import ( diff --git a/cli/smartcontract/testdata/rpcbindings/structs/rpcbindings.out b/cli/smartcontract/testdata/rpcbindings/structs/rpcbindings.out index 0afbef67a..7a1166ea6 100644 --- a/cli/smartcontract/testdata/rpcbindings/structs/rpcbindings.out +++ b/cli/smartcontract/testdata/rpcbindings/structs/rpcbindings.out @@ -1,4 +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 import ( diff --git a/cli/smartcontract/testdata/rpcbindings/structs/rpcbindings_dynamic_hash.out b/cli/smartcontract/testdata/rpcbindings/structs/rpcbindings_dynamic_hash.out index e869574da..e5047b273 100755 --- a/cli/smartcontract/testdata/rpcbindings/structs/rpcbindings_dynamic_hash.out +++ b/cli/smartcontract/testdata/rpcbindings/structs/rpcbindings_dynamic_hash.out @@ -1,4 +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 import ( diff --git a/cli/smartcontract/testdata/rpcbindings/types/rpcbindings.out b/cli/smartcontract/testdata/rpcbindings/types/rpcbindings.out index 765c20937..4a46652ab 100644 --- a/cli/smartcontract/testdata/rpcbindings/types/rpcbindings.out +++ b/cli/smartcontract/testdata/rpcbindings/types/rpcbindings.out @@ -1,4 +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 import ( diff --git a/cli/smartcontract/testdata/rpcbindings/types/rpcbindings_dynamic_hash.out b/cli/smartcontract/testdata/rpcbindings/types/rpcbindings_dynamic_hash.out index 0530e9912..fbd348691 100755 --- a/cli/smartcontract/testdata/rpcbindings/types/rpcbindings_dynamic_hash.out +++ b/cli/smartcontract/testdata/rpcbindings/types/rpcbindings_dynamic_hash.out @@ -1,4 +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 import ( diff --git a/cli/smartcontract/testdata/verifyrpc/verify.go b/cli/smartcontract/testdata/verifyrpc/verify.go index 905c3fb88..3bda46f3f 100644 --- a/cli/smartcontract/testdata/verifyrpc/verify.go +++ b/cli/smartcontract/testdata/verifyrpc/verify.go @@ -1,4 +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 import ( diff --git a/pkg/smartcontract/binding/generate.go b/pkg/smartcontract/binding/generate.go index a49d56029..37bc145f4 100644 --- a/pkg/smartcontract/binding/generate.go +++ b/pkg/smartcontract/binding/generate.go @@ -34,6 +34,8 @@ func {{.Name}}({{range $index, $arg := .Arguments -}} } {{- 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}} import ( diff --git a/pkg/smartcontract/rpcbinding/binding.go b/pkg/smartcontract/rpcbinding/binding.go index 83ab4702c..c35d9c179 100644 --- a/pkg/smartcontract/rpcbinding/binding.go +++ b/pkg/smartcontract/rpcbinding/binding.go @@ -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 --out [--hash ] [--config ]; DO NOT EDIT. package {{.PackageName}} import ( diff --git a/pkg/smartcontract/zkpbinding/binding.go b/pkg/smartcontract/zkpbinding/binding.go index 133f4bcf3..751031b3b 100644 --- a/pkg/smartcontract/zkpbinding/binding.go +++ b/pkg/smartcontract/zkpbinding/binding.go @@ -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 (