common

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2019 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EmptyHash = ethCommon.Hash{}
)

Functions

func BigIntMulBigRat

func BigIntMulBigRat(bigInt *big.Int, bigRat *big.Rat) *big.Int

func BytesToUint32

func BytesToUint32(byte []byte) uint32

func DeepCopy

func DeepCopy(dst, src interface{}) error

func GetIPV4Addr

func GetIPV4Addr() (string, error)

func Has0xPrefix

func Has0xPrefix(input string) bool

func IntLeftMostBit

func IntLeftMostBit(v uint32) uint32

IntLeftMostBit left most bit

func IsLocalIP

func IsLocalIP(ip string) bool

func IsNil

func IsNil(data interface{}) bool

func IsP2

func IsP2(shardSize uint32) bool

IsP2 is check num is 2^x

func MasksHaveOverlap

func MasksHaveOverlap(m1, m2 uint32) bool

0b101, 0b11 -> True 0b101, 0b10 -> False

func RemoveDuplicate

func RemoveDuplicate(data []uint64) []uint64

func Uint32ToBytes

func Uint32ToBytes(n uint32) []byte

Uint32ToBytes trans uint32 num to bytes

Types

type ConstMinorBlockRewardCalculator

type ConstMinorBlockRewardCalculator struct {
}

ConstMinorBlockRewardCalculator blockReward struct

func (*ConstMinorBlockRewardCalculator) GetBlockReward

func (c *ConstMinorBlockRewardCalculator) GetBlockReward() *big.Int

GetBlockReward getBlockReward

Jump to

Keyboard shortcuts

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