From c0e521ce4c503a2e2f311afa885e6e792cdd5687 Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Fri, 13 Dec 2019 01:56:03 +0100 Subject: [PATCH] accounts/abi/bind use subscribeFilterLogs, typos --- accounts/abi/bind/base.go | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/accounts/abi/bind/base.go b/accounts/abi/bind/base.go index 499b4bda07..b5fd93c63e 100644 --- a/accounts/abi/bind/base.go +++ b/accounts/abi/bind/base.go @@ -166,7 +166,7 @@ func (c *BoundContract) Call(opts *CallOpts, result interface{}, method string, // Transact invokes the (paid) contract method with params as input values. func (c *BoundContract) Transact(opts *TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { - // Otherwise pack up the parameters and invoke the contract + // Pack up the parameters and invoke the contract input, err := c.abi.Pack(method, params...) if err != nil { return nil, err @@ -269,24 +269,7 @@ func (c *BoundContract) FilterLogs(opts *FilterOpts, name string, query ...[]int if opts.End != nil { config.ToBlock = new(big.Int).SetUint64(*opts.End) } - /* TODO(karalabe): Replace the rest of the method below with this when supported sub, err := c.filterer.SubscribeFilterLogs(ensureContext(opts.Context), config, logs) - */ - buff, err := c.filterer.FilterLogs(ensureContext(opts.Context), config) - if err != nil { - return nil, nil, err - } - sub, err := event.NewSubscription(func(quit <-chan struct{}) error { - for _, log := range buff { - select { - case logs <- log: - case <-quit: - return nil - } - } - return nil - }), nil - if err != nil { return nil, nil, err }