stellar

package
v0.0.0-...-f76b1da Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStellarRemotenet

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

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(rpcUrl string, httpCl *http.Client) (*Client, error)

func (*Client) CallContext

func (c *Client) CallContext(ctx context.Context, result interface{}, method string, params interface{}) error

func (*Client) GetEvent

func (c *Client) GetEvent(ctx context.Context, height uint64, inputSn, contractId, eventSignature string) (*EventResponseEvent, error)

func (*Client) GetLatestLedger

func (c *Client) GetLatestLedger(ctx context.Context) (*LatestLedgerResponse, error)

type EventQueryFilter

type EventQueryFilter struct {
	StartLedger uint64     `json:"startLedger"`
	Pagination  Pagination `json:"pagination"`
	Filters     []Filter   `json:"filters"`
}

type EventResponse

type EventResponse struct {
	Events []EventResponseEvent `json:"events"`
}

type EventResponseEvent

type EventResponseEvent struct {
	Type         string   `json:"type"`
	ContractId   string   `json:"contractID"`
	Topic        []string `json:"topic"`
	Value        string   `json:"value"`
	ValueDecoded map[string]interface{}
}

type Filter

type Filter struct {
	Type        string   `json:"type"`
	ContractIDS []string `json:"contractIds"`
}

type HTTPError

type HTTPError struct {
	StatusCode int
	Status     string
	Body       []byte
}

func (HTTPError) Error

func (err HTTPError) Error() string

type LatestLedgerResponse

type LatestLedgerResponse struct {
	ID              string `json:"id"`
	ProtocolVersion uint64 `json:"protocolVersion"`
	Sequence        uint64 `json:"sequence"`
}

type Pagination

type Pagination struct {
	Limit uint64 `json:"limit"`
}

type StellarMessage

type StellarMessage struct {
	Params          []string
	Method          string
	PackageObjectId string
	Module          string
}

func (*StellarMessage) MsgBytes

func (m *StellarMessage) MsgBytes() ([]byte, error)

func (*StellarMessage) Type

func (m *StellarMessage) Type() string

type StellarRemotenet

type StellarRemotenet struct {
	IBCAddresses map[string]string     `json:"addresses"`
	Wallets      map[string]ibc.Wallet `json:"wallets"`
	Client       *client.Client
	Network      string
	// contains filtered or unexported fields
}

func (*StellarRemotenet) BackupConfig

func (sn *StellarRemotenet) BackupConfig() ([]byte, error)

func (*StellarRemotenet) BinCommand

func (sn *StellarRemotenet) BinCommand(command ...string) []string

func (*StellarRemotenet) Config

func (sn *StellarRemotenet) Config() chains.ChainConfig

Config fetches the chain configuration.

func (*StellarRemotenet) DeployContract

func (sn *StellarRemotenet) DeployContract(ctx context.Context, keyName string) (context.Context, error)

Remote implements chains.Chain

func (*StellarRemotenet) DeployContractRemote

func (sn *StellarRemotenet) DeployContractRemote(ctx context.Context, contractPath string) (string, error)

func (*StellarRemotenet) DeployXCallMockApp

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

func (*StellarRemotenet) Exec

func (sn *StellarRemotenet) 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 (*StellarRemotenet) ExecBin

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

func (*StellarRemotenet) ExecCallTx

func (sn *StellarRemotenet) ExecCallTx(ctx context.Context, scoreAddress, methodName string, params map[string]string) (string, error)

func (*StellarRemotenet) ExecCallTxCommand

func (sn *StellarRemotenet) ExecCallTxCommand(ctx context.Context, scoreAddress, methodName string, params map[string]string) []string

func (*StellarRemotenet) ExecTx

func (sn *StellarRemotenet) ExecTx(ctx context.Context, filePath string, command ...string) (string, error)

func (*StellarRemotenet) ExportState

func (sn *StellarRemotenet) ExportState(ctx context.Context, height int64) (string, error)

ExportState exports the chain state at specific height.

func (*StellarRemotenet) FindCallMessage

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

func (*StellarRemotenet) FindCallResponse

func (sn *StellarRemotenet) FindCallResponse(ctx context.Context, startHeight uint64, sno string) (string, error)

func (*StellarRemotenet) FindEvent

func (sn *StellarRemotenet) FindEvent(ctx context.Context, startHeight uint64, contract, signature, sno string) (*EventResponseEvent, error)

func (*StellarRemotenet) FindRollbackExecutedMessage

func (sn *StellarRemotenet) FindRollbackExecutedMessage(ctx context.Context, startHeight uint64, sno string) (string, error)

func (*StellarRemotenet) FindTargetXCallMessage

func (sn *StellarRemotenet) 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 (*StellarRemotenet) GetAddress

func (sn *StellarRemotenet) GetAddress(ctx context.Context, keyName string) ([]byte, error)

GetAddress fetches the bech32 address for a test key on the "user" node (either the first fullnode or the first validator if no fullnodes).

func (*StellarRemotenet) GetClientBlockByHeight

func (sn *StellarRemotenet) GetClientBlockByHeight(ctx context.Context, height int64) (string, error)

GetBlockByHeight implements chains.Chain

func (*StellarRemotenet) GetContractAddress

func (sn *StellarRemotenet) GetContractAddress(key string) string

func (*StellarRemotenet) GetGRPCAddress

func (sn *StellarRemotenet) GetGRPCAddress() string

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

func (*StellarRemotenet) GetGasFeesInNativeDenom

func (sn *StellarRemotenet) GetGasFeesInNativeDenom(gasPaid int64) int64

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

func (*StellarRemotenet) GetHostGRPCAddress

func (sn *StellarRemotenet) 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 (*StellarRemotenet) GetHostRPCAddress

func (sn *StellarRemotenet) 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 (*StellarRemotenet) GetLastBlock

func (sn *StellarRemotenet) GetLastBlock(ctx context.Context) (context.Context, error)

GetLastBlock implements chains.Chain

func (*StellarRemotenet) GetRPCAddress

func (sn *StellarRemotenet) GetRPCAddress() string

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

func (*StellarRemotenet) GetRelayConfig

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

func (*StellarRemotenet) Height

func (sn *StellarRemotenet) Height(ctx context.Context) (uint64, error)

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

func (*StellarRemotenet) IsPacketReceived

func (sn *StellarRemotenet) 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 (*StellarRemotenet) NodeCommand

func (sn *StellarRemotenet) NodeCommand(command ...string) []string

func (*StellarRemotenet) QueryContract

func (sn *StellarRemotenet) QueryContract(ctx context.Context, contractAddress, methodName string, params map[string]interface{}) (context.Context, error)

QueryContract implements chains.Chain

func (*StellarRemotenet) RestoreConfig

func (sn *StellarRemotenet) RestoreConfig(backup []byte) error

func (*StellarRemotenet) SendPacketXCall

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

func (*StellarRemotenet) SetupConnection

func (sn *StellarRemotenet) SetupConnection(ctx context.Context, target chains.Chain) error

func (*StellarRemotenet) SetupXCall

func (sn *StellarRemotenet) SetupXCall(ctx context.Context) error

func (*StellarRemotenet) TxCommand

func (sn *StellarRemotenet) TxCommand(ctx context.Context, filePath string, command ...string) []string

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

func (*StellarRemotenet) XCall

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

Jump to

Keyboard shortcuts

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