Export api.SessionManager.

This commit is contained in:
Louis Thibault 2024-01-22 16:06:09 -05:00
parent ae2ff276a1
commit d4817ad29d

View file

@ -6,13 +6,13 @@ import (
"github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/types"
) )
// sessionManager is the backend that manages the session state of the builder API. // SessionManager is the backend that manages the session state of the builder API.
type sessionManager interface { type SessionManager interface {
NewSession() (string, error) NewSession() (string, error)
AddTransaction(sessionId string, tx *types.Transaction) (*types.SimulateTransactionResult, error) AddTransaction(sessionId string, tx *types.Transaction) (*types.SimulateTransactionResult, error)
} }
func NewServer(s sessionManager) *Server { func NewServer(s SessionManager) *Server {
api := &Server{ api := &Server{
sessionMngr: s, sessionMngr: s,
} }
@ -20,7 +20,7 @@ func NewServer(s sessionManager) *Server {
} }
type Server struct { type Server struct {
sessionMngr sessionManager sessionMngr SessionManager
} }
func (s *Server) NewSession(ctx context.Context) (string, error) { func (s *Server) NewSession(ctx context.Context) (string, error) {