common

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DposContractAddress = "0x00000000000000000000000000000000000000fe"

Variables

This section is empty.

Functions

func FormatFloat

func FormatFloat(f float64) string

func GetYieldIntervalEnd

func GetYieldIntervalEnd(pbft_count uint64, block_num *uint64, interval uint64) uint64

func MakeThreadPool

func MakeThreadPool() pool.Pool

isn't creating threads, but limiting goroutines count. Mostly used for RPC and db related tasks

func ParseStringToBigInt

func ParseStringToBigInt(v string) *big.Int

Types

type ChainConfig

type ChainConfig struct {
	CommitteeSize        *big.Int
	BlocksPerYear        *big.Int
	YieldPercentage      *big.Int
	DagProposersReward   *big.Int
	MaxBlockAuthorReward *big.Int
}

func DefaultChainConfig

func DefaultChainConfig() *ChainConfig

type Config

type Config struct {
	Chain                         *ChainConfig
	TotalYieldSavingInterval      uint64
	ValidatorsYieldSavingInterval uint64
}

func DefaultConfig

func DefaultConfig() *Config

type Task

type Task[P any] struct {
	// contains filtered or unexported fields
}

func MakeTask

func MakeTask[P any](f func(P) error, params P, err *error) *Task[P]

func (*Task[P]) Run

func (t *Task[P]) Run()

type TaskWithResult

type TaskWithResult[P, R any] struct {
	// contains filtered or unexported fields
}

func MakeTaskWithResult

func MakeTaskWithResult[P, R any](f func(P) (R, error), params P, result *R, err *error) *TaskWithResult[P, R]

func (*TaskWithResult[P, R]) Run

func (t *TaskWithResult[P, R]) Run()

Jump to

Keyboard shortcuts

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