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(ctx context.Context) error
- func (r *FaultResponder) ResolveClaim(ctx context.Context, claimIdx uint64) error
- type GameContract
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, txMgr txmgr.TxManager, contract GameContract) (*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(ctx context.Context) error
Resolve executes a resolve transaction to resolve a fault dispute game.
func (*FaultResponder) ResolveClaim ¶
func (r *FaultResponder) ResolveClaim(ctx context.Context, claimIdx uint64) error
ResolveClaim executes a resolveClaim transaction to resolve a fault 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(parentContractIndex uint64, pivot common.Hash) (txmgr.TxCandidate, error) DefendTx(parentContractIndex uint64, pivot common.Hash) (txmgr.TxCandidate, error) StepTx(claimIdx uint64, isAttack bool, stateData []byte, proof []byte) (txmgr.TxCandidate, error) UpdateOracleTx(ctx context.Context, data *types.PreimageOracleData) (txmgr.TxCandidate, error) }
Click to show internal directories.
Click to hide internal directories.