gen

package
v0.0.0-...-24d451d Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenImport

func GenImport(inPath string, res *parsecode.Result, reses []*parsecode.Result, contractInfoList []ContractInfo, index int) error

GenImport - generate import code from source smart contract to destination smart contract

func GenReceipt

func GenReceipt(inPath string, res *parsecode.Result)

focus to generate logic nolint unhandled - because WriteString always return (error)nil

func GenSDK

func GenSDK(inPath string, res *parsecode.Result)

func GenStore

func GenStore(inPath string, res *parsecode.Result)

func GenTypes

func GenTypes(inPath string, res *parsecode.Result)

func IsBnNumber

func IsBnNumber(f parsecode.Field) bool

func IsLiteralType

func IsLiteralType(f parsecode.Field) bool

func IsLiteralTypeEx

func IsLiteralTypeEx(f parsecode.Field) bool

func IsMap

func IsMap(f parsecode.Field) bool

Types

type ContractInfo

type ContractInfo struct {
	Name         string `json:"name"`
	Version      string `json:"version"`
	EffectHeight int64  `json:"effectHeight"`
	LoseHeight   int64  `json:"loseHeight"`
}

type FatMethod

type FatMethod struct {
	parsecode.Method
	SingleParams []parsecode.Field // expand the names of param field to multiple field with same type
}

FatMethod - the method describe, easy to export

type ImportContract

type ImportContract struct {
	Contracts  []OtherContract
	IContracts []OtherContract

	// 当前合约参数
	OrgID             string
	PackageName       string
	ContractStructure string

	// 跨合约信息
	ImportContract     string
	DirectionName      string
	ImportPackage      string
	Index              int
	ImportInterfaces   []parsecode.Method
	ImportContractInfo std.ContractVersionList
	Imports            map[parsecode.Import]struct{}
}

type OtherContract

type OtherContract struct {
	OrgID         string
	DirectionName string
	Name          string
	PackageName   string
	Version       string
	LoseHeight    int64
	EffectHeight  int64
	Functions     []parsecode.Function
	IFunctions    []parsecode.Function
	UserStruct    map[string]ast.GenDecl
}

Jump to

Keyboard shortcuts

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