testutil

package
v1.21.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 18, 2024 License: MIT Imports: 40 Imported by: 0

Documentation

Overview

Package testutil is used for deploying test contracts and generic testing functions

Index

Constants

View Source
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

View Source
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

NewCCTPDeployer creates a new cctp client.

func NewFastBridgeDeployer added in v0.4.4

NewFastBridgeDeployer creates a new fastbridge client.

func NewMessageBusDeployer added in v0.0.19

NewMessageBusDeployer creates a new message bus client.

func NewMetaSwapDeployer added in v0.0.81

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

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

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

GetFastBridge gets a typecast fastbridge.

func (*DeployManager) GetMessageBus added in v0.0.19

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

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

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

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

Deploy deploys Swap Flash Loan contract

type SynapseBridgeDeployer

type SynapseBridgeDeployer struct {
	*deployer.BaseDeployer
}

SynapseBridgeDeployer is the type of the bridge deployer.

func (SynapseBridgeDeployer) Deploy

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

Deploy deploys Synapse Bridge V1 contract

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL