Merge pull request #3 from flashbots/cleanup/export-session-manager

Export api.SessionManager.
This commit is contained in:
Louis Thibault 2024-01-22 22:22:07 +01:00 committed by GitHub
commit b754a25119
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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) {