Documentation ¶
Overview ¶
Package testutil contains mock deployers for interacting with the mock backend
Index ¶
- Constants
- Variables
- func NewAgentsTestContractDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- 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 NewOriginDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewOriginHarnessDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewTipsHarnessDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- type AgentsTestContractDeployer
- type AttestationCollectorDeployer
- type AttestationHarnessDeployer
- type DeployManager
- func (d *DeployManager) GetAgentsTestContract(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, ...)
- 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) 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 OriginDeployer
- type OriginHarnessDeployer
- type SimulatedBackendsTestSuite
- func (a *SimulatedBackendsTestSuite) SetupAttestation(deployManager *DeployManager)
- func (a *SimulatedBackendsTestSuite) SetupDestination(deployManager *DeployManager)
- func (a *SimulatedBackendsTestSuite) SetupExecutor()
- func (a *SimulatedBackendsTestSuite) SetupGuard()
- func (a *SimulatedBackendsTestSuite) SetupNotary()
- func (a *SimulatedBackendsTestSuite) SetupOrigin(deployManager *DeployManager)
- func (a *SimulatedBackendsTestSuite) SetupTest()
- type TipsHarnessDeployer
Constants ¶
const ( // OriginType is the type of the origin. OriginType contractTypeImpl = iota // Origin // MessageHarnessType is the type of the message harness contract. MessageHarnessType // MessageHarness // OriginHarnessType is the origin harness type. OriginHarnessType // OriginHarness // AttestationHarnessType is the attestation harness type. AttestationHarnessType // TipsHarnessType is the type of the tips harness. TipsHarnessType // HeaderHarnessType is the type of the header harness. HeaderHarnessType // DestinationHarnessType is the destination harness type. DestinationHarnessType // DestinationHarness // AttestationCollectorType is the type of the attestation collector. AttestationCollectorType // AttestationCollector // DestinationType is the type of the destination. DestinationType // Destination // AgentsTestContractType is the type of the agents test contract. AgentsTestContractType // AgentsTestContract )
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 NewAgentsTestContractDeployer ¶ added in v0.0.65
func NewAgentsTestContractDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer
NewAgentsTestContractDeployer gets the agents test contract.
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 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 AgentsTestContractDeployer ¶ added in v0.0.65
type AgentsTestContractDeployer struct {
*deployer.BaseDeployer
}
AgentsTestContractDeployer deploys the agents test contract.
func (AgentsTestContractDeployer) Deploy ¶ added in v0.0.65
func (h AgentsTestContractDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys the header harness.
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) GetAgentsTestContract ¶ added in v0.0.65
func (d *DeployManager) GetAgentsTestContract(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *agentstestcontract.AgentsTestContractRef)
GetAgentsTestContract gets the agents test contract.
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) 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. nolint:dupl
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 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. nolint:dupl
type SimulatedBackendsTestSuite ¶ added in v0.0.54
type SimulatedBackendsTestSuite struct { *testsuite.TestSuite OriginContract *originharness.OriginHarnessRef OriginContractMetadata contracts.DeployedContract DestinationContract *destinationharness.DestinationHarnessRef DestinationContractMetadata contracts.DeployedContract AttestationHarness *attestationharness.AttestationHarnessRef AttestationContract *attestationcollector.AttestationCollectorRef AttestationContractMetadata contracts.DeployedContract TestBackendOrigin backends.SimulatedTestBackend TestBackendDestination backends.SimulatedTestBackend TestBackendAttestation backends.SimulatedTestBackend NotaryBondedWallet wallet.Wallet GuardBondedWallet wallet.Wallet NotaryBondedSigner signer.Signer GuardBondedSigner signer.Signer NotaryUnbondedWallet wallet.Wallet NotaryUnbondedSigner signer.Signer GuardUnbondedWallet wallet.Wallet GuardUnbondedSigner signer.Signer ExecutorUnbondedWallet wallet.Wallet ExecutorUnbondedSigner signer.Signer OriginDomainClient domains.DomainClient AttestationDomainClient domains.DomainClient DestinationDomainClient domains.DomainClient TestDeployManager *DeployManager ScribeTestDB scribedb.EventDB DBPath string ExecutorTestDB db.ExecutorDB }
SimulatedBackendsTestSuite can be used as the base for any test needing simulated backends that have an origin, destination and attestation collector and a guard and notary added to each. TODO (joe): For tests that do not need all 3 simulated backends, allow them to pass in flags indicating the subset of backends desired. Some tests might only want an attestation collector, others might only want an origin and an attestation collector, others might want just a destination, etc.
func NewSimulatedBackendsTestSuite ¶ added in v0.0.54
func NewSimulatedBackendsTestSuite(tb testing.TB) *SimulatedBackendsTestSuite
NewSimulatedBackendsTestSuite creates an end-to-end test suite with simulated backends set up.
func (*SimulatedBackendsTestSuite) SetupAttestation ¶ added in v0.0.54
func (a *SimulatedBackendsTestSuite) SetupAttestation(deployManager *DeployManager)
SetupAttestation sets up the backend that will have the attestation collector contract deployed on it.
func (*SimulatedBackendsTestSuite) SetupDestination ¶ added in v0.0.54
func (a *SimulatedBackendsTestSuite) SetupDestination(deployManager *DeployManager)
SetupDestination sets up the backend that will have the destination contract deployed on it.
func (*SimulatedBackendsTestSuite) SetupExecutor ¶ added in v0.0.79
func (a *SimulatedBackendsTestSuite) SetupExecutor()
SetupExecutor sets up the Executor agent.
func (*SimulatedBackendsTestSuite) SetupGuard ¶ added in v0.0.60
func (a *SimulatedBackendsTestSuite) SetupGuard()
SetupGuard sets up the Guard agent.
func (*SimulatedBackendsTestSuite) SetupNotary ¶ added in v0.0.60
func (a *SimulatedBackendsTestSuite) SetupNotary()
SetupNotary sets up the Notary agent.
func (*SimulatedBackendsTestSuite) SetupOrigin ¶ added in v0.0.54
func (a *SimulatedBackendsTestSuite) SetupOrigin(deployManager *DeployManager)
SetupOrigin sets up the backend that will have the origin contract deployed on it.
func (*SimulatedBackendsTestSuite) SetupTest ¶ added in v0.0.54
func (a *SimulatedBackendsTestSuite) SetupTest()
SetupTest sets up the test.
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.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Code generated by synapse abigen DO NOT EDIT.
|
Code generated by synapse abigen DO NOT EDIT. |