Documentation ¶
Index ¶
- Variables
- type Client
- func (c *Client) CollateralBridgeAddress() ethcommon.Address
- func (c *Client) CollateralBridgeAddressHex() string
- func (c *Client) ConfirmationsRequired() uint64
- func (c *Client) CurrentHeight(ctx context.Context) (uint64, error)
- func (c *Client) UpdateEthereumConfig(ethConfig *types.EthereumConfig) error
- func (c *Client) VerifyContract(ctx context.Context, address ethcommon.Address, expectedHash string) error
- type Config
- type ETHClient
- type EthereumClientConfirmations
- type EthereumConfirmations
- type StdTime
- type Time
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrUnexpectedContractHash = errors.New("hash of contract bytecode not as expected") ErrUnexpectedSolidityFormat = errors.New("unexpected format of solidity bytecode") )
View Source
var ContractHashes = map[string]string{
"staking": "d66948e12817f8ae6ca94d56b43ca12e66416e7e9bc23bb09056957b25afc6bd",
"vesting": "5278802577f4aca315b9524bfa78790f8f0fae08939ec58bc9e8f0ea40123b09",
"collateral": "1cd7f315188baf26f70c77a764df361c5d01bd365b109b96033b8755ee2b2750",
"multisig": "5b7070e6159628455b38f5796e8d0dc08185aaaa1fb6073767c88552d396c6c2",
}
ContractHashes the sha3-256(contract-bytecode stripped of metadata).
View Source
var ErrMissingConfirmations = errors.New("not enough confirmations")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { ETHClient // contains filtered or unexported fields }
func (*Client) CollateralBridgeAddress ¶
func (*Client) CollateralBridgeAddressHex ¶
func (*Client) ConfirmationsRequired ¶
func (*Client) UpdateEthereumConfig ¶
func (c *Client) UpdateEthereumConfig(ethConfig *types.EthereumConfig) error
type Config ¶
type Config struct { Level encoding.LogLevel `long:"log-level"` RPCEndpoint string RetryDelay encoding.Duration }
func NewDefaultConfig ¶
func NewDefaultConfig() Config
NewDefaultConfig creates an instance of the package specific configuration, given a pointer to a logger instance to be used for logging within the package.
type ETHClient ¶
type ETHClient interface { // client ChainID(context.Context) (*big.Int, error) NetworkID(context.Context) (*big.Int, error) // ethereum.ChainReader BlockByHash(ctx context.Context, hash ethcommon.Hash) (*ethtypes.Block, error) HeaderByNumber(ctx context.Context, number *big.Int) (*ethtypes.Header, error) BlockByNumber(ctx context.Context, number *big.Int) (*ethtypes.Block, error) HeaderByHash(ctx context.Context, hash ethcommon.Hash) (*ethtypes.Header, error) SubscribeNewHead(ctx context.Context, ch chan<- *ethtypes.Header) (ethereum.Subscription, error) TransactionCount(ctx context.Context, blockHash ethcommon.Hash) (uint, error) TransactionInBlock(ctx context.Context, blockHash ethcommon.Hash, index uint) (*ethtypes.Transaction, error) // bind.ContractCaller CodeAt(ctx context.Context, contract ethcommon.Address, blockNumber *big.Int) ([]byte, error) CallContract(ctx context.Context, call ethereum.CallMsg, blockNumber *big.Int) ([]byte, error) // bind.ContractTransactor EstimateGas(ctx context.Context, call ethereum.CallMsg) (gas uint64, err error) PendingCodeAt(ctx context.Context, account ethcommon.Address) ([]byte, error) PendingNonceAt(ctx context.Context, account ethcommon.Address) (uint64, error) SendTransaction(ctx context.Context, tx *ethtypes.Transaction) error SuggestGasPrice(ctx context.Context) (*big.Int, error) SuggestGasTipCap(ctx context.Context) (*big.Int, error) // bind.ContractFilterer FilterLogs(ctx context.Context, query ethereum.FilterQuery) ([]ethtypes.Log, error) SubscribeFilterLogs(ctx context.Context, query ethereum.FilterQuery, ch chan<- ethtypes.Log) (ethereum.Subscription, error) }
ETHClient ...
type EthereumConfirmations ¶
type EthereumConfirmations struct {
// contains filtered or unexported fields
}
func NewEthereumConfirmations ¶
func NewEthereumConfirmations( cfg Config, ethClient EthereumClientConfirmations, time Time, ) *EthereumConfirmations
func (*EthereumConfirmations) Check ¶
func (e *EthereumConfirmations) Check(block uint64) error
func (*EthereumConfirmations) CheckRequiredConfirmations ¶ added in v0.73.0
func (e *EthereumConfirmations) CheckRequiredConfirmations(block uint64, required uint64) error
func (*EthereumConfirmations) UpdateConfirmations ¶
func (e *EthereumConfirmations) UpdateConfirmations(confirmations uint64)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.