sv

package
v1.5.6 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2021 License: Apache-2.0 Imports: 12 Imported by: 7

Documentation

Index

Constants

View Source
const (
	// NodeMaxValidators specifies how many registered nodes are given
	// validation power. The set of nodes is sorted by goodness; only this
	// many of the best receive validation power in proportion to their goodness.
	NodeMaxValidators = "MaxValidatorNodes"
	// NodeRewardMaxRewarded specifies how many registered nodes are in contention
	// for each node reward. The set of nodes is sorted by goodness; only this
	// many of the best are eligible to receive node rewards.
	NodeRewardMaxRewarded = "MaxRewardedNodes"
)
View Source
const (
	AccountAttributeExchange string = "x"
)

Available account attributes.

View Source
const AccountAttributesName = "AccountAttributes"

AccountAttributesName is the name of the AccountAttributes system variable

This sytem variable stores a map[string]map[string]struct{} which maps account addresses to a map of attributes associated with that account. For example, if AccountAttributes[addr]["x"] exists, then the account with address 'addr' is an exchange account.

View Source
const BPCRulesAccountAddressName = "BPCRulesAccountAddress"

BPCRulesAccountAddressName is the name of the BPCRulesAccountAddress system variable

The value contained in this system variable must be of type address.Address

View Source
const BPCRulesAccountOwnershipName = "BPCRulesAccountOwnership"

BPCRulesAccountOwnershipName is the name of the public ownership key

View Source
const BPCRulesAccountOwnershipPrivateName = "BPCRulesAccountOwnershipPrivate"

BPCRulesAccountOwnershipPrivateName is the name of the private ownership key

View Source
const BPCRulesAccountValidationName = "BPCRulesAccountValidation"

BPCRulesAccountValidationName is the name of the public validation key

View Source
const BPCRulesAccountValidationPrivateName = "BPCRulesAccountValidationPrivate"

BPCRulesAccountValidationPrivateName is the name of the private validation key

View Source
const ChangeSchemaAddressName = "ChangeSchemaAddress"

ChangeSchemaAddressName is the name of the ChangeSchemaAddress system variable

The value contained in this system variable must be of type address.Address

View Source
const ChangeSchemaOwnershipName = "ChangeSchemaOwnership"

ChangeSchemaOwnershipName is the name of the public ownership key

View Source
const ChangeSchemaOwnershipPrivateName = "ChangeSchemaOwnershipPrivate"

ChangeSchemaOwnershipPrivateName is the name of the private ownership key

View Source
const ChangeSchemaValidationName = "ChangeSchemaValidation"

ChangeSchemaValidationName is the name of the public validation key

View Source
const ChangeSchemaValidationPrivateName = "ChangeSchemaValidationPrivate"

ChangeSchemaValidationPrivateName is the name of the private validation key

View Source
const CommandValidatorChangeAddressName = "CommandValidatorChangeAddress"

CommandValidatorChangeAddressName is the name of the CommandValidatorChangeAddress system variable

The value contained in this system variable must be of type address.Address

View Source
const CommandValidatorChangeOwnershipName = "CommandValidatorChangeOwnership"

CommandValidatorChangeOwnershipName is the name of the public ownership key

View Source
const CommandValidatorChangeOwnershipPrivateName = "CommandValidatorChangeOwnershipPrivate"

CommandValidatorChangeOwnershipPrivateName is the name of the private ownership key

View Source
const CommandValidatorChangeValidationName = "CommandValidatorChangeValidation"

CommandValidatorChangeValidationName is the name of the public validation key

View Source
const CommandValidatorChangeValidationPrivateName = "CommandValidatorChangeValidationPrivate"

CommandValidatorChangeValidationPrivateName is the name of the private validation key

View Source
const DefaultRecourseDurationName = "DefaultRecourseDuration"

DefaultRecourseDurationName is the name of the DefaultRecourseDuration system variable

View Source
const DisputeRulesAccountAddressName = "DisputeRulesAccountAddress"

DisputeRulesAccountAddressName is the name of the DisputeRulesAccountAddress system variable

The value contained in this system variable must be of type address.Address

View Source
const DisputeRulesAccountOwnershipName = "DisputeRulesAccountOwnership"

DisputeRulesAccountOwnershipName is the name of the public ownership key

View Source
const DisputeRulesAccountOwnershipPrivateName = "DisputeRulesAccountOwnershipPrivate"

DisputeRulesAccountOwnershipPrivateName is the name of the private ownership key

View Source
const DisputeRulesAccountValidationName = "DisputeRulesAccountValidation"

DisputeRulesAccountValidationName is the name of the public validation key

View Source
const DisputeRulesAccountValidationPrivateName = "DisputeRulesAccountValidationPrivate"

DisputeRulesAccountValidationPrivateName is the name of the private validation key

View Source
const EAIFeeTableName = "EAIFeeTable"

EAIFeeTableName names the EAI fee table

The system variable of this name must have the type EAIFeeTable

View Source
const EAIOvertime = "EAIOvertime"

EAIOvertime names the EAIOvertime system variable

EAI Overtime is a math.Duration constraining the max awarded interval between CreditEAI transactions.

View Source
const ExchangeEAIScriptName = "ExchangeEAIScript"

ExchangeEAIScriptName is the name of the ExchangeEAIScript system variable

This sytem variable stores the chaincode script for calculating EAI rate for exchange accounts.

View Source
const LockedRateTableName = "LockedRateTable"

LockedRateTableName is the name of the LockedRateTable system variable.

The system variable of this name has the type eai.RateTable.

This variable defines the basic table of unlocked EAI rates.

View Source
const MinDurationBetweenNodeRewardNominationsName = "MinDurationBetweenNodeRewardNominations"

MinDurationBetweenNodeRewardNominationsName names the minimum duration permitted between node rewards nominations

The system variable named by this must have the type math.Duration

View Source
const NodeGoodnessFuncName = "NodeGoodnessFunction"

NodeGoodnessFuncName names the chaincode computing the node's goodness functin

View Source
const NodeRewardNominationTimeoutName = "NodeRewardNominationTimeout"

NodeRewardNominationTimeoutName names the maximum interval permitted between valid NominateNodeReward and ClaimNodeReward transactions.

The system variable named by this must have the type math.Duration

View Source
const NodeRulesAccountAddressName = "NodeRulesAccountAddress"

NodeRulesAccountAddressName is the name of the NodeRulesAccountAddress system variable

The value contained in this system variable must be of type address.Address

View Source
const NodeRulesAccountOwnershipName = "NodeRulesAccountOwnership"

NodeRulesAccountOwnershipName is the name of the public ownership key

View Source
const NodeRulesAccountOwnershipPrivateName = "NodeRulesAccountOwnershipPrivate"

NodeRulesAccountOwnershipPrivateName is the name of the private ownership key

View Source
const NodeRulesAccountValidationName = "NodeRulesAccountValidation"

NodeRulesAccountValidationName is the name of the public validation key

View Source
const NodeRulesAccountValidationPrivateName = "NodeRulesAccountValidationPrivate"

NodeRulesAccountValidationPrivateName is the name of the private validation key

View Source
const NominateNodeRewardAddressName = "NominateNodeRewardAddress"

NominateNodeRewardAddressName is the name of the NominateNodeRewardAddress system variable

The value contained in this system variable must be of type address.Address

View Source
const NominateNodeRewardOwnershipName = "NominateNodeRewardOwnership"

NominateNodeRewardOwnershipName is the name of the public ownership key

View Source
const NominateNodeRewardOwnershipPrivateName = "NominateNodeRewardOwnershipPrivate"

NominateNodeRewardOwnershipPrivateName is the name of the private ownership key

View Source
const NominateNodeRewardValidationName = "NominateNodeRewardValidation"

NominateNodeRewardValidationName is the name of the public validation key

View Source
const NominateNodeRewardValidationPrivateName = "NominateNodeRewardValidationPrivate"

NominateNodeRewardValidationPrivateName is the name of the private validation key

View Source
const RecordEndowmentNAVAddressName = "RecordEndowmentNAVAddress"

RecordEndowmentNAVAddressName is the name of the RecordEndowmentNAVAddress system variable

The value contained in this system variable must be of type address.Address

View Source
const RecordEndowmentNAVOwnershipName = "RecordEndowmentNAVOwnership"

RecordEndowmentNAVOwnershipName is the name of the public ownership key

View Source
const RecordEndowmentNAVOwnershipPrivateName = "RecordEndowmentNAVOwnershipPrivate"

RecordEndowmentNAVOwnershipPrivateName is the name of the private ownership key

View Source
const RecordEndowmentNAVValidationName = "RecordEndowmentNAVValidation"

RecordEndowmentNAVValidationName is the name of the public validation key

View Source
const RecordEndowmentNAVValidationPrivateName = "RecordEndowmentNAVValidationPrivate"

RecordEndowmentNAVValidationPrivateName is the name of the private validation key

View Source
const RecordPriceAddressName = "RecordPriceAddress"

RecordPriceAddressName is the name of the RecordPriceAddress system variable

The value contained in this system variable must be of type address.Address

View Source
const RecordPriceOwnershipName = "RecordPriceOwnership"

RecordPriceOwnershipName is the name of the public ownership key

View Source
const RecordPriceOwnershipPrivateName = "RecordPriceOwnershipPrivate"

RecordPriceOwnershipPrivateName is the name of the private ownership key

View Source
const RecordPriceValidationName = "RecordPriceValidation"

RecordPriceValidationName is the name of the public validation key

View Source
const RecordPriceValidationPrivateName = "RecordPriceValidationPrivate"

RecordPriceValidationPrivateName is the name of the private validation key

View Source
const ReleaseFromEndowmentAddressName = "ReleaseFromEndowmentAddress"

ReleaseFromEndowmentAddressName is the name of the ReleaseFromEndowmentAddress system variable

The value contained in this system variable must be of type address.Address

View Source
const ReleaseFromEndowmentOwnershipName = "ReleaseFromEndowmentOwnership"

ReleaseFromEndowmentOwnershipName is the name of the public ownership key

View Source
const ReleaseFromEndowmentOwnershipPrivateName = "ReleaseFromEndowmentOwnershipPrivate"

ReleaseFromEndowmentOwnershipPrivateName is the name of the private ownership key

View Source
const ReleaseFromEndowmentValidationName = "ReleaseFromEndowmentValidation"

ReleaseFromEndowmentValidationName is the name of the public validation key

View Source
const ReleaseFromEndowmentValidationPrivateName = "ReleaseFromEndowmentValidationPrivate"

ReleaseFromEndowmentValidationPrivateName is the name of the private validation key

View Source
const SIBScriptName = "SIBScript"

SIBScriptName is the name of the SIBScript system variable

This sytem variable stores the chaincode script for calculating SIB.

View Source
const SetSysvarAddressName = "SetSysvarAddress"

SetSysvarAddressName is the name of the SetSysvarAddress system variable

The value contained in this system variable must be of type address.Address

View Source
const SetSysvarOwnershipName = "SetSysvarOwnership"

SetSysvarOwnershipName is the name of the public ownership key

View Source
const SetSysvarOwnershipPrivateName = "SetSysvarOwnershipPrivate"

SetSysvarOwnershipPrivateName is the name of the private ownership key

View Source
const SetSysvarValidationName = "SetSysvarValidation"

SetSysvarValidationName is the name of the public validation key

View Source
const SetSysvarValidationPrivateName = "SetSysvarValidationPrivate"

SetSysvarValidationPrivateName is the name of the private validation key

View Source
const TxFeeScriptName = "TransactionFeeScript"

TxFeeScriptName is the name of the TxFeeScript system variable

This sytem variable store the chaincode script used to calculate transaction fees.

View Source
const UnlockedRateTableName = "UnlockedRateTable"

UnlockedRateTableName is the name of the UnlockedRateTable system variable.

The system variable of this name has the type eai.RateTable.

This variable defines the basic table of unlocked EAI rates.

Variables

View Source
var BPCRulesAccount = SysAcct{
	Name:    "BPCRulesAccount",
	Address: BPCRulesAccountAddressName,
	Ownership: Keypair{
		Public:  BPCRulesAccountOwnershipName,
		Private: BPCRulesAccountOwnershipPrivateName,
	},
	Validation: Keypair{
		Public:  BPCRulesAccountValidationName,
		Private: BPCRulesAccountValidationPrivateName,
	},
}

BPCRulesAccount encapsulates data about the BPCRulesAccount system variables in a structured way.

View Source
var ChangeSchema = SysAcct{
	Name:    "ChangeSchema",
	Address: ChangeSchemaAddressName,
	Ownership: Keypair{
		Public:  ChangeSchemaOwnershipName,
		Private: ChangeSchemaOwnershipPrivateName,
	},
	Validation: Keypair{
		Public:  ChangeSchemaValidationName,
		Private: ChangeSchemaValidationPrivateName,
	},
}

ChangeSchema encapsulates data about the ChangeSchema system variables in a structured way.

View Source
var CommandValidatorChange = SysAcct{
	Name:    "CommandValidatorChange",
	Address: CommandValidatorChangeAddressName,
	Ownership: Keypair{
		Public:  CommandValidatorChangeOwnershipName,
		Private: CommandValidatorChangeOwnershipPrivateName,
	},
	Validation: Keypair{
		Public:  CommandValidatorChangeValidationName,
		Private: CommandValidatorChangeValidationPrivateName,
	},
}

CommandValidatorChange encapsulates data about the CommandValidatorChange system variables in a structured way.

View Source
var DisputeRulesAccount = SysAcct{
	Name:    "DisputeRulesAccount",
	Address: DisputeRulesAccountAddressName,
	Ownership: Keypair{
		Public:  DisputeRulesAccountOwnershipName,
		Private: DisputeRulesAccountOwnershipPrivateName,
	},
	Validation: Keypair{
		Public:  DisputeRulesAccountValidationName,
		Private: DisputeRulesAccountValidationPrivateName,
	},
}

DisputeRulesAccount encapsulates data about the DisputeRulesAccount system variables in a structured way.

View Source
var NodeRulesAccount = SysAcct{
	Name:    "NodeRulesAccount",
	Address: NodeRulesAccountAddressName,
	Ownership: Keypair{
		Public:  NodeRulesAccountOwnershipName,
		Private: NodeRulesAccountOwnershipPrivateName,
	},
	Validation: Keypair{
		Public:  NodeRulesAccountValidationName,
		Private: NodeRulesAccountValidationPrivateName,
	},
}

NodeRulesAccount encapsulates data about the NodeRulesAccount system variables in a structured way.

View Source
var NominateNodeReward = SysAcct{
	Name:    "NominateNodeReward",
	Address: NominateNodeRewardAddressName,
	Ownership: Keypair{
		Public:  NominateNodeRewardOwnershipName,
		Private: NominateNodeRewardOwnershipPrivateName,
	},
	Validation: Keypair{
		Public:  NominateNodeRewardValidationName,
		Private: NominateNodeRewardValidationPrivateName,
	},
}

NominateNodeReward encapsulates data about the NominateNodeReward system variables in a structured way.

View Source
var RecordEndowmentNAV = SysAcct{
	Name:    "RecordEndowmentNAV",
	Address: RecordEndowmentNAVAddressName,
	Ownership: Keypair{
		Public:  RecordEndowmentNAVOwnershipName,
		Private: RecordEndowmentNAVOwnershipPrivateName,
	},
	Validation: Keypair{
		Public:  RecordEndowmentNAVValidationName,
		Private: RecordEndowmentNAVValidationPrivateName,
	},
}

RecordEndowmentNAV encapsulates data about the RecordEndowmentNAV system variables in a structured way.

View Source
var RecordPrice = SysAcct{
	Name:    "RecordPrice",
	Address: RecordPriceAddressName,
	Ownership: Keypair{
		Public:  RecordPriceOwnershipName,
		Private: RecordPriceOwnershipPrivateName,
	},
	Validation: Keypair{
		Public:  RecordPriceValidationName,
		Private: RecordPriceValidationPrivateName,
	},
}

RecordPrice encapsulates data about the RecordPrice system variables in a structured way.

View Source
var ReleaseFromEndowment = SysAcct{
	Name:    "ReleaseFromEndowment",
	Address: ReleaseFromEndowmentAddressName,
	Ownership: Keypair{
		Public:  ReleaseFromEndowmentOwnershipName,
		Private: ReleaseFromEndowmentOwnershipPrivateName,
	},
	Validation: Keypair{
		Public:  ReleaseFromEndowmentValidationName,
		Private: ReleaseFromEndowmentValidationPrivateName,
	},
}

ReleaseFromEndowment encapsulates data about the ReleaseFromEndowment system variables in a structured way.

View Source
var SetSysvar = SysAcct{
	Name:    "SetSysvar",
	Address: SetSysvarAddressName,
	Ownership: Keypair{
		Public:  SetSysvarOwnershipName,
		Private: SetSysvarOwnershipPrivateName,
	},
	Validation: Keypair{
		Public:  SetSysvarValidationName,
		Private: SetSysvarValidationPrivateName,
	},
}

SetSysvar encapsulates data about the SetSysvar system variables in a structured way.

Functions

func FuncValidators

func FuncValidators() []string

FuncValidators returns the list of known function validators

func HasValidator

func HasValidator(name string) bool

HasValidator is true when a validator exists for the given sysvar

func IsValid

func IsValid(name string, data []byte) (*bool, error)

IsValid is true when the supplied data is a valid instance of the given system variable.

In the event the name is unknown, this function will return nil.

func RegisterFuncValidator

func RegisterFuncValidator(name string, v func([]byte) bool)

RegisterFuncValidator registers a function validator for a sysvar

func RegisterTypeValidator

func RegisterTypeValidator(name string, v Validatable)

RegisterTypeValidator registers a type validator for a sysvar

func TypeValidators

func TypeValidators() []string

TypeValidators returns the list of know type validators

func ValidateAddress

func ValidateAddress(data []byte) bool

ValidateAddress ensures this value works as an Address

func ValidateChaincode

func ValidateChaincode(data []byte) bool

ValidateChaincode ensures this value works as a Chaincode script

func ValidateDuration

func ValidateDuration(data []byte) bool

ValidateDuration ensures this value works as a Duration

func ValidateNdau

func ValidateNdau(data []byte) bool

ValidateNdau ensures this value works as Ndau

func ValidateRateTable

func ValidateRateTable(data []byte) bool

ValidateRateTable validates an eai.RateTable

func ValidateUInt64

func ValidateUInt64(data []byte) bool

ValidateUInt64 ensures this value works as a wkt.Uint64

Types

type AccountAttributes

type AccountAttributes map[string]map[string]struct{}

AccountAttributes is a list of EAI fees and their destinations

func (AccountAttributes) MarshalMsg

func (z AccountAttributes) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (AccountAttributes) Msgsize

func (z AccountAttributes) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*AccountAttributes) UnmarshalMsg

func (z *AccountAttributes) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*AccountAttributes) Validate

func (aa *AccountAttributes) Validate() bool

Validate implements SelfValidatable

In this case, it exists to reduce the chance that someone reversed the order of the map keys by enforcing that all top-level keys must be valid addresses

func (*AccountAttributes) Zeroize

func (aa *AccountAttributes) Zeroize()

Zeroize implements validatable

type EAIFee

type EAIFee struct {
	Fee math.Ndau
	To  *address.Address
}

An EAIFee is a fee applied to accrued EAI when crediting.

The fee is listed as Ndau; the listed value is multiplied by the number of Ndau actually earned as EAI.

The fee is credited to the account at the listed address. If the destination is nil, it is considered to be a node reward, and is tracked in internal state instead of going into an account.

func (*EAIFee) MarshalMsg

func (z *EAIFee) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (EAIFee) MarshalText

func (f EAIFee) MarshalText() ([]byte, error)

MarshalText implements encoding.TextMarshaler

func (*EAIFee) Msgsize

func (z *EAIFee) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*EAIFee) UnmarshalMsg

func (z *EAIFee) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*EAIFee) UnmarshalText

func (f *EAIFee) UnmarshalText(text []byte) error

UnmarshalText implements encoding.TextUnmarshaler

type EAIFeeTable

type EAIFeeTable []EAIFee

EAIFeeTable is a list of EAI fees and their destinations

func (EAIFeeTable) MarshalMsg

func (z EAIFeeTable) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (EAIFeeTable) Msgsize

func (z EAIFeeTable) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*EAIFeeTable) UnmarshalMsg

func (z *EAIFeeTable) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*EAIFeeTable) Zeroize

func (e *EAIFeeTable) Zeroize()

Zeroize implements Validatable

type Keypair

type Keypair struct {
	Public  string
	Private string
}

Keypair is a helper for organizing data about system accounts.

type SelfValidatable

type SelfValidatable interface {
	Validate() bool
}

A SelfValidatable type is one which applies additional self-validation

type SysAcct

type SysAcct struct {
	Name       string
	Address    string
	Ownership  Keypair
	Validation Keypair
}

SysAcct is a helper for organizing data about system accounts

While the canonical data is in the package-root consts, it is useful in i.e. a generation context to be able to package up all the data about a particular system account. That's what this is for.

All data in this struct is comprised of strings which name system variables which exist either in the SystemStore or in the associated data.

type Validatable

type Validatable interface {
	msgp.Unmarshaler

	// reset this instance to the zero value
	Zeroize()
}

A Validatable type is one which can be unmarshaled and zeroized

Jump to

Keyboard shortcuts

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