mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-16 17:03:46 +00:00
eth: add fake function for ContractBackend to match inteface ContractCaller
This commit is contained in:
parent
eae240191d
commit
0cf0aceffe
1 changed files with 2 additions and 9 deletions
11
eth/bind.go
11
eth/bind.go
|
|
@ -52,7 +52,6 @@ func NewContractBackend(apiBackend ethapi.Backend) *ContractBackend {
|
|||
eapi: ethapi.NewPublicEthereumAPI(apiBackend),
|
||||
bcapi: ethapi.NewPublicBlockChainAPI(apiBackend),
|
||||
txapi: ethapi.NewPublicTransactionPoolAPI(apiBackend, new(ethapi.AddrLocker)),
|
||||
fapi: filters.NewPublicFilterAPI(apiBackend, false),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -142,15 +141,9 @@ func (b *ContractBackend) SendTransaction(ctx context.Context, tx *types.Transac
|
|||
}
|
||||
|
||||
func (b *ContractBackend) SubscribeFilterLogs(ctx context.Context, q ethereum.FilterQuery, ch chan<- types.Log) (ethereum.Subscription, error) {
|
||||
return nil, errors.New("not support right now")
|
||||
return nil, errors.New("not support right now") //todo fix this need ethapi.Backend to modify and PublicFilterAPI export Logs func for local call.
|
||||
}
|
||||
|
||||
func (b *ContractBackend) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]*types.Log, error) {
|
||||
crit := filters.FilterCriteria{
|
||||
FromBlock: q.FromBlock,
|
||||
ToBlock: q.ToBlock,
|
||||
Addresses: q.Addresses,
|
||||
Topics: q.Topics,
|
||||
}
|
||||
return b.fapi.GetLogs(ctx, crit)
|
||||
return nil, errors.New("not support right now")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue