From 8beb9f23c3471e4e8d91c85a4de5c12b8eb2618a Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Tue, 23 May 2023 12:18:26 +0300 Subject: [PATCH] smartcontract: add comments to binding config fields Signed-off-by: Anna Shaleva --- pkg/smartcontract/binding/generate.go | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/pkg/smartcontract/binding/generate.go b/pkg/smartcontract/binding/generate.go index c02bbd49a..3f9bca863 100644 --- a/pkg/smartcontract/binding/generate.go +++ b/pkg/smartcontract/binding/generate.go @@ -48,14 +48,22 @@ const Hash = "{{ .Hash }}" type ( // Config contains parameter for the generated binding. Config struct { - Package string `yaml:"package,omitempty"` - Manifest *manifest.Manifest `yaml:"-"` - Hash util.Uint160 `yaml:"hash,omitempty"` - Overrides map[string]Override `yaml:"overrides,omitempty"` - CallFlags map[string]callflag.CallFlag `yaml:"callflags,omitempty"` - NamedTypes map[string]ExtendedType `yaml:"namedtypes,omitempty"` - Types map[string]ExtendedType `yaml:"types,omitempty"` - Output io.Writer `yaml:"-"` + Package string `yaml:"package,omitempty"` + Manifest *manifest.Manifest `yaml:"-"` + Hash util.Uint160 `yaml:"hash,omitempty"` + Overrides map[string]Override `yaml:"overrides,omitempty"` + CallFlags map[string]callflag.CallFlag `yaml:"callflags,omitempty"` + // NamedTypes contains exported structured types that have some name (even + // if the original structure doesn't) and a number of internal fields. The + // map key is in the form of `namespace.name`, the value is fully-qualified + // and possibly nested description of the type structure. + NamedTypes map[string]ExtendedType `yaml:"namedtypes,omitempty"` + // Types contains type structure description for various types used in + // smartcontract. The map key has one of the following forms: + // - `methodName` for method return value; + // - `mathodName.paramName` for method's parameter value. + Types map[string]ExtendedType `yaml:"types,omitempty"` + Output io.Writer `yaml:"-"` } ExtendedType struct {