From adc4ab6e7921fb8797e02e0862842728b4cbd96a Mon Sep 17 00:00:00 2001 From: Jared Wasinger Date: Wed, 18 Dec 2024 14:42:54 +0700 Subject: [PATCH] remove unecessarily-added method --- accounts/abi/bind/base.go | 12 +----------- accounts/abi/bind/v2/lib_test.go | 3 +-- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/accounts/abi/bind/base.go b/accounts/abi/bind/base.go index e787268560..69e3b94bb3 100644 --- a/accounts/abi/bind/base.go +++ b/accounts/abi/bind/base.go @@ -510,22 +510,12 @@ func (c *BoundContract) FilterLogs(opts *FilterOpts, name string, query ...[]int // WatchLogs filters subscribes to contract logs for future blocks, returning a // subscription object that can be used to tear down the watcher. func (c *BoundContract) WatchLogs(opts *WatchOpts, name string, query ...[]interface{}) (chan types.Log, event.Subscription, error) { - return c.watchLogs(opts, c.abi.Events[name].ID, query...) -} - -// WatchLogsForId filters subscribes to contract logs for future blocks, returning a -// subscription object that can be used to tear down the watcher. -func (c *BoundContract) WatchLogsForId(opts *WatchOpts, id common.Hash, query ...[]interface{}) (chan types.Log, event.Subscription, error) { - return c.watchLogs(opts, id, query...) -} - -func (c *BoundContract) watchLogs(opts *WatchOpts, eventID common.Hash, query ...[]interface{}) (chan types.Log, event.Subscription, error) { // Don't crash on a lazy user if opts == nil { opts = new(WatchOpts) } // Append the event selector to the query parameters and construct the topic set - query = append([][]interface{}{{eventID}}, query...) + query = append([][]interface{}{{c.abi.Events[name].ID}}, query...) topics, err := abi.MakeTopics(query...) if err != nil { diff --git a/accounts/abi/bind/v2/lib_test.go b/accounts/abi/bind/v2/lib_test.go index 6ae87ea034..07d9230f0a 100644 --- a/accounts/abi/bind/v2/lib_test.go +++ b/accounts/abi/bind/v2/lib_test.go @@ -424,8 +424,7 @@ func TestErrors(t *testing.T) { // TODO: check anything about the error? } -// TODO: this test will pass if the code is changed but not compiled to a combined-abi.json. -// Not really possible to test this without including solc in the path when running CI. +// TestBindingGeneration tests that re-running generation of bindings does not result in mutations to the binding code func TestBindingGeneration(t *testing.T) { matches, _ := filepath.Glob("internal/*") var dirs []string