configs

package
v1.0.1-prerelease Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GitCommit            = "null" // sha1 revision used to build the program
	BuildTime            = "null" // when the executable was built
	Version              = "1"    // software version
	Denom                = "uarkeo"
	MaxBasisPoints int64 = 10_000
)
View Source
var BlockTime = 5 * time.Second

Functions

func GetSWVersion

func GetSWVersion() (int64, error)

Types

type ConfigName

type ConfigName int

ConfigName the name we used to get constant values

const (
	HandlerBondProvider ConfigName = iota
	HandlerModProvider
	HandlerOpenContract
	HandlerCloseContract
	HandlerClaimContractIncome
	HandlerSetVersion
	MaxSupply
	MaxContractLength
	OpenContractCost
	MinProviderBond
	ReserveTax
	BlocksPerYear
	EmissionCurve
	ValidatorPayoutCycle
	VersionConsensus
)

func (ConfigName) String

func (cn ConfigName) String() string

String implement fmt.stringer

type ConfigVals

type ConfigVals struct {
	// contains filtered or unexported fields
}

ConfigVals implement ConfigValues interface

func NewConfigValue010

func NewConfigValue010() *ConfigVals

NewConfigValue010 get new instance of ConfigValue010

func (*ConfigVals) GetBoolValue

func (cv *ConfigVals) GetBoolValue(name ConfigName) bool

GetBoolValue retrieve a bool constant value from the map

func (*ConfigVals) GetInt64Value

func (cv *ConfigVals) GetInt64Value(name ConfigName) int64

GetInt64Value get value in int64 type, if it doesn't exist then it will return the default value of int64, which is 0

func (*ConfigVals) GetStringValue

func (cv *ConfigVals) GetStringValue(name ConfigName) string

GetStringValue retrieve a string const value from the map

func (ConfigVals) MarshalJSON

func (cv ConfigVals) MarshalJSON() ([]byte, error)

MarshalJSON marshal result to json format

func (*ConfigVals) String

func (cv *ConfigVals) String() string

type ConfigValues

type ConfigValues interface {
	fmt.Stringer
	GetInt64Value(name ConfigName) int64
	GetBoolValue(name ConfigName) bool
	GetStringValue(name ConfigName) string
}

ConfigValues define methods used to get constant values

func GetConfigValues

func GetConfigValues(ver int64) ConfigValues

GetConfigValues will return an implementation of ConfigValues which provide ways to get constant values

Jump to

Keyboard shortcuts

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