Documentation ¶
Overview ¶
Package testcontracts provides a set of test contracts for use in tests.
Index ¶
- Constants
- Variables
- func NewBridgeConfigV3Deployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewTestMessageBusDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewTestMetaSwapDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewTestSwapFlashLoanDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewTestSynapseBridgeDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewTestSynapseBridgeV1Deployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- type BridgeConfigV3Deployer
- type DeployManager
- func (d *DeployManager) GetBridgeConfigV3(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *bridgeconfig.BridgeConfigRef)
- func (d *DeployManager) GetTestMessageBusUpgradeable(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *testmessagebus.TestMessageBusRef)
- func (d *DeployManager) GetTestMetaSwap(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *testmetaswap.TestMetaSwapRef)
- func (d *DeployManager) GetTestSwapFlashLoan(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *testswap.TestSwapRef)
- func (d *DeployManager) GetTestSynapseBridge(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *testbridge.TestBridgeRef)
- func (d *DeployManager) GetTestSynapseBridgeV1(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *testbridgev1.TestBridgeV1Ref)
- type TestMessageBusUpgradeableDeployer
- type TestMetaSwapDeployer
- type TestSwapFlashLoanDeployer
- type TestSynapseBridgeDeployer
- type TestSynapseBridgeV1Deployer
Constants ¶
const ( // TestBridgeConfigTypeV3 is the bridge config contract type. TestBridgeConfigTypeV3 contractTypeImpl = iota // TestSynapseBridgeType is the bridge contract type. TestSynapseBridgeType // TestSwapFlashLoanType is the swap contract type. TestSwapFlashLoanType // TestSynapseBridgeV1Type is the bridge contract type for V1. TestSynapseBridgeV1Type // TestMessageBusType is the message bus type. TestMessageBusType // TestMetaSwapType is the meta swap type. TestMetaSwapType )
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 NewBridgeConfigV3Deployer ¶
func NewBridgeConfigV3Deployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer
NewBridgeConfigV3Deployer creates a new bridge config v2 client.
func NewTestMessageBusDeployer ¶ added in v0.0.19
func NewTestMessageBusDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer
NewTestMessageBusDeployer creates a new test message bus deployer.
func NewTestMetaSwapDeployer ¶ added in v0.0.81
func NewTestMetaSwapDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer
NewTestMetaSwapDeployer creates a new test meta swap deployer.
func NewTestSwapFlashLoanDeployer ¶
func NewTestSwapFlashLoanDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer
NewTestSwapFlashLoanDeployer creates a new test swap deployer.
func NewTestSynapseBridgeDeployer ¶
func NewTestSynapseBridgeDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer
NewTestSynapseBridgeDeployer creates a new test bridge deployer.
func NewTestSynapseBridgeV1Deployer ¶ added in v0.0.15
func NewTestSynapseBridgeV1Deployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer
NewTestSynapseBridgeV1Deployer creates a new test bridge v1 deployer.
Types ¶
type BridgeConfigV3Deployer ¶
type BridgeConfigV3Deployer struct {
*deployer.BaseDeployer
}
BridgeConfigV3Deployer is the type of the bridge config v3 deployer.
func (BridgeConfigV3Deployer) Deploy ¶
func (n BridgeConfigV3Deployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys bridge config v3
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) GetBridgeConfigV3 ¶
func (d *DeployManager) GetBridgeConfigV3(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *bridgeconfig.BridgeConfigRef)
GetBridgeConfigV3 gets a typecast bridgeconfig contract.
func (*DeployManager) GetTestMessageBusUpgradeable ¶ added in v0.0.19
func (d *DeployManager) GetTestMessageBusUpgradeable(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *testmessagebus.TestMessageBusRef)
GetTestMessageBusUpgradeable gets a typecast test message bus contract.
func (*DeployManager) GetTestMetaSwap ¶ added in v0.0.81
func (d *DeployManager) GetTestMetaSwap(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *testmetaswap.TestMetaSwapRef)
GetTestMetaSwap gets a typecast test meta swap contract.
func (*DeployManager) GetTestSwapFlashLoan ¶
func (d *DeployManager) GetTestSwapFlashLoan(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *testswap.TestSwapRef)
GetTestSwapFlashLoan gets a typecast test swap contract.
func (*DeployManager) GetTestSynapseBridge ¶
func (d *DeployManager) GetTestSynapseBridge(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *testbridge.TestBridgeRef)
GetTestSynapseBridge gets a typecast test bridge contract.
func (*DeployManager) GetTestSynapseBridgeV1 ¶ added in v0.0.15
func (d *DeployManager) GetTestSynapseBridgeV1(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *testbridgev1.TestBridgeV1Ref)
GetTestSynapseBridgeV1 gets a typecast test bridge contract v1.
type TestMessageBusUpgradeableDeployer ¶ added in v0.0.19
type TestMessageBusUpgradeableDeployer struct {
*deployer.BaseDeployer
}
TestMessageBusUpgradeableDeployer is the type of the test message bus upgradeable deployer.
func (TestMessageBusUpgradeableDeployer) Deploy ¶ added in v0.0.19
func (t TestMessageBusUpgradeableDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys a test message bus contract.
type TestMetaSwapDeployer ¶ added in v0.0.81
type TestMetaSwapDeployer struct {
*deployer.BaseDeployer
}
TestMetaSwapDeployer is the type of the test meta swap deployer.
func (TestMetaSwapDeployer) Deploy ¶ added in v0.0.81
func (t TestMetaSwapDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys a test meta swap contract.
type TestSwapFlashLoanDeployer ¶
type TestSwapFlashLoanDeployer struct {
*deployer.BaseDeployer
}
TestSwapFlashLoanDeployer is the type of the test swap deployer.
func (TestSwapFlashLoanDeployer) Deploy ¶
func (t TestSwapFlashLoanDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys a test swap.
type TestSynapseBridgeDeployer ¶
type TestSynapseBridgeDeployer struct {
*deployer.BaseDeployer
}
TestSynapseBridgeDeployer is the type of the test bridge deployer.
func (TestSynapseBridgeDeployer) Deploy ¶
func (t TestSynapseBridgeDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys a test bridge.
type TestSynapseBridgeV1Deployer ¶ added in v0.0.15
type TestSynapseBridgeV1Deployer struct {
*deployer.BaseDeployer
}
TestSynapseBridgeV1Deployer is the type of the test bridge deployer.
func (TestSynapseBridgeV1Deployer) Deploy ¶ added in v0.0.15
func (t TestSynapseBridgeV1Deployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys a test bridge v1.