utils

package
v0.15.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AddrPrefix = "0lt"
	HexPrefix  = "0x"
)

Hex prefix

Variables

View Source
var ErrParsingAddress = errors.New("failed to parse network address")

Functions

func GetPort

func GetPort(addr string) (string, error)

Pick out the port from a full address

func Hash added in v0.10.4

func Hash(result []byte) []byte

Hash returns ripemd160 hash of the given input

func PrefixAddress added in v0.14.0

func PrefixAddress(in string) string

func PrefixHex added in v0.10.8

func PrefixHex(in string) string

func SHA2 added in v0.14.1

func SHA2(data []byte) []byte

func TrimAddress added in v0.14.0

func TrimAddress(in string) string

func TrimHex added in v0.14.0

func TrimHex(in string) string

Types

type PriorityQueue added in v0.10.4

type PriorityQueue []*Queued

A PriorityQueue implements heap.Interface and holds Items.

func (PriorityQueue) Len added in v0.10.4

func (vq PriorityQueue) Len() int

func (PriorityQueue) Less added in v0.10.4

func (vq PriorityQueue) Less(i, j int) bool

func (*PriorityQueue) Pop added in v0.10.4

func (vq *PriorityQueue) Pop() interface{}

func (*PriorityQueue) Push added in v0.10.4

func (vq *PriorityQueue) Push(x interface{})

func (PriorityQueue) Swap added in v0.10.4

func (vq PriorityQueue) Swap(i, j int)

func (*PriorityQueue) Update added in v0.10.4

func (vq *PriorityQueue) Update(item *Queued, value []byte, priority int64)

update modifies the priority and value of an Queued in the queue.

type Queued added in v0.10.4

type Queued struct {
	// contains filtered or unexported fields
}

An Queued is a priority queue we hold for validators

func NewQueued added in v0.10.4

func NewQueued(value []byte, priority int64, index int) *Queued

func (Queued) Index added in v0.14.3

func (q Queued) Index() int

func (Queued) Priority added in v0.10.4

func (q Queued) Priority() int64

func (Queued) Value added in v0.10.4

func (q Queued) Value() []byte

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL