Documentation ¶
Overview ¶
Package testutil contains mock deployers for interacting with the mock backend
Index ¶
Constants ¶
const ( // TestContractType is the type of the test contract. TestContractType contractTypeImpl = 0 // TestContract )
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 NewTestContractDeployer ¶
func NewTestContractDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer
NewTestContractDeployer creates a new test contract deployer.
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 deploy manager.
func (*DeployManager) GetTestContract ¶
func (d *DeployManager) GetTestContract(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *testcontract.TestContractRef)
GetTestContract gets the test contract.
type TestContractDeployer ¶
type TestContractDeployer struct {
*deployer.BaseDeployer
}
TestContractDeployer deploys a test contract.
func (TestContractDeployer) Deploy ¶
func (t TestContractDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys the test contract.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package testcontract contains a contract used for testing event and transaction emission.
|
Package testcontract contains a contract used for testing event and transaction emission. |