Documentation ¶
Index ¶
- type FaultResponder
- func (r *FaultResponder) CallResolve(ctx context.Context) (gameTypes.GameStatus, error)
- func (r *FaultResponder) CallResolveClaim(ctx context.Context, claimIdx uint64) error
- func (r *FaultResponder) PerformAction(ctx context.Context, action types.Action) error
- func (r *FaultResponder) Resolve() error
- func (r *FaultResponder) ResolveClaims(claimIdxs ...uint64) error
- type GameContract
- type Oracle
- type TxSender
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FaultResponder ¶
type FaultResponder struct {
// contains filtered or unexported fields
}
FaultResponder implements the [Responder] interface to send onchain transactions.
func NewFaultResponder ¶
func NewFaultResponder(logger log.Logger, sender TxSender, contract GameContract, uploader preimages.PreimageUploader, oracle Oracle) (*FaultResponder, error)
NewFaultResponder returns a new FaultResponder.
func (*FaultResponder) CallResolve ¶
func (r *FaultResponder) CallResolve(ctx context.Context) (gameTypes.GameStatus, error)
CallResolve determines if the resolve function on the fault dispute game contract would succeed. Returns the game status if the call would succeed, errors otherwise.
func (*FaultResponder) CallResolveClaim ¶
func (r *FaultResponder) CallResolveClaim(ctx context.Context, claimIdx uint64) error
CallResolveClaim determines if the resolveClaim function on the fault dispute game contract would succeed.
func (*FaultResponder) PerformAction ¶
func (*FaultResponder) Resolve ¶
func (r *FaultResponder) Resolve() error
Resolve executes a resolve transaction to resolve a fault dispute game.
func (*FaultResponder) ResolveClaims ¶
func (r *FaultResponder) ResolveClaims(claimIdxs ...uint64) error
ResolveClaims executes resolveClaim transactions to resolve claims in a dispute game.
type GameContract ¶
type GameContract interface { CallResolve(ctx context.Context) (gameTypes.GameStatus, error) ResolveTx() (txmgr.TxCandidate, error) CallResolveClaim(ctx context.Context, claimIdx uint64) error ResolveClaimTx(claimIdx uint64) (txmgr.TxCandidate, error) AttackTx(ctx context.Context, parent types.Claim, pivot common.Hash) (txmgr.TxCandidate, error) DefendTx(ctx context.Context, parent types.Claim, pivot common.Hash) (txmgr.TxCandidate, error) StepTx(claimIdx uint64, isAttack bool, stateData []byte, proof []byte) (txmgr.TxCandidate, error) ChallengeL2BlockNumberTx(challenge *types.InvalidL2BlockNumberChallenge) (txmgr.TxCandidate, error) }
Click to show internal directories.
Click to hide internal directories.