isaacoperation

package
v0.0.2-alpha Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: GPL-3.0 Imports: 14 Imported by: 4

Documentation

Overview

Package isaacoperation provides the base operations.

Index

Constants

This section is empty.

Variables

View Source
var (
	GenesisNetworkPolicyFactHint = hint.MustNewHint("genesis-network-policy-fact-v0.0.1")
	GenesisNetworkPolicyHint     = hint.MustNewHint("genesis-network-policy-v0.0.1")
)
View Source
var (
	SuffrageCandidateFactHint = hint.MustNewHint("suffrage-candidate-fact-v0.0.1")
	SuffrageCandidateHint     = hint.MustNewHint("suffrage-candidate-operation-v0.0.1")
)
View Source
var (
	SuffrageDisjoinFactHint = hint.MustNewHint("suffrage-disjoin-fact-v0.0.1")
	SuffrageDisjoinHint     = hint.MustNewHint("suffrage-disjoin-operation-v0.0.1")
)
View Source
var (
	SuffrageJoinFactHint        = hint.MustNewHint("suffrage-join-fact-v0.0.1")
	SuffrageJoinHint            = hint.MustNewHint("suffrage-join-operation-v0.0.1")
	SuffrageGenesisJoinFactHint = hint.MustNewHint("suffrage-genesis-join-fact-v0.0.1")
	SuffrageGenesisJoinHint     = hint.MustNewHint("suffrage-genesis-join-operation-v0.0.1")
)
View Source
var WithdrawPreProcessedContextKey = util.ContextKey("withdraw-preprocessed")

Functions

This section is empty.

Types

type GenesisNetworkPolicy

type GenesisNetworkPolicy struct {
	base.BaseOperation
}

GenesisNetworkPolicy is only for used for genesis block

func (GenesisNetworkPolicy) IsValid

func (op GenesisNetworkPolicy) IsValid(networkID []byte) error

func (GenesisNetworkPolicy) PreProcess

type GenesisNetworkPolicyFact

type GenesisNetworkPolicyFact struct {
	base.BaseFact
	// contains filtered or unexported fields
}

func NewGenesisNetworkPolicyFact

func NewGenesisNetworkPolicyFact(policy base.NetworkPolicy) GenesisNetworkPolicyFact

func (*GenesisNetworkPolicyFact) DecodeJSON

func (fact *GenesisNetworkPolicyFact) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (GenesisNetworkPolicyFact) IsValid

func (fact GenesisNetworkPolicyFact) IsValid([]byte) error

func (GenesisNetworkPolicyFact) MarshalJSON

func (fact GenesisNetworkPolicyFact) MarshalJSON() ([]byte, error)

func (GenesisNetworkPolicyFact) Policy

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 SuffrageCandidate

type SuffrageCandidate struct {
	base.BaseNodeOperation
}

func NewSuffrageCandidate

func NewSuffrageCandidate(fact SuffrageCandidateFact) SuffrageCandidate

func (SuffrageCandidate) IsValid

func (op SuffrageCandidate) IsValid(networkID []byte) error

func (*SuffrageCandidate) SetToken

func (op *SuffrageCandidate) SetToken(t base.Token) error

type SuffrageCandidateFact

type SuffrageCandidateFact struct {
	base.BaseFact
	// contains filtered or unexported fields
}

func NewSuffrageCandidateFact

func NewSuffrageCandidateFact(
	token base.Token,
	address base.Address,
	publickey base.Publickey,
) SuffrageCandidateFact

func (SuffrageCandidateFact) Address

func (fact SuffrageCandidateFact) Address() base.Address

func (*SuffrageCandidateFact) DecodeJSON

func (fact *SuffrageCandidateFact) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (SuffrageCandidateFact) IsValid

func (fact SuffrageCandidateFact) IsValid([]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 (*SuffrageCandidateProcessor) Process

type SuffrageCandidatesStateValueMerger

type SuffrageCandidatesStateValueMerger struct {
	*base.BaseStateValueMerger
	// contains filtered or unexported fields
}

func NewSuffrageCandidatesStateValueMerger

func NewSuffrageCandidatesStateValueMerger(height base.Height, st base.State) *SuffrageCandidatesStateValueMerger

func (*SuffrageCandidatesStateValueMerger) Close

func (*SuffrageCandidatesStateValueMerger) Merge

type SuffrageDisjoin

type SuffrageDisjoin struct {
	base.BaseNodeOperation
}

func NewSuffrageDisjoin

func NewSuffrageDisjoin(fact SuffrageDisjoinFact) SuffrageDisjoin

func (SuffrageDisjoin) IsValid

func (op SuffrageDisjoin) IsValid(networkID []byte) error

func (*SuffrageDisjoin) SetToken

func (op *SuffrageDisjoin) SetToken(t base.Token) error

type SuffrageDisjoinFact

type SuffrageDisjoinFact struct {
	base.BaseFact
	// contains filtered or unexported fields
}

func NewSuffrageDisjoinFact

func NewSuffrageDisjoinFact(
	token base.Token,
	node base.Address,
	start base.Height,
) SuffrageDisjoinFact

func (*SuffrageDisjoinFact) DecodeJSON

func (fact *SuffrageDisjoinFact) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (SuffrageDisjoinFact) IsValid

func (fact SuffrageDisjoinFact) IsValid([]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 (*SuffrageDisjoinProcessor) Process

type SuffrageGenesisJoin

type SuffrageGenesisJoin struct {
	base.BaseOperation
}

SuffrageGenesisJoin is only for used for genesis block

func NewSuffrageGenesisJoin

func NewSuffrageGenesisJoin(fact SuffrageGenesisJoinFact) SuffrageGenesisJoin

func (SuffrageGenesisJoin) IsValid

func (op SuffrageGenesisJoin) IsValid(networkID []byte) error

func (SuffrageGenesisJoin) PreProcess

type SuffrageGenesisJoinFact

type SuffrageGenesisJoinFact struct {
	base.BaseFact
	// contains filtered or unexported fields
}

func NewSuffrageGenesisJoinFact

func NewSuffrageGenesisJoinFact(
	nodes []base.Node,
	networkID base.NetworkID,
) SuffrageGenesisJoinFact

func (*SuffrageGenesisJoinFact) DecodeJSON

func (fact *SuffrageGenesisJoinFact) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (SuffrageGenesisJoinFact) IsValid

func (fact SuffrageGenesisJoinFact) IsValid(networkID []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 {
	base.BaseNodeOperation
}

func NewSuffrageJoin

func NewSuffrageJoin(fact SuffrageJoinFact) SuffrageJoin

func (SuffrageJoin) IsValid

func (op SuffrageJoin) IsValid(networkID []byte) error

func (*SuffrageJoin) SetToken

func (op *SuffrageJoin) SetToken(t base.Token) error

type SuffrageJoinFact

type SuffrageJoinFact struct {
	base.BaseFact
	// contains filtered or unexported fields
}

func NewSuffrageJoinFact

func NewSuffrageJoinFact(
	token base.Token,
	candidate base.Address,
	start base.Height,
) SuffrageJoinFact

func (SuffrageJoinFact) Candidate

func (fact SuffrageJoinFact) Candidate() base.Address

func (*SuffrageJoinFact) DecodeJSON

func (fact *SuffrageJoinFact) DecodeJSON(b []byte, enc *jsonenc.Encoder) error

func (SuffrageJoinFact) IsValid

func (fact SuffrageJoinFact) IsValid([]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 (*SuffrageJoinProcessor) Process

type SuffrageJoinStateValueMerger

type SuffrageJoinStateValueMerger struct {
	*base.BaseStateValueMerger
	// contains filtered or unexported fields
}

func NewSuffrageJoinStateValueMerger

func NewSuffrageJoinStateValueMerger(height base.Height, st base.State) *SuffrageJoinStateValueMerger

func (*SuffrageJoinStateValueMerger) Close

func (*SuffrageJoinStateValueMerger) Merge

func (s *SuffrageJoinStateValueMerger) Merge(value base.StateValue, ops []util.Hash) error

type SuffrageWithdrawProcessor

type SuffrageWithdrawProcessor struct {
	*base.BaseOperationProcessor
	// contains filtered or unexported fields
}

func NewSuffrageWithdrawProcessor

func NewSuffrageWithdrawProcessor(
	height base.Height,
	getStateFunc base.GetStateFunc,
	newPreProcessConstraintFunc base.NewOperationProcessorProcessFunc,
	newProcessConstraintFunc base.NewOperationProcessorProcessFunc,
) (*SuffrageWithdrawProcessor, error)

func (*SuffrageWithdrawProcessor) Close

func (p *SuffrageWithdrawProcessor) Close() error

func (*SuffrageWithdrawProcessor) PreProcess

func (*SuffrageWithdrawProcessor) Process

Jump to

Keyboard shortcuts

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