common

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DposContractAddress = "0x00000000000000000000000000000000000000fe"

Variables

This section is empty.

Functions

func DecodeTransaction added in v0.2.3

func DecodeTransaction(tx models.Transaction) (functionSig string, params any, err error)

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

func ParseToString added in v0.2.3

func ParseToString(item any) (result any, err error)

func ProcessTransaction added in v0.2.3

func ProcessTransaction(trx *models.Transaction) (err error)

Types

type CallData added in v0.2.3

type CallData struct {
	Name   string `json:"name"`
	Params any    `json:"params"`
}

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