mock

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultNtfnDuration = 250 * time.Millisecond
)

Functions

This section is empty.

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) *OpGethMockHandler

func (*OpGethMockHandler) CloseConnections

func (f *OpGethMockHandler) CloseConnections() error

Force close all websocket connection to the test server

func (*OpGethMockHandler) Running

func (f *OpGethMockHandler) Running() bool

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

func (*OpGethMockHandler) Stop

func (f *OpGethMockHandler) Stop()

Stop the test server from accept incoming websocket connection

func (*OpGethMockHandler) URL

func (f *OpGethMockHandler) URL() string

Retrieve the URL from the test server

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

func (f *TBCMockHandler) CloseConnections() error

Force close all websocket connection to the test server

func (*TBCMockHandler) GetKeystones

func (f *TBCMockHandler) GetKeystones() map[chainhash.Hash]*hemi.L2KeystoneAbrev

func (*TBCMockHandler) Running

func (f *TBCMockHandler) Running() bool

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

func (*TBCMockHandler) Stop

func (f *TBCMockHandler) Stop()

Stop the test server from accept incoming websocket connection

func (*TBCMockHandler) URL

func (f *TBCMockHandler) URL() string

Retrieve the URL from the test server

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL