Documentation ¶
Index ¶
- Constants
- Variables
- func ApplyL2Txs(ctx context.Context, txs []*ethTypes.Transaction, auth *bind.TransactOpts, ...) ([]*big.Int, error)
- func CollectDockerLogs(dacIndices []int)
- func GetAuth(privateKeyStr string, chainID uint64) (*bind.TransactOpts, error)
- func NodeUpCondition(target string) (bool, error)
- func Poll(interval, deadline time.Duration, condition ConditionFunc) error
- func ReportContainerLogs(name string, max int)
- func RevertReason(ctx context.Context, c ethClienter, tx *ethTypes.Transaction, ...) (string, error)
- func RunMakeTarget(target string) error
- func Setup() error
- func ShowRunningDockerContainers()
- func StartComponent(component string, conditions ...ConditionFunc) error
- func StartNetwork() error
- func StartNode() error
- func StopComponent(component string) error
- func Teardown() error
- func WaitL2BlockToBeConsolidated(l2Block *big.Int, timeout time.Duration) error
- func WaitL2BlockToBeVirtualized(l2Block *big.Int, timeout time.Duration) error
- func WaitTxToBeMined(parentCtx context.Context, client ethClienter, tx *ethTypes.Transaction, ...) error
- type ConditionFunc
- type ConfirmationLevel
Constants ¶
const ( // DefaultInterval is a time interval DefaultInterval = 2 * time.Second // DefaultDeadline is a time interval DefaultDeadline = 2 * time.Minute // DefaultL1NetworkURL is the L1 node URL DefaultL1NetworkURL = "http://localhost:8545" // DefaultL2NetworkURL is the L2 node URL DefaultL2NetworkURL = "http://localhost:8123" // DefaultSequencerPrivateKey is the sequencer private key DefaultSequencerPrivateKey = "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80" // DefaultL2ChainID is the l2 chain id DefaultL2ChainID uint64 = 1001 // DefaultL1ChainID is the l1 chain id DefaultL1ChainID uint64 = 1337 // DefaultL1DataCommitteeContract is the l1 data committee contract address DefaultL1DataCommitteeContract = "0x68B1D87F95878fE05B998F19b66F4baba5De1aed" // DefaultTimeoutTxToBeMined is the timeout for blocks to be mined DefaultTimeoutTxToBeMined = 1 * time.Minute // DefaultL1CDKValidiumSmartContract is the l1 CDK validium contract address DefaultL1CDKValidiumSmartContract = "0x8dAF17A20c9DBA35f005b6324F493785D239719d" )
Variables ¶
var ( // ErrTimeoutReached is thrown when the timeout is reached and // because the condition is not matched ErrTimeoutReached = fmt.Errorf("timeout has been reached") )
Functions ¶
func ApplyL2Txs ¶
func ApplyL2Txs(ctx context.Context, txs []*ethTypes.Transaction, auth *bind.TransactOpts, client *ethclient.Client, confirmationLevel ConfirmationLevel) ([]*big.Int, error)
ApplyL2Txs sends the given L2 txs, waits for them to be consolidated and checks the final state.
func CollectDockerLogs ¶ added in v0.0.4
func CollectDockerLogs(dacIndices []int)
CollectDockerLogs retrieves the logs from Docker containers and writes them into the logger
func GetAuth ¶
func GetAuth(privateKeyStr string, chainID uint64) (*bind.TransactOpts, error)
GetAuth configures and returns an auth object.
func NodeUpCondition ¶
NodeUpCondition check if the container is up and running
func Poll ¶
func Poll(interval, deadline time.Duration, condition ConditionFunc) error
Poll retries the given condition with the given interval until it succeeds or the given deadline expires.
func ReportContainerLogs ¶ added in v0.0.6
func RevertReason ¶
func RevertReason(ctx context.Context, c ethClienter, tx *ethTypes.Transaction, blockNumber *big.Int) (string, error)
RevertReason returns the revert reason for a tx that has a receipt with failed status
func Setup ¶
func Setup() error
Setup creates all the required components and initializes them according to the manager config.
func ShowRunningDockerContainers ¶ added in v0.0.6
func ShowRunningDockerContainers()
func StartComponent ¶
func StartComponent(component string, conditions ...ConditionFunc) error
StartComponent starts a docker-compose component.
func StopComponent ¶
StopComponent stops a docker-compose component.
func WaitL2BlockToBeConsolidated ¶
WaitL2BlockToBeConsolidated waits until a L2 Block has been consolidated or the given timeout expires.
func WaitL2BlockToBeVirtualized ¶
WaitL2BlockToBeVirtualized waits until a L2 Block has been virtualized or the given timeout expires.
func WaitTxToBeMined ¶
func WaitTxToBeMined(parentCtx context.Context, client ethClienter, tx *ethTypes.Transaction, timeout time.Duration) error
WaitTxToBeMined waits until a tx has been mined or the given timeout expires.
Types ¶
type ConditionFunc ¶
ConditionFunc is a generic function
type ConfirmationLevel ¶
type ConfirmationLevel int
ConfirmationLevel type used to describe the confirmation level of a transaction
const PoolConfirmationLevel ConfirmationLevel = 0
PoolConfirmationLevel indicates that transaction is added into the pool
const TrustedConfirmationLevel ConfirmationLevel = 1
TrustedConfirmationLevel indicates that transaction is added into the trusted state
const VerifiedConfirmationLevel ConfirmationLevel = 3
VerifiedConfirmationLevel indicates that transaction is added into the verified state
const VirtualConfirmationLevel ConfirmationLevel = 2
VirtualConfirmationLevel indicates that transaction is added into the virtual state