Extract slow tests from omni full transformer

This commit is contained in:
Rob Mulholand
2019-03-06 12:43:06 -06:00
parent 34c96654ce
commit a806cb2818
11 changed files with 497 additions and 340 deletions
-14
View File
@@ -1,14 +0,0 @@
package fakes
type MockBlockRetriever struct {
FirstBlock int64
FirstBlockErr error
}
func (retriever *MockBlockRetriever) RetrieveFirstBlock() (int64, error) {
return retriever.FirstBlock, retriever.FirstBlockErr
}
func (retriever *MockBlockRetriever) RetrieveMostRecentBlock() (int64, error) {
return 0, nil
}
+14
View File
@@ -0,0 +1,14 @@
package fakes
import "github.com/vulcanize/vulcanizedb/pkg/filters"
type MockFilterRepository struct {
}
func (*MockFilterRepository) CreateFilter(filter filters.LogFilter) error {
return nil
}
func (*MockFilterRepository) GetFilter(name string) (filters.LogFilter, error) {
panic("implement me")
}
+15
View File
@@ -0,0 +1,15 @@
package fakes
type MockFullBlockRetriever struct {
FirstBlock int64
FirstBlockErr error
MostRecentBlock int64
}
func (retriever *MockFullBlockRetriever) RetrieveFirstBlock(contractAddr string) (int64, error) {
return retriever.FirstBlock, retriever.FirstBlockErr
}
func (retriever *MockFullBlockRetriever) RetrieveMostRecentBlock() (int64, error) {
return retriever.MostRecentBlock, nil
}
+14
View File
@@ -0,0 +1,14 @@
package fakes
type MockLightBlockRetriever struct {
FirstBlock int64
FirstBlockErr error
}
func (retriever *MockLightBlockRetriever) RetrieveFirstBlock() (int64, error) {
return retriever.FirstBlock, retriever.FirstBlockErr
}
func (retriever *MockLightBlockRetriever) RetrieveMostRecentBlock() (int64, error) {
return 0, nil
}
+42
View File
@@ -0,0 +1,42 @@
package fakes
import "github.com/vulcanize/vulcanizedb/pkg/core"
type MockLightHeaderRepository struct {
}
func (*MockLightHeaderRepository) AddCheckColumn(id string) error {
return nil
}
func (*MockLightHeaderRepository) AddCheckColumns(ids []string) error {
panic("implement me")
}
func (*MockLightHeaderRepository) MarkHeaderChecked(headerID int64, eventID string) error {
panic("implement me")
}
func (*MockLightHeaderRepository) MarkHeaderCheckedForAll(headerID int64, ids []string) error {
panic("implement me")
}
func (*MockLightHeaderRepository) MarkHeadersCheckedForAll(headers []core.Header, ids []string) error {
panic("implement me")
}
func (*MockLightHeaderRepository) MissingHeaders(startingBlockNumber int64, endingBlockNumber int64, eventID string) ([]core.Header, error) {
panic("implement me")
}
func (*MockLightHeaderRepository) MissingMethodsCheckedEventsIntersection(startingBlockNumber, endingBlockNumber int64, methodIds, eventIds []string) ([]core.Header, error) {
panic("implement me")
}
func (*MockLightHeaderRepository) MissingHeadersForAll(startingBlockNumber, endingBlockNumber int64, ids []string) ([]core.Header, error) {
panic("implement me")
}
func (*MockLightHeaderRepository) CheckCache(key string) (interface{}, bool) {
panic("implement me")
}
+4 -2
View File
@@ -7,6 +7,8 @@ import (
type MockParser struct {
AbiToReturn string
EventName string
Event types.Event
}
func (*MockParser) Parse(contractAddr string) error {
@@ -33,6 +35,6 @@ func (*MockParser) GetSelectMethods(wanted []string) []types.Method {
return []types.Method{}
}
func (*MockParser) GetEvents(wanted []string) map[string]types.Event {
return map[string]types.Event{}
func (parser *MockParser) GetEvents(wanted []string) map[string]types.Event {
return map[string]types.Event{parser.EventName: parser.Event}
}