github.com/unicornultrafoundation/go-u2u@v1.0.0-rc1.0.20240205080301-e74a83d3fadc/utils/concurrent/ValidatorEventsSet.go (about)

     1  package concurrent
     2  
     3  import (
     4  	"sync"
     5  
     6  	"github.com/unicornultrafoundation/go-helios/hash"
     7  	"github.com/unicornultrafoundation/go-helios/native/idx"
     8  )
     9  
    10  type ValidatorEventsSet struct {
    11  	sync.RWMutex
    12  	Val map[idx.ValidatorID]hash.Event
    13  }
    14  
    15  func WrapValidatorEventsSet(v map[idx.ValidatorID]hash.Event) *ValidatorEventsSet {
    16  	return &ValidatorEventsSet{
    17  		RWMutex: sync.RWMutex{},
    18  		Val:     v,
    19  	}
    20  }