Documentation ¶
Index ¶
- func HandleBlockchainEvents(ctx context.Context, client ArbAuthClient, startBlockId *common.BlockId, ...) (context.Context, <-chan Event)
- func WaitForBalance(ctx context.Context, client ArbClient, tokenAddress common.Address, ...) error
- type ArbAuthClient
- type ArbClient
- type ArbClientStressTest
- type ArbFactory
- type ArbFactoryWatcher
- type ArbRollup
- type ArbRollupWatcher
- type AssertedEvent
- type AsserterTimeoutEvent
- type ChainInfo
- type ChainTimeGetter
- type Challenge
- type ChallengeCompletedEvent
- type ChallengeFactory
- type ChallengeStartedEvent
- type ChallengerTimeoutEvent
- type ConfirmedAssertionEvent
- type ConfirmedEvent
- type ContinueChallengeEvent
- type ContractWatcher
- type Event
- type ExecutionBisectionEvent
- type ExecutionChallenge
- type ExecutionChallengeWatcher
- type GlobalInbox
- type GlobalInboxSender
- type GlobalInboxWatcher
- type IERC20
- type IERC20Watcher
- type InboxTopBisectionEvent
- type InboxTopChallenge
- type InboxTopChallengeWatcher
- type InitiateChallengeEvent
- type MaybeBlockId
- type MaybeEvent
- type MessageDeliveredEvent
- type MessagesBisectionEvent
- type NewTimeEvent
- type OneStepProofEvent
- type PrunedEvent
- type StakeCreatedEvent
- type StakeMovedEvent
- type StakeRefundedEvent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleBlockchainEvents ¶
func HandleBlockchainEvents( ctx context.Context, client ArbAuthClient, startBlockId *common.BlockId, startLogIndex uint, contract ContractWatcher, ) (context.Context, <-chan Event)
Types ¶
type ArbAuthClient ¶
type ArbAuthClient interface { ArbClient Address() common.Address NewArbFactory(address common.Address) (ArbFactory, error) NewRollup(address common.Address) (ArbRollup, error) NewGlobalInbox(address common.Address, rollupAddress common.Address) (GlobalInbox, error) NewChallengeFactory(address common.Address) (ChallengeFactory, error) NewExecutionChallenge(address common.Address) (ExecutionChallenge, error) NewInboxTopChallenge(address common.Address) (InboxTopChallenge, error) NewIERC20(address common.Address) (IERC20, error) }
type ArbClient ¶
type ArbClient interface { ChainTimeGetter SubscribeBlockHeaders(ctx context.Context, startBlockId *common.BlockId) (<-chan MaybeBlockId, error) SubscribeBlockHeadersAfter(ctx context.Context, prevBlockId *common.BlockId) (<-chan MaybeBlockId, error) NewArbFactoryWatcher(address common.Address) (ArbFactoryWatcher, error) NewRollupWatcher(address common.Address) (ArbRollupWatcher, error) NewGlobalInboxWatcher(address common.Address, rollupAddress common.Address) (GlobalInboxWatcher, error) NewExecutionChallengeWatcher(address common.Address) (ExecutionChallengeWatcher, error) NewInboxTopChallengeWatcher(address common.Address) (InboxTopChallengeWatcher, error) NewIERC20Watcher(address common.Address) (IERC20Watcher, error) GetBalance(ctx context.Context, account common.Address) (*big.Int, error) }
type ArbClientStressTest ¶ added in v0.7.3
type ArbClientStressTest struct { ArbClient // contains filtered or unexported fields }
func NewStressTestClient ¶ added in v0.7.3
func NewStressTestClient(client ArbClient, reorgInterval time.Duration) *ArbClientStressTest
func (*ArbClientStressTest) SubscribeBlockHeaders ¶ added in v0.7.3
func (st *ArbClientStressTest) SubscribeBlockHeaders(ctx context.Context, startBlockId *common.BlockId) (<-chan MaybeBlockId, error)
func (*ArbClientStressTest) SubscribeBlockHeadersAfter ¶ added in v0.7.3
func (st *ArbClientStressTest) SubscribeBlockHeadersAfter(ctx context.Context, prevBlockId *common.BlockId) (<-chan MaybeBlockId, error)
type ArbFactory ¶
type ArbFactory interface { ArbFactoryWatcher CreateRollup( ctx context.Context, vmState common.Hash, params valprotocol.ChainParams, owner common.Address, ) (common.Address, *common.BlockId, error) }
type ArbFactoryWatcher ¶
type ArbRollup ¶
type ArbRollup interface { ArbRollupWatcher PlaceStake(ctx context.Context, stakeAmount *big.Int, proof1 []common.Hash, proof2 []common.Hash) ([]Event, error) RecoverStakeConfirmed(ctx context.Context, proof []common.Hash) ([]Event, error) RecoverStakeOld(ctx context.Context, staker common.Address, proof []common.Hash) ([]Event, error) RecoverStakeMooted(ctx context.Context, nodeHash common.Hash, staker common.Address, latestConfirmedProof []common.Hash, stakerProof []common.Hash) ([]Event, error) RecoverStakePassedDeadline(ctx context.Context, stakerAddress common.Address, deadlineTicks *big.Int, disputableNodeHashVal common.Hash, childType uint64, vmProtoStateHash common.Hash, proof []common.Hash) ([]Event, error) MoveStake(ctx context.Context, proof1 []common.Hash, proof2 []common.Hash) ([]Event, error) PruneLeaves(ctx context.Context, params []valprotocol.PruneParams) ([]Event, error) MakeAssertion( ctx context.Context, prevPrevLeafHash common.Hash, prevDataHash common.Hash, prevDeadline common.TimeTicks, prevChildType valprotocol.ChildType, beforeState *valprotocol.VMProtoData, assertionParams *valprotocol.AssertionParams, assertion *valprotocol.ExecutionAssertionStub, stakerProof []common.Hash, validBlock *common.BlockId, ) ([]Event, error) Confirm(ctx context.Context, opp *valprotocol.ConfirmOpportunity) ([]Event, error) StartChallenge( ctx context.Context, asserterAddress common.Address, challengerAddress common.Address, prevNode common.Hash, disputableDeadline *big.Int, asserterPosition valprotocol.ChildType, challengerPosition valprotocol.ChildType, asserterVMProtoHash common.Hash, challengerVMProtoHash common.Hash, asserterProof []common.Hash, challengerProof []common.Hash, asserterNodeHash common.Hash, challengerDataHash common.Hash, challengerPeriodTicks common.TimeTicks, ) ([]Event, error) }
type ArbRollupWatcher ¶
type ArbRollupWatcher interface { ContractWatcher GetAllEvents(ctx context.Context, fromBlock *big.Int, toBlock *big.Int) ([]Event, error) GetParams(ctx context.Context) (valprotocol.ChainParams, error) InboxAddress(ctx context.Context) (common.Address, error) GetCreationInfo(ctx context.Context) (common.Hash, ChainInfo, common.Hash, *big.Int, error) GetVersion(ctx context.Context) (string, error) IsStaked(address common.Address) (bool, error) VerifyArbChain(ctx context.Context, machHash common.Hash) error }
type AssertedEvent ¶
type AssertedEvent struct { ChainInfo PrevLeafHash common.Hash AssertionParams *valprotocol.AssertionParams MaxInboxTop common.Hash MaxInboxCount *big.Int NumGas uint64 AfterMachineHash common.Hash AfterInboxHash common.Hash LastMessageHash common.Hash MessageCount uint64 LastLogHash common.Hash LogCount uint64 }
type AsserterTimeoutEvent ¶
type AsserterTimeoutEvent struct {
ChainInfo
}
type ChainInfo ¶
func (ChainInfo) GetChainInfo ¶
type ChainTimeGetter ¶ added in v0.6.0
type ChallengeCompletedEvent ¶
type ChallengeFactory ¶
type ChallengeStartedEvent ¶
type ChallengerTimeoutEvent ¶
type ChallengerTimeoutEvent struct {
ChainInfo
}
type ConfirmedAssertionEvent ¶
type ConfirmedEvent ¶
type ContinueChallengeEvent ¶
type ContractWatcher ¶
type Event ¶
type Event interface {
GetChainInfo() ChainInfo
}
func MergeEventsUnsafe ¶ added in v0.6.5
MergeEventsUnsafe assumes that both sets of events are disjoint and come from the same chain state rather than from two different states caused by a reorg
type ExecutionBisectionEvent ¶
type ExecutionChallenge ¶
type ExecutionChallenge interface { Challenge BisectAssertion( ctx context.Context, assertions []*valprotocol.ExecutionAssertionStub, totalSteps uint64, ) error OneStepProof( ctx context.Context, assertion *valprotocol.ExecutionAssertionStub, proof []byte, ) error OneStepProofWithMessage( ctx context.Context, assertion *valprotocol.ExecutionAssertionStub, proof []byte, msg inbox.InboxMessage, ) error ChooseSegment( ctx context.Context, assertionToChallenge uint16, assertionHashes []common.Hash, ) error }
type ExecutionChallengeWatcher ¶
type ExecutionChallengeWatcher interface { ContractWatcher }
type GlobalInbox ¶
type GlobalInbox interface { GlobalInboxWatcher GlobalInboxSender }
type GlobalInboxSender ¶ added in v0.7.3
type GlobalInboxSender interface { SendL2Message( ctx context.Context, data []byte, ) (MessageDeliveredEvent, error) // SendL2MessageNoWait calls SendL2Message without // blocking while waiting for the receipt. This behavior is different from // the other ArbBridge methods. At some point other methods should be // updated to behave this way once we can be confident that it will not // create any security problems SendL2MessageNoWait( ctx context.Context, data []byte, ) (common.Hash, error) DepositEthMessage( ctx context.Context, destination common.Address, value *big.Int, ) error DepositERC20Message( ctx context.Context, tokenAddress common.Address, destination common.Address, value *big.Int, ) error DepositERC721Message( ctx context.Context, tokenAddress common.Address, destination common.Address, value *big.Int, ) error }
type GlobalInboxWatcher ¶ added in v0.6.5
type GlobalInboxWatcher interface { ContractWatcher GetDeliveredEvents( ctx context.Context, fromBlock *big.Int, toBlock *big.Int, ) ([]MessageDeliveredEvent, error) GetDeliveredEventsInBlock( ctx context.Context, blockId *common.BlockId, timestamp *big.Int, ) ([]MessageDeliveredEvent, error) GetERC20Balance( ctx context.Context, user common.Address, tokenContract common.Address, ) (*big.Int, error) GetEthBalance( ctx context.Context, user common.Address, ) (*big.Int, error) }
type IERC20Watcher ¶ added in v0.7.0
type InboxTopBisectionEvent ¶
type InboxTopChallenge ¶
type InboxTopChallenge interface { Challenge Bisect( ctx context.Context, chainHashes []common.Hash, chainLength *big.Int, ) error OneStepProof( ctx context.Context, lowerHashA common.Hash, value common.Hash, ) error ChooseSegment( ctx context.Context, assertionToChallenge uint16, chainHashes []common.Hash, chainLength uint64, ) error }
type InboxTopChallengeWatcher ¶
type InboxTopChallengeWatcher interface { ContractWatcher }
type InitiateChallengeEvent ¶
type MaybeBlockId ¶
type MaybeEvent ¶
type MessageDeliveredEvent ¶
type MessageDeliveredEvent struct { ChainInfo Message inbox.InboxMessage }
type MessagesBisectionEvent ¶
type NewTimeEvent ¶
type NewTimeEvent struct {
ChainInfo
}
type OneStepProofEvent ¶
type OneStepProofEvent struct {
ChainInfo
}
type PrunedEvent ¶
type StakeCreatedEvent ¶
type StakeMovedEvent ¶
type StakeRefundedEvent ¶
Click to show internal directories.
Click to hide internal directories.