decred.org/dcrwallet/v3@v3.1.0/wallet/network_test.go (about) 1 // Copyright (c) 2019 The Decred developers 2 // Use of this source code is governed by an ISC 3 // license that can be found in the LICENSE file. 4 5 package wallet 6 7 import ( 8 "context" 9 10 "github.com/decred/dcrd/chaincfg/chainhash" 11 "github.com/decred/dcrd/dcrutil/v4" 12 "github.com/decred/dcrd/txscript/v4/stdaddr" 13 "github.com/decred/dcrd/wire" 14 ) 15 16 // mockNetwork implements all methods of NetworkBackend, returning zero values 17 // without error. It may be embedded in a struct to create another 18 // NetworkBackend which dispatches to particular implementations of the methods. 19 type mockNetwork struct{} 20 21 func (mockNetwork) Blocks(ctx context.Context, blockHashes []*chainhash.Hash) ([]*wire.MsgBlock, error) { 22 return nil, nil 23 } 24 func (mockNetwork) CFiltersV2(ctx context.Context, blockHashes []*chainhash.Hash) ([]FilterProof, error) { 25 return nil, nil 26 } 27 func (mockNetwork) Headers(ctx context.Context, blockLocators []*chainhash.Hash, hashStop *chainhash.Hash) ([]*wire.BlockHeader, error) { 28 return nil, nil 29 } 30 func (mockNetwork) PublishTransactions(ctx context.Context, txs ...*wire.MsgTx) error { return nil } 31 func (mockNetwork) LoadTxFilter(ctx context.Context, reload bool, addrs []stdaddr.Address, outpoints []wire.OutPoint) error { 32 return nil 33 } 34 func (mockNetwork) Rescan(ctx context.Context, blocks []chainhash.Hash, save func(*chainhash.Hash, []*wire.MsgTx) error) error { 35 return nil 36 } 37 func (mockNetwork) StakeDifficulty(ctx context.Context) (dcrutil.Amount, error) { return 0, nil }