testutil

package
v0.0.47 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package testutil contains mock deployers for interacting with the mock backend

Index

Constants

View Source
const (
	// SynapseCCTPType is the type of the synapse cctp contract.
	SynapseCCTPType contractTypeImpl = iota + 1 // SynapseCCTP
	// MockMessageTransmitterType is the type of the mock message transmitter contract.
	MockMessageTransmitterType // MockMessageTransmitter
	// MockTokenMessengerType is the type of the mock token messenger contract.
	MockTokenMessengerType // MockTokenMessenger
	// MockMintBurnTokenType is the type of the mock token messenger contract.
	MockMintBurnTokenType // MockMintBurnToken
	// MockTokenMinterType is the type of the mock token minter contract.
	MockTokenMinterType // MockTokenMinter
)

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.

View Source
var ChainIDDomainMap = map[uint32]uint32{
	1:     0,
	43114: 1,
}

ChainIDDomainMap maps chain IDs to domains. see: https://developers.circle.com/stablecoin/docs/cctp-technical-reference#domain TODO: make this eaiser to debug in the case of missing domains, etc.

Functions

func NewMockMessageTransmitterDeployer

func NewMockMessageTransmitterDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer

NewMockMessageTransmitterDeployer deploys the light inbox contract.

func NewMockMintBurnTokenDeployer

func NewMockMintBurnTokenDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer

NewMockMintBurnTokenDeployer deploys the mocktokenmessenger.

func NewMockTokenMessengerDeployer

func NewMockTokenMessengerDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer

NewMockTokenMessengerDeployer deploys the mocktokenmessenger.

func NewMockTokenMinterDeployer

func NewMockTokenMinterDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer

NewMockTokenMinterDeployer deploys the mocktokenminter.

func NewSynapseCCTPDeployer

NewSynapseCCTPDeployer deploys the synapse cctp 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 deploy manager.

func (*DeployManager) GetMockMessageTransmitterType

GetMockMessageTransmitterType gets a mock token message transmitter contract.

func (*DeployManager) GetMockMintBurnTokenType

func (d *DeployManager) GetMockMintBurnTokenType(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *mockmintburntoken.MockMintBurnTokenRef)

GetMockMintBurnTokenType gets a mock token transmitter contract.

func (*DeployManager) GetMockTokenMessengerType

func (d *DeployManager) GetMockTokenMessengerType(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *mocktokenmessenger.MockTokenMessengerRef)

GetMockTokenMessengerType gets a mock token transmitter contract.

func (*DeployManager) GetMockTokenMinter

GetMockTokenMinter gets a mock token minter contract.

func (*DeployManager) GetSynapseCCTP

func (d *DeployManager) GetSynapseCCTP(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *cctp.SynapseCCTPRef)

GetSynapseCCTP gets a typecast synapsecctp contract.

type MockMessageTransmitterDeployer

type MockMessageTransmitterDeployer struct {
	*deployer.BaseDeployer
}

MockMessageTransmitterDeployer deploys the mockmessagetransmitter.

func (MockMessageTransmitterDeployer) Deploy

Deploy deploys the light manager contract.

type MockMintBurnTokenDeployer

type MockMintBurnTokenDeployer struct {
	*deployer.BaseDeployer
}

MockMintBurnTokenDeployer deploys the mocktokenminter.

func (MockMintBurnTokenDeployer) Dependencies

Dependencies returns the dependencies of the mock mint burn token.

func (MockMintBurnTokenDeployer) Deploy

Deploy deploys the mock mint burn token contract.

type MockTokenMessengerDeployer

type MockTokenMessengerDeployer struct {
	*deployer.BaseDeployer
}

MockTokenMessengerDeployer deploys the mocktokenmessenger.

func (MockTokenMessengerDeployer) Dependencies

Dependencies returns the dependencies of the mocktokenmessenger.

func (MockTokenMessengerDeployer) Deploy

Deploy deploys the mock token messenger contract.

type MockTokenMinterDeployer

type MockTokenMinterDeployer struct {
	*deployer.BaseDeployer
}

MockTokenMinterDeployer deploys the mocktokenminter.

func (MockTokenMinterDeployer) Dependencies

func (m MockTokenMinterDeployer) Dependencies() []contracts.ContractType

Dependencies returns the dependencies of the mock token minter.

func (MockTokenMinterDeployer) Deploy

Deploy deploys the mock token minter contract.

type SynapseCCTPDeployer

type SynapseCCTPDeployer struct {
	*deployer.BaseDeployer
}

SynapseCCTPDeployer deploys the synapse cctp contract.

func (SynapseCCTPDeployer) Dependencies

func (d SynapseCCTPDeployer) Dependencies() []contracts.ContractType

Dependencies returns the dependencies of the SynapseCCTP contract.

func (SynapseCCTPDeployer) Deploy

Deploy deploys the light manager contract.

Jump to

Keyboard shortcuts

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