adapter

package
v1.3.17 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const ARBITRARY_TXHASH = "0xb41e0591756bd1331de35eac3e3da460c9b3503d10e7bf08b84f057f489cd189"
View Source
const STATUS_FAILED = "failed"
View Source
const STATUS_IN_PROGRESS = "in-progress"
View Source
const STATUS_SUCCESS = "success"

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockNumberAndTime added in v1.3.0

type BlockNumberAndTime struct {
	TimeInSeconds uint64
	BlockNumber   int64
}

func (*BlockNumberAndTime) String added in v1.3.0

func (b *BlockNumberAndTime) String() string

type DeployingEthereumConnection added in v0.7.1

type DeployingEthereumConnection interface {
	EthereumConnection
	DeploySimpleStorageContract(auth *bind.TransactOpts, stringValue string) ([]byte, error)
	DeployEthereumContract(auth *bind.TransactOpts, abijson string, bytecode string, params ...interface{}) (*common.Address, *bind.BoundContract, error)
}

type EthereumCaller added in v0.7.1

type EthereumCaller interface {
	bind.ContractBackend
	TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
}

type EthereumConnection

type EthereumConnection interface {
	CallContract(ctx context.Context, contractAddress []byte, packedInput []byte, blockNumber *big.Int) (packedOutput []byte, err error)
	GetTransactionLogs(ctx context.Context, txHash primitives.Uint256, eventSignature []byte) ([]*TransactionLog, error)
	HeaderByNumber(ctx context.Context, number *big.Int) (*BlockNumberAndTime, error)
}

type EthereumRpcConnection added in v0.7.1

type EthereumRpcConnection struct {
	govnr.TreeSupervisor
	// contains filtered or unexported fields
}

func NewEthereumRpcConnection added in v0.7.1

func NewEthereumRpcConnection(config ethereumAdapterConfig, logger log.Logger, registry metric.Registry) *EthereumRpcConnection

func (*EthereumRpcConnection) CallContract added in v0.7.1

func (c *EthereumRpcConnection) CallContract(ctx context.Context, contractAddress []byte, packedInput []byte, blockNumber *big.Int) (packedOutput []byte, err error)

func (*EthereumRpcConnection) DeployEthereumContract added in v0.7.1

func (c *EthereumRpcConnection) DeployEthereumContract(auth *bind.TransactOpts, abijson string, bytecode string, params ...interface{}) (*common.Address, *bind.BoundContract, error)

this is a helper for integration test, not used in production code

func (*EthereumRpcConnection) DeployEthereumContractManually added in v0.7.5

func (c *EthereumRpcConnection) DeployEthereumContractManually(ctx context.Context, auth *bind.TransactOpts, abijson string, bytecode string, params ...interface{}) (*common.Address, error)

func (*EthereumRpcConnection) DeploySimpleStorageContract added in v0.7.1

func (c *EthereumRpcConnection) DeploySimpleStorageContract(auth *bind.TransactOpts, stringValue string) ([]byte, error)

this is a helper for integration test, not used in production code

func (*EthereumRpcConnection) GetTransactionLogs added in v0.7.1

func (c *EthereumRpcConnection) GetTransactionLogs(ctx context.Context, txHash primitives.Uint256, eventSignature []byte) ([]*TransactionLog, error)

func (*EthereumRpcConnection) HeaderByNumber added in v0.7.5

func (rpc *EthereumRpcConnection) HeaderByNumber(ctx context.Context, number *big.Int) (*BlockNumberAndTime, error)

func (*EthereumRpcConnection) Receipt added in v0.7.5

func (c *EthereumRpcConnection) Receipt(txHash common.Hash) (*types.Receipt, error)

func (*EthereumRpcConnection) ReportConnectionStatus added in v0.7.11

func (c *EthereumRpcConnection) ReportConnectionStatus(ctx context.Context)

func (*EthereumRpcConnection) SyncProgress added in v0.7.11

func (c *EthereumRpcConnection) SyncProgress() (*ethereum.SyncProgress, error)

type NopEthereumAdapter added in v1.3.0

type NopEthereumAdapter struct {
}

func (*NopEthereumAdapter) CallContract added in v1.3.0

func (n *NopEthereumAdapter) CallContract(ctx context.Context, contractAddress []byte, packedInput []byte, blockNumber *big.Int) (packedOutput []byte, err error)

func (*NopEthereumAdapter) GetTransactionLogs added in v1.3.0

func (n *NopEthereumAdapter) GetTransactionLogs(ctx context.Context, txHash primitives.Uint256, eventSignature []byte) ([]*TransactionLog, error)

func (*NopEthereumAdapter) HeaderByNumber added in v1.3.0

func (n *NopEthereumAdapter) HeaderByNumber(ctx context.Context, number *big.Int) (*BlockNumberAndTime, error)

type TransactionLog added in v0.7.1

type TransactionLog struct {
	ContractAddress []byte
	PackedTopics    [][]byte // indexed fields
	Data            []byte   // non-indexed fields
	RepackedData    []byte
	BlockNumber     uint64
	TxIndex         uint32
}

Jump to

Keyboard shortcuts

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