Documentation ¶
Index ¶
- func RegisterMinipoolRoute[ContextType IMinipoolCallContext[DataType], DataType any](router *mux.Router, functionName string, ...)
- type IMinipoolCallContext
- type IMinipoolCallContextFactory
- type MinipoolCloseContext
- type MinipoolCloseDetailsContext
- func (c *MinipoolCloseDetailsContext) CheckState(node *node.Node, data *csapi.MinipoolCloseDetailsData) bool
- func (c *MinipoolCloseDetailsContext) GetMinipoolDetails(mc *batch.MultiCaller, mp minipool.IMinipool, index int)
- func (c *MinipoolCloseDetailsContext) GetState(node *node.Node, mc *batch.MultiCaller)
- func (c *MinipoolCloseDetailsContext) Initialize(walletStatus wallet.WalletStatus) (types.ResponseStatus, error)
- func (c *MinipoolCloseDetailsContext) PrepareData(addresses []common.Address, mps []minipool.IMinipool, ...) (types.ResponseStatus, error)
- type MinipoolCreateContext
- func (c *MinipoolCreateContext) GetState(mc *batch.MultiCaller)
- func (c *MinipoolCreateContext) Initialize(walletStatus wallet.WalletStatus) (types.ResponseStatus, error)
- func (c *MinipoolCreateContext) PrepareData(data *csapi.MinipoolCreateData, opts *bind.TransactOpts) (types.ResponseStatus, error)
- type MinipoolExitContext
- type MinipoolExitDetailsContext
- func (c *MinipoolExitDetailsContext) CheckState(node *node.Node, response *csapi.MinipoolExitDetailsData) bool
- func (c *MinipoolExitDetailsContext) GetMinipoolDetails(mc *batch.MultiCaller, mp minipool.IMinipool, index int)
- func (c *MinipoolExitDetailsContext) GetState(node *node.Node, mc *batch.MultiCaller)
- func (c *MinipoolExitDetailsContext) Initialize(walletStatus wallet.WalletStatus) (types.ResponseStatus, error)
- func (c *MinipoolExitDetailsContext) PrepareData(addresses []common.Address, mps []minipool.IMinipool, ...) (types.ResponseStatus, error)
- type MinipoolHandler
- type MinipoolStakeContext
- func (c *MinipoolStakeContext) CheckState(node *node.Node, data *csapi.MinipoolStakeData) bool
- func (c *MinipoolStakeContext) GetMinipoolDetails(mc *batch.MultiCaller, mp minipool.IMinipool, index int)
- func (c *MinipoolStakeContext) GetState(node *node.Node, mc *batch.MultiCaller)
- func (c *MinipoolStakeContext) Initialize(walletStatus wallet.WalletStatus) (types.ResponseStatus, error)
- func (c *MinipoolStakeContext) PrepareData(addresses []common.Address, mps []minipool.IMinipool, ...) (types.ResponseStatus, error)
- type MinipoolStatusContext
- func (c *MinipoolStatusContext) CheckState(node *node.Node, data *csapi.MinipoolStatusData) bool
- func (c *MinipoolStatusContext) GetMinipoolDetails(mc *batch.MultiCaller, mp minipool.IMinipool, index int)
- func (c *MinipoolStatusContext) GetState(node *node.Node, mc *batch.MultiCaller)
- func (c *MinipoolStatusContext) Initialize(walletStatus wallet.WalletStatus) (types.ResponseStatus, error)
- func (c *MinipoolStatusContext) PrepareData(addresses []common.Address, mps []minipool.IMinipool, ...) (types.ResponseStatus, error)
- type MinipoolUploadSignedExitsContext
- type MinipoolVanityContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterMinipoolRoute ¶
func RegisterMinipoolRoute[ContextType IMinipoolCallContext[DataType], DataType any]( router *mux.Router, functionName string, factory IMinipoolCallContextFactory[ContextType, DataType], ctx context.Context, logger *slog.Logger, serviceProvider cscommon.IConstellationServiceProvider, )
Registers a new route with the router, which will invoke the provided factory to create and execute the context for the route when it's called; use this for complex calls that will iterate over and query each minipool in the node
Types ¶
type IMinipoolCallContext ¶
type IMinipoolCallContext[DataType any] interface { // Initialize the context with any bootstrapping, requirements checks, or bindings it needs to set up Initialize(walletStatus wallet.WalletStatus) (types.ResponseStatus, error) // Used to get any supplemental state required during initialization - anything in here will be fed into an rp.Query() multicall GetState(node *node.Node, mc *batch.MultiCaller) // Check the initialized state after being queried to see if the response needs to be updated and the query can be ended prematurely // Return true if the function should continue, or false if it needs to end and just return the response as-is CheckState(node *node.Node, data *DataType) bool // Get whatever details of the given minipool are necessary; this will be passed into an rp.BatchQuery call, one run per minipool // belonging to the node GetMinipoolDetails(mc *batch.MultiCaller, mp minipool.IMinipool, index int) // Prepare the response data using all of the provided artifacts PrepareData(addresses []common.Address, mps []minipool.IMinipool, data *DataType, blockHeader *ethtypes.Header, opts *bind.TransactOpts) (types.ResponseStatus, error) }
Wrapper for callbacks used by functions that will query all of the node's minipools - they follow this pattern: Create bindings, query the chain, return prematurely if some state isn't correct, query all of the minipools, and process them to populate a response. Structs implementing this will handle the caller-specific functionality.
type IMinipoolCallContextFactory ¶
type IMinipoolCallContextFactory[ContextType IMinipoolCallContext[DataType], DataType any] interface { // Create the context for the route Create(args url.Values) (ContextType, error) }
Interface for minipool call context factories - these will be invoked during route handling to create the unique context for the route
type MinipoolCloseContext ¶
type MinipoolCloseContext struct { Handler *MinipoolHandler MinipoolAddresses []common.Address // contains filtered or unexported fields }
func (*MinipoolCloseContext) GetState ¶
func (c *MinipoolCloseContext) GetState(mc *batch.MultiCaller)
func (*MinipoolCloseContext) Initialize ¶
func (c *MinipoolCloseContext) Initialize(walletStatus wallet.WalletStatus) (types.ResponseStatus, error)
func (*MinipoolCloseContext) PrepareData ¶
func (c *MinipoolCloseContext) PrepareData(data *types.BatchTxInfoData, opts *bind.TransactOpts) (types.ResponseStatus, error)
type MinipoolCloseDetailsContext ¶
type MinipoolCloseDetailsContext struct { // Dependencies ServiceProvider cscommon.IConstellationServiceProvider Logger *slog.Logger Context context.Context SnServiceProvider snservices.ISmartNodeServiceProvider // contains filtered or unexported fields }
func (*MinipoolCloseDetailsContext) CheckState ¶
func (c *MinipoolCloseDetailsContext) CheckState(node *node.Node, data *csapi.MinipoolCloseDetailsData) bool
func (*MinipoolCloseDetailsContext) GetMinipoolDetails ¶
func (c *MinipoolCloseDetailsContext) GetMinipoolDetails(mc *batch.MultiCaller, mp minipool.IMinipool, index int)
func (*MinipoolCloseDetailsContext) GetState ¶
func (c *MinipoolCloseDetailsContext) GetState(node *node.Node, mc *batch.MultiCaller)
func (*MinipoolCloseDetailsContext) Initialize ¶
func (c *MinipoolCloseDetailsContext) Initialize(walletStatus wallet.WalletStatus) (types.ResponseStatus, error)
func (*MinipoolCloseDetailsContext) PrepareData ¶
func (c *MinipoolCloseDetailsContext) PrepareData(addresses []common.Address, mps []minipool.IMinipool, data *csapi.MinipoolCloseDetailsData, latestBlockHeader *ethtypes.Header, opts *bind.TransactOpts) (types.ResponseStatus, error)
type MinipoolCreateContext ¶
type MinipoolCreateContext struct { // Dependencies ServiceProvider cscommon.IConstellationServiceProvider Logger *slog.Logger Context context.Context // Inputs ExpectedMinipoolAddress common.Address Salt *big.Int // contains filtered or unexported fields }
func (*MinipoolCreateContext) GetState ¶
func (c *MinipoolCreateContext) GetState(mc *batch.MultiCaller)
func (*MinipoolCreateContext) Initialize ¶
func (c *MinipoolCreateContext) Initialize(walletStatus wallet.WalletStatus) (types.ResponseStatus, error)
func (*MinipoolCreateContext) PrepareData ¶
func (c *MinipoolCreateContext) PrepareData(data *csapi.MinipoolCreateData, opts *bind.TransactOpts) (types.ResponseStatus, error)
type MinipoolExitContext ¶
type MinipoolExitContext struct { // Dependencies ServiceProvider cscommon.IConstellationServiceProvider Logger *slog.Logger Context context.Context // Arguments Infos []csapi.MinipoolValidatorInfo }
func (*MinipoolExitContext) PrepareData ¶
func (c *MinipoolExitContext) PrepareData(data *types.SuccessData, walletStatus wallet.WalletStatus, opts *bind.TransactOpts) (types.ResponseStatus, error)
type MinipoolExitDetailsContext ¶
type MinipoolExitDetailsContext struct { // Dependencies ServiceProvider cscommon.IConstellationServiceProvider Logger *slog.Logger Context context.Context // Arguments Verbose bool }
func (*MinipoolExitDetailsContext) CheckState ¶
func (c *MinipoolExitDetailsContext) CheckState(node *node.Node, response *csapi.MinipoolExitDetailsData) bool
func (*MinipoolExitDetailsContext) GetMinipoolDetails ¶
func (c *MinipoolExitDetailsContext) GetMinipoolDetails(mc *batch.MultiCaller, mp minipool.IMinipool, index int)
func (*MinipoolExitDetailsContext) GetState ¶
func (c *MinipoolExitDetailsContext) GetState(node *node.Node, mc *batch.MultiCaller)
func (*MinipoolExitDetailsContext) Initialize ¶
func (c *MinipoolExitDetailsContext) Initialize(walletStatus wallet.WalletStatus) (types.ResponseStatus, error)
func (*MinipoolExitDetailsContext) PrepareData ¶
func (c *MinipoolExitDetailsContext) PrepareData(addresses []common.Address, mps []minipool.IMinipool, data *csapi.MinipoolExitDetailsData, blockHeader *ethtypes.Header, opts *bind.TransactOpts) (types.ResponseStatus, error)
type MinipoolHandler ¶
type MinipoolHandler struct {
// contains filtered or unexported fields
}
func NewMinipoolHandler ¶
func NewMinipoolHandler(logger *log.Logger, ctx context.Context, serviceProvider cscommon.IConstellationServiceProvider) *MinipoolHandler
func (*MinipoolHandler) RegisterRoutes ¶
func (h *MinipoolHandler) RegisterRoutes(router *mux.Router)
type MinipoolStakeContext ¶
type MinipoolStakeContext struct { // Dependencies ServiceProvider cscommon.IConstellationServiceProvider Logger *slog.Logger Context context.Context // contains filtered or unexported fields }
func (*MinipoolStakeContext) CheckState ¶
func (c *MinipoolStakeContext) CheckState(node *node.Node, data *csapi.MinipoolStakeData) bool
func (*MinipoolStakeContext) GetMinipoolDetails ¶
func (c *MinipoolStakeContext) GetMinipoolDetails(mc *batch.MultiCaller, mp minipool.IMinipool, index int)
func (*MinipoolStakeContext) GetState ¶
func (c *MinipoolStakeContext) GetState(node *node.Node, mc *batch.MultiCaller)
func (*MinipoolStakeContext) Initialize ¶
func (c *MinipoolStakeContext) Initialize(walletStatus wallet.WalletStatus) (types.ResponseStatus, error)
func (*MinipoolStakeContext) PrepareData ¶
func (c *MinipoolStakeContext) PrepareData(addresses []common.Address, mps []minipool.IMinipool, data *csapi.MinipoolStakeData, blockHeader *ethtypes.Header, opts *bind.TransactOpts) (types.ResponseStatus, error)
type MinipoolStatusContext ¶
type MinipoolStatusContext struct { // Dependencies ServiceProvider cscommon.IConstellationServiceProvider Logger *slog.Logger Context context.Context SnServiceProvider snservices.ISmartNodeServiceProvider // contains filtered or unexported fields }
func (*MinipoolStatusContext) CheckState ¶
func (c *MinipoolStatusContext) CheckState(node *node.Node, data *csapi.MinipoolStatusData) bool
func (*MinipoolStatusContext) GetMinipoolDetails ¶
func (c *MinipoolStatusContext) GetMinipoolDetails(mc *batch.MultiCaller, mp minipool.IMinipool, index int)
func (*MinipoolStatusContext) GetState ¶
func (c *MinipoolStatusContext) GetState(node *node.Node, mc *batch.MultiCaller)
func (*MinipoolStatusContext) Initialize ¶
func (c *MinipoolStatusContext) Initialize(walletStatus wallet.WalletStatus) (types.ResponseStatus, error)
func (*MinipoolStatusContext) PrepareData ¶
func (c *MinipoolStatusContext) PrepareData(addresses []common.Address, mps []minipool.IMinipool, data *csapi.MinipoolStatusData, latestBlockHeader *ethtypes.Header, opts *bind.TransactOpts) (types.ResponseStatus, error)
type MinipoolUploadSignedExitsContext ¶
type MinipoolUploadSignedExitsContext struct { // Dependencies ServiceProvider cscommon.IConstellationServiceProvider Logger *slog.Logger Context context.Context // Arguments Infos []csapi.MinipoolValidatorInfo }
func (*MinipoolUploadSignedExitsContext) PrepareData ¶
func (c *MinipoolUploadSignedExitsContext) PrepareData(data *types.SuccessData, walletStatus wallet.WalletStatus, opts *bind.TransactOpts) (types.ResponseStatus, error)
type MinipoolVanityContext ¶
type MinipoolVanityContext struct {
// contains filtered or unexported fields
}
func (*MinipoolVanityContext) PrepareData ¶
func (c *MinipoolVanityContext) PrepareData(data *csapi.MinipoolVanityArtifactsData, walletStatus wallet.WalletStatus, opts *bind.TransactOpts) (types.ResponseStatus, error)