gethwrappers

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: ISC Imports: 24 Imported by: 0

Documentation

Overview

package gethwrappers provides infrastructure for generating and verifying go-ethereum wrapper packages for smart contracts. See go_generate.go for more information.

Package gethwrappers provides tools for wrapping solidity contracts with golang packages, using abigen.

Example (BoxOutput)
fmt.Println()
fmt.Print(boxOutput("%s is %d", "foo", 17))
Output:

↘↓↓↓↓↓↓↓↓↓↓↓↓↓↙
→             ←
→  README     ←
→             ←
→  foo is 17  ←
→             ←
→  README     ←
→             ←
↗↑↑↑↑↑↑↑↑↑↑↑↑↑↖

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Abigen

func Abigen(a AbigenArgs)

Abigen calls Abigen with the given arguments

It might seem like a shame, to shell out to another golang program like this, but the abigen executable is the stable public interface to the geth contract-wrapper machinery.

Check whether native abigen is installed, and has correct version

func Exit

func Exit(msg string, err error)

func GetProjectRoot

func GetProjectRoot() (rootPath string)

GetProjectRoot returns the root of the seerlink project

func ImproveAbigenOutput

func ImproveAbigenOutput(path string)

func TempDir

func TempDir(dirPrefix string) (string, func())

func WriteVersionsDB

func WriteVersionsDB(db *IntegratedVersion) error

Types

type AbigenArgs

type AbigenArgs struct {
	Bin, ABI, Out, Type, Pkg string
}

AbigenArgs is the arguments to the abigen executable. E.g., Bin is the -bin arg.

type ContractDetails

type ContractDetails struct {
	Binary  string // Hex representation of the contract's  raw bytes
	ABI     string
	Sources map[string]string // contractName -> source code
}

ContractDetails contains the contract data needed to make a geth contract wrapper for a solidity contract.

func ExtractContractDetails

func ExtractContractDetails(beltArtifactPath string) (*ContractDetails, error)

ExtractContractDetails returns the data in the belt artifact needed to make a geth contract wrapper for the corresponding EVM contract

func (*ContractDetails) VersionHash

func (c *ContractDetails) VersionHash() (hash string)

VersionHash is the hash used to detect changes in the underlying contract

type ContractVersion

type ContractVersion struct {
	// path to compiler artifact used by generate.sh to create wrapper package
	CompilerArtifactPath string
	// Hash of the artifact at the timem the wrapper was last generated
	Hash string
}

ContractVersion records information about the solidity compiler artifact a golang contract wrapper package depends on.

type IntegratedVersion

type IntegratedVersion struct {
	// Version of geth last used to generate the wrappers
	GethVersion string
	// { golang-pkg-name: version_info }
	ContractVersions map[string]ContractVersion
}

IntegratedVersion carries the full versioning information checked in this test

func ReadVersionsDB

func ReadVersionsDB() (*IntegratedVersion, error)

readVersionsDB populates an IntegratedVersion with all the info in the versions DB

Jump to

Keyboard shortcuts

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