Versions in this module Expand all Collapse all v1 v1.7.0 Mar 25, 2021 Changes in this version + var ErrAwaitTimeout = errors.New("await timeout") + var ErrClientNotAvailable = errors.New("EVM RPC client is not available due to connection issue") + var ErrCompilationFailed = errors.New("failed to compile contract code") + var ErrCompilerNotFound = errors.New("unable to locate Solidity compiler") + var ErrEndpointUnreachable = errors.New("unable to dial EVM RPC endpoint") + var ErrEventNotFound = errors.New("event not found") + var ErrEventParse = errors.New("unable to unmarshal log") + var ErrNoCache = errors.New("no cached version") + var ErrNoChainID = errors.New("failed to get valid Chain ID") + var ErrNoCoverage = errors.New("coverage not enabled") + var ErrNoCoverageInContract = errors.New("coverage not compiled into the contract") + var ErrNoNonce = errors.New("failed to get latest from nonce") + var ErrNoRevertReason = errors.New("no revert reason") + var ErrTransactionReverted = errors.New("transaction reverted without logs") + var ErrTxNotFound = errors.New("transaction not found") + 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 func(args abi.Arguments) []interface + type BoundContract struct + func BindContract(client *ethclient.Client, contract *sol.Contract) (*BoundContract, error) + func (c *BoundContract) DeployContract(opts *bind.TransactOpts, params ...interface{}) (common.Address, *types.Transaction, error) + func (c *BoundContract) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) + func (c *BoundContract) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) + func (contract *BoundContract) ABI() abi.ABI + func (contract *BoundContract) Address() common.Address + func (contract *BoundContract) Client() *ethclient.Client + 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 + type BuildCache interface + Clear func() error + LoadContract func(absSolPath, contractName string, coverage bool) (contract *sol.Contract, err error) + StoreContract func(absSolPath string, contract *sol.Contract) error + func NewBuildCache(prefix string) (BuildCache, error) + type BuildCacheEntry struct + ABI json.RawMessage + AllPaths []string + Bin string + CodeHash string + CompilerVersion string + ContractName string + Coverage bool + Statements [][]int + Timestamp time.Time + type Client struct + func NewClient(rc *rpc.Client) *Client + func (ec *Client) SendTransactionWithRet(ctx context.Context, tx *types.Transaction) (txHash common.Hash, err error) + type ContractCallOpts struct + BytecodeOnly bool + Contract common.Address + ContractName string + CoverageAgent CoverageDataCollector + CoverageCall ContractCoverageCallOpts + From common.Address + SolSource string + type ContractCoverageCallOpts struct + FromPk *ecdsa.PrivateKey + SignerFn bind.SignerFn + type ContractDeployOpts struct + Await bool + BytecodeOnly bool + ContractName string + CoverageAgent CoverageDataCollector + From common.Address + FromPk *ecdsa.PrivateKey + SignerFn bind.SignerFn + SolSource string + type ContractLogUnpackFunc func(unpacker LogUnpacker, event abi.Event, log ctypes.Log) (interface{}, error) + type ContractLogsOpts struct + Contract common.Address + ContractName string + CoverageAgent CoverageDataCollector + From common.Address + SolSource string + type ContractTxOpts struct + Await bool + BytecodeOnly bool + Contract common.Address + ContractName string + CoverageAgent CoverageDataCollector + From common.Address + FromPk *ecdsa.PrivateKey + SignerFn bind.SignerFn + SolSource string + type CoverageDataCollector interface + AddStatement func(contractName string, start, end, file uint64) error + CollectCoverageEvent func(contractName string, coverageEventABI abi.Event, log *ctypes.Log) error + CollectCoverageRevert func(contractName string, err error) error + LoadContract func(contract *sol.Contract) error + ReportHTML func(out io.Writer, filterNames ...string) error + ReportTextCoverfile func(out io.Writer, filterNames ...string) error + ReportTextSummary func(out io.Writer, filterNames ...string) error + func NewCoverageDataCollector(mode CoverageMode) CoverageDataCollector + type CoverageMode string + const CoverageModeCount + const CoverageModeDefault + const CoverageModeSet + type Deployer interface + Backend func() (*Client, error) + Build func(ctx context.Context, solSource string, contractName string) (*sol.Contract, error) + Call func(ctx context.Context, callOpts ContractCallOpts, methodName string, ...) (output []interface{}, outputAbi abi.Arguments, err error) + Deploy func(ctx context.Context, deployOpts ContractDeployOpts, ...) (txHash common.Hash, contract *sol.Contract, err error) + Logs func(ctx context.Context, logsOpts ContractLogsOpts, txHash common.Hash, ...) (events []interface{}, err error) + Tx func(ctx context.Context, txOpts ContractTxOpts, methodName string, ...) (txHash common.Hash, abiPackedArgs []byte, err error) + func New(opts ...option) (Deployer, error) + type LogUnpacker interface + UnpackLog func(out interface{}, event string, log ctypes.Log) error + type SignerType string + const SignerEIP155 + const SignerHomestead + type TransactFunc func(opts *bind.TransactOpts, contract *common.Address, input []byte) (*types.Transaction, error)