Documentation
¶
Index ¶
- Constants
- Variables
- func NewJSONError(code int, message string, data any) *jsonError
- type L2KeystoneLatestResponse
- type L2KeystoneValidityResponse
- type OpGethMockHandler
- func (f *OpGethMockHandler) CloseConnections(force bool) error
- func (f *OpGethMockHandler) Running() bool
- func (f *OpGethMockHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (f *OpGethMockHandler) Shutdown()
- func (f *OpGethMockHandler) Start()
- func (f *OpGethMockHandler) Stop()
- func (f *OpGethMockHandler) URL() string
- type TBCMockHandler
- func (f *TBCMockHandler) CloseConnections(force bool) error
- func (f *TBCMockHandler) GetKeystones() map[chainhash.Hash]*hemi.L2KeystoneAbrev
- func (f *TBCMockHandler) Running() bool
- func (f *TBCMockHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (f *TBCMockHandler) Shutdown()
- func (f *TBCMockHandler) Start()
- func (f *TBCMockHandler) Stop()
- func (f *TBCMockHandler) URL() string
Constants ¶
View Source
const (
InfiniteDuration = time.Duration(math.MaxInt64)
)
Variables ¶
View Source
var (
DefaultNtfnDuration = 250 * time.Millisecond
)
Functions ¶
func NewJSONError ¶
NewJSONError creates a new JSON error.
Types ¶
type L2KeystoneLatestResponse ¶
type L2KeystoneLatestResponse struct {
L2Keystones []hemi.L2Keystone `json:"keystones"`
Error *protocol.Error `json:"error,omitempty"`
}
type L2KeystoneValidityResponse ¶
type L2KeystoneValidityResponse struct {
L2Keystones []hemi.L2Keystone `json:"keystones"`
Error *protocol.Error `json:"error,omitempty"`
}
type OpGethMockHandler ¶
type OpGethMockHandler struct {
// contains filtered or unexported fields
}
func NewMockOpGeth ¶
func NewMockOpGeth(pctx context.Context, errCh chan error, msgCh chan string, keystones []hemi.L2Keystone, initKssCount int) *OpGethMockHandler
func (*OpGethMockHandler) CloseConnections ¶
Close all websocket connection to the test server
func (*OpGethMockHandler) ServeHTTP ¶
func (f *OpGethMockHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*OpGethMockHandler) Shutdown ¶
func (f *OpGethMockHandler) Shutdown()
Fully shutdown the test server
func (*OpGethMockHandler) Start ¶
func (f *OpGethMockHandler) Start()
Allow the test server to accept incoming websocket connection
type TBCMockHandler ¶
type TBCMockHandler struct {
// contains filtered or unexported fields
}
func NewMockTBC ¶
func NewMockTBC(pctx context.Context, errCh chan error, msgCh chan string, keystones map[chainhash.Hash]*hemi.L2KeystoneAbrev, btcTip, utxoNum uint) *TBCMockHandler
func (*TBCMockHandler) CloseConnections ¶
Close all websocket connection to the test server
func (*TBCMockHandler) GetKeystones ¶
func (f *TBCMockHandler) GetKeystones() map[chainhash.Hash]*hemi.L2KeystoneAbrev
func (*TBCMockHandler) ServeHTTP ¶
func (f *TBCMockHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*TBCMockHandler) Shutdown ¶
func (f *TBCMockHandler) Shutdown()
Fully shutdown the test server
func (*TBCMockHandler) Start ¶
func (f *TBCMockHandler) Start()
Allow the test server to accept incoming websocket connection
Click to show internal directories.
Click to hide internal directories.