mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 01:13:45 +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),
|
eapi: ethapi.NewPublicEthereumAPI(apiBackend),
|
||||||
bcapi: ethapi.NewPublicBlockChainAPI(apiBackend),
|
bcapi: ethapi.NewPublicBlockChainAPI(apiBackend),
|
||||||
txapi: ethapi.NewPublicTransactionPoolAPI(apiBackend, new(ethapi.AddrLocker)),
|
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) {
|
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) {
|
func (b *ContractBackend) FilterLogs(ctx context.Context, q ethereum.FilterQuery) ([]*types.Log, error) {
|
||||||
crit := filters.FilterCriteria{
|
return nil, errors.New("not support right now")
|
||||||
FromBlock: q.FromBlock,
|
|
||||||
ToBlock: q.ToBlock,
|
|
||||||
Addresses: q.Addresses,
|
|
||||||
Topics: q.Topics,
|
|
||||||
}
|
|
||||||
return b.fapi.GetLogs(ctx, crit)
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue