ethereum

package
v0.0.0-...-5628e88 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContractConfig

type ContractConfig interface {
	GetIBCHostAddress() common.Address
	GetIBCHandlerAddress() common.Address
	GetIBCIdentifierAddress() common.Address
	GetIBFT2ClientAddress() common.Address
	GetMockClientAddress() common.Address

	GetSimpleTokenAddress() common.Address
	GetICS20TransferBankAddress() common.Address
	GetICS20BankAddress() common.Address
}

type TestChain

type TestChain struct {
	IBCHandler    ibchandler.Ibchandler
	IBCHost       ibchost.Ibchost
	IBCIdentifier ibcidentifier.Ibcidentifier

	// App Modules
	SimpleToken   simpletoken.Simpletoken
	ICS20Transfer ics20transferbank.Ics20transferbank
	ICS20Bank     ics20bank.Ics20bank

	ContractConfig ContractConfig

	// State
	LastContractState map[string]client.ContractState

	Codec codec.BinaryCodec
	// contains filtered or unexported fields
}

func NewChain

func NewChain(t *testing.T, chainClient client.ChainClient, config ContractConfig, mnemonicPhrase string) *TestChain

func (*TestChain) CallOpts

func (chain *TestChain) CallOpts(ctx context.Context, index uint32) *bind.CallOpts

func (*TestChain) ChainID

func (chain *TestChain) ChainID() string

func (*TestChain) ChannelOpenAck

func (chain *TestChain) ChannelOpenAck(ctx context.Context, msg ibctestingtypes.MsgChannelOpenAck) error

func (*TestChain) ChannelOpenConfirm

func (chain *TestChain) ChannelOpenConfirm(ctx context.Context, msg ibctestingtypes.MsgChannelOpenConfirm) error

func (*TestChain) ChannelOpenInit

func (chain *TestChain) ChannelOpenInit(ctx context.Context, msg ibctestingtypes.MsgChannelOpenInit) (string, error)

func (*TestChain) ChannelOpenTry

func (chain *TestChain) ChannelOpenTry(ctx context.Context, msg ibctestingtypes.MsgChannelOpenTry) (string, error)

func (*TestChain) ChannelStateCommitmentKey

func (chain *TestChain) ChannelStateCommitmentKey(portID, channelID string) []byte

func (*TestChain) Client

func (chain *TestChain) Client() client.ChainClient

func (*TestChain) ClientStateCommitmentKey

func (chain *TestChain) ClientStateCommitmentKey(clientID string) []byte

func (*TestChain) ConnectionOpenAck

func (chain *TestChain) ConnectionOpenAck(ctx context.Context, msg ibctestingtypes.MsgConnectionOpenAck) error

ConnectionOpenAck will construct and execute a MsgConnectionOpenAck.

func (*TestChain) ConnectionOpenConfirm

func (chain *TestChain) ConnectionOpenConfirm(ctx context.Context, msg ibctestingtypes.MsgConnectionOpenConfirm) error

func (*TestChain) ConnectionOpenInit

func (chain *TestChain) ConnectionOpenInit(ctx context.Context, msg ibctestingtypes.MsgConnectionOpenInit) (string, error)

func (*TestChain) ConnectionOpenTry

func (chain *TestChain) ConnectionOpenTry(ctx context.Context, msg ibctestingtypes.MsgConnectionOpenTry) (string, error)

func (*TestChain) ConnectionStateCommitmentKey

func (chain *TestChain) ConnectionStateCommitmentKey(connectionID string) []byte

func (*TestChain) ConsensusStateCommitmentKey

func (chain *TestChain) ConsensusStateCommitmentKey(clientID string, height exported.Height) []byte

func (*TestChain) ConstructMockMsgCreateClient

func (chain *TestChain) ConstructMockMsgCreateClient() ibctestingtypes.MsgCreateClient

func (*TestChain) ConstructMockMsgUpdateClient

func (chain *TestChain) ConstructMockMsgUpdateClient(clientID string) ibctestingtypes.MsgUpdateClient

func (*TestChain) ConstructTendermintMsgCreateClient

func (chain *TestChain) ConstructTendermintMsgCreateClient(
	trustLevel ibctmtypes.Fraction,
	trustingPeriod, unbondingPeriod, maxClockDrift time.Duration,
	upgradePath []string, allowUpdateAfterExpiry, allowUpdateAfterMisbehaviour bool,
) ibctestingtypes.MsgCreateClient

func (*TestChain) ConstructTendermintUpdateTMClientHeader

func (chain *TestChain) ConstructTendermintUpdateTMClientHeader(
	counterparty ibctestingtypes.TestChainI, clientID string,
) ibctestingtypes.MsgUpdateClient

func (*TestChain) ConstructTrustedEthereumMsgCreateClient

func (chain *TestChain) ConstructTrustedEthereumMsgCreateClient(
	publicKey cryptotypes.PubKey,
	diversifier string,
) ibctestingtypes.MsgCreateClient

func (*TestChain) ConstructTrustedEthereumMsgUpdateClient

func (chain *TestChain) ConstructTrustedEthereumMsgUpdateClient(
	clientID string,
	privateKey cryptotypes.PrivKey,
	divisifier string,
) ibctestingtypes.MsgUpdateClient

func (*TestChain) CreateClient

func (chain *TestChain) CreateClient(ctx context.Context, msg ibctestingtypes.MsgCreateClient) (string, error)

func (*TestChain) FindPacket

func (chain *TestChain) FindPacket(
	ctx context.Context,
	sourcePortID string,
	sourceChannel string,
	sequence uint64,
) (exported.PacketI, error)

func (*TestChain) GetChannel

func (chain *TestChain) GetChannel(portID, channelID string) (ibchost.ChannelData, bool, error)

func (*TestChain) GetClientStateBytes

func (chain *TestChain) GetClientStateBytes(clientID string) []byte

func (*TestChain) GetCommitmentPrefix

func (chain *TestChain) GetCommitmentPrefix() []byte

func (*TestChain) GetConnection

func (chain *TestChain) GetConnection(connectionID string) (ibchost.ConnectionEndData, bool, error)

func (*TestChain) GetContractState

func (chain *TestChain) GetContractState(
	storageKeys [][]byte,
	height *big.Int,
	clientType string,
) (client.ContractState, error)

func (*TestChain) GetLastGeneratedChannelID

func (chain *TestChain) GetLastGeneratedChannelID(ctx context.Context) (string, error)

func (*TestChain) GetLastGeneratedClientID

func (chain *TestChain) GetLastGeneratedClientID(ctx context.Context) (string, error)

func (*TestChain) GetLastGeneratedConnectionID

func (chain *TestChain) GetLastGeneratedConnectionID(ctx context.Context) (string, error)

func (*TestChain) GetLastSentPacket

func (chain *TestChain) GetLastSentPacket(
	ctx context.Context,
	sourcePortID string,
	sourceChannel string,
) (exported.PacketI, error)

func (*TestChain) GetLatestHeight

func (chain *TestChain) GetLatestHeight(clientID string, clientType string) (height exported.Height)

func (*TestChain) GetMockClientState

func (chain *TestChain) GetMockClientState(clientID string) *mocktypes.ClientState

func (*TestChain) GetSenderAddress

func (chain *TestChain) GetSenderAddress() string

func (*TestChain) GetTrustedEthClientState

func (chain *TestChain) GetTrustedEthClientState(clientID string) *trustedethereumtypes.ClientState

func (*TestChain) HandlePacketAcknowledgement

func (chain *TestChain) HandlePacketAcknowledgement(
	ctx context.Context,
	packet exported.PacketI,
	acknowledgement []byte,
	proof *ibctestingtypes.Proof,
) error

func (*TestChain) HandlePacketRecv

func (chain *TestChain) HandlePacketRecv(
	ctx context.Context,
	packet exported.PacketI,
	proof *ibctestingtypes.Proof,
) error

func (*TestChain) Init

func (chain *TestChain) Init(chainID string) error

func (*TestChain) LastHeader

func (chain *TestChain) LastHeader(clientType string) *gethtypes.Header

func (*TestChain) MockAcknowledgementProof

func (chain *TestChain) MockAcknowledgementProof(ack []byte, proof *ibctestingtypes.Proof) (*ibctestingtypes.Proof, error)

func (*TestChain) MockChannelProof

func (chain *TestChain) MockChannelProof(portID string, channelID string, proof *ibctestingtypes.Proof) (*ibctestingtypes.Proof, error)

func (*TestChain) MockConnectionProof

func (chain *TestChain) MockConnectionProof(connectionID string, proof *ibctestingtypes.Proof) (*ibctestingtypes.Proof, error)

func (*TestChain) MockPacketProof

func (chain *TestChain) MockPacketProof(packet exported.PacketI, proof *ibctestingtypes.Proof) (*ibctestingtypes.Proof, error)

func (*TestChain) NextBlock

func (chain *TestChain) NextBlock()

func (*TestChain) PacketAcknowledgementCommitmentKey

func (chain *TestChain) PacketAcknowledgementCommitmentKey(portID, channelID string, sequence uint64) []byte

func (*TestChain) PacketCommitmentKey

func (chain *TestChain) PacketCommitmentKey(portID, channelID string, sequence uint64) []byte

func (*TestChain) QueryProofAtHeight

func (chain *TestChain) QueryProofAtHeight(
	storageKeyBytes []byte,
	height exported.Height,
	clientType string,
) (*ibctestingtypes.Proof, error)

Querier

func (*TestChain) T

func (chain *TestChain) T() *testing.T

func (*TestChain) TxOpts

func (chain *TestChain) TxOpts(ctx context.Context, index uint32) *bind.TransactOpts

func (*TestChain) UpdateClient

func (chain *TestChain) UpdateClient(ctx context.Context, msg ibctestingtypes.MsgUpdateClient) error

func (*TestChain) WaitForReceiptAndGet

func (chain *TestChain) WaitForReceiptAndGet(ctx context.Context, tx *gethtypes.Transaction) error

func (*TestChain) WaitIfNoError

func (chain *TestChain) WaitIfNoError(ctx context.Context) func(tx *gethtypes.Transaction, err error) error

Jump to

Keyboard shortcuts

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