Consolidate test doubles

- Migrate various mocks of core namespaces to shared version in `fakes` pkg
- Err on the side of making test doubles less sophisticated
- Don't pull over mocks of namespaces that are only used in example code
This commit is contained in:
Rob Mulholand
2018-07-20 11:37:46 -05:00
parent 63434f6bc9
commit a683e45855
46 changed files with 640 additions and 893 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ type Transformer interface {
Execute() error
}
type TransformerInitializer func(db *postgres.DB, blockchain core.Blockchain) Transformer
type TransformerInitializer func(db *postgres.DB, blockchain core.BlockChain) Transformer
func HexToInt64(byteString string) int64 {
value := common.HexToHash(byteString)
+1 -1
View File
@@ -8,7 +8,7 @@ import (
type Watcher struct {
Transformers []Transformer
DB postgres.DB
Blockchain core.Blockchain
Blockchain core.BlockChain
}
func (watcher *Watcher) AddTransformers(us []TransformerInitializer) {
+1 -1
View File
@@ -23,7 +23,7 @@ func (mh *MockTransformer) Execute() error {
return nil
}
func fakeTransformerInitializer(db *postgres.DB, blockchain core.Blockchain) shared.Transformer {
func fakeTransformerInitializer(db *postgres.DB, blockchain core.BlockChain) shared.Transformer {
return &MockTransformer{}
}