icon

package
v0.0.0-...-1129cfb Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewIconRemotenet

func NewIconRemotenet(testName string, log *zap.Logger, chainConfig chains.ChainConfig, client *client.Client, network string, testconfig *testconfig.Chain) chains.Chain

Types

type DebugTrace

type DebugTrace struct {
	Logs []struct {
		Level   uint   `json:"level"`
		Message string `json:"msg"`
		Ts      int    `json:"ts"`
	} `json:"logs"`
	Status icontypes.HexInt `json:"status"`
}

type IconRemotenet

type IconRemotenet struct {
	IBCAddresses map[string]string     `json:"addresses"`
	Wallets      map[string]ibc.Wallet `json:"wallets"`
	Client       *client.Client
	Network      string

	IconClient iconclient.Client
	// contains filtered or unexported fields
}

func (*IconRemotenet) BackupConfig

func (in *IconRemotenet) BackupConfig() ([]byte, error)

func (*IconRemotenet) BinCommand

func (in *IconRemotenet) BinCommand(command ...string) []string

func (*IconRemotenet) Config

func (in *IconRemotenet) Config() chains.ChainConfig

Config fetches the chain configuration.

func (*IconRemotenet) DeployContractRemote

func (in *IconRemotenet) DeployContractRemote(ctx context.Context, contractPath, keystorePath, initMessage string) (string, error)

func (*IconRemotenet) DeployXCallMockApp

func (in *IconRemotenet) DeployXCallMockApp(ctx context.Context, keyName string, connections []chains.XCallConnection) error

func (*IconRemotenet) Exec

func (in *IconRemotenet) Exec(ctx context.Context, cmd []string, env []string) (stdout []byte, stderr []byte, err error)

Exec runs an arbitrary command using Chain's docker environment. Whether the invoked command is run in a one-off container or execing into an already running container is up to the chain implementation.

"env" are environment variables in the format "MY_ENV_VAR=value"

func (*IconRemotenet) ExecBin

func (in *IconRemotenet) ExecBin(ctx context.Context, command ...string) ([]byte, []byte, error)

func (*IconRemotenet) ExecCallTx

func (in *IconRemotenet) ExecCallTx(ctx context.Context, scoreAddress, methodName, keystorePath, params string) (string, error)

func (*IconRemotenet) ExecCallTxCommand

func (in *IconRemotenet) ExecCallTxCommand(ctx context.Context, scoreAddress, methodName, keystorePath, params string) []string

func (*IconRemotenet) ExecTx

func (in *IconRemotenet) ExecTx(ctx context.Context, initMessage string, filePath string, keystorePath string, command ...string) (string, error)

func (*IconRemotenet) ExecuteRemoteContract

func (in *IconRemotenet) ExecuteRemoteContract(ctx context.Context, scoreAddress, methodName, keyStorePath, params string) (string, error)

func (*IconRemotenet) FindCallMessage

func (in *IconRemotenet) FindCallMessage(ctx context.Context, startHeight uint64, from, to, sn string) (string, string, error)

func (*IconRemotenet) FindCallResponse

func (in *IconRemotenet) FindCallResponse(ctx context.Context, startHeight uint64, sn string) (string, error)

func (*IconRemotenet) FindEvent

func (in *IconRemotenet) FindEvent(ctx context.Context, startHeight uint64, contract, signature string, index []*string) (*icontypes.EventNotification, error)

func (*IconRemotenet) FindRollbackExecutedMessage

func (in *IconRemotenet) FindRollbackExecutedMessage(ctx context.Context, startHeight uint64, sn string) (string, error)

func (*IconRemotenet) FindTargetXCallMessage

func (in *IconRemotenet) FindTargetXCallMessage(ctx context.Context, target chains.Chain, height uint64, to string) (*chains.XCallResponse, error)

FindTargetXCallMessage returns the request id and the data of the message sent to the target chain

func (*IconRemotenet) GetContractAddress

func (in *IconRemotenet) GetContractAddress(key string) string

func (*IconRemotenet) GetDebugTrace

func (in *IconRemotenet) GetDebugTrace(ctx context.Context, hash icontypes.HexBytes) (*DebugTrace, error)

func (*IconRemotenet) GetGRPCAddress

func (in *IconRemotenet) GetGRPCAddress() string

GetGRPCAddress retrieves the grpc address that can be reached by other containers in the docker network. Not Applicable for Icon

func (*IconRemotenet) GetGasFeesInNativeDenom

func (in *IconRemotenet) GetGasFeesInNativeDenom(gasPaid int64) int64

GetGasFeesInNativeDenom gets the fees in native denom for an amount of spent gas.

func (*IconRemotenet) GetHostGRPCAddress

func (in *IconRemotenet) GetHostGRPCAddress() string

GetHostGRPCAddress returns the grpc address that can be reached by processes on the host machine. Note that this will not return a valid value until after Start returns. Not applicable for Icon

func (*IconRemotenet) GetHostRPCAddress

func (in *IconRemotenet) GetHostRPCAddress() string

GetHostRPCAddress returns the rpc address that can be reached by processes on the host machine. Note that this will not return a valid value until after Start returns.

func (*IconRemotenet) GetRPCAddress

func (in *IconRemotenet) GetRPCAddress() string

GetRPCAddress retrieves the rpc address that can be reached by other containers in the docker network.

func (*IconRemotenet) GetRelayConfig

func (in *IconRemotenet) GetRelayConfig(ctx context.Context, rlyHome string, keyName string) ([]byte, error)

func (*IconRemotenet) Height

func (in *IconRemotenet) Height(ctx context.Context) (uint64, error)

Height returns the current block height or an error if unable to get current height.

func (*IconRemotenet) HomeDir

func (in *IconRemotenet) HomeDir() string

HomeDir is the home directory of a node running in a docker container. Therefore, this maps to the container's filesystem (not the host).

func (*IconRemotenet) IsPacketReceived

func (in *IconRemotenet) IsPacketReceived(ctx context.Context, params map[string]interface{}, order ibc.Order) bool

HasPacketReceipt returns the receipt of the packet sent to the target chain

func (*IconRemotenet) NodeCommand

func (in *IconRemotenet) NodeCommand(command ...string) []string

func (*IconRemotenet) RestoreConfig

func (in *IconRemotenet) RestoreConfig(backup []byte) error

func (*IconRemotenet) SendPacketXCall

func (in *IconRemotenet) SendPacketXCall(ctx context.Context, keyName, _to string, data, rollback []byte) (context.Context, error)

func (*IconRemotenet) SetupConnection

func (in *IconRemotenet) SetupConnection(ctx context.Context, target chains.Chain) error

func (*IconRemotenet) SetupXCall

func (in *IconRemotenet) SetupXCall(ctx context.Context) error

func (*IconRemotenet) TransactionResult

func (in *IconRemotenet) TransactionResult(ctx context.Context, hash string) (*icontypes.TransactionResult, error)

func (*IconRemotenet) TxCommand

func (in *IconRemotenet) TxCommand(ctx context.Context, initMessage, filePath, keystorePath string, command ...string) []string

TxCommand is a helper to retrieve a full command for broadcasting a tx with the chain node binary.

func (*IconRemotenet) XCall

func (in *IconRemotenet) XCall(ctx context.Context, targetChain chains.Chain, keyName, to string, data, rollback []byte) (*chains.XCallResponse, error)

type Query

type Query struct {
	MethodName string
	Value      Value
}

type Value

type Value struct {
	Params map[string]interface{} `json:"params,omitempty"`
}

type WebSocketListener

type WebSocketListener struct {
	Shutdown chan struct{}
	Events   []map[string][]string
	// contains filtered or unexported fields
}

func NewIconEventListener

func NewIconEventListener(c *IconRemotenet, contract string) *WebSocketListener

func (*WebSocketListener) FindEvent

func (w *WebSocketListener) FindEvent(filters chains.Filter) (chains.Event, error)

func (*WebSocketListener) Start

func (w *WebSocketListener) Start()

func (*WebSocketListener) Stop

func (w *WebSocketListener) Stop()

Jump to

Keyboard shortcuts

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