Documentation ¶
Overview ¶
Package isaacoperation provides the base operations.
Index ¶
- Variables
- func NewCandidatesOfMajoritySuffrageCandidateLimiterRule(ratio float64, getSuffrage func() (uint64, error)) (uint64, error)
- func NewFixedSuffrageCandidateLimiter(rule FixedSuffrageCandidateLimiterRule) base.SuffrageCandidateLimiter
- func NewMajoritySuffrageCandidateLimiter(rule MajoritySuffrageCandidateLimiterRule, getSuffrage func() (uint64, error)) base.SuffrageCandidateLimiter
- type FixedSuffrageCandidateLimiterRule
- func (l *FixedSuffrageCandidateLimiterRule) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
- func (l FixedSuffrageCandidateLimiterRule) HashBytes() []byte
- func (l FixedSuffrageCandidateLimiterRule) IsValid([]byte) error
- func (l FixedSuffrageCandidateLimiterRule) Limit() uint64
- func (l FixedSuffrageCandidateLimiterRule) MarshalBSON() ([]byte, error)
- func (l FixedSuffrageCandidateLimiterRule) MarshalJSON() ([]byte, error)
- func (l *FixedSuffrageCandidateLimiterRule) UnmarshalJSON(b []byte) error
- type FixedSuffrageCandidateLimiterRuleBSONUnMarshaler
- type GenesisNetworkPolicy
- func (op GenesisNetworkPolicy) IsValid(networkID []byte) error
- func (GenesisNetworkPolicy) PreProcess(ctx context.Context, getStateFunc base.GetStateFunc) (context.Context, base.OperationProcessReasonError, error)
- func (op GenesisNetworkPolicy) Process(context.Context, base.GetStateFunc) ([]base.StateMergeValue, base.OperationProcessReasonError, error)
- type GenesisNetworkPolicyFact
- func (fact *GenesisNetworkPolicyFact) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
- func (fact *GenesisNetworkPolicyFact) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (fact GenesisNetworkPolicyFact) IsValid([]byte) error
- func (fact GenesisNetworkPolicyFact) MarshalBSON() ([]byte, error)
- func (fact GenesisNetworkPolicyFact) MarshalJSON() ([]byte, error)
- func (fact GenesisNetworkPolicyFact) Policy() base.NetworkPolicy
- type GenesisNetworkPolicyFactBSONUnMarshaler
- type GenesisNetworkPolicyFactJSONMarshaler
- type GenesisNetworkPolicyFactJSONUnmarshaler
- type MajoritySuffrageCandidateLimiterRule
- func (l *MajoritySuffrageCandidateLimiterRule) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
- func (l MajoritySuffrageCandidateLimiterRule) HashBytes() []byte
- func (l MajoritySuffrageCandidateLimiterRule) IsValid([]byte) error
- func (l MajoritySuffrageCandidateLimiterRule) MarshalBSON() ([]byte, error)
- func (l MajoritySuffrageCandidateLimiterRule) MarshalJSON() ([]byte, error)
- func (l MajoritySuffrageCandidateLimiterRule) Max() uint64
- func (l MajoritySuffrageCandidateLimiterRule) Min() uint64
- func (l MajoritySuffrageCandidateLimiterRule) Ratio() float64
- func (l *MajoritySuffrageCandidateLimiterRule) UnmarshalJSON(b []byte) error
- type MajoritySuffrageCandidateLimiterRuleBSONUnMarshaler
- type NetworkPolicy
- type NetworkPolicyFact
- func (fact *NetworkPolicyFact) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
- func (fact *NetworkPolicyFact) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (fact NetworkPolicyFact) IsValid([]byte) error
- func (fact NetworkPolicyFact) MarshalBSON() ([]byte, error)
- func (fact NetworkPolicyFact) MarshalJSON() ([]byte, error)
- func (fact NetworkPolicyFact) Policy() base.NetworkPolicy
- type NetworkPolicyFactBSONUnMarshaler
- type NetworkPolicyFactJSONMarshaler
- type NetworkPolicyFactJSONUnmarshaler
- type NetworkPolicyProcessor
- func (p *NetworkPolicyProcessor) Close() error
- func (p *NetworkPolicyProcessor) PreProcess(ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc) (context.Context, base.OperationProcessReasonError, error)
- func (p *NetworkPolicyProcessor) Process(ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc) ([]base.StateMergeValue, base.OperationProcessReasonError, error)
- type SuffrageCandidate
- type SuffrageCandidateFact
- func (fact SuffrageCandidateFact) Address() base.Address
- func (fact *SuffrageCandidateFact) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
- func (fact *SuffrageCandidateFact) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (fact SuffrageCandidateFact) IsValid([]byte) error
- func (fact SuffrageCandidateFact) MarshalBSON() ([]byte, error)
- func (fact SuffrageCandidateFact) MarshalJSON() ([]byte, error)
- func (fact SuffrageCandidateFact) Publickey() base.Publickey
- type SuffrageCandidateFactBSONUnMarshaler
- type SuffrageCandidateProcessor
- func (p *SuffrageCandidateProcessor) Close() error
- func (p *SuffrageCandidateProcessor) PreProcess(ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc) (context.Context, base.OperationProcessReasonError, error)
- func (p *SuffrageCandidateProcessor) Process(ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc) ([]base.StateMergeValue, base.OperationProcessReasonError, error)
- type SuffrageCandidatesStateValueMerger
- type SuffrageDisjoin
- type SuffrageDisjoinFact
- func (fact *SuffrageDisjoinFact) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
- func (fact *SuffrageDisjoinFact) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (fact SuffrageDisjoinFact) IsValid([]byte) error
- func (fact SuffrageDisjoinFact) MarshalBSON() ([]byte, error)
- func (fact SuffrageDisjoinFact) MarshalJSON() ([]byte, error)
- func (fact SuffrageDisjoinFact) Node() base.Address
- func (fact SuffrageDisjoinFact) Start() base.Height
- type SuffrageDisjoinFactBSONUnMarshaler
- type SuffrageDisjoinProcessor
- func (p *SuffrageDisjoinProcessor) Close() error
- func (p *SuffrageDisjoinProcessor) PreProcess(ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc) (context.Context, base.OperationProcessReasonError, error)
- func (p *SuffrageDisjoinProcessor) Process(ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc) ([]base.StateMergeValue, base.OperationProcessReasonError, error)
- type SuffrageExpelProcessor
- func (p *SuffrageExpelProcessor) Close() error
- func (p *SuffrageExpelProcessor) PreProcess(ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc) (context.Context, base.OperationProcessReasonError, error)
- func (p *SuffrageExpelProcessor) Process(ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc) ([]base.StateMergeValue, base.OperationProcessReasonError, error)
- type SuffrageGenesisJoin
- func (op *SuffrageGenesisJoin) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
- func (op SuffrageGenesisJoin) IsValid(networkID []byte) error
- func (SuffrageGenesisJoin) PreProcess(ctx context.Context, getStateFunc base.GetStateFunc) (context.Context, base.OperationProcessReasonError, error)
- func (op SuffrageGenesisJoin) Process(context.Context, base.GetStateFunc) ([]base.StateMergeValue, base.OperationProcessReasonError, error)
- type SuffrageGenesisJoinFact
- func (fact *SuffrageGenesisJoinFact) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
- func (fact *SuffrageGenesisJoinFact) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (fact SuffrageGenesisJoinFact) IsValid(networkID []byte) error
- func (fact SuffrageGenesisJoinFact) MarshalBSON() ([]byte, error)
- func (fact SuffrageGenesisJoinFact) MarshalJSON() ([]byte, error)
- func (fact SuffrageGenesisJoinFact) Nodes() []base.Node
- type SuffrageGenesisJoinFactBSONUnMarshaler
- type SuffrageJoin
- type SuffrageJoinFact
- func (fact SuffrageJoinFact) Candidate() base.Address
- func (fact *SuffrageJoinFact) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
- func (fact *SuffrageJoinFact) DecodeJSON(b []byte, enc encoder.Encoder) error
- func (fact SuffrageJoinFact) IsValid([]byte) error
- func (fact SuffrageJoinFact) MarshalBSON() ([]byte, error)
- func (fact SuffrageJoinFact) MarshalJSON() ([]byte, error)
- func (fact SuffrageJoinFact) Start() base.Height
- type SuffrageJoinFactBSONUnMarshaler
- type SuffrageJoinProcessor
- func (p *SuffrageJoinProcessor) Close() error
- func (p *SuffrageJoinProcessor) PreProcess(ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc) (context.Context, base.OperationProcessReasonError, error)
- func (p *SuffrageJoinProcessor) Process(ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc) ([]base.StateMergeValue, base.OperationProcessReasonError, error)
- type SuffrageJoinStateValueMerger
Constants ¶
This section is empty.
Variables ¶
View Source
var ( GenesisNetworkPolicyFactHint = hint.MustNewHint("currency-genesis-network-policy-fact-v0.0.1") GenesisNetworkPolicyHint = hint.MustNewHint("currency-genesis-network-policy-v0.0.1") NetworkPolicyFactHint = hint.MustNewHint("currency-network-policy-fact-v0.0.1") NetworkPolicyHint = hint.MustNewHint("currency-network-policy-operation-v0.0.1") )
View Source
var ( SuffrageCandidateFactHint = hint.MustNewHint("currency-suffrage-candidate-fact-v0.0.1") SuffrageCandidateHint = hint.MustNewHint("currency-suffrage-candidate-operation-v0.0.1") )
View Source
var ( SuffrageDisjoinFactHint = hint.MustNewHint("currency-suffrage-disjoin-fact-v0.0.1") SuffrageDisjoinHint = hint.MustNewHint("currency-suffrage-disjoin-operation-v0.0.1") )
View Source
var ( SuffrageJoinFactHint = hint.MustNewHint("currency-suffrage-join-fact-v0.0.1") SuffrageJoinHint = hint.MustNewHint("currency-suffrage-join-operation-v0.0.1") SuffrageGenesisJoinFactHint = hint.MustNewHint("currency-suffrage-genesis-join-fact-v0.0.1") SuffrageGenesisJoinHint = hint.MustNewHint("currency-suffrage-genesis-join-operation-v0.0.1") )
View Source
var ( FixedSuffrageCandidateLimiterRuleHint = hint.MustNewHint("currency-fixed-suffrage-candidate-limiter-rule-v0.0.1") MajoritySuffrageCandidateLimiterRuleHint = hint.MustNewHint("currency-majority-suffrage-candidate-limiter-rule-v0.0.1") )
View Source
var ExpelPreProcessedContextKey = util.ContextKey("expel-preprocessed")
Functions ¶
func NewCandidatesOfMajoritySuffrageCandidateLimiterRule ¶
func NewCandidatesOfMajoritySuffrageCandidateLimiterRule( ratio float64, getSuffrage func() (uint64, error), ) (uint64, error)
NewCandidatesOfMajoritySuffrageCandidateLimiterRule find the number of new candidates to prevent the current suffrage majority.
func NewFixedSuffrageCandidateLimiter ¶
func NewFixedSuffrageCandidateLimiter(rule FixedSuffrageCandidateLimiterRule) base.SuffrageCandidateLimiter
func NewMajoritySuffrageCandidateLimiter ¶
func NewMajoritySuffrageCandidateLimiter( rule MajoritySuffrageCandidateLimiterRule, getSuffrage func() (uint64, error), ) base.SuffrageCandidateLimiter
Types ¶
type FixedSuffrageCandidateLimiterRule ¶
type FixedSuffrageCandidateLimiterRule struct { hint.BaseHinter // contains filtered or unexported fields }
func NewFixedSuffrageCandidateLimiterRule ¶
func NewFixedSuffrageCandidateLimiterRule(limit uint64) FixedSuffrageCandidateLimiterRule
func (*FixedSuffrageCandidateLimiterRule) DecodeBSON ¶
func (l *FixedSuffrageCandidateLimiterRule) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
func (FixedSuffrageCandidateLimiterRule) HashBytes ¶
func (l FixedSuffrageCandidateLimiterRule) HashBytes() []byte
func (FixedSuffrageCandidateLimiterRule) IsValid ¶
func (l FixedSuffrageCandidateLimiterRule) IsValid([]byte) error
func (FixedSuffrageCandidateLimiterRule) Limit ¶
func (l FixedSuffrageCandidateLimiterRule) Limit() uint64
func (FixedSuffrageCandidateLimiterRule) MarshalBSON ¶
func (l FixedSuffrageCandidateLimiterRule) MarshalBSON() ([]byte, error)
func (FixedSuffrageCandidateLimiterRule) MarshalJSON ¶
func (l FixedSuffrageCandidateLimiterRule) MarshalJSON() ([]byte, error)
func (*FixedSuffrageCandidateLimiterRule) UnmarshalJSON ¶
func (l *FixedSuffrageCandidateLimiterRule) UnmarshalJSON(b []byte) error
type GenesisNetworkPolicy ¶
type GenesisNetworkPolicy struct {
common.BaseOperation
}
GenesisNetworkPolicy is only for used for genesis block
func NewGenesisNetworkPolicy ¶
func NewGenesisNetworkPolicy(fact GenesisNetworkPolicyFact) GenesisNetworkPolicy
func (GenesisNetworkPolicy) IsValid ¶
func (op GenesisNetworkPolicy) IsValid(networkID []byte) error
func (GenesisNetworkPolicy) PreProcess ¶
func (GenesisNetworkPolicy) PreProcess(ctx context.Context, getStateFunc base.GetStateFunc) ( context.Context, base.OperationProcessReasonError, error, )
func (GenesisNetworkPolicy) Process ¶
func (op GenesisNetworkPolicy) Process(context.Context, base.GetStateFunc) ( []base.StateMergeValue, base.OperationProcessReasonError, error, )
type GenesisNetworkPolicyFact ¶
func NewGenesisNetworkPolicyFact ¶
func NewGenesisNetworkPolicyFact(policy base.NetworkPolicy) GenesisNetworkPolicyFact
func (*GenesisNetworkPolicyFact) DecodeBSON ¶
func (fact *GenesisNetworkPolicyFact) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
func (*GenesisNetworkPolicyFact) DecodeJSON ¶
func (fact *GenesisNetworkPolicyFact) DecodeJSON(b []byte, enc encoder.Encoder) error
func (GenesisNetworkPolicyFact) IsValid ¶
func (fact GenesisNetworkPolicyFact) IsValid([]byte) error
func (GenesisNetworkPolicyFact) MarshalBSON ¶
func (fact GenesisNetworkPolicyFact) MarshalBSON() ([]byte, error)
func (GenesisNetworkPolicyFact) MarshalJSON ¶
func (fact GenesisNetworkPolicyFact) MarshalJSON() ([]byte, error)
func (GenesisNetworkPolicyFact) Policy ¶
func (fact GenesisNetworkPolicyFact) Policy() base.NetworkPolicy
type GenesisNetworkPolicyFactJSONMarshaler ¶
type GenesisNetworkPolicyFactJSONMarshaler struct { Policy base.NetworkPolicy `json:"policy"` base.BaseFactJSONMarshaler }
type GenesisNetworkPolicyFactJSONUnmarshaler ¶
type GenesisNetworkPolicyFactJSONUnmarshaler struct { base.BaseFactJSONUnmarshaler Policy json.RawMessage `json:"policy"` }
type MajoritySuffrageCandidateLimiterRule ¶
type MajoritySuffrageCandidateLimiterRule struct { hint.BaseHinter // contains filtered or unexported fields }
func NewMajoritySuffrageCandidateLimiterRule ¶
func NewMajoritySuffrageCandidateLimiterRule(ratio float64, min, max uint64) MajoritySuffrageCandidateLimiterRule
func (*MajoritySuffrageCandidateLimiterRule) DecodeBSON ¶
func (l *MajoritySuffrageCandidateLimiterRule) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
func (MajoritySuffrageCandidateLimiterRule) HashBytes ¶
func (l MajoritySuffrageCandidateLimiterRule) HashBytes() []byte
func (MajoritySuffrageCandidateLimiterRule) IsValid ¶
func (l MajoritySuffrageCandidateLimiterRule) IsValid([]byte) error
func (MajoritySuffrageCandidateLimiterRule) MarshalBSON ¶
func (l MajoritySuffrageCandidateLimiterRule) MarshalBSON() ([]byte, error)
func (MajoritySuffrageCandidateLimiterRule) MarshalJSON ¶
func (l MajoritySuffrageCandidateLimiterRule) MarshalJSON() ([]byte, error)
func (MajoritySuffrageCandidateLimiterRule) Max ¶
func (l MajoritySuffrageCandidateLimiterRule) Max() uint64
func (MajoritySuffrageCandidateLimiterRule) Min ¶
func (l MajoritySuffrageCandidateLimiterRule) Min() uint64
func (MajoritySuffrageCandidateLimiterRule) Ratio ¶
func (l MajoritySuffrageCandidateLimiterRule) Ratio() float64
func (*MajoritySuffrageCandidateLimiterRule) UnmarshalJSON ¶
func (l *MajoritySuffrageCandidateLimiterRule) UnmarshalJSON(b []byte) error
type NetworkPolicy ¶
type NetworkPolicy struct {
common.BaseNodeOperation
}
func NewNetworkPolicy ¶
func NewNetworkPolicy(fact NetworkPolicyFact) NetworkPolicy
func (NetworkPolicy) IsValid ¶
func (op NetworkPolicy) IsValid(networkID []byte) error
type NetworkPolicyFact ¶
func NewNetworkPolicyFact ¶
func NewNetworkPolicyFact(token base.Token, policy base.NetworkPolicy) NetworkPolicyFact
func (*NetworkPolicyFact) DecodeBSON ¶
func (fact *NetworkPolicyFact) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
func (*NetworkPolicyFact) DecodeJSON ¶
func (fact *NetworkPolicyFact) DecodeJSON(b []byte, enc encoder.Encoder) error
func (NetworkPolicyFact) IsValid ¶
func (fact NetworkPolicyFact) IsValid([]byte) error
func (NetworkPolicyFact) MarshalBSON ¶
func (fact NetworkPolicyFact) MarshalBSON() ([]byte, error)
func (NetworkPolicyFact) MarshalJSON ¶
func (fact NetworkPolicyFact) MarshalJSON() ([]byte, error)
func (NetworkPolicyFact) Policy ¶
func (fact NetworkPolicyFact) Policy() base.NetworkPolicy
type NetworkPolicyFactJSONMarshaler ¶
type NetworkPolicyFactJSONMarshaler struct { Policy base.NetworkPolicy `json:"policy"` base.BaseFactJSONMarshaler }
type NetworkPolicyFactJSONUnmarshaler ¶
type NetworkPolicyFactJSONUnmarshaler struct { base.BaseFactJSONUnmarshaler Policy json.RawMessage `json:"policy"` }
type NetworkPolicyProcessor ¶
type NetworkPolicyProcessor struct { *base.BaseOperationProcessor // contains filtered or unexported fields }
func NewNetworkPolicyProcessor ¶
func NewNetworkPolicyProcessor( height base.Height, threshold base.Threshold, getStateFunc base.GetStateFunc, newPreProcessConstraintFunc base.NewOperationProcessorProcessFunc, newProcessConstraintFunc base.NewOperationProcessorProcessFunc, ) (*NetworkPolicyProcessor, error)
func (*NetworkPolicyProcessor) Close ¶
func (p *NetworkPolicyProcessor) Close() error
func (*NetworkPolicyProcessor) PreProcess ¶
func (p *NetworkPolicyProcessor) PreProcess(ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc) ( context.Context, base.OperationProcessReasonError, error, )
func (*NetworkPolicyProcessor) Process ¶
func (p *NetworkPolicyProcessor) Process(ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc) ( []base.StateMergeValue, base.OperationProcessReasonError, error, )
type SuffrageCandidate ¶
type SuffrageCandidate struct {
common.BaseNodeOperation
}
func NewSuffrageCandidate ¶
func NewSuffrageCandidate(fact SuffrageCandidateFact) SuffrageCandidate
func (*SuffrageCandidate) DecodeBSON ¶
func (op *SuffrageCandidate) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
func (SuffrageCandidate) IsValid ¶
func (op SuffrageCandidate) IsValid(networkID []byte) error
func (SuffrageCandidate) MarshalBSON ¶
func (op SuffrageCandidate) MarshalBSON() ([]byte, error)
type SuffrageCandidateFact ¶
func (SuffrageCandidateFact) Address ¶
func (fact SuffrageCandidateFact) Address() base.Address
func (*SuffrageCandidateFact) DecodeBSON ¶
func (fact *SuffrageCandidateFact) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
func (*SuffrageCandidateFact) DecodeJSON ¶
func (fact *SuffrageCandidateFact) DecodeJSON(b []byte, enc encoder.Encoder) error
func (SuffrageCandidateFact) IsValid ¶
func (fact SuffrageCandidateFact) IsValid([]byte) error
func (SuffrageCandidateFact) MarshalBSON ¶
func (fact SuffrageCandidateFact) MarshalBSON() ([]byte, error)
func (SuffrageCandidateFact) MarshalJSON ¶
func (fact SuffrageCandidateFact) MarshalJSON() ([]byte, error)
func (SuffrageCandidateFact) Publickey ¶
func (fact SuffrageCandidateFact) Publickey() base.Publickey
type SuffrageCandidateProcessor ¶
type SuffrageCandidateProcessor struct { *base.BaseOperationProcessor // contains filtered or unexported fields }
func NewSuffrageCandidateProcessor ¶
func NewSuffrageCandidateProcessor( height base.Height, getStateFunc base.GetStateFunc, newPreProcessConstraintFunc base.NewOperationProcessorProcessFunc, newProcessConstraintFunc base.NewOperationProcessorProcessFunc, lifespan base.Height, ) (*SuffrageCandidateProcessor, error)
func (*SuffrageCandidateProcessor) Close ¶
func (p *SuffrageCandidateProcessor) Close() error
func (*SuffrageCandidateProcessor) PreProcess ¶
func (p *SuffrageCandidateProcessor) PreProcess( ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc) ( context.Context, base.OperationProcessReasonError, error, )
func (*SuffrageCandidateProcessor) Process ¶
func (p *SuffrageCandidateProcessor) Process(ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc) ( []base.StateMergeValue, base.OperationProcessReasonError, error, )
type SuffrageCandidatesStateValueMerger ¶
type SuffrageCandidatesStateValueMerger struct { *common.BaseStateValueMerger sync.Mutex // contains filtered or unexported fields }
func NewSuffrageCandidatesStateValueMerger ¶
func NewSuffrageCandidatesStateValueMerger(height base.Height, st base.State) *SuffrageCandidatesStateValueMerger
func (*SuffrageCandidatesStateValueMerger) CloseValue ¶
func (s *SuffrageCandidatesStateValueMerger) CloseValue() (base.State, error)
func (*SuffrageCandidatesStateValueMerger) Merge ¶
func (s *SuffrageCandidatesStateValueMerger) Merge(value base.StateValue, op util.Hash) error
type SuffrageDisjoin ¶
type SuffrageDisjoin struct {
common.BaseNodeOperation
}
func NewSuffrageDisjoin ¶
func NewSuffrageDisjoin(fact SuffrageDisjoinFact) SuffrageDisjoin
func (*SuffrageDisjoin) DecodeBSON ¶
func (op *SuffrageDisjoin) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
func (SuffrageDisjoin) IsValid ¶
func (op SuffrageDisjoin) IsValid(networkID []byte) error
type SuffrageDisjoinFact ¶
func NewSuffrageDisjoinFact ¶
func (*SuffrageDisjoinFact) DecodeBSON ¶
func (fact *SuffrageDisjoinFact) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
func (*SuffrageDisjoinFact) DecodeJSON ¶
func (fact *SuffrageDisjoinFact) DecodeJSON(b []byte, enc encoder.Encoder) error
func (SuffrageDisjoinFact) IsValid ¶
func (fact SuffrageDisjoinFact) IsValid([]byte) error
func (SuffrageDisjoinFact) MarshalBSON ¶
func (fact SuffrageDisjoinFact) MarshalBSON() ([]byte, error)
func (SuffrageDisjoinFact) MarshalJSON ¶
func (fact SuffrageDisjoinFact) MarshalJSON() ([]byte, error)
func (SuffrageDisjoinFact) Node ¶
func (fact SuffrageDisjoinFact) Node() base.Address
func (SuffrageDisjoinFact) Start ¶
func (fact SuffrageDisjoinFact) Start() base.Height
type SuffrageDisjoinProcessor ¶
type SuffrageDisjoinProcessor struct { *base.BaseOperationProcessor // contains filtered or unexported fields }
func NewSuffrageDisjoinProcessor ¶
func NewSuffrageDisjoinProcessor( height base.Height, getStateFunc base.GetStateFunc, newPreProcessConstraintFunc base.NewOperationProcessorProcessFunc, newProcessConstraintFunc base.NewOperationProcessorProcessFunc, ) (*SuffrageDisjoinProcessor, error)
func (*SuffrageDisjoinProcessor) Close ¶
func (p *SuffrageDisjoinProcessor) Close() error
func (*SuffrageDisjoinProcessor) PreProcess ¶
func (p *SuffrageDisjoinProcessor) PreProcess(ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc) ( context.Context, base.OperationProcessReasonError, error, )
func (*SuffrageDisjoinProcessor) Process ¶
func (p *SuffrageDisjoinProcessor) Process(ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc) ( []base.StateMergeValue, base.OperationProcessReasonError, error, )
type SuffrageExpelProcessor ¶
type SuffrageExpelProcessor struct { *base.BaseOperationProcessor // contains filtered or unexported fields }
func NewSuffrageExpelProcessor ¶
func NewSuffrageExpelProcessor( height base.Height, getStateFunc base.GetStateFunc, newPreProcessConstraintFunc base.NewOperationProcessorProcessFunc, newProcessConstraintFunc base.NewOperationProcessorProcessFunc, ) (*SuffrageExpelProcessor, error)
func (*SuffrageExpelProcessor) Close ¶
func (p *SuffrageExpelProcessor) Close() error
func (*SuffrageExpelProcessor) PreProcess ¶
func (p *SuffrageExpelProcessor) PreProcess(ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc) ( context.Context, base.OperationProcessReasonError, error, )
func (*SuffrageExpelProcessor) Process ¶
func (p *SuffrageExpelProcessor) Process(ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc) ( []base.StateMergeValue, base.OperationProcessReasonError, error, )
type SuffrageGenesisJoin ¶
type SuffrageGenesisJoin struct {
common.BaseOperation
}
SuffrageGenesisJoin is only for used for genesis block
func NewSuffrageGenesisJoin ¶
func NewSuffrageGenesisJoin(fact SuffrageGenesisJoinFact) SuffrageGenesisJoin
func (*SuffrageGenesisJoin) DecodeBSON ¶
func (op *SuffrageGenesisJoin) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
func (SuffrageGenesisJoin) IsValid ¶
func (op SuffrageGenesisJoin) IsValid(networkID []byte) error
func (SuffrageGenesisJoin) PreProcess ¶
func (SuffrageGenesisJoin) PreProcess( ctx context.Context, getStateFunc base.GetStateFunc, ) (context.Context, base.OperationProcessReasonError, error)
func (SuffrageGenesisJoin) Process ¶
func (op SuffrageGenesisJoin) Process(context.Context, base.GetStateFunc) ( []base.StateMergeValue, base.OperationProcessReasonError, error, )
type SuffrageGenesisJoinFact ¶
func NewSuffrageGenesisJoinFact ¶
func NewSuffrageGenesisJoinFact( nodes []base.Node, networkID base.NetworkID, ) SuffrageGenesisJoinFact
func (*SuffrageGenesisJoinFact) DecodeBSON ¶
func (fact *SuffrageGenesisJoinFact) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
func (*SuffrageGenesisJoinFact) DecodeJSON ¶
func (fact *SuffrageGenesisJoinFact) DecodeJSON(b []byte, enc encoder.Encoder) error
func (SuffrageGenesisJoinFact) IsValid ¶
func (fact SuffrageGenesisJoinFact) IsValid(networkID []byte) error
func (SuffrageGenesisJoinFact) MarshalBSON ¶
func (fact SuffrageGenesisJoinFact) MarshalBSON() ([]byte, error)
func (SuffrageGenesisJoinFact) MarshalJSON ¶
func (fact SuffrageGenesisJoinFact) MarshalJSON() ([]byte, error)
func (SuffrageGenesisJoinFact) Nodes ¶
func (fact SuffrageGenesisJoinFact) Nodes() []base.Node
type SuffrageJoin ¶
type SuffrageJoin struct {
common.BaseNodeOperation
}
func NewSuffrageJoin ¶
func NewSuffrageJoin(fact SuffrageJoinFact) SuffrageJoin
func (*SuffrageJoin) DecodeBSON ¶
func (op *SuffrageJoin) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
func (SuffrageJoin) IsValid ¶
func (op SuffrageJoin) IsValid(networkID []byte) error
type SuffrageJoinFact ¶
func NewSuffrageJoinFact ¶
func (SuffrageJoinFact) Candidate ¶
func (fact SuffrageJoinFact) Candidate() base.Address
func (*SuffrageJoinFact) DecodeBSON ¶
func (fact *SuffrageJoinFact) DecodeBSON(b []byte, enc *bsonenc.Encoder) error
func (*SuffrageJoinFact) DecodeJSON ¶
func (fact *SuffrageJoinFact) DecodeJSON(b []byte, enc encoder.Encoder) error
func (SuffrageJoinFact) IsValid ¶
func (fact SuffrageJoinFact) IsValid([]byte) error
func (SuffrageJoinFact) MarshalBSON ¶
func (fact SuffrageJoinFact) MarshalBSON() ([]byte, error)
func (SuffrageJoinFact) MarshalJSON ¶
func (fact SuffrageJoinFact) MarshalJSON() ([]byte, error)
func (SuffrageJoinFact) Start ¶
func (fact SuffrageJoinFact) Start() base.Height
type SuffrageJoinProcessor ¶
type SuffrageJoinProcessor struct { *base.BaseOperationProcessor // contains filtered or unexported fields }
func NewSuffrageJoinProcessor ¶
func NewSuffrageJoinProcessor( height base.Height, threshold base.Threshold, getStateFunc base.GetStateFunc, newPreProcessConstraintFunc base.NewOperationProcessorProcessFunc, newProcessConstraintFunc base.NewOperationProcessorProcessFunc, ) (*SuffrageJoinProcessor, error)
func (*SuffrageJoinProcessor) Close ¶
func (p *SuffrageJoinProcessor) Close() error
func (*SuffrageJoinProcessor) PreProcess ¶
func (p *SuffrageJoinProcessor) PreProcess(ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc) ( context.Context, base.OperationProcessReasonError, error, )
func (*SuffrageJoinProcessor) Process ¶
func (p *SuffrageJoinProcessor) Process(ctx context.Context, op base.Operation, getStateFunc base.GetStateFunc) ( []base.StateMergeValue, base.OperationProcessReasonError, error, )
type SuffrageJoinStateValueMerger ¶
type SuffrageJoinStateValueMerger struct { *common.BaseStateValueMerger sync.Mutex // contains filtered or unexported fields }
func NewSuffrageJoinStateValueMerger ¶
func NewSuffrageJoinStateValueMerger(height base.Height, st base.State) *SuffrageJoinStateValueMerger
func (*SuffrageJoinStateValueMerger) CloseValue ¶
func (s *SuffrageJoinStateValueMerger) CloseValue() (base.State, error)
func (*SuffrageJoinStateValueMerger) Merge ¶
func (s *SuffrageJoinStateValueMerger) Merge(value base.StateValue, op util.Hash) error
Source Files ¶
- doc.go
- policy_network.go
- policy_network_bson.go
- policy_network_json.go
- policy_network_processor.go
- suffrage_candidate.go
- suffrage_candidate_bson.go
- suffrage_candidate_encode.go
- suffrage_candidate_json.go
- suffrage_candidate_processor.go
- suffrage_disjoin.go
- suffrage_disjoin_bson.go
- suffrage_disjoin_encode.go
- suffrage_disjoin_json.go
- suffrage_disjoin_processor.go
- suffrage_expel_processor.go
- suffrage_join.go
- suffrage_join_bson.go
- suffrage_join_encode.go
- suffrage_join_json.go
- suffrage_join_processor.go
- suffrage_limiter.go
- suffrage_limiter_bson.go
- suffrage_limiter_json.go
Click to show internal directories.
Click to hide internal directories.