Documentation ¶
Index ¶
- Variables
- func NewTestEthBackend(privateKey *ecdsa.PrivateKey, alloc core.GenesisAlloc) (*node.Node, error)
- type ChainSubscrier
- type Client
- func (c *Client) BatchSendMsg(ctx context.Context, msgs <-chan Message) (<-chan *types.Transaction, <-chan error)
- func (c *Client) Close()
- func (c *Client) ConfirmTx(txHash common.Hash, n uint, timeout time.Duration) (bool, error)
- func (c *Client) MessageToTransactOpts(ctx context.Context, msg Message) (*bind.TransactOpts, error)
- func (c *Client) NewMethodData(a abi.ABI, methodName string, args ...interface{}) ([]byte, error)
- func (c *Client) NewTransaction(ctx context.Context, msg ethereum.CallMsg) (*types.Transaction, error)
- func (c *Client) RawClient() *ethclient.Client
- func (c *Client) SendMsg(ctx context.Context, msg Message) (*types.Transaction, error)
- type ExpectedEventsFunc
- type Message
- type Subscriber
- type TransactFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoAnyKeyStores = errors.New("No any keystores") ErrMessagePrivateKeyNil = errors.New("PrivateKey is nil") )
Functions ¶
func NewTestEthBackend ¶
func NewTestEthBackend(privateKey *ecdsa.PrivateKey, alloc core.GenesisAlloc) (*node.Node, error)
Types ¶
type ChainSubscrier ¶
type ChainSubscrier struct {
// contains filtered or unexported fields
}
ChainSubscrier implements Subscriber interface
func NewChainSubscriber ¶
func NewChainSubscriber(c *ethclient.Client) (*ChainSubscrier, error)
NewChainSubscriber .
func (*ChainSubscrier) SubscribeFilterlogs ¶
func (cs *ChainSubscrier) SubscribeFilterlogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) error
SubscribeFilterlog .
func (*ChainSubscrier) SubscribeNewHead ¶
SubscribeNewHead .
type Client ¶
type Client struct { Subscriber // contains filtered or unexported fields }
func (*Client) BatchSendMsg ¶
func (*Client) MessageToTransactOpts ¶
func (c *Client) MessageToTransactOpts(ctx context.Context, msg Message) (*bind.TransactOpts, error)
MessageToTransactOpts . NOTE: You must provide private key for signature.
func (*Client) NewMethodData ¶
func (*Client) NewTransaction ¶
type ExpectedEventsFunc ¶
type ExpectedEventsFunc func(event interface{}) bool
ExpectedEventsFunc returns true if event is expected.
type Message ¶
type Message struct { From common.Address // the sender of the 'transaction' PrivateKey *ecdsa.PrivateKey // overwrite From if not nil To *common.Address // the destination contract (nil for contract creation) Gas uint64 // if 0, the call executes with near-infinite gas GasPrice *big.Int // wei <-> gas exchange ratio Value *big.Int // amount of wei sent along with the call Data []byte // input data, usually an ABI-encoded contract method invocation AccessList types.AccessList // EIP-2930 access list. }
type Subscriber ¶
type Subscriber interface { SubscribeFilterlogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- types.Log) error SubscribeNewHead(ctx context.Context, ch chan<- *types.Header) error }
Subscriber represents a set of methods about chain subscription
type TransactFunc ¶
type TransactFunc func() (*types.Transaction, error)
TransactFunc represents the transact call of Smart Contract.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.