node_v1

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

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

Handler manages channel state transitions and provides RPC endpoints for state submission.

func NewHandler

func NewHandler(
	memoryStore MemoryStore,
	nodeAddress string,
	nodeVersion string,
) *Handler

NewHandler creates a new Handler instance with the provided dependencies.

func (*Handler) GetAssets

func (h *Handler) GetAssets(c *rpc.Context)

GetAssets retrieves the current assets of the Node.

func (*Handler) GetConfig

func (h *Handler) GetConfig(c *rpc.Context)

GetConfig retrieves the current configuration of the Node.

func (*Handler) Ping

func (h *Handler) Ping(c *rpc.Context)

Ping handles the ping request and responds with the ping method.

type MemoryStore

type MemoryStore interface {
	// GetBlockchains retrieves the list of supported blockchains.
	GetBlockchains() ([]core.Blockchain, error)

	// GetAssets retrieves the list of supported assets.
	// If blockchainID is provided, filters assets to only include tokens on that blockchain.
	GetAssets(blockchainID *uint64) ([]core.Asset, error)
}

MemoryStore defines an in-memory data store interface for retrieving supported blockchains and assets.

type MockMemoryStore

type MockMemoryStore struct {
	mock.Mock
}

MockMemoryStore is a mock implementation of the MemoryStore interface

func (*MockMemoryStore) GetAssets

func (m *MockMemoryStore) GetAssets(blockchainID *uint64) ([]core.Asset, error)

func (*MockMemoryStore) GetBlockchains

func (m *MockMemoryStore) GetBlockchains() ([]core.Blockchain, error)

Jump to

Keyboard shortcuts

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