binding

package
v0.99.3-pre Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(cfg Config) error

Generate writes Go file containing smartcontract bindings to the `cfg.Output`.

Types

type Config

type 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"`
	Output    io.Writer                    `yaml:"-"`
}

Config contains parameter for the generated binding.

func NewConfig

func NewConfig() Config

NewConfig initializes and returns a new config instance.

type Override

type Override struct {
	// Package contains a fully-qualified package name.
	Package string
	// TypeName contains type name together with a package alias.
	TypeName string
}

Override contains a package and a type to replace manifest method parameter type with.

func NewOverrideFromString

func NewOverrideFromString(s string) Override

NewOverrideFromString parses s and returns method parameter type override spec.

func (Override) MarshalYAML

func (o Override) MarshalYAML() (interface{}, error)

MarshalYAML implements the YAML marshaler interface.

func (*Override) UnmarshalYAML

func (o *Override) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the YAML Unmarshaler interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL