forked from TrueCloudLab/frostfs-node
[#86] Add alphabet contract processor
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
4308a6f522
commit
f1f20b49db
5 changed files with 151 additions and 0 deletions
23
pkg/innerring/processors/alphabet/process_emit.go
Normal file
23
pkg/innerring/processors/alphabet/process_emit.go
Normal 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")
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue