remove unecessarily-added method

This commit is contained in:
Jared Wasinger 2024-12-18 14:42:54 +07:00 committed by Felix Lange
parent b1f3970c57
commit adc4ab6e79
2 changed files with 2 additions and 13 deletions

View file

@ -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 // WatchLogs filters subscribes to contract logs for future blocks, returning a
// subscription object that can be used to tear down the watcher. // 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) { 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 // Don't crash on a lazy user
if opts == nil { if opts == nil {
opts = new(WatchOpts) opts = new(WatchOpts)
} }
// Append the event selector to the query parameters and construct the topic set // 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...) topics, err := abi.MakeTopics(query...)
if err != nil { if err != nil {

View file

@ -424,8 +424,7 @@ func TestErrors(t *testing.T) {
// TODO: check anything about the error? // TODO: check anything about the error?
} }
// TODO: this test will pass if the code is changed but not compiled to a combined-abi.json. // TestBindingGeneration tests that re-running generation of bindings does not result in mutations to the binding code
// Not really possible to test this without including solc in the path when running CI.
func TestBindingGeneration(t *testing.T) { func TestBindingGeneration(t *testing.T) {
matches, _ := filepath.Glob("internal/*") matches, _ := filepath.Glob("internal/*")
var dirs []string var dirs []string