Documentation ¶
Index ¶
- func GetRealApplicationDir(dir string) (string, error)
- func GetRealContractsNames() ([]string, error)
- type ParsedFile
- func (pf *ParsedFile) ChangePackageToMain()
- func (pf *ParsedFile) ContractName() string
- func (pf *ParsedFile) ProxyPackageName() (string, error)
- func (pf *ParsedFile) Write(out io.Writer) error
- func (pf *ParsedFile) WriteProxy(classReference string, out io.Writer) error
- func (pf *ParsedFile) WriteWrapper(out io.Writer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetRealApplicationDir ¶ added in v0.6.0
GetRealApplicationDir return application dir path
func GetRealContractsNames ¶ added in v0.3.0
GetRealContractsNames returns names of all real smart contracts
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) 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