Documentation ¶
Overview ¶
Package testutil contains mock deployers for interacting with the mock backend
Index ¶
- Constants
- Variables
- func NewMockMessageTransmitterDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewMockMintBurnTokenDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewMockTokenMessengerDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewMockTokenMinterDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- func NewSynapseCCTPDeployer(registry deployer.GetOnlyContractRegistry, ...) deployer.ContractDeployer
- type DeployManager
- func (d *DeployManager) GetMockMessageTransmitterType(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, ...)
- func (d *DeployManager) GetMockMintBurnTokenType(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, ...)
- func (d *DeployManager) GetMockTokenMessengerType(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, ...)
- func (d *DeployManager) GetMockTokenMinter(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, ...)
- func (d *DeployManager) GetSynapseCCTP(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *cctp.SynapseCCTPRef)
- type MockMessageTransmitterDeployer
- type MockMintBurnTokenDeployer
- type MockTokenMessengerDeployer
- type MockTokenMinterDeployer
- type SynapseCCTPDeployer
Constants ¶
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 ¶
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.
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 ¶
func NewSynapseCCTPDeployer(registry deployer.GetOnlyContractRegistry, backend backends.SimulatedTestBackend) deployer.ContractDeployer
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 ¶
func (d *DeployManager) GetMockMessageTransmitterType(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *mockmessagetransmitter.MockMessageTransmitterRef)
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 ¶
func (d *DeployManager) GetMockTokenMinter(ctx context.Context, backend backends.SimulatedTestBackend) (contract contracts.DeployedContract, handle *mocktokenminter.MockTokenMinterRef)
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 ¶
func (d MockMessageTransmitterDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys the light manager contract.
type MockMintBurnTokenDeployer ¶
type MockMintBurnTokenDeployer struct {
*deployer.BaseDeployer
}
MockMintBurnTokenDeployer deploys the mocktokenminter.
func (MockMintBurnTokenDeployer) Dependencies ¶
func (m MockMintBurnTokenDeployer) Dependencies() []contracts.ContractType
Dependencies returns the dependencies of the mock mint burn token.
func (MockMintBurnTokenDeployer) Deploy ¶
func (m MockMintBurnTokenDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys the mock mint burn token contract.
type MockTokenMessengerDeployer ¶
type MockTokenMessengerDeployer struct {
*deployer.BaseDeployer
}
MockTokenMessengerDeployer deploys the mocktokenmessenger.
func (MockTokenMessengerDeployer) Dependencies ¶
func (m MockTokenMessengerDeployer) Dependencies() []contracts.ContractType
Dependencies returns the dependencies of the mocktokenmessenger.
func (MockTokenMessengerDeployer) Deploy ¶
func (m MockTokenMessengerDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
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 ¶
func (m MockTokenMinterDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
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 ¶
func (d SynapseCCTPDeployer) Deploy(ctx context.Context) (contracts.DeployedContract, error)
Deploy deploys the light manager contract.