disputegame

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2023 License: MIT Imports: 26 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CorrectAlphabet = "abcdefghijklmnop"

Functions

This section is empty.

Types

type AlphabetGameHelper added in v1.1.4

type AlphabetGameHelper struct {
	FaultGameHelper
	// contains filtered or unexported fields
}

func (*AlphabetGameHelper) StartChallenger added in v1.1.4

func (g *AlphabetGameHelper) StartChallenger(ctx context.Context, l1Endpoint string, name string, options ...challenger.Option) *challenger.Helper

type CannonGameHelper added in v1.1.4

type CannonGameHelper struct {
	FaultGameHelper
}

func (*CannonGameHelper) CreateHonestActor added in v1.1.4

func (g *CannonGameHelper) CreateHonestActor(ctx context.Context, rollupCfg *rollup.Config, l2Genesis *core.Genesis, l1Client bind.ContractCaller, l1Endpoint string, l2Endpoint string, options ...challenger.Option) *HonestHelper

func (*CannonGameHelper) StartChallenger added in v1.1.4

func (g *CannonGameHelper) StartChallenger(ctx context.Context, rollupCfg *rollup.Config, l2Genesis *core.Genesis, l1Endpoint string, l2Endpoint string, name string, options ...challenger.Option) *challenger.Helper

type ContractClaim

type ContractClaim struct {
	ParentIndex uint32
	Countered   bool
	Claim       [32]byte
	Position    *big.Int
	Clock       *big.Int
}

type FactoryHelper

type FactoryHelper struct {
	// contains filtered or unexported fields
}

func NewFactoryHelper

func NewFactoryHelper(t *testing.T, ctx context.Context, deployments *genesis.L1Deployments, client *ethclient.Client) *FactoryHelper

func (*FactoryHelper) StartAlphabetGame

func (h *FactoryHelper) StartAlphabetGame(ctx context.Context, claimedAlphabet string) *AlphabetGameHelper

func (*FactoryHelper) StartCannonGame added in v1.1.4

func (h *FactoryHelper) StartCannonGame(ctx context.Context, rootClaim common.Hash) *CannonGameHelper

func (*FactoryHelper) StartChallenger added in v1.1.4

func (h *FactoryHelper) StartChallenger(ctx context.Context, l1Endpoint string, name string, options ...challenger.Option) *challenger.Helper

type FaultGameHelper

type FaultGameHelper struct {
	// contains filtered or unexported fields
}

func (*FaultGameHelper) Attack added in v1.1.4

func (g *FaultGameHelper) Attack(ctx context.Context, claimIdx int64, claim common.Hash)

func (*FaultGameHelper) Defend added in v1.1.4

func (g *FaultGameHelper) Defend(ctx context.Context, claimIdx int64, claim common.Hash)

func (*FaultGameHelper) GameDuration added in v1.1.4

func (g *FaultGameHelper) GameDuration(ctx context.Context) time.Duration

func (*FaultGameHelper) LogGameData added in v1.1.4

func (g *FaultGameHelper) LogGameData(ctx context.Context)

func (*FaultGameHelper) MaxDepth added in v1.1.4

func (g *FaultGameHelper) MaxDepth(ctx context.Context) int64

func (*FaultGameHelper) Resolve

func (g *FaultGameHelper) Resolve(ctx context.Context)

func (*FaultGameHelper) WaitForClaim

func (g *FaultGameHelper) WaitForClaim(ctx context.Context, predicate func(claim ContractClaim) bool)

func (*FaultGameHelper) WaitForClaimAtMaxDepth

func (g *FaultGameHelper) WaitForClaimAtMaxDepth(ctx context.Context, countered bool)

func (*FaultGameHelper) WaitForClaimCount

func (g *FaultGameHelper) WaitForClaimCount(ctx context.Context, count int64)

func (*FaultGameHelper) WaitForGameStatus

func (g *FaultGameHelper) WaitForGameStatus(ctx context.Context, expected Status)

type HonestHelper added in v1.1.4

type HonestHelper struct {
	// contains filtered or unexported fields
}

func (*HonestHelper) Attack added in v1.1.4

func (h *HonestHelper) Attack(ctx context.Context, claimIdx int64)

func (*HonestHelper) Defend added in v1.1.4

func (h *HonestHelper) Defend(ctx context.Context, claimIdx int64)

type Status

type Status uint8
const (
	StatusInProgress Status = iota
	StatusChallengerWins
	StatusDefenderWins
)

func (Status) String added in v1.1.4

func (s Status) String() string

Jump to

Keyboard shortcuts

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