frostfs-node/pkg/innerring/processors/alphabet/process_emit.go
Alex Vanin f1f20b49db [#86] Add alphabet contract processor
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
2020-10-12 14:43:33 +03:00

23 lines
569 B
Go

package alphabet
import (
"github.com/nspcc-dev/neofs-node/pkg/innerring/invoke"
"go.uber.org/zap"
)
func (np *Processor) processEmit() {
index := np.irList.Index()
if index < 0 {
np.log.Info("passive mode, ignore gas emission event")
return
} else if int(index) >= len(np.alphabetContracts) {
np.log.Debug("node is out of alphabet range, ignore gas emission event",
zap.Int32("index", index))
return
}
err := invoke.AlphabetEmit(np.morphClient, np.alphabetContracts[index])
if err != nil {
np.log.Warn("can't invoke alphabet emit method")
}
}