2019-04-26 15:42:40 +00:00
|
|
|
// VulcanizeDB
|
|
|
|
// Copyright © 2019 Vulcanize
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU Affero General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
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-10-18 16:16:19 +00:00
|
|
|
func (parser *MockParser) ParseAbiStr(abiStr string) error {
|
|
|
|
parser.AbiToReturn = abiStr
|
2019-03-13 16:14:35 +00:00
|
|
|
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
|
|
|
}
|