evm

package
v0.3.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrSmartContractNotFound     = whoops.Errorf("smart contract %s was not found")
	ErrInvalidAddress            = whoops.Errorf("provided address: '%s' is not valid")
	ErrAddressNotFoundInKeyStore = whoops.Errorf("address: '%s' not found in keystore: %s")
	ErrUnsupportedMessageType    = whoops.Errorf("unsupported message type: %T")
	ErrABINotInitialized         = whoops.String("ABI is not initialized")

	ErrNoConsensus = whoops.String("no consensus reached")
)
View Source
const (
	SignedMessagePrefix = "\x19Ethereum Signed Message:\n32"
)

Variables

This section is empty.

Functions

func OpenKeystore

func OpenKeystore(dir string) *keystore.KeyStore

func StoredContracts

func StoredContracts() map[string]StoredContract

Types

type Client

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

func (Client) DeployContract

func (c Client) DeployContract(
	ctx context.Context,
	chainID *big.Int,
	contractAbi abi.ABI,
	bytecode,
	constructorInput []byte,
) (contractAddr common.Address, tx *ethtypes.Transaction, err error)

func (Client) ExecuteSmartContract

func (c Client) ExecuteSmartContract(
	ctx context.Context,
	chainID *big.Int,
	contractAbi abi.ABI,
	addr common.Address,
	method string,
	arguments []any,
) (*etherumtypes.Transaction, error)

func (Client) FilterLogs

func (c Client) FilterLogs(ctx context.Context, fq etherum.FilterQuery, currBlockHeight *big.Int, fn func(logs []ethtypes.Log) bool) (bool, error)

FilterLogs will gather all logs given a FilterQuery. If it encounters an error saying that there are too many results in the provided block window, then it's going to try to do this using a "binary search" approach while splitting the possible set in two, recursively.

func (Client) TransactionByHash

func (c Client) TransactionByHash(ctx context.Context, txHash common.Hash) (*ethtypes.Transaction, bool, error)

type Factory

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

func NewFactory

func NewFactory(pc PalomaClienter) *Factory

func (*Factory) Build

func (f *Factory) Build(
	cfg config.EVM,
	chainReferenceID,
	smartContractID,
	smartContractABIJson,
	smartContractAddress string,
	chainID *big.Int,
) (chain.Processor, error)

type PalomaClienter

type PalomaClienter interface {
	AddMessageEvidence(ctx context.Context, queueTypeName string, messageID uint64, proof []byte) error
	SetPublicAccessData(ctx context.Context, queueTypeName string, messageID uint64, data []byte) error
	QueryGetEVMValsetByID(ctx context.Context, id uint64, chainID string) (*types.Valset, error)
}

type Processor

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

func (Processor) ExternalAccount

func (p Processor) ExternalAccount() chain.ExternalAccount

func (Processor) ProcessMessages

func (p Processor) ProcessMessages(ctx context.Context, queueTypeName string, msgs []chain.MessageWithSignatures) error

func (Processor) SignMessages

func (p Processor) SignMessages(ctx context.Context, queueTypeName string, messages ...chain.QueuedMessage) ([]chain.SignedQueuedMessage, error)

func (Processor) SupportedQueues

func (p Processor) SupportedQueues() []string

type StoredContract

type StoredContract struct {
	ABI    abi.ABI
	Source []byte
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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