2018-12-10 11:57:24 +01:00
|
|
|
package wallet
|
|
|
|
|
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
2021-08-26 00:58:28 +02:00
|
|
|
"github.com/lbryio/lbcd/chaincfg/chainhash"
|
|
|
|
"github.com/lbryio/lbcd/wire"
|
|
|
|
btcutil "github.com/lbryio/lbcutil"
|
|
|
|
"github.com/lbryio/lbcwallet/chain"
|
|
|
|
"github.com/lbryio/lbcwallet/waddrmgr"
|
2018-12-10 11:57:24 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
type mockChainClient struct {
|
|
|
|
}
|
|
|
|
|
|
|
|
var _ chain.Interface = (*mockChainClient)(nil)
|
|
|
|
|
|
|
|
func (m *mockChainClient) Start() error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *mockChainClient) Stop() {
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *mockChainClient) WaitForShutdown() {}
|
|
|
|
|
|
|
|
func (m *mockChainClient) GetBestBlock() (*chainhash.Hash, int32, error) {
|
|
|
|
return nil, 0, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *mockChainClient) GetBlock(*chainhash.Hash) (*wire.MsgBlock, error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *mockChainClient) GetBlockHash(int64) (*chainhash.Hash, error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *mockChainClient) GetBlockHeader(*chainhash.Hash) (*wire.BlockHeader,
|
|
|
|
error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
2019-05-14 22:17:58 +02:00
|
|
|
func (m *mockChainClient) IsCurrent() bool {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
|
2018-12-10 11:57:24 +01:00
|
|
|
func (m *mockChainClient) FilterBlocks(*chain.FilterBlocksRequest) (
|
|
|
|
*chain.FilterBlocksResponse, error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *mockChainClient) BlockStamp() (*waddrmgr.BlockStamp, error) {
|
|
|
|
return &waddrmgr.BlockStamp{
|
|
|
|
Height: 500000,
|
|
|
|
Hash: chainhash.Hash{},
|
|
|
|
Timestamp: time.Unix(1234, 0),
|
|
|
|
}, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *mockChainClient) SendRawTransaction(*wire.MsgTx, bool) (
|
|
|
|
*chainhash.Hash, error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *mockChainClient) Rescan(*chainhash.Hash, []btcutil.Address,
|
|
|
|
map[wire.OutPoint]btcutil.Address) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *mockChainClient) NotifyReceived([]btcutil.Address) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *mockChainClient) NotifyBlocks() error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *mockChainClient) Notifications() <-chan interface{} {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (m *mockChainClient) BackEnd() string {
|
|
|
|
return "mock"
|
|
|
|
}
|