2019-02-27 00:29:27 +00:00
|
|
|
package fakes
|
|
|
|
|
|
|
|
import (
|
2019-03-11 23:18:54 +00:00
|
|
|
"github.com/vulcanize/vulcanizedb/pkg/contract_watcher/shared/contract"
|
2019-02-27 00:29:27 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
type MockPoller struct {
|
|
|
|
ContractName string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (*MockPoller) PollContract(con contract.Contract) error {
|
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (*MockPoller) PollContractAt(con contract.Contract, blockNumber int64) error {
|
|
|
|
panic("implement me")
|
|
|
|
}
|
|
|
|
|
|
|
|
func (poller *MockPoller) FetchContractData(contractAbi, contractAddress, method string, methodArgs []interface{}, result interface{}, blockNumber int64) error {
|
|
|
|
if p, ok := result.(*string); ok {
|
|
|
|
*p = poller.ContractName
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
}
|