[#324] ir: Measure GAS emission intervals in sidechain blocks

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-01-22 18:49:52 +03:00 committed by Alex Vanin
parent 19bb94cc04
commit d01b4e1a2d
6 changed files with 41 additions and 123 deletions

View file

@ -1,7 +1,6 @@
package innerring
import (
"github.com/nspcc-dev/neofs-node/pkg/innerring/timers"
"github.com/nspcc-dev/neofs-node/pkg/morph/event"
)
@ -27,28 +26,16 @@ func connectListenerWithProcessor(l event.Listener, p ContractProcessor) {
}
}
func connectTimerWithProcessor(t *timers.Timers, p ContractProcessor) error {
var err error
for _, parser := range p.TimersHandlers() {
err = t.RegisterHandler(parser)
if err != nil {
return err
}
}
return nil
}
// bindMorphProcessor connects both morph chain listener handlers and
// local timers handlers.
func bindMorphProcessor(proc ContractProcessor, s *Server) error {
connectListenerWithProcessor(s.morphListener, proc)
return connectTimerWithProcessor(s.localTimers, proc)
return nil
}
// bindMainnetProcessor connects both mainnet chain listener handlers and
// local timers handlers.
func bindMainnetProcessor(proc ContractProcessor, s *Server) error {
connectListenerWithProcessor(s.mainnetListener, proc)
return connectTimerWithProcessor(s.localTimers, proc)
return nil
}