Commit c8a82e8e authored by Andreas Bigger's avatar Andreas Bigger

fix: unsubscribes and redundant methods

parent 2214da2e
...@@ -74,7 +74,7 @@ func (c *Challenger) NewOracleSubscription() (*Subscription, error) { ...@@ -74,7 +74,7 @@ func (c *Challenger) NewOracleSubscription() (*Subscription, error) {
// NewFactorySubscription creates a new [Subscription] listening to the DisputeGameFactory contract. // NewFactorySubscription creates a new [Subscription] listening to the DisputeGameFactory contract.
func (c *Challenger) NewFactorySubscription() (*Subscription, error) { func (c *Challenger) NewFactorySubscription() (*Subscription, error) {
query, err := c.BuildDisputeGameLogFilter() query, err := BuildDisputeGameLogFilter(c.dgfABI)
if err != nil { if err != nil {
return nil, err return nil, err
} }
......
...@@ -31,8 +31,3 @@ func BuildDisputeGameLogFilter(contract *abi.ABI) (ethereum.FilterQuery, error) ...@@ -31,8 +31,3 @@ func BuildDisputeGameLogFilter(contract *abi.ABI) (ethereum.FilterQuery, error)
return query, nil return query, nil
} }
// BuildDisputeGameLogFilter creates a filter query for the DisputeGameFactory contract.
func (c *Challenger) BuildDisputeGameLogFilter() (ethereum.FilterQuery, error) {
return BuildDisputeGameLogFilter(c.dgfABI)
}
...@@ -41,6 +41,8 @@ func Factory(logger log.Logger, cfg *config.Config) error { ...@@ -41,6 +41,8 @@ func Factory(logger log.Logger, cfg *config.Config) error {
return err return err
} }
defer subscription.Quit()
interruptChannel := make(chan os.Signal, 1) interruptChannel := make(chan os.Signal, 1)
signal.Notify(interruptChannel, []os.Signal{ signal.Notify(interruptChannel, []os.Signal{
os.Interrupt, os.Interrupt,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment