2019-02-27 00:29:27 +00:00
|
|
|
package fakes
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/ethereum/go-ethereum/accounts/abi"
|
2019-03-11 23:18:54 +00:00
|
|
|
"github.com/vulcanize/vulcanizedb/pkg/contract_watcher/shared/types"
|
2019-02-27 00:29:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type MockParser struct {
|
|
|
|
AbiToReturn string
|
2019-02-27 16:10:59 +00:00
|
|
|
EventName string
|
|
|
|
Event types.Event
|
2019-02-27 00:29:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (*MockParser) Parse(contractAddr string) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2019-03-13 16:14:35 +00:00
|
|
|
func (m *MockParser) ParseAbiStr(abiStr string) error {
|
|
|
|
m.AbiToReturn = abiStr
|
|
|
|
return nil
|
2019-02-27 00:29:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (parser *MockParser) Abi() string {
|
|
|
|
return parser.AbiToReturn
|
|
|
|
}
|
|
|
|
|
|
|
|
func (*MockParser) ParsedAbi() abi.ABI {
|
|
|
|
return abi.ABI{}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (*MockParser) GetMethods(wanted []string) []types.Method {
|
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (*MockParser) GetSelectMethods(wanted []string) []types.Method {
|
|
|
|
return []types.Method{}
|
|
|
|
}
|
|
|
|
|
2019-02-27 16:10:59 +00:00
|
|
|
func (parser *MockParser) GetEvents(wanted []string) map[string]types.Event {
|
|
|
|
return map[string]types.Event{parser.EventName: parser.Event}
|
2019-02-27 00:29:27 +00:00
|
|
|
}
|