Documentation ¶
Index ¶
- Constants
- Variables
- func FuncValidators() []string
- func HasValidator(name string) bool
- func IsValid(name string, data []byte) (*bool, error)
- func RegisterFuncValidator(name string, v func([]byte) bool)
- func RegisterTypeValidator(name string, v Validatable)
- func TypeValidators() []string
- func ValidateAddress(data []byte) bool
- func ValidateChaincode(data []byte) bool
- func ValidateDuration(data []byte) bool
- func ValidateNdau(data []byte) bool
- func ValidateRateTable(data []byte) bool
- func ValidateUInt64(data []byte) bool
- type AccountAttributes
- type EAIFee
- type EAIFeeTable
- type Keypair
- type SelfValidatable
- type SysAcct
- type Validatable
Constants ¶
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" )
const (
AccountAttributeExchange string = "x"
)
Available account attributes.
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.
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
const BPCRulesAccountOwnershipName = "BPCRulesAccountOwnership"
BPCRulesAccountOwnershipName is the name of the public ownership key
const BPCRulesAccountOwnershipPrivateName = "BPCRulesAccountOwnershipPrivate"
BPCRulesAccountOwnershipPrivateName is the name of the private ownership key
const BPCRulesAccountValidationName = "BPCRulesAccountValidation"
BPCRulesAccountValidationName is the name of the public validation key
const BPCRulesAccountValidationPrivateName = "BPCRulesAccountValidationPrivate"
BPCRulesAccountValidationPrivateName is the name of the private validation key
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
const ChangeSchemaOwnershipName = "ChangeSchemaOwnership"
ChangeSchemaOwnershipName is the name of the public ownership key
const ChangeSchemaOwnershipPrivateName = "ChangeSchemaOwnershipPrivate"
ChangeSchemaOwnershipPrivateName is the name of the private ownership key
const ChangeSchemaValidationName = "ChangeSchemaValidation"
ChangeSchemaValidationName is the name of the public validation key
const ChangeSchemaValidationPrivateName = "ChangeSchemaValidationPrivate"
ChangeSchemaValidationPrivateName is the name of the private validation key
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
const CommandValidatorChangeOwnershipName = "CommandValidatorChangeOwnership"
CommandValidatorChangeOwnershipName is the name of the public ownership key
const CommandValidatorChangeOwnershipPrivateName = "CommandValidatorChangeOwnershipPrivate"
CommandValidatorChangeOwnershipPrivateName is the name of the private ownership key
const CommandValidatorChangeValidationName = "CommandValidatorChangeValidation"
CommandValidatorChangeValidationName is the name of the public validation key
const CommandValidatorChangeValidationPrivateName = "CommandValidatorChangeValidationPrivate"
CommandValidatorChangeValidationPrivateName is the name of the private validation key
const DefaultRecourseDurationName = "DefaultRecourseDuration"
DefaultRecourseDurationName is the name of the DefaultRecourseDuration system variable
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
const DisputeRulesAccountOwnershipName = "DisputeRulesAccountOwnership"
DisputeRulesAccountOwnershipName is the name of the public ownership key
const DisputeRulesAccountOwnershipPrivateName = "DisputeRulesAccountOwnershipPrivate"
DisputeRulesAccountOwnershipPrivateName is the name of the private ownership key
const DisputeRulesAccountValidationName = "DisputeRulesAccountValidation"
DisputeRulesAccountValidationName is the name of the public validation key
const DisputeRulesAccountValidationPrivateName = "DisputeRulesAccountValidationPrivate"
DisputeRulesAccountValidationPrivateName is the name of the private validation key
const EAIFeeTableName = "EAIFeeTable"
EAIFeeTableName names the EAI fee table
The system variable of this name must have the type EAIFeeTable
const EAIOvertime = "EAIOvertime"
EAIOvertime names the EAIOvertime system variable
EAI Overtime is a math.Duration constraining the max awarded interval between CreditEAI transactions.
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.
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.
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
const NodeGoodnessFuncName = "NodeGoodnessFunction"
NodeGoodnessFuncName names the chaincode computing the node's goodness functin
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
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
const NodeRulesAccountOwnershipName = "NodeRulesAccountOwnership"
NodeRulesAccountOwnershipName is the name of the public ownership key
const NodeRulesAccountOwnershipPrivateName = "NodeRulesAccountOwnershipPrivate"
NodeRulesAccountOwnershipPrivateName is the name of the private ownership key
const NodeRulesAccountValidationName = "NodeRulesAccountValidation"
NodeRulesAccountValidationName is the name of the public validation key
const NodeRulesAccountValidationPrivateName = "NodeRulesAccountValidationPrivate"
NodeRulesAccountValidationPrivateName is the name of the private validation key
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
const NominateNodeRewardOwnershipName = "NominateNodeRewardOwnership"
NominateNodeRewardOwnershipName is the name of the public ownership key
const NominateNodeRewardOwnershipPrivateName = "NominateNodeRewardOwnershipPrivate"
NominateNodeRewardOwnershipPrivateName is the name of the private ownership key
const NominateNodeRewardValidationName = "NominateNodeRewardValidation"
NominateNodeRewardValidationName is the name of the public validation key
const NominateNodeRewardValidationPrivateName = "NominateNodeRewardValidationPrivate"
NominateNodeRewardValidationPrivateName is the name of the private validation key
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
const RecordEndowmentNAVOwnershipName = "RecordEndowmentNAVOwnership"
RecordEndowmentNAVOwnershipName is the name of the public ownership key
const RecordEndowmentNAVOwnershipPrivateName = "RecordEndowmentNAVOwnershipPrivate"
RecordEndowmentNAVOwnershipPrivateName is the name of the private ownership key
const RecordEndowmentNAVValidationName = "RecordEndowmentNAVValidation"
RecordEndowmentNAVValidationName is the name of the public validation key
const RecordEndowmentNAVValidationPrivateName = "RecordEndowmentNAVValidationPrivate"
RecordEndowmentNAVValidationPrivateName is the name of the private validation key
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
const RecordPriceOwnershipName = "RecordPriceOwnership"
RecordPriceOwnershipName is the name of the public ownership key
const RecordPriceOwnershipPrivateName = "RecordPriceOwnershipPrivate"
RecordPriceOwnershipPrivateName is the name of the private ownership key
const RecordPriceValidationName = "RecordPriceValidation"
RecordPriceValidationName is the name of the public validation key
const RecordPriceValidationPrivateName = "RecordPriceValidationPrivate"
RecordPriceValidationPrivateName is the name of the private validation key
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
const ReleaseFromEndowmentOwnershipName = "ReleaseFromEndowmentOwnership"
ReleaseFromEndowmentOwnershipName is the name of the public ownership key
const ReleaseFromEndowmentOwnershipPrivateName = "ReleaseFromEndowmentOwnershipPrivate"
ReleaseFromEndowmentOwnershipPrivateName is the name of the private ownership key
const ReleaseFromEndowmentValidationName = "ReleaseFromEndowmentValidation"
ReleaseFromEndowmentValidationName is the name of the public validation key
const ReleaseFromEndowmentValidationPrivateName = "ReleaseFromEndowmentValidationPrivate"
ReleaseFromEndowmentValidationPrivateName is the name of the private validation key
const SIBScriptName = "SIBScript"
SIBScriptName is the name of the SIBScript system variable
This sytem variable stores the chaincode script for calculating SIB.
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
const SetSysvarOwnershipName = "SetSysvarOwnership"
SetSysvarOwnershipName is the name of the public ownership key
const SetSysvarOwnershipPrivateName = "SetSysvarOwnershipPrivate"
SetSysvarOwnershipPrivateName is the name of the private ownership key
const SetSysvarValidationName = "SetSysvarValidation"
SetSysvarValidationName is the name of the public validation key
const SetSysvarValidationPrivateName = "SetSysvarValidationPrivate"
SetSysvarValidationPrivateName is the name of the private validation key
const TxFeeScriptName = "TransactionFeeScript"
TxFeeScriptName is the name of the TxFeeScript system variable
This sytem variable store the chaincode script used to calculate transaction fees.
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 ¶
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.
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.
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.
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.
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.
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.
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.
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.
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.
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 ¶
HasValidator is true when a validator exists for the given sysvar
func IsValid ¶
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 ¶
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 ¶
ValidateAddress ensures this value works as an Address
func ValidateChaincode ¶
ValidateChaincode ensures this value works as a Chaincode script
func ValidateDuration ¶
ValidateDuration ensures this value works as a Duration
func ValidateNdau ¶
ValidateNdau ensures this value works as Ndau
func ValidateRateTable ¶
ValidateRateTable validates an eai.RateTable
func ValidateUInt64 ¶
ValidateUInt64 ensures this value works as a wkt.Uint64
Types ¶
type AccountAttributes ¶
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 ¶
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 ¶
MarshalMsg implements msgp.Marshaler
func (EAIFee) MarshalText ¶
MarshalText implements encoding.TextMarshaler
func (*EAIFee) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*EAIFee) UnmarshalMsg ¶
UnmarshalMsg implements msgp.Unmarshaler
func (*EAIFee) UnmarshalText ¶
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
type SelfValidatable ¶
type SelfValidatable interface {
Validate() bool
}
A SelfValidatable type is one which applies additional self-validation
type SysAcct ¶
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
Source Files ¶
- account_attributes.go
- account_attributes_gen_edited.go
- bpc_rules.go
- change_schema.go
- default_recourse.go
- dispute_rules.go
- eai_fee.go
- eai_fee_gen.go
- eai_overtime.go
- exchange_eai.go
- goodness.go
- node_reward.go
- node_rules.go
- rate_tables.go
- record_endowment_nav.go
- rfe_keys.go
- set_sysvar.go
- sib.go
- sys_acct.go
- sysvar_validation.go
- transaction_fees.go
- validator_change.go