-
Notifications
You must be signed in to change notification settings - Fork 0
/
chainio.go
34 lines (27 loc) · 912 Bytes
/
chainio.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package mock
import (
"github.com/brronsuite/brond/chaincfg"
"github.com/brronsuite/brond/chaincfg/chainhash"
"github.com/brronsuite/brond/wire"
)
// ChainIO is a mock implementation of the BlockChainIO interface.
type ChainIO struct {
BestHeight int32
}
// GetBestBlock currently returns dummy values.
func (c *ChainIO) GetBestBlock() (*chainhash.Hash, int32, error) {
return chaincfg.TestNet3Params.GenesisHash, c.BestHeight, nil
}
// GetUtxo currently returns dummy values.
func (c *ChainIO) GetUtxo(op *wire.OutPoint, _ []byte,
heightHint uint32, _ <-chan struct{}) (*wire.TxOut, error) {
return nil, nil
}
// GetBlockHash currently returns dummy values.
func (c *ChainIO) GetBlockHash(blockHeight int64) (*chainhash.Hash, error) {
return nil, nil
}
// GetBlock currently returns dummy values.
func (c *ChainIO) GetBlock(blockHash *chainhash.Hash) (*wire.MsgBlock, error) {
return nil, nil
}