Merge pull request #3167 from nspcc-dev/autogen-warn

smartcontract: add `DO NOT EDIT` warning to autogenerated files
This commit is contained in:
Roman Khimov 2023-10-18 21:35:20 +03:00 committed by GitHub
commit 04d778612e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 38 additions and 2 deletions

View file

@ -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 (

View file

@ -46,7 +46,7 @@ var generateWrapperCmd = cli.Command{
var generateRPCWrapperCmd = cli.Command{
Name: "generate-rpcwrapper",
Usage: "generate RPC wrapper to use for data reads",
UsageText: "neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> --hash <hash> [--config <config>]",
UsageText: "neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]",
Action: contractGenerateRPCWrapper,
Flags: generatorFlags,
}

View file

@ -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 (
@ -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 (
@ -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 (

View file

@ -1,4 +1,6 @@
// Package gastoken contains RPC wrappers for GasToken contract.
//
// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
package gastoken
import (

View file

@ -1,4 +1,6 @@
// Package nameservice contains RPC wrappers for NameService contract.
//
// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
package nameservice
import (

View file

@ -1,4 +1,6 @@
// Package nextoken contains RPC wrappers for NEX Token contract.
//
// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
package nextoken
import (

View file

@ -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 <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
package nonnepxxcontractwithiterators
import (

View file

@ -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 (

View file

@ -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 (

View file

@ -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 (

View file

@ -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 (

View file

@ -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 (

View file

@ -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 (

View file

@ -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 (

View file

@ -1,4 +1,6 @@
// Package verify contains RPC wrappers for verify contract.
//
// Code generated by neo-go contract generate-rpcwrapper --manifest <file.json> --out <file.go> [--hash <hash>] [--config <config>]; DO NOT EDIT.
package verify
import (

View file

@ -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 <file.json> --out <file.go> --hash <hash> [--config <config>]; DO NOT EDIT.
package {{.PackageName}}
import (

View file

@ -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 (

View file

@ -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 (