Documentation ¶
Overview ¶
Package testutil contains mock deployers for interacting with the mock backend
Index ¶
- Constants
- Variables
- func NewAttestationCollectorDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewAttestationHarnessDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewDestinationDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewDestinationHarnessDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewHeaderHarnessDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewMessageHarnessDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewNotaryManagerDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewOriginDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewOriginHarnessDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewTipsHarnessDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- type AttestationCollectorDeployer
- type AttestationHarnessDeployer
- type DeployManager
- func (d *DeployManager) GetAttestationCollector(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, ...)
- func (d *DeployManager) GetAttestationHarness(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, ...)
- func (d *DeployManager) GetDestination(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *destination.DestinationRef)
- func (d *DeployManager) GetDestinationHarness(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, ...)
- func (d *DeployManager) GetHeaderHarness(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *headerharness.HeaderHarnessRef)
- func (d *DeployManager) GetMessageHarness(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *messageharness.MessageHarnessRef)
- func (d *DeployManager) GetNotaryManager(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *notarymanager.NotaryManagerRef)
- func (d *DeployManager) GetOrigin(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *origin.OriginRef)
- func (d *DeployManager) GetOriginHarness(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *originharness.OriginHarnessRef)
- func (d *DeployManager) GetTipsHarness(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *tipsharness.TipsHarnessRef)
- type DestinationDeployer
- type DestinationHarnessDeployer
- type HeaderHarnessDeployer
- type MessageHarnessDeployer
- type NotaryManagerDeployer
- type OriginDeployer
- type OriginHarnessDeployer
- type TipsHarnessDeployer
Constants ¶
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 )
const OriginHarnessDomain = 1
OriginHarnessDomain is the domain used for the origin harness.
Variables ¶
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 ¶
func NewDestinationDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer
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 ¶
func NewOriginDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer
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 ¶
func NewTipsHarnessDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer
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 ¶
func (a AttestationCollectorDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys the attestation collector.
type AttestationHarnessDeployer ¶
type AttestationHarnessDeployer struct {
*deployer.BaseDeployer
}
AttestationHarnessDeployer deploys the attestation harness.
func (AttestationHarnessDeployer) Deploy ¶
func (a AttestationHarnessDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
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 ¶
func (d *DeployManager) GetAttestationCollector(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *attestationcollector.AttestationCollectorRef)
GetAttestationCollector gets the attestation collector contract.
func (*DeployManager) GetAttestationHarness ¶
func (d *DeployManager) GetAttestationHarness(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *attestationharness.AttestationHarnessRef)
GetAttestationHarness gets the attestation harness.
func (*DeployManager) GetDestination ¶
func (d *DeployManager) GetDestination(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *destination.DestinationRef)
GetDestination gets the destination contract.
func (*DeployManager) GetDestinationHarness ¶
func (d *DeployManager) GetDestinationHarness(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *destinationharness.DestinationHarnessRef)
GetDestinationHarness gets the destination harness.
func (*DeployManager) GetHeaderHarness ¶
func (d *DeployManager) GetHeaderHarness(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *headerharness.HeaderHarnessRef)
GetHeaderHarness gets the header harness.
func (*DeployManager) GetMessageHarness ¶
func (d *DeployManager) GetMessageHarness(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *messageharness.MessageHarnessRef)
GetMessageHarness gets the message harness.
func (*DeployManager) GetNotaryManager ¶
func (d *DeployManager) GetNotaryManager(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *notarymanager.NotaryManagerRef)
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 ¶
func (d *DeployManager) GetOriginHarness(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *originharness.OriginHarnessRef)
GetOriginHarness gets the origin harness.
func (*DeployManager) GetTipsHarness ¶
func (d *DeployManager) GetTipsHarness(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *tipsharness.TipsHarnessRef)
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 ¶
func (d DestinationDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys the destination.
type DestinationHarnessDeployer ¶
type DestinationHarnessDeployer struct {
*deployer.BaseDeployer
}
DestinationHarnessDeployer deploys the destination harness.
func (DestinationHarnessDeployer) Deploy ¶
func (d DestinationHarnessDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys the destination harness.
type HeaderHarnessDeployer ¶
type HeaderHarnessDeployer struct {
*deployer.BaseDeployer
}
HeaderHarnessDeployer deploys the header harness.
func (HeaderHarnessDeployer) Deploy ¶
func (h HeaderHarnessDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys the header harness.
type MessageHarnessDeployer ¶
type MessageHarnessDeployer struct {
*deployer.BaseDeployer
}
MessageHarnessDeployer deploys the message harness for testing.
func (MessageHarnessDeployer) Deploy ¶
func (d MessageHarnessDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys the message harness deployer.
type NotaryManagerDeployer ¶
type NotaryManagerDeployer struct {
*deployer.BaseDeployer
}
NotaryManagerDeployer deploys the update manager.
func (NotaryManagerDeployer) Deploy ¶
func (n NotaryManagerDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
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 ¶
func (d OriginDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys the origin contract.
type OriginHarnessDeployer ¶
type OriginHarnessDeployer struct {
*deployer.BaseDeployer
}
OriginHarnessDeployer deploys the origin harness for testing.
func (OriginHarnessDeployer) Dependencies ¶ added in v0.0.20
func (o OriginHarnessDeployer) Dependencies() []contracts.ContractType
Dependencies gets a list of dependencies used to deploy the origin contract.
func (OriginHarnessDeployer) Deploy ¶
func (o OriginHarnessDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys the origin harness.
type TipsHarnessDeployer ¶
type TipsHarnessDeployer struct {
*deployer.BaseDeployer
}
TipsHarnessDeployer deploys the tip harness for tester.
func (TipsHarnessDeployer) Deploy ¶
func (a TipsHarnessDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys the attestation harness.