Documentation ¶
Overview ¶
Package manager manages deployers to make them as simple as possible
Index ¶
- type DeployerFunc
- type DeployerManager
- func (d *DeployerManager) BulkDeploy(ctx context.Context, testBackends []backends.SimulatedTestBackend, ...)
- func (d *DeployerManager) Get(ctx context.Context, backend backends.SimulatedTestBackend, ...) contracts.DeployedContract
- func (d *DeployerManager) GetContractRegistry(backend backends.SimulatedTestBackend) deployer.ContractRegistry
- func (d *DeployerManager) GetDeployedContracts() (res map[uint32][]contracts.DeployedContract)
- func (d *DeployerManager) SetT(t *testing.T)
- func (d *DeployerManager) T() *testing.T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeployerFunc ¶
type DeployerFunc func(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer
DeployerFunc defines a deployer we can use.
type DeployerManager ¶
type DeployerManager struct {
// contains filtered or unexported fields
}
DeployerManager is responsible for wrapping contract registry with easy to use getters that correctly cast the handles. since ContractRegistry is meant to be kept pure and go does not support generics, the sole function is to provide handler wrappers around the registry. This will no longer be required when go supports generics: https://blog.golang.org/generics-proposal TODO: go 1.19 supports generics, this can be improved.
func NewDeployerManager ¶
func NewDeployerManager(t *testing.T, deployers ...DeployerFunc) (d *DeployerManager)
NewDeployerManager creates a new deployment helper.
func (*DeployerManager) BulkDeploy ¶
func (d *DeployerManager) BulkDeploy(ctx context.Context, testBackends []backends.SimulatedTestBackend, contracts ...contracts.ContractType)
BulkDeploy synchronously deploys a bunch of contracts as quickly as possible to speed up tests. in a future version this will utilize dependency trees. Returns nothing when complete.
func (*DeployerManager) Get ¶
func (d *DeployerManager) Get(ctx context.Context, backend backends.SimulatedTestBackend, contractType contracts.ContractType) contracts.DeployedContract
Get gets the contract from the registry.
func (*DeployerManager) GetContractRegistry ¶
func (d *DeployerManager) GetContractRegistry(backend backends.SimulatedTestBackend) deployer.ContractRegistry
GetContractRegistry gets a contract registry for a backend and creates it if it does not exist.
func (*DeployerManager) GetDeployedContracts ¶ added in v0.0.42
func (d *DeployerManager) GetDeployedContracts() (res map[uint32][]contracts.DeployedContract)
GetDeployedContracts gets all deployed contracts by domain.
func (*DeployerManager) SetT ¶
func (d *DeployerManager) SetT(t *testing.T)
SetT sets the testing object.