utils

package
v0.18.15 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 18 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 GetStorageByAddressKey added in v0.18.15

func GetStorageByAddressKey(address ethcmn.Address, key []byte) ethcmn.Hash

func GetTransactionHash added in v0.18.15

func GetTransactionHash(tx []byte) []byte

func Hash added in v0.10.4

func Hash(result []byte) []byte

Hash returns ripemd160 hash of the given input

func HashToBigInt added in v0.18.15

func HashToBigInt(s string) *big.Int

hashToBigInt used to convert mostly chain id which is a string

func PadZero added in v0.16.1

func PadZero(s string) string

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 PrintStringMap added in v0.18.15

func PrintStringMap(dict map[string]interface{}, msg string, sorted bool)

func RecoverPlain added in v0.18.15

func RecoverPlain(sighash common.Hash, R, S, Vb *big.Int, homestead bool) (*ecdsa.PublicKey, error)

func RlpHash added in v0.18.15

func RlpHash(x interface{}) (h common.Hash)

rlpHash encodes x and hashes the encoded bytes.

func SHA2 added in v0.14.1

func SHA2(data []byte) []byte

func ToUncompressedSig added in v0.18.15

func ToUncompressedSig(R, S, Vb *big.Int) []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