Documentation ¶
Index ¶
- func BigTo256(b *big.Int) common.Hash
- func I64to256(i64 int64) common.Hash
- func NameOf(p idx.ValidatorID) string
- func ToFtm(ftm uint64) *big.Int
- func U64to256(u64 uint64) common.Hash
- func U64toBig(u64 uint64) *big.Int
- func WeightedPermutation(size int, weights []pos.Weight, seed hash.Hash) []int
- type NumQueue
- type PrettyDuration
- type SpinLock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NameOf ¶
func NameOf(p idx.ValidatorID) string
NameOf returns human readable string representation.
Types ¶
type NumQueue ¶
type NumQueue struct {
// contains filtered or unexported fields
}
func NewNumQueue ¶
type PrettyDuration ¶
PrettyDuration is a combination of common.PrettyDuration and common.PrettyAge It is a pretty printed version of a time.Duration value that rounds the values up to a single most significant unit, while showing the least significant part if duration isn't too large.
func (PrettyDuration) String ¶
func (t PrettyDuration) String() string
String implements the Stringer interface, allowing pretty printing of duration values rounded to the most significant time unit.
type SpinLock ¶
type SpinLock struct {
// contains filtered or unexported fields
}
SpinLock implements a simple atomic spin lock, the zero value for a SpinLock is an unlocked spinlock.
func (*SpinLock) Lock ¶
func (sl *SpinLock) Lock()
Lock locks sl. If the lock is already in use, the caller blocks until Unlock is called
func (*SpinLock) TryLock ¶
TryLock will try to lock sl and return whether it succeed or not without blocking.
func (*SpinLock) Unlock ¶
func (sl *SpinLock) Unlock()
Unlock unlocks sl, unlike [Mutex.Unlock](http://golang.org/pkg/sync/#Mutex.Unlock), there's no harm calling it on an unlocked SpinLock