ethglue

package
v1.6.3 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dialler

type Dialler struct {
	// contains filtered or unexported fields
}

Connection dialler. To start an Ethereum connection you pass from here.

func NewCustomDialler

func NewCustomDialler(ethDialler ETHDiallerIF, connectionTimeout time.Duration) *Dialler

func NewDefaultDialler

func NewDefaultDialler() *Dialler

func (*Dialler) Dial

func (me *Dialler) Dial(rawUrl string) (ethClient ETHClientIF, err error)

func (*Dialler) DialContext

func (me *Dialler) DialContext(ctx context.Context, rawUrl string) (ethClient ETHClientIF, err error)

type ETHClientIF

type ETHClientIF interface {
	bind.ContractBackend
	HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)
	SuggestGasTipCap(ctx context.Context) (*big.Int, error)
}

type ETHDiallerIF

type ETHDiallerIF interface {
	Dial(rawUrl string) (ethClient ETHClientIF, err error)
	DialContext(ctx context.Context, rawUrl string) (ETHClientIF, error)
}

type FakeETHClient

type FakeETHClient struct {
	HeaderByNumberStub       func(ctx context.Context, number *big.Int) (*types.Header, error)
	HeaderByNumberCalls      int
	SubscribeFilterLogsStub  func(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)
	SubscribeFilterLogsCalls int
}

func (*FakeETHClient) CallContract

func (me *FakeETHClient) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error)

func (*FakeETHClient) CodeAt

func (me *FakeETHClient) CodeAt(ctx context.Context, contract common.Address, blockNumber *big.Int) ([]byte, error)

func (*FakeETHClient) EstimateGas

func (me *FakeETHClient) EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error)

func (*FakeETHClient) FilterLogs

func (me *FakeETHClient) FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]types.Log, error)

func (*FakeETHClient) HeaderByNumber

func (me *FakeETHClient) HeaderByNumber(ctx context.Context, number *big.Int) (*types.Header, error)

func (*FakeETHClient) PendingCodeAt

func (me *FakeETHClient) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)

func (*FakeETHClient) PendingNonceAt

func (me *FakeETHClient) PendingNonceAt(ctx context.Context, account common.Address) (uint64, error)

func (*FakeETHClient) SendTransaction

func (me *FakeETHClient) SendTransaction(ctx context.Context, tx *types.Transaction) error

func (*FakeETHClient) SubscribeFilterLogs

func (me *FakeETHClient) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error)

func (*FakeETHClient) SuggestGasPrice

func (me *FakeETHClient) SuggestGasPrice(ctx context.Context) (*big.Int, error)

func (*FakeETHClient) SuggestGasTipCap

func (me *FakeETHClient) SuggestGasTipCap(ctx context.Context) (*big.Int, error)

type FakeETHDialler

type FakeETHDialler struct {
	DialContextStub  func(ctx context.Context, rawUrl string) (ETHClientIF, error)
	DialContextCalls int

	DialStub  func(rawUrl string) (ethClient ETHClientIF, err error)
	DialCalls int
}

func (*FakeETHDialler) Dial

func (me *FakeETHDialler) Dial(rawUrl string) (ethClient ETHClientIF, err error)

func (*FakeETHDialler) DialContext

func (me *FakeETHDialler) DialContext(ctx context.Context, rawUrl string) (ETHClientIF, error)

type NonceManager

type NonceManager struct {
	// contains filtered or unexported fields
}

func (*NonceManager) NextNonce

func (n *NonceManager) NextNonce() *big.Int

func (*NonceManager) OnAccountChange

func (n *NonceManager) OnAccountChange(addr string)

func (*NonceManager) OnDial

func (n *NonceManager) OnDial(c ETHClientIF)

func (*NonceManager) OnError

func (n *NonceManager) OnError(err error)

Jump to

Keyboard shortcuts

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