Documentation ¶
Overview ¶
Copyright 2013 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
With changes for etherman Solidity coverage.
Index ¶
- Variables
- func NewCoverageMarkerEvent(definitionID uint64) (name string, eventABI abi.ABI)
- func OptionBuildCacheDir(dir string) option
- func OptionCallTimeout(dur time.Duration) option
- func OptionEVMRPCEndpoint(uri string) option
- func OptionEnableCoverage(enabled bool) option
- func OptionGasLimit(gasLimit uint64) option
- func OptionGasPrice(price *big.Int) option
- func OptionNoCache(noCache bool) option
- func OptionRPCTimeout(dur time.Duration) option
- func OptionSignerType(signerType SignerType) option
- func OptionSolcAllowedPaths(allowedPaths []string) option
- func OptionSolcPath(dir string) option
- func OptionTxTimeout(dur time.Duration) option
- type AbiMethodInputMapperFunc
- type BoundContract
- func (contract *BoundContract) ABI() abi.ABI
- func (contract *BoundContract) Address() common.Address
- func (contract *BoundContract) Client() *ethclient.Client
- func (c *BoundContract) DeployContract(opts *bind.TransactOpts, params ...interface{}) (common.Address, *types.Transaction, error)
- func (contract *BoundContract) SetAddress(address common.Address)
- func (contract *BoundContract) SetClient(client *ethclient.Client)
- func (contract *BoundContract) SetTransact(fn TransactFunc)
- func (contract *BoundContract) Source() *sol.Contract
- func (c *BoundContract) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)
- func (c *BoundContract) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)
- type BuildCache
- type BuildCacheEntry
- type Client
- type ContractCallOpts
- type ContractCoverageCallOpts
- type ContractDeployOpts
- type ContractLogUnpackFunc
- type ContractLogsOpts
- type ContractTxOpts
- type CoverageDataCollector
- type CoverageMode
- type Deployer
- type LogUnpacker
- type SignerType
- type TransactFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoCoverage = errors.New("coverage not enabled") ErrNoCoverageInContract = errors.New("coverage not compiled into the contract") )
View Source
var ( ErrEndpointUnreachable = errors.New("unable to dial EVM RPC endpoint") ErrNoChainID = errors.New("failed to get valid Chain ID") ErrNoNonce = errors.New("failed to get latest from nonce") )
View Source
var ( ErrEventNotFound = errors.New("event not found") ErrEventParse = errors.New("unable to unmarshal log") ErrTxNotFound = errors.New("transaction not found") ErrTransactionReverted = errors.New("transaction reverted without logs") )
View Source
var ( ErrAwaitTimeout = errors.New("await timeout") ErrNoRevertReason = errors.New("no revert reason") )
View Source
var ErrClientNotAvailable = errors.New("EVM RPC client is not available due to connection issue")
View Source
var (
ErrCompilationFailed = errors.New("failed to compile contract code")
)
View Source
var (
ErrCompilerNotFound = errors.New("unable to locate Solidity compiler")
)
View Source
var ErrNoCache = errors.New("no cached version")
Functions ¶
func NewCoverageMarkerEvent ¶
func OptionBuildCacheDir ¶
func OptionBuildCacheDir(dir string) option
func OptionCallTimeout ¶
func OptionEVMRPCEndpoint ¶
func OptionEVMRPCEndpoint(uri string) option
func OptionEnableCoverage ¶
func OptionEnableCoverage(enabled bool) option
func OptionGasLimit ¶
func OptionGasLimit(gasLimit uint64) option
func OptionGasPrice ¶
func OptionNoCache ¶
func OptionNoCache(noCache bool) option
func OptionRPCTimeout ¶
func OptionSignerType ¶
func OptionSignerType(signerType SignerType) option
func OptionSolcAllowedPaths ¶
func OptionSolcAllowedPaths(allowedPaths []string) option
func OptionSolcPath ¶
func OptionSolcPath(dir string) option
func OptionTxTimeout ¶
Types ¶
type BoundContract ¶
type BoundContract struct { *bind.BoundContract // contains filtered or unexported fields }
func BindContract ¶
func (*BoundContract) ABI ¶
func (contract *BoundContract) ABI() abi.ABI
func (*BoundContract) Address ¶
func (contract *BoundContract) Address() common.Address
func (*BoundContract) Client ¶
func (contract *BoundContract) Client() *ethclient.Client
func (*BoundContract) DeployContract ¶
func (c *BoundContract) DeployContract(opts *bind.TransactOpts, params ...interface{}) (common.Address, *types.Transaction, error)
DeployContract deploys a contract onto the Ethereum blockchain and binds the deployment address with a Go wrapper.
func (*BoundContract) SetAddress ¶
func (contract *BoundContract) SetAddress(address common.Address)
func (*BoundContract) SetClient ¶
func (contract *BoundContract) SetClient(client *ethclient.Client)
func (*BoundContract) SetTransact ¶
func (contract *BoundContract) SetTransact(fn TransactFunc)
func (*BoundContract) Source ¶
func (contract *BoundContract) Source() *sol.Contract
func (*BoundContract) Transact ¶
func (c *BoundContract) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error)
Transact invokes the (paid) contract method with params as input values.
func (*BoundContract) Transfer ¶
func (c *BoundContract) Transfer(opts *bind.TransactOpts) (*types.Transaction, error)
Transfer initiates a plain transaction to move funds to the contract, calling its default method if one is available.
type BuildCache ¶
type BuildCache interface { StoreContract(absSolPath string, contract *sol.Contract) error LoadContract(absSolPath, contractName string, coverage bool) (contract *sol.Contract, err error) Clear() error }
func NewBuildCache ¶
func NewBuildCache(prefix string) (BuildCache, error)
type BuildCacheEntry ¶
type BuildCacheEntry struct { Timestamp time.Time `json:"timestamp"` CodeHash string `json:"codeHash"` AllPaths []string `json:"allPaths"` ContractName string `json:"contractName"` CompilerVersion string `json:"compilerVersion"` Coverage bool `json:"coverage"` Statements [][]int `json:"statements"` ABI json.RawMessage `json:"abi"` Bin string `json:"bin"` }
type Client ¶
func (*Client) SendTransactionWithRet ¶
type ContractCallOpts ¶
type ContractCallOpts struct { From common.Address SolSource string ContractName string Contract common.Address CoverageCall ContractCoverageCallOpts CoverageAgent CoverageDataCollector BytecodeOnly bool }
type ContractCoverageCallOpts ¶
type ContractCoverageCallOpts struct { FromPk *ecdsa.PrivateKey SignerFn bind.SignerFn }
type ContractDeployOpts ¶
type ContractLogUnpackFunc ¶
type ContractLogsOpts ¶
type ContractTxOpts ¶
type CoverageDataCollector ¶
type CoverageDataCollector interface { LoadContract(contract *sol.Contract) error AddStatement(contractName string, start, end, file uint64) error CollectCoverageEvent(contractName string, coverageEventABI abi.Event, log *ctypes.Log) error CollectCoverageRevert(contractName string, err error) error ReportTextSummary(out io.Writer, filterNames ...string) error ReportTextCoverfile(out io.Writer, filterNames ...string) error ReportHTML(out io.Writer, filterNames ...string) error }
func NewCoverageDataCollector ¶
func NewCoverageDataCollector(mode CoverageMode) CoverageDataCollector
type CoverageMode ¶
type CoverageMode string
const ( CoverageModeSet CoverageMode = "set" CoverageModeCount CoverageMode = "count" CoverageModeDefault CoverageMode = CoverageModeCount )
type Deployer ¶
type Deployer interface { Backend() (*Client, error) Build( ctx context.Context, solSource string, contractName string, ) (*sol.Contract, error) Deploy( ctx context.Context, deployOpts ContractDeployOpts, constructorInputMapper AbiMethodInputMapperFunc, ) (txHash common.Hash, contract *sol.Contract, err error) Tx( ctx context.Context, txOpts ContractTxOpts, methodName string, methodInputMapper AbiMethodInputMapperFunc, ) (txHash common.Hash, abiPackedArgs []byte, err error) Call( ctx context.Context, callOpts ContractCallOpts, methodName string, methodInputMapper AbiMethodInputMapperFunc, ) (output []interface{}, outputAbi abi.Arguments, err error) Logs( ctx context.Context, logsOpts ContractLogsOpts, txHash common.Hash, eventName string, eventUnpacker ContractLogUnpackFunc, ) (events []interface{}, err error) }
type LogUnpacker ¶
type SignerType ¶
type SignerType string
const ( SignerEIP155 SignerType = "eip155" SignerHomestead SignerType = "homestead" )
type TransactFunc ¶
type TransactFunc func(opts *bind.TransactOpts, contract *common.Address, input []byte) (*types.Transaction, error)
Click to show internal directories.
Click to hide internal directories.