test

package
v1.1.5-rc.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAlphabetWithProofProvider

func NewAlphabetWithProofProvider(t *testing.T, maxDepth int, oracleError error) *alphabetWithProofProvider

Types

type ClaimBuilder

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

ClaimBuilder is a test utility to enable creating claims in a wide range of situations

func NewAlphabetClaimBuilder

func NewAlphabetClaimBuilder(t *testing.T, maxDepth int) *ClaimBuilder

func NewClaimBuilder

func NewClaimBuilder(t *testing.T, maxDepth int, provider types.TraceProvider) *ClaimBuilder

NewClaimBuilder creates a new ClaimBuilder.

func (*ClaimBuilder) AttackClaim

func (c *ClaimBuilder) AttackClaim(claim types.Claim, correct bool) types.Claim

func (*ClaimBuilder) CorrectClaim

func (c *ClaimBuilder) CorrectClaim(idx uint64) common.Hash

CorrectClaim returns the canonical claim at a specified trace index

func (*ClaimBuilder) CorrectOracleData

func (c *ClaimBuilder) CorrectOracleData(idx uint64) *types.PreimageOracleData

func (*ClaimBuilder) CorrectPreState

func (c *ClaimBuilder) CorrectPreState(idx uint64) []byte

CorrectPreState returns the pre-state (not hashed) required to execute the valid step at the specified trace index

func (*ClaimBuilder) CorrectProofData

func (c *ClaimBuilder) CorrectProofData(idx uint64) []byte

CorrectProofData returns the proof-data required to execute the valid step at the specified trace index

func (*ClaimBuilder) CorrectTraceProvider

func (c *ClaimBuilder) CorrectTraceProvider() types.TraceProvider

CorrectTraceProvider returns a types.TraceProvider that provides the canonical trace.

func (*ClaimBuilder) CreateLeafClaim

func (c *ClaimBuilder) CreateLeafClaim(traceIndex uint64, correct bool) types.Claim

func (*ClaimBuilder) CreateRootClaim

func (c *ClaimBuilder) CreateRootClaim(correct bool) types.Claim

func (*ClaimBuilder) DefendClaim

func (c *ClaimBuilder) DefendClaim(claim types.Claim, correct bool) types.Claim

func (*ClaimBuilder) Seq

func (c *ClaimBuilder) Seq(rootCorrect bool) *SequenceBuilder

Seq starts building a claim by following a sequence of attack and defend moves from the root The returned SequenceBuilder can be used to add additional moves. e.g: claim := Seq(true).Attack(false).Attack(true).Defend(true).Get()

type SequenceBuilder

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

func (*SequenceBuilder) Attack

func (s *SequenceBuilder) Attack(correct bool) *SequenceBuilder

func (*SequenceBuilder) Defend

func (s *SequenceBuilder) Defend(correct bool) *SequenceBuilder

func (*SequenceBuilder) Get

func (s *SequenceBuilder) Get() types.Claim

Jump to

Keyboard shortcuts

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