utils

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2021 License: GPL-3.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToAddressString

func BytesToAddressString(a []byte) string

Hex returns an EIP55-compliant hex string representation of the address.

func BytesToHex

func BytesToHex(a []byte) string

func FindStringValue

func FindStringValue(obj *bson.D, key string) string

func GetAsBool

func GetAsBool(rv bson.RawValue) bool

func GetAsInt

func GetAsInt(rv bson.RawValue) int

func GetAsInt32

func GetAsInt32(rv bson.RawValue) int32

func GetAsInt64

func GetAsInt64(rv bson.RawValue) int64

func GetAsString

func GetAsString(rv bson.RawValue) string

func GetAsUInt32

func GetAsUInt32(rv bson.RawValue) uint32

func GetAsUInt64

func GetAsUInt64(rv bson.RawValue) uint64

func Gini

func Gini(smeshers map[string]int64) float64
1          sum((n + 1 - i)*y[i])

G = -(n + 1 - 2---------------------

n                sum(y[i])

func NBytesToHex

func NBytesToHex(a []byte, n int) string

func PrintActivation

func PrintActivation(atx *pb.Activation)

func PrintBlock

func PrintBlock(block *pb.Block)

func PrintLayer

func PrintLayer(layer *pb.Layer)

func PrintReward

func PrintReward(reward *pb.Reward)

func PrintTransaction

func PrintTransaction(tx *pb.Transaction)

func StringToBytes

func StringToBytes(s string) ([]byte, error)

Types

type CommitmentSizes

type CommitmentSizes []int64

func (CommitmentSizes) Len

func (a CommitmentSizes) Len() int

func (CommitmentSizes) Less

func (a CommitmentSizes) Less(i, j int) bool

func (CommitmentSizes) Swap

func (a CommitmentSizes) Swap(i, j int)

Jump to

Keyboard shortcuts

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