preprocessor

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRealContractsNames added in v0.3.0

func GetRealContractsNames() ([]string, error)

GetRealContractsNames returns names of all real smart contracts

func GetRealGenesisDir added in v0.3.0

func GetRealGenesisDir(dir string) (string, error)

GetRealGenesisDir return dir under genesis dir

Types

type ParsedFile

type ParsedFile struct {
	// contains filtered or unexported fields
}

ParsedFile struct with prepared info we extract from source code

func ParseFile

func ParseFile(fileName string) (*ParsedFile, error)

ParseFile parses a file as Go source code of a smart contract and returns it as `ParsedFile`

func (*ParsedFile) ChangePackageToMain added in v0.4.0

func (pf *ParsedFile) ChangePackageToMain()

ChangePackageToMain changes package of the parsed code to "main"

func (*ParsedFile) ContractName added in v0.4.0

func (pf *ParsedFile) ContractName() string

ContractName returns name of the contract

func (*ParsedFile) ProxyPackageName added in v0.4.0

func (pf *ParsedFile) ProxyPackageName() (string, error)

ProxyPackageName guesses user friendly contract "name" from file name and/or package in the file

func (*ParsedFile) ReplaceFoundationImport added in v0.4.0

func (pf *ParsedFile) ReplaceFoundationImport()

ReplaceFoundationImport replaces import of "client" foundation with "server" version

func (*ParsedFile) Write added in v0.4.0

func (pf *ParsedFile) Write(out io.Writer) error

Write prints `out` contract's code, it could be changed with a few methods

func (*ParsedFile) WriteProxy added in v0.4.0

func (pf *ParsedFile) WriteProxy(classReference string, out io.Writer) error

WriteProxy generates and writes into `out` source code of contract's proxy

func (*ParsedFile) WriteWrapper added in v0.4.0

func (pf *ParsedFile) WriteWrapper(out io.Writer) error

WriteWrapper generates and writes into `out` source code of wrapper for the contract

Jump to

Keyboard shortcuts

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