[#86] Add alphabet contract processor

Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
Alex Vanin 2020-10-12 13:17:40 +03:00 committed by Alex Vanin
parent 4308a6f522
commit f1f20b49db
5 changed files with 151 additions and 0 deletions

View file

@ -0,0 +1,23 @@
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")
}
}