Documentation
¶
Index ¶
- Constants
- func DecodeTransaction(tx models.Transaction) (functionSig string, params any, err error)
- func FormatFloat(f float64) string
- func GetFunctionName(temp interface{}) string
- func GetYieldIntervalEnd(pbft_count uint64, block_num *uint64, interval uint64) uint64
- func MakeThreadPool() pool.Pool
- func Max[T Number](a, b T) T
- func Min[T Number](a, b T) T
- func ParseBool(s string) (v bool)
- func ParseFloat(s string) (v float64)
- func ParseInt(s string) (v int64)
- func ParseStringToBigInt(v string) *big.Int
- func ParseToString(item any) (result any, err error)
- func ParseUInt(s string) (v uint64)
- func ProcessTransaction(trx *models.Transaction) (err error)
- type AspenHfConfig
- type CallData
- type ChainConfig
- type Config
- type HardforksConfig
- type MagnoliaHfConfig
- type Number
- type Task
- type TaskWithResult
- type TaskWithoutParams
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 GetFunctionName ¶ added in v0.4.0
func GetFunctionName(temp interface{}) string
func GetYieldIntervalEnd ¶
func MakeThreadPool ¶
func MakeThreadPool() pool.Pool
isn't creating threads, but limiting goroutines count. Mostly used for RPC and db related tasks
func ParseFloat ¶ added in v1.5.6
func ParseStringToBigInt ¶
func ParseToString ¶ added in v0.2.3
func ProcessTransaction ¶ added in v0.2.3
func ProcessTransaction(trx *models.Transaction) (err error)
Types ¶
type AspenHfConfig ¶ added in v1.5.4
type AspenHfConfig struct { BlockNumPartOne uint64 `json:"block_num_part_one"` BlockNumPartTwo uint64 `json:"block_num_part_two"` MaxSupply *big.Int `json:"max_supply"` GeneratedRewards *big.Int `json:"generated_rewards"` }
func (*AspenHfConfig) UnmarshalJSON ¶ added in v1.5.4
func (hf *AspenHfConfig) UnmarshalJSON(data []byte) error
type ChainConfig ¶
type ChainConfig struct { CommitteeSize *big.Int BlocksPerYear *big.Int YieldPercentage *big.Int DagProposersReward *big.Int MaxBlockAuthorReward *big.Int EligibilityBalanceThreshold *big.Int Hardforks HardforksConfig }
func DefaultChainConfig ¶
func DefaultChainConfig() *ChainConfig
type Config ¶
type Config struct { Chain *ChainConfig TotalYieldSavingInterval uint64 ValidatorsYieldSavingInterval uint64 SyncQueueLimit uint64 ChainStatsInterval int }
func DefaultConfig ¶
func DefaultConfig() *Config
type HardforksConfig ¶ added in v0.4.0
type HardforksConfig struct { RewardsDistributionFrequency map[uint64]uint32 `json:"rewards_distribution_frequency"` MagnoliaHf MagnoliaHfConfig `json:"magnolia_hf"` AspenHf AspenHfConfig `json:"aspen_hf"` }
func (*HardforksConfig) GetDistributionFrequency ¶ added in v0.4.0
func (c *HardforksConfig) GetDistributionFrequency(period uint64) uint32
func (*HardforksConfig) IsAspenHfOne ¶ added in v1.8.1
func (c *HardforksConfig) IsAspenHfOne(blockNum uint64) bool
func (*HardforksConfig) IsAspenHfTwo ¶ added in v1.8.1
func (c *HardforksConfig) IsAspenHfTwo(blockNum uint64) bool
type MagnoliaHfConfig ¶ added in v0.4.0
type MagnoliaHfConfig struct {
BlockNum uint64 `json:"block_num"`
}
func (*MagnoliaHfConfig) UnmarshalJSON ¶ added in v0.4.0
func (hf *MagnoliaHfConfig) UnmarshalJSON(data []byte) error
type Number ¶ added in v1.8.1
type Number interface { constraints.Integer | constraints.Float }
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()
type TaskWithoutParams ¶ added in v0.4.0
type TaskWithoutParams struct {
// contains filtered or unexported fields
}
func MakeTaskWithoutParams ¶ added in v0.4.0
func MakeTaskWithoutParams(f func() error, err *error) *TaskWithoutParams
func (*TaskWithoutParams) Run ¶ added in v0.4.0
func (t *TaskWithoutParams) Run()
Click to show internal directories.
Click to hide internal directories.