app

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: GPL-3.0 Imports: 62 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_solver_app_solver_proto protoreflect.FileDescriptor

Functions

func Run

func Run(ctx context.Context, cfg Config) error

Run starts the solver service.

func WriteConfigTOML

func WriteConfigTOML(cfg Config, logCfg log.Config, path string) error

WriteConfigTOML writes the toml solver config to disk.

Types

type Call added in v0.13.0

type Call = solvernet.Call

type CallGotFormatter added in v0.13.0

type CallGotFormatter struct{}

CallGotFormatter formats the got value of a CallMatcher.

func (CallGotFormatter) Got added in v0.13.0

func (CallGotFormatter) Got(got any) string

type CallMatcher added in v0.13.0

type CallMatcher struct {
	Name string

	To common.Address

	// if omitted, matches any selector
	Selector []byte
}

CallMatcher is a gomock.Matcher for ethereum.CallMsg.

func (CallMatcher) Matches added in v0.13.0

func (m CallMatcher) Matches(x any) bool

func (CallMatcher) String added in v0.13.0

func (m CallMatcher) String() string

type ChainClass added in v0.13.0

type ChainClass string
const (
	ClassDevent  ChainClass = "devnet"
	ClassTestnet ChainClass = "testnet"
	ClassMainnet ChainClass = "mainnet"
)

type CheckRequest added in v0.13.0

type CheckRequest = types.CheckRequest

type CheckResponse added in v0.13.0

type CheckResponse = types.CheckResponse

type Config

type Config struct {
	RPCEndpoints   xchain.RPCEndpoints
	Network        netconf.ID
	MonitoringAddr string
	APIAddr        string
	SolverPrivKey  string
	LoadGenPrivKey string
	DBDir          string
	FeatureFlags   feature.Flags
}

func DefaultConfig

func DefaultConfig() Config

type Cursor

type Cursor struct {
	ChainId     uint64 `protobuf:"varint,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"`
	ConfLevel   uint32 `protobuf:"varint,2,opt,name=conf_level,json=confLevel,proto3" json:"conf_level,omitempty"`
	BlockHeight uint64 `protobuf:"varint,3,opt,name=block_height,json=blockHeight,proto3" json:"block_height,omitempty"`
	// contains filtered or unexported fields
}

func (*Cursor) Descriptor deprecated

func (*Cursor) Descriptor() ([]byte, []int)

Deprecated: Use Cursor.ProtoReflect.Descriptor instead.

func (*Cursor) GetBlockHeight

func (x *Cursor) GetBlockHeight() uint64

func (*Cursor) GetChainId

func (x *Cursor) GetChainId() uint64

func (*Cursor) GetConfLevel

func (x *Cursor) GetConfLevel() uint32

func (*Cursor) ProtoMessage

func (*Cursor) ProtoMessage()

func (*Cursor) ProtoReflect

func (x *Cursor) ProtoReflect() protoreflect.Message

func (*Cursor) Reset

func (x *Cursor) Reset()

func (*Cursor) String

func (x *Cursor) String() string

type CursorChainIdConfLevelIndexKey

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

func (CursorChainIdConfLevelIndexKey) WithChainId

func (CursorChainIdConfLevelIndexKey) WithChainIdConfLevel

func (this CursorChainIdConfLevelIndexKey) WithChainIdConfLevel(chain_id uint64, conf_level uint32) CursorChainIdConfLevelIndexKey

type CursorIndexKey

type CursorIndexKey interface {
	// contains filtered or unexported methods
}

type CursorIterator

type CursorIterator struct {
	ormtable.Iterator
}

func (CursorIterator) Value

func (i CursorIterator) Value() (*Cursor, error)

type CursorPrimaryKey

type CursorPrimaryKey = CursorChainIdConfLevelIndexKey

primary key starting index..

type CursorTable

type CursorTable interface {
	Insert(ctx context.Context, cursor *Cursor) error
	Update(ctx context.Context, cursor *Cursor) error
	Save(ctx context.Context, cursor *Cursor) error
	Delete(ctx context.Context, cursor *Cursor) error
	Has(ctx context.Context, chain_id uint64, conf_level uint32) (found bool, err error)
	// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
	Get(ctx context.Context, chain_id uint64, conf_level uint32) (*Cursor, error)
	List(ctx context.Context, prefixKey CursorIndexKey, opts ...ormlist.Option) (CursorIterator, error)
	ListRange(ctx context.Context, from, to CursorIndexKey, opts ...ormlist.Option) (CursorIterator, error)
	DeleteBy(ctx context.Context, prefixKey CursorIndexKey) error
	DeleteRange(ctx context.Context, from, to CursorIndexKey) error
	// contains filtered or unexported methods
}

func NewCursorTable

func NewCursorTable(db ormtable.Schema) (CursorTable, error)

type Deposit added in v0.13.0

type Deposit = solvernet.Deposit

type Expense added in v0.13.0

type Expense = solvernet.Expense

type FillOriginData added in v0.13.0

type FillOriginData = solvernet.FillOriginData

type JSONErrorResponse added in v0.13.0

type JSONErrorResponse = types.JSONErrorResponse

type JSONResponse added in v0.13.0

type JSONResponse = types.JSONResponse

type MockClients added in v0.13.0

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

func (MockClients) Client added in v0.13.0

func (m MockClients) Client(t *testing.T, chainID uint64) *mock.MockClient

Client returns a mock client for the given chainID.

func (MockClients) Finish added in v0.13.0

func (m MockClients) Finish(t *testing.T)

Finish finishes all mock controllers.

type Order added in v0.13.0

type Order struct {
	ID                 OrderID
	FillInstruction    bindings.IERC7683FillInstruction
	FillOriginData     []byte
	DestinationSettler common.Address
	DestinationChainID uint64
	SourceChainID      uint64
	MaxSpent           []bindings.IERC7683Output
	MinReceived        []bindings.IERC7683Output

	Status    solvernet.OrderStatus
	UpdatedBy common.Address
}

func (Order) ParsedFillOriginData added in v0.13.0

func (o Order) ParsedFillOriginData() (FillOriginData, error)

type OrderData added in v0.13.0

type OrderData = bindings.SolverNetOrderData

type OrderID added in v0.13.0

type OrderID = solvernet.OrderID

type OrderResolved added in v0.13.0

type OrderResolved = solvernet.OrderResolved

type OrderState added in v0.13.0

type OrderState = solvernet.OrderState

type Payment added in v0.13.0

type Payment struct {
	Token  Token
	Amount *big.Int
}

type QuoteRequest added in v0.13.0

type QuoteRequest = types.QuoteRequest

type QuoteResponse added in v0.13.0

type QuoteResponse = types.QuoteResponse

type QuoteUnit added in v0.13.0

type QuoteUnit = types.QuoteUnit

type RejectionError added in v0.13.0

type RejectionError struct {
	Reason rejectReason // Succinct human-readable reason for rejection.
	Err    error        // Internal detailed reject condition
}

RejectionError implement error, but represents a logical (expected) rejection, not an unexpected system error. We combine rejections with errors for detailed internal structured errors.

func (*RejectionError) Error added in v0.13.0

func (r *RejectionError) Error() string

Error implements error.

type SolverStore

type SolverStore interface {
	CursorTable() CursorTable
	// contains filtered or unexported methods
}

func NewSolverStore

func NewSolverStore(db ormtable.Schema) (SolverStore, error)

type Token added in v0.13.0

type Token struct {
	tokenslib.Token
	ChainID    uint64
	ChainClass ChainClass
	Address    common.Address // empty if native
	MaxSpend   *big.Int
	MinSpend   *big.Int
	IsMock     bool
}

func (Token) IsNative added in v0.13.0

func (t Token) IsNative() bool

func (Token) IsOMNI added in v0.13.0

func (t Token) IsOMNI() bool

type Tokens added in v0.13.0

type Tokens []Token

func AllTokens added in v0.13.0

func AllTokens() Tokens

func (Tokens) Find added in v0.13.0

func (ts Tokens) Find(chainID uint64, addr common.Address) (Token, bool)

func (Tokens) ForChain added in v0.13.0

func (ts Tokens) ForChain(chainID uint64) Tokens

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳