forked from TrueCloudLab/frostfs-node
[#392] ir: Upgrade to a dynamic number of alphabetical contracts
In previous implementation IR worked with exactly 7 alphabetic contracts only. Actually number of contracts is limited to only the Glagolitic alphabet. Make IR to work with any valid number of alphabetic contracts. Change parser of alphabetic contract addresses to read amount of processing contracts before performance. Make Alphabet processor to use interface of the alphabetic contract group. Use `alphabetContracts` type in IR `Server`. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
1016ba3a5d
commit
72935d0a80
4 changed files with 43 additions and 23 deletions
|
@ -15,14 +15,17 @@ func (np *Processor) processEmit() {
|
|||
np.log.Info("passive mode, ignore gas emission event")
|
||||
|
||||
return
|
||||
} else if index >= len(np.alphabetContracts) {
|
||||
}
|
||||
|
||||
contract, ok := np.alphabetContracts.GetByIndex(index)
|
||||
if !ok {
|
||||
np.log.Debug("node is out of alphabet range, ignore gas emission event",
|
||||
zap.Int("index", index))
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
err := invoke.AlphabetEmit(np.morphClient, np.alphabetContracts[index])
|
||||
err := invoke.AlphabetEmit(np.morphClient, contract)
|
||||
if err != nil {
|
||||
np.log.Warn("can't invoke alphabet emit method")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue