Documentation ¶
Overview ¶
Package constants contains all the constants used by thorchain by default all the settings in this is for mainnet
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( GitCommit string = "null" // sha1 revision used to build the program BuildTime string = "null" // when the executable was built Version string = "0.1.0" // software version )
var SWVersion, _ = semver.Make(Version)
The version of this software
var ThorchainBlockTime = 5 * time.Second
Block time of THORChain
Functions ¶
This section is empty.
Types ¶
type ConstantName ¶
type ConstantName int
ConstantName the name we used to get constant values
const ( EmissionCurve ConstantName = iota BlocksPerYear TransactionFee NewPoolCycle MinimumNodesForYggdrasil MinimumNodesForBFT ValidatorRotateInNumBeforeFull ValidatorRotateOutNumBeforeFull ValidatorRotateNumAfterFull DesireValidatorSet RotatePerBlockHeight RotateRetryBlocks ValidatorsChangeWindow LeaveProcessPerBlockHeight BadValidatorRate OldValidatorRate LackOfObservationPenalty SigningTransactionPeriod DoubleSignMaxAge MinimumBondInRune FundMigrationInterval WhiteListGasAsset ArtificialRagnarokBlockHeight MaximumStakeRune StrictBondStakeRatio DefaultPoolStatus FailKeygenSlashPoints FailKeySignSlashPoints StakeLockUpBlocks ObserveSlashPoints ObserveFlex YggFundLimit JailTimeKeygen JailTimeKeysign CliTxCost )
type ConstantVals ¶
type ConstantVals struct {
// contains filtered or unexported fields
}
ConstantValues implement ConstantValues interface
func NewConstantValue010 ¶
func NewConstantValue010() *ConstantVals
NewConstantValue010 get new instance of ConstantValue010
func (*ConstantVals) GetBoolValue ¶
func (cv *ConstantVals) GetBoolValue(name ConstantName) bool
GetBoolValue retrieve a bool constant value from the map
func (*ConstantVals) GetInt64Value ¶
func (cv *ConstantVals) GetInt64Value(name ConstantName) 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 (*ConstantVals) GetStringValue ¶
func (cv *ConstantVals) GetStringValue(name ConstantName) string
GetStringValue retrieve a string const value from the map
func (ConstantVals) MarshalJSON ¶
func (cv ConstantVals) MarshalJSON() ([]byte, error)
MarshalJSON marshal result to json format
func (*ConstantVals) String ¶
func (cv *ConstantVals) String() string
type ConstantValues ¶
type ConstantValues interface { fmt.Stringer GetInt64Value(name ConstantName) int64 GetBoolValue(name ConstantName) bool GetStringValue(name ConstantName) string }
ConstantValues define methods used to get constant values
func GetConstantValues ¶
func GetConstantValues(ver semver.Version) ConstantValues
GetConstantValues will return an implementation of ConstantValues which provide ways to get constant values
type DummyConstants ¶
type DummyConstants struct {
// contains filtered or unexported fields
}
func NewDummyConstants ¶
func NewDummyConstants(int64Values map[ConstantName]int64, boolValues map[ConstantName]bool, stringValues map[ConstantName]string) *DummyConstants
NewDummyConstants create a new instance of DummyConstants for test purpose
func (*DummyConstants) GetBoolValue ¶
func (dc *DummyConstants) GetBoolValue(name ConstantName) bool
func (*DummyConstants) GetInt64Value ¶
func (dc *DummyConstants) GetInt64Value(name ConstantName) int64
func (*DummyConstants) GetStringValue ¶
func (dc *DummyConstants) GetStringValue(name ConstantName) string
func (*DummyConstants) String ¶
func (dc *DummyConstants) String() string