Documentation ¶
Overview ¶
Package testutil implements utilities for testing the RFQ Quoter. TODO: deduplicate with
Index ¶
- Constants
- type ITestContractHandler
- type TestContractHandlerImpl
- func (t *TestContractHandlerImpl) ChainID() uint32
- func (t *TestContractHandlerImpl) FBExecuteBridge(ctx context.Context, bridgeParams bindings2.IFastBridgeBridgeParams) (*types.Transaction, error)
- func (t *TestContractHandlerImpl) FBExecuteClaim(ctx context.Context, request []byte, to common.Address) (*types.Transaction, error)
- func (t *TestContractHandlerImpl) FBExecuteProve(ctx context.Context, request []byte, destTxHash [32]byte) (*types.Transaction, error)
- func (t *TestContractHandlerImpl) FBExecuteRelay(ctx context.Context, request []byte) (*types.Transaction, error)
- func (t *TestContractHandlerImpl) FastBridgeAddress() common.Address
- func (t *TestContractHandlerImpl) TestWallet() wallet.Wallet
- func (t *TestContractHandlerImpl) Tokens() []TokenContract
- type TokenContract
Constants ¶
const ( // DefaultMintAmount is the default amount of tokens to mint. DefaultMintAmount = params.Ether // NumberOfTokens is the number of tokens to create. NumberOfTokens = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ITestContractHandler ¶
type ITestContractHandler interface { // ChainID returns the chain ID of the contract handler. ChainID() uint32 // FastBridgeAddress returns the address of the fast bridge contract. FastBridgeAddress() common.Address // Tokens returns the list of tokens. Tokens() []TokenContract // FBExecuteBridge executes the bridge function on the fast bridge contract. FBExecuteBridge(ctx context.Context, bridgeParams bindings2.IFastBridgeBridgeParams) (*types.Transaction, error) // FBExecuteRelay executes the relay function on the fast bridge contract. FBExecuteRelay(ctx context.Context, request []byte) (*types.Transaction, error) // FBExecuteProve executes the prove function on the fast bridge contract. FBExecuteProve(ctx context.Context, request []byte, destTxHash [32]byte) (*types.Transaction, error) // FBExecuteClaim executes the claim function on the fast bridge contract. Will likely be unused. FBExecuteClaim(ctx context.Context, request []byte, to common.Address) (*types.Transaction, error) // TestWallet returns the test wallet. TestWallet() wallet.Wallet }
ITestContractHandler is the interface for the handling contracts on a given chain.
func NewTestContractHandlerImpl ¶
func NewTestContractHandlerImpl(ctx context.Context, anvilBackend backends.SimulatedTestBackend, testWallet wallet.Wallet, chainID uint32) (ITestContractHandler, error)
NewTestContractHandlerImpl creates a new instance of the ITestContractHandler interface. TODO: just get chainid from rpc, don't require passing.
type TestContractHandlerImpl ¶
type TestContractHandlerImpl struct {
// contains filtered or unexported fields
}
TestContractHandlerImpl is the implementation of the ITestContractHandler interface.
func (*TestContractHandlerImpl) ChainID ¶
func (t *TestContractHandlerImpl) ChainID() uint32
ChainID returns the chain ID of the contract handler.
func (*TestContractHandlerImpl) FBExecuteBridge ¶
func (t *TestContractHandlerImpl) FBExecuteBridge(ctx context.Context, bridgeParams bindings2.IFastBridgeBridgeParams) (*types.Transaction, error)
FBExecuteBridge executes the bridge function on the fast bridge contract.
func (*TestContractHandlerImpl) FBExecuteClaim ¶
func (t *TestContractHandlerImpl) FBExecuteClaim(ctx context.Context, request []byte, to common.Address) (*types.Transaction, error)
FBExecuteClaim executes the claim function on the fast bridge contract. Will likely be unused.
func (*TestContractHandlerImpl) FBExecuteProve ¶
func (t *TestContractHandlerImpl) FBExecuteProve(ctx context.Context, request []byte, destTxHash [32]byte) (*types.Transaction, error)
FBExecuteProve executes the prove function on the fast bridge contract.
func (*TestContractHandlerImpl) FBExecuteRelay ¶
func (t *TestContractHandlerImpl) FBExecuteRelay(ctx context.Context, request []byte) (*types.Transaction, error)
FBExecuteRelay executes the relay function on the fast bridge contract.
func (*TestContractHandlerImpl) FastBridgeAddress ¶
func (t *TestContractHandlerImpl) FastBridgeAddress() common.Address
FastBridgeAddress returns the address of the fast bridge contract.
func (*TestContractHandlerImpl) TestWallet ¶
func (t *TestContractHandlerImpl) TestWallet() wallet.Wallet
TestWallet returns the test wallet.
func (*TestContractHandlerImpl) Tokens ¶
func (t *TestContractHandlerImpl) Tokens() []TokenContract
Tokens returns the list of tokens.