diff --git a/pkg/innerring/processors/alphabet/process_emit.go b/pkg/innerring/processors/alphabet/process_emit.go index c8c95fa864..319769e131 100644 --- a/pkg/innerring/processors/alphabet/process_emit.go +++ b/pkg/innerring/processors/alphabet/process_emit.go @@ -15,9 +15,9 @@ func (np *Processor) processEmit() { np.log.Info("passive mode, ignore gas emission event") return - } else if int(index) >= len(np.alphabetContracts) { + } else if index >= len(np.alphabetContracts) { np.log.Debug("node is out of alphabet range, ignore gas emission event", - zap.Int32("index", index)) + zap.Int("index", index)) return } diff --git a/pkg/innerring/processors/alphabet/processor.go b/pkg/innerring/processors/alphabet/processor.go index 0b5a7c145f..978d2c4608 100644 --- a/pkg/innerring/processors/alphabet/processor.go +++ b/pkg/innerring/processors/alphabet/processor.go @@ -12,7 +12,7 @@ import ( type ( // Indexer is a callback interface for inner ring global state. Indexer interface { - Index() int32 + Index() int } // Processor of events produced for alphabet contracts in sidechain. diff --git a/pkg/innerring/processors/audit/processor.go b/pkg/innerring/processors/audit/processor.go index be55edd4f1..370c5bff1f 100644 --- a/pkg/innerring/processors/audit/processor.go +++ b/pkg/innerring/processors/audit/processor.go @@ -20,8 +20,8 @@ import ( type ( // Indexer is a callback interface for inner ring global state. Indexer interface { - Index() int32 - InnerRingSize() int32 + Index() int + InnerRingSize() int } // NeoFSClientCache is an interface for cache of neofs RPC clients diff --git a/pkg/innerring/state.go b/pkg/innerring/state.go index ac220c6546..b3715905a5 100644 --- a/pkg/innerring/state.go +++ b/pkg/innerring/state.go @@ -25,14 +25,14 @@ func (s *Server) IsActive() bool { // Index is a getter for a global index of node in inner ring list. Negative // index means that node is not in the inner ring list. -func (s *Server) Index() int32 { - return s.innerRingIndex.Load() +func (s *Server) Index() int { + return int(s.innerRingIndex.Load()) } // InnerRingSize is a getter for a global size of inner ring list. This value // paired with inner ring index. -func (s *Server) InnerRingSize() int32 { - return s.innerRingSize.Load() +func (s *Server) InnerRingSize() int { + return int(s.innerRingSize.Load()) } func (s *Server) voteForSidechainValidator(validators []keys.PublicKey) error {