Documentation ¶
Overview ¶
Package testutil provides utilities for testing.
Index ¶
- Constants
- Variables
- func NewGasOracleDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewInterchainDBDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewSynapseModuleDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- type DeployManager
- func (d *DeployManager) GetInterchainDB(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *interchaindb.InterchainDBRef)
- func (d *DeployManager) GetSynapseModule(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *synapsemodule.SynapseModuleRef)
- type GasOracleDeployer
- type InterchainDBDeployer
- type SynapseModuleDeployer
Constants ¶
const ( // SynapseModuleType is the type of the contract being fetched. SynapseModuleType contractTypeImpl = iota + 1 // SynapseModule // InterchainDB is the type of the contract being fetched. InterchainDB // InterchainDB // GasOracleMockType is the type of the contract being fetched. GasOracleMockType // GasOracleMock )
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 NewGasOracleDeployer ¶
func NewGasOracleDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer
NewGasOracleDeployer deploys a GasOracle contract.
func NewInterchainDBDeployer ¶
func NewInterchainDBDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer
NewInterchainDBDeployer deploys a NoOpInterchain contract.
func NewSynapseModuleDeployer ¶
func NewSynapseModuleDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer
NewSynapseModuleDeployer deploys a SynapseModule contract.
Types ¶
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 new DeployManager.
func (*DeployManager) GetInterchainDB ¶
func (d *DeployManager) GetInterchainDB(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *interchaindb.InterchainDBRef)
GetInterchainDB returns a deployed InterchainDB contract and a reference to the contract.
func (*DeployManager) GetSynapseModule ¶
func (d *DeployManager) GetSynapseModule(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *synapsemodule.SynapseModuleRef)
GetSynapseModule returns a deployed SynapseModule contract and a reference to the contract.
type GasOracleDeployer ¶
type GasOracleDeployer struct {
*deployer.BaseDeployer
}
GasOracleDeployer wraps GasOracleDeployer and allows typed contract handles to be returned.
func (GasOracleDeployer) Deploy ¶
func (i GasOracleDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys a GasOracle contract.
type InterchainDBDeployer ¶
type InterchainDBDeployer struct {
*deployer.BaseDeployer
}
InterchainDBDeployer wraps InterchainDBDeployer and allows typed contract handles to be returned.
func (InterchainDBDeployer) Deploy ¶
func (i InterchainDBDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys a NoOpInterchain contract.
type SynapseModuleDeployer ¶
type SynapseModuleDeployer struct {
*deployer.BaseDeployer
}
SynapseModuleDeployer wraps SynapseModuleDeployer and allows typed contract handles to be returned.
func (SynapseModuleDeployer) Dependencies ¶
func (s SynapseModuleDeployer) Dependencies() []contracts.ContractType
Dependencies returns the dependencies of the SynapseModuleDeployer.
func (SynapseModuleDeployer) Deploy ¶
func (s SynapseModuleDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys a SynapseModule contract. this is deployed with the NoOpInterchain contract as the interchain contract. this can be overridden at any time by owner.