2018-10-26 18:26:10 +00:00
|
|
|
package mocks
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/ethereum/go-ethereum/core/types"
|
|
|
|
)
|
|
|
|
|
|
|
|
type MockLogNoteConverter struct {
|
2018-11-06 16:30:11 +00:00
|
|
|
err error
|
|
|
|
returnModels []interface{}
|
|
|
|
PassedLogs []types.Log
|
|
|
|
ToModelsCalledCounter int
|
2018-10-26 18:26:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (converter *MockLogNoteConverter) ToModels(ethLogs []types.Log) ([]interface{}, error) {
|
|
|
|
converter.PassedLogs = ethLogs
|
2018-11-06 16:30:11 +00:00
|
|
|
converter.ToModelsCalledCounter ++
|
2018-10-26 18:26:10 +00:00
|
|
|
return converter.returnModels, converter.err
|
|
|
|
}
|
|
|
|
|
|
|
|
func (converter *MockLogNoteConverter) SetConverterError(e error) {
|
|
|
|
converter.err = e
|
|
|
|
}
|
|
|
|
|
|
|
|
func (converter *MockLogNoteConverter) SetReturnModels(models []interface{}) {
|
|
|
|
converter.returnModels = models
|
|
|
|
}
|