testutil

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2022 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package testutil contains mock deployers for interacting with the mock backend

Index

Constants

View Source
const (
	// OriginType is the type of the origin.
	OriginType contractTypeImpl = 0 // Origin
	// MessageHarnessType is the type of the message harness contract.
	MessageHarnessType contractTypeImpl = iota // MessageHarness
	// OriginHarnessType is the origin harness type.
	OriginHarnessType contractTypeImpl = iota // OriginHarness
	// AttestationHarnessType is the attestation harness type.
	AttestationHarnessType contractTypeImpl = iota
	// TipsHarnessType is the type of the tips harness.
	TipsHarnessType contractTypeImpl = iota
	// HeaderHarnessType is the type of the header harness.
	HeaderHarnessType contractTypeImpl = iota
	// DestinationHarnessType is the destination harness type.
	DestinationHarnessType contractTypeImpl = iota // DestinationHarness
	// NotaryManagerType is the type of the update manager.
	NotaryManagerType contractTypeImpl = iota // NotaryManager
	// AttestationCollectorType is the type of the attestation collector.
	AttestationCollectorType contractTypeImpl = iota // AttestationCollector
	// DestinationType is the type of the destination.
	DestinationType contractTypeImpl = iota // Destination
)
View Source
const OriginHarnessDomain = 1

OriginHarnessDomain is the domain used for the origin harness.

Variables

View Source
var AllContractTypes []contractTypeImpl

AllContractTypes is a list of all contract types. Since we use stringer and this is a testing library, instead of manually copying all these out we pull the names out of stringer. In order to make sure stringer is updated, we panic on any method called where the index is higher than the stringer array length.

Functions

func NewAttestationCollectorDeployer

func NewAttestationCollectorDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer

NewAttestationCollectorDeployer creates the deployer for the attestation collecotr.

func NewAttestationHarnessDeployer

func NewAttestationHarnessDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer

NewAttestationHarnessDeployer creates a new deployer for the attestation harness.

func NewDestinationDeployer

NewDestinationDeployer creates the deployer for the destination.

func NewDestinationHarnessDeployer

func NewDestinationHarnessDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer

NewDestinationHarnessDeployer creates a new deployer for the destination harness.

func NewHeaderHarnessDeployer

func NewHeaderHarnessDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer

NewHeaderHarnessDeployer gets the header harness.

func NewMessageHarnessDeployer

func NewMessageHarnessDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer

NewMessageHarnessDeployer creates a message harness deployer.

func NewNotaryManagerDeployer

func NewNotaryManagerDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer

NewNotaryManagerDeployer deploys a new notary manager.

func NewOriginDeployer

NewOriginDeployer deploys the origin contract.

func NewOriginHarnessDeployer

func NewOriginHarnessDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer

NewOriginHarnessDeployer deploys a new origin harness.

func NewTipsHarnessDeployer

NewTipsHarnessDeployer creates a new deployer for the attestation harness.

Types

type AttestationCollectorDeployer

type AttestationCollectorDeployer struct {
	*deployer.BaseDeployer
}

AttestationCollectorDeployer deploys the attestation collector.

func (AttestationCollectorDeployer) Deploy

Deploy deploys the attestation collector.

type AttestationHarnessDeployer

type AttestationHarnessDeployer struct {
	*deployer.BaseDeployer
}

AttestationHarnessDeployer deploys the attestation harness.

func (AttestationHarnessDeployer) Deploy

Deploy deploys the attestation harness.

type DeployManager

type DeployManager struct {
	*manager.DeployerManager
}

DeployManager wraps DeployManager and allows typed contract handles to be returned.

func NewDeployManager

func NewDeployManager(t *testing.T) *DeployManager

NewDeployManager creates a deploy manager.

func (*DeployManager) GetAttestationCollector

GetAttestationCollector gets the attestation collector contract.

func (*DeployManager) GetAttestationHarness

GetAttestationHarness gets the attestation harness.

func (*DeployManager) GetDestination

GetDestination gets the destination contract.

func (*DeployManager) GetDestinationHarness

GetDestinationHarness gets the destination harness.

func (*DeployManager) GetHeaderHarness

GetHeaderHarness gets the header harness.

func (*DeployManager) GetMessageHarness

GetMessageHarness gets the message harness.

func (*DeployManager) GetNotaryManager

GetNotaryManager gets the notary manager.

func (*DeployManager) GetOrigin

func (d *DeployManager) GetOrigin(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *origin.OriginRef)

GetOrigin gets a typecast origin contract.

func (*DeployManager) GetOriginHarness

GetOriginHarness gets the origin harness.

func (*DeployManager) GetTipsHarness

GetTipsHarness gets the tips harness for testing.

type DestinationDeployer

type DestinationDeployer struct {
	*deployer.BaseDeployer
}

DestinationDeployer deploys the destination.

func (DestinationDeployer) Dependencies

func (d DestinationDeployer) Dependencies() []contracts.ContractType

Dependencies gets a list of dependencies used to deploy the destination contract.

func (DestinationDeployer) Deploy

Deploy deploys the destination.

type DestinationHarnessDeployer

type DestinationHarnessDeployer struct {
	*deployer.BaseDeployer
}

DestinationHarnessDeployer deploys the destination harness.

func (DestinationHarnessDeployer) Deploy

Deploy deploys the destination harness.

type HeaderHarnessDeployer

type HeaderHarnessDeployer struct {
	*deployer.BaseDeployer
}

HeaderHarnessDeployer deploys the header harness.

func (HeaderHarnessDeployer) Deploy

Deploy deploys the header harness.

type MessageHarnessDeployer

type MessageHarnessDeployer struct {
	*deployer.BaseDeployer
}

MessageHarnessDeployer deploys the message harness for testing.

func (MessageHarnessDeployer) Deploy

Deploy deploys the message harness deployer.

type NotaryManagerDeployer

type NotaryManagerDeployer struct {
	*deployer.BaseDeployer
}

NotaryManagerDeployer deploys the update manager.

func (NotaryManagerDeployer) Deploy

Deploy deploys the notary contract.

type OriginDeployer

type OriginDeployer struct {
	*deployer.BaseDeployer
}

OriginDeployer deploys the origin contract.

func (OriginDeployer) Dependencies

func (d OriginDeployer) Dependencies() []contracts.ContractType

Dependencies gets a list of dependencies used to deploy the origin contract.

func (OriginDeployer) Deploy

Deploy deploys the origin contract.

type OriginHarnessDeployer

type OriginHarnessDeployer struct {
	*deployer.BaseDeployer
}

OriginHarnessDeployer deploys the origin harness for testing.

func (OriginHarnessDeployer) Deploy

Deploy deploys the origin harness.

type TipsHarnessDeployer

type TipsHarnessDeployer struct {
	*deployer.BaseDeployer
}

TipsHarnessDeployer deploys the tip harness for tester.

func (TipsHarnessDeployer) Deploy

Deploy deploys the attestation harness.

Jump to

Keyboard shortcuts

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