Documentation ¶
Index ¶
- func NewAlphabetWithProofProvider(t *testing.T, maxDepth int, oracleError error) *alphabetWithProofProvider
- type ClaimBuilder
- func (c *ClaimBuilder) AttackClaim(claim types.Claim, correct bool) types.Claim
- func (c *ClaimBuilder) CorrectClaim(idx uint64) common.Hash
- func (c *ClaimBuilder) CorrectOracleData(idx uint64) *types.PreimageOracleData
- func (c *ClaimBuilder) CorrectPreState(idx uint64) []byte
- func (c *ClaimBuilder) CorrectProofData(idx uint64) []byte
- func (c *ClaimBuilder) CorrectTraceProvider() types.TraceProvider
- func (c *ClaimBuilder) CreateLeafClaim(traceIndex uint64, correct bool) types.Claim
- func (c *ClaimBuilder) CreateRootClaim(correct bool) types.Claim
- func (c *ClaimBuilder) DefendClaim(claim types.Claim, correct bool) types.Claim
- func (c *ClaimBuilder) Seq(rootCorrect bool) *SequenceBuilder
- type SequenceBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 (*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 (*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