responder

package
v0.0.0-...-011bec4 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

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 (r *FaultResponder) PerformAction(ctx context.Context, action types.Action) error

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)
}

type Oracle

type Oracle interface {
	GlobalDataExists(ctx context.Context, data *types.PreimageOracleData) (bool, error)
}

type TxSender

type TxSender interface {
	SendAndWaitSimple(txPurpose string, txs ...txmgr.TxCandidate) error
}

Jump to

Keyboard shortcuts

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