Documentation ¶
Overview ¶
Package testutil is used for deploying test contracts and generic testing functions
Index ¶
- Constants
- Variables
- func NewBridgeConfigV3Deployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewCCTPDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewFastBridgeDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewMessageBusDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewMetaSwapDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewSwapFlashLoanDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewSynapseBridgeDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewSynapseBridgeV1Deployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- type BridgeConfigV3Deployer
- type CCTPDeployer
- type DeployManager
- func (d *DeployManager) GetBridgeConfigV3(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *bridgeconfig.BridgeConfigRef)
- func (d *DeployManager) GetCCTP(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *cctp.CCTPRef)
- func (d *DeployManager) GetFastBridge(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *fastbridge.FastBridgeRef)
- func (d *DeployManager) GetMessageBus(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *messagebus.MessageBusRef)
- func (d *DeployManager) GetMetaSwap(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *metaswap.MetaSwapRef)
- func (d *DeployManager) GetSwapFlashLoan(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *swap.SwapRef)
- func (d *DeployManager) GetSynapseBridge(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *bridge.BridgeRef)
- func (d *DeployManager) GetSynapseBridgeV1(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *bridgev1.BridgeRef)
- type FastBridgeDeployer
- type MessageBusDeployer
- type MetaSwapDeployer
- type SwapFlashLoanDeployer
- type SynapseBridgeDeployer
- type SynapseBridgeV1Deployer
Constants ¶
const ( // BridgeConfigTypeV3 is the bridge config contract type. BridgeConfigTypeV3 contractTypeImpl = iota // SynapseBridgeType is the bridge contract type. SynapseBridgeType // SwapFlashLoanType is the swap contract type. SwapFlashLoanType // SynapseBridgeV1Type is the swap contract type. SynapseBridgeV1Type // MessageBusType is the messagebus contract type. MessageBusType // MetaSwapType is the metaswap contract type. MetaSwapType // CCTPType is cctp contract type. CCTPType // FastBridgeType is the rfq (fastbridge) contract type. FastBridgeType )
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 NewCCTPDeployer ¶ added in v0.0.138
func NewCCTPDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer
NewCCTPDeployer creates a new cctp client.
func NewFastBridgeDeployer ¶ added in v0.4.4
func NewFastBridgeDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer
NewFastBridgeDeployer creates a new fastbridge client.
func NewMessageBusDeployer ¶ added in v0.0.19
func NewMessageBusDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer
NewMessageBusDeployer creates a new message bus client.
func NewMetaSwapDeployer ¶ added in v0.0.81
func NewMetaSwapDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer
NewMetaSwapDeployer creates a new meta swap client.
func NewSwapFlashLoanDeployer ¶
func NewSwapFlashLoanDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer
NewSwapFlashLoanDeployer creates a new flash loan client.
func NewSynapseBridgeDeployer ¶
func NewSynapseBridgeDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer
NewSynapseBridgeDeployer creates a new bridge client.
func NewSynapseBridgeV1Deployer ¶ added in v0.0.15
func NewSynapseBridgeV1Deployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer
NewSynapseBridgeV1Deployer creates a new bridge v1 client.
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 contract
type CCTPDeployer ¶ added in v0.0.138
type CCTPDeployer struct {
*deployer.BaseDeployer
}
CCTPDeployer is the type of the cctp deployer.
func (CCTPDeployer) Deploy ¶ added in v0.0.138
func (n CCTPDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys CCTP contract
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 NewTestEnvDB ¶
func NewTestEnvDB(ctx context.Context, t *testing.T, handler metrics.Handler) (db db.ConsumerDB, eventDB scribedb.EventDB, gqlClient *client.Client, logIndex atomic.Int64, cleanup func(), testBackend backends.SimulatedTestBackend, deployManager *DeployManager)
NewTestEnvDB sets up the test env with a database.
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) GetCCTP ¶ added in v0.0.138
func (d *DeployManager) GetCCTP(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *cctp.CCTPRef)
GetCCTP gets a typecast cctp.
func (*DeployManager) GetFastBridge ¶ added in v0.4.4
func (d *DeployManager) GetFastBridge(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *fastbridge.FastBridgeRef)
GetFastBridge gets a typecast fastbridge.
func (*DeployManager) GetMessageBus ¶ added in v0.0.19
func (d *DeployManager) GetMessageBus(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *messagebus.MessageBusRef)
GetMessageBus gets a typecast message bus contract.
func (*DeployManager) GetMetaSwap ¶ added in v0.0.81
func (d *DeployManager) GetMetaSwap(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *metaswap.MetaSwapRef)
GetMetaSwap gets a typecast meta swap.
func (*DeployManager) GetSwapFlashLoan ¶
func (d *DeployManager) GetSwapFlashLoan(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *swap.SwapRef)
GetSwapFlashLoan gets a typecast swap contract.
func (*DeployManager) GetSynapseBridge ¶
func (d *DeployManager) GetSynapseBridge(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *bridge.BridgeRef)
GetSynapseBridge gets a typecast bridge contract.
func (*DeployManager) GetSynapseBridgeV1 ¶ added in v0.0.15
func (d *DeployManager) GetSynapseBridgeV1(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *bridgev1.BridgeRef)
GetSynapseBridgeV1 gets a typecast bridge v1 contract.
type FastBridgeDeployer ¶ added in v0.4.4
type FastBridgeDeployer struct {
*deployer.BaseDeployer
}
FastBridgeDeployer is the type of the rfq (fastbridge) deployer.
func (FastBridgeDeployer) Deploy ¶ added in v0.4.4
func (n FastBridgeDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys RFQ contract
type MessageBusDeployer ¶ added in v0.0.19
type MessageBusDeployer struct {
*deployer.BaseDeployer
}
MessageBusDeployer is the type of the message bus deployer.
func (MessageBusDeployer) Deploy ¶ added in v0.0.19
func (n MessageBusDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys Message Bus contract
type MetaSwapDeployer ¶ added in v0.0.81
type MetaSwapDeployer struct {
*deployer.BaseDeployer
}
MetaSwapDeployer is the type of the meta swap deployer.
func (MetaSwapDeployer) Deploy ¶ added in v0.0.81
func (n MetaSwapDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys Meta Swap contract
type SwapFlashLoanDeployer ¶
type SwapFlashLoanDeployer struct {
*deployer.BaseDeployer
}
SwapFlashLoanDeployer is the type of the swap flash loan deployer.
func (SwapFlashLoanDeployer) Deploy ¶
func (n SwapFlashLoanDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys Swap Flash Loan contract
type SynapseBridgeDeployer ¶
type SynapseBridgeDeployer struct {
*deployer.BaseDeployer
}
SynapseBridgeDeployer is the type of the bridge deployer.
func (SynapseBridgeDeployer) Deploy ¶
func (n SynapseBridgeDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys Synapse Bridge contract
type SynapseBridgeV1Deployer ¶ added in v0.0.15
type SynapseBridgeV1Deployer struct {
*deployer.BaseDeployer
}
SynapseBridgeV1Deployer is the type of the swap flash loan deployer.
func (SynapseBridgeV1Deployer) Deploy ¶ added in v0.0.15
func (n SynapseBridgeV1Deployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys Synapse Bridge V1 contract
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package clickhouse spins up a temp clickhouse db with docker.
|
Package clickhouse spins up a temp clickhouse db with docker. |
Package testcontracts provides a set of test contracts for use in tests.
|
Package testcontracts provides a set of test contracts for use in tests. |