identity

package
v0.18.15 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stake

type Stake struct {
	ValidatorAddress keys.Address
	StakeAddress     keys.Address
	Pubkey           keys.PublicKey
	ECDSAPubKey      keys.PublicKey
	Name             string
	Amount           balance.Amount
}

type Unstake

type Unstake struct {
	Address keys.Address
	Amount  balance.Amount
}

type Validator

type Validator struct {
	Address      keys.Address   `json:"address"`
	StakeAddress keys.Address   `json:"stakeAddress"`
	PubKey       keys.PublicKey `json:"pubKey"`
	ECDSAPubKey  keys.PublicKey `json:"ecdsaPubkey"`
	Power        int64          `json:"power"`
	Name         string         `json:"name"`
	Staking      balance.Amount `json:"staking"`
}

func NewValidator added in v0.14.3

func NewValidator(address keys.Address, stakeAddress keys.Address, pubKey keys.PublicKey, ecdsaPubKey keys.PublicKey, amount balance.Amount, name string) *Validator

func (*Validator) Bytes

func (v *Validator) Bytes() []byte

func (*Validator) FromBytes

func (v *Validator) FromBytes(msg []byte) (*Validator, error)

func (*Validator) GetBTCScriptAddress added in v0.13.0

func (v *Validator) GetBTCScriptAddress(params *chaincfg.Params) (keys.Address, error)

type ValidatorContext

type ValidatorContext struct {
	Balances      *balance.Store
	FeePool       *fees.Store
	Delegators    *delegation.DelegationStore
	EvidenceStore *evidence.EvidenceStore
	Govern        *governance.Store
	Currencies    *balance.CurrencySet
	Validators    *ValidatorStore
}

func NewValidatorContext

func NewValidatorContext(
	balances *balance.Store, feePool *fees.Store,
	delegators *delegation.DelegationStore,
	evidenceStore *evidence.EvidenceStore,
	govern *governance.Store, currencies *balance.CurrencySet,
	validators *ValidatorStore,
) *ValidatorContext

type ValidatorQueue added in v0.10.4

type ValidatorQueue struct {
	utils.PriorityQueue
}

func (*ValidatorQueue) Init added in v0.10.4

func (vq *ValidatorQueue) Init()

func (*ValidatorQueue) Len added in v0.10.4

func (vq *ValidatorQueue) Len() int

func (*ValidatorQueue) Pop added in v0.10.4

func (vq *ValidatorQueue) Pop() *utils.Queued

func (*ValidatorQueue) Push added in v0.10.4

func (vq *ValidatorQueue) Push(queued *utils.Queued)

type ValidatorStore added in v0.10.4

type ValidatorStore struct {
	// contains filtered or unexported fields
}

func NewValidatorStore added in v0.10.4

func NewValidatorStore(prefix string, prefixPurge string, state *storage.State) *ValidatorStore

func (*ValidatorStore) CheckMaliciousValidators added in v0.16.1

func (vs *ValidatorStore) CheckMaliciousValidators(es *evidence.EvidenceStore, govern *govern.Store) error

CheckMaliciousValidators that not pass criterias and will be marked as malicious

func (*ValidatorStore) ClearEvents added in v0.16.1

func (vs *ValidatorStore) ClearEvents()

func (*ValidatorStore) ExecuteAllegationTracker added in v0.16.1

func (vs *ValidatorStore) ExecuteAllegationTracker(ctx *ValidatorContext, activeCount int64) error

func (*ValidatorStore) Exists added in v0.13.0

func (vs *ValidatorStore) Exists(addr keys.Address) bool

func (*ValidatorStore) Get added in v0.12.0

func (vs *ValidatorStore) Get(addr keys.Address) (*Validator, error)

func (*ValidatorStore) GetActiveValidatorList added in v0.14.4

func (vs *ValidatorStore) GetActiveValidatorList(es *evidence.EvidenceStore) ([]Validator, error)

func (*ValidatorStore) GetBitcoinKeys added in v0.13.0

func (vs *ValidatorStore) GetBitcoinKeys(net *chaincfg.Params) (list []*btcutil.AddressPubKey, err error)

func (*ValidatorStore) GetDelayUnstake added in v0.16.1

func (vs *ValidatorStore) GetDelayUnstake(addr keys.Address) (*Unstake, error)

func (*ValidatorStore) GetEndBlockUpdate added in v0.10.4

func (vs *ValidatorStore) GetEndBlockUpdate(ctx *ValidatorContext, req types.RequestEndBlock) []types.ValidatorUpdate

func (*ValidatorStore) GetEvents added in v0.16.1

func (vs *ValidatorStore) GetEvents() []types.Event

func (*ValidatorStore) GetLastPurgeHeight added in v0.14.3

func (vs *ValidatorStore) GetLastPurgeHeight(validator keys.Address) (height int64, err error)

Get validator last purge height

func (*ValidatorStore) GetValidatorSet added in v0.10.4

func (vs *ValidatorStore) GetValidatorSet() ([]Validator, error)

get validators set

func (*ValidatorStore) GetValidatorsAddress added in v0.13.0

func (vs *ValidatorStore) GetValidatorsAddress() ([]keys.Address, error)

get validators set

func (*ValidatorStore) HandleStake added in v0.10.4

func (vs *ValidatorStore) HandleStake(apply Stake, updateStakeAddress bool, height int64) error

handle stake action

func (*ValidatorStore) HandleUnstake added in v0.10.4

func (vs *ValidatorStore) HandleUnstake(unstake Unstake, height int64) error

func (*ValidatorStore) Init added in v0.10.4

func (*ValidatorStore) InitValidatorQueue added in v0.14.3

func (vs *ValidatorStore) InitValidatorQueue(nodeValidatorAddress keys.Address)

func (*ValidatorStore) IsValidator added in v0.13.0

func (vs *ValidatorStore) IsValidator() bool

func (*ValidatorStore) IsValidatorAddress added in v0.13.0

func (vs *ValidatorStore) IsValidatorAddress(addr keys.Address) bool

func (*ValidatorStore) Iterate added in v0.12.0

func (vs *ValidatorStore) Iterate(fn func(addr keys.Address, validator *Validator) bool) (stopped bool)

func (*ValidatorStore) PushEvent added in v0.16.1

func (vs *ValidatorStore) PushEvent(typeName string, attrs []kv.Pair)

func (*ValidatorStore) Set added in v0.10.4

func (vs *ValidatorStore) Set(validator Validator) error

func (*ValidatorStore) SetDelayUnstake added in v0.16.1

func (vs *ValidatorStore) SetDelayUnstake(unstake *Unstake) error

func (*ValidatorStore) SetLastPurgeHeight added in v0.14.3

func (vs *ValidatorStore) SetLastPurgeHeight(validator keys.Address, height int64) error

Set validator last purge height

func (*ValidatorStore) Setup added in v0.12.0

func (vs *ValidatorStore) Setup(req types.RequestBeginBlock, nodeValidatorAddress keys.Address) error

setup the validators according to begin block

func (*ValidatorStore) WithState added in v0.12.0

func (vs *ValidatorStore) WithState(state *storage.State) *ValidatorStore

type Witness added in v0.14.0

type Witness struct {
	Address     keys.Address   `json:"address"`
	PubKey      keys.PublicKey `json:"pubKey"`
	ECDSAPubKey keys.PublicKey `json:"ecdsaPubkey"`
	Name        string         `json:"name"`
}

func (*Witness) Bytes added in v0.14.0

func (w *Witness) Bytes() []byte

func (*Witness) FromBytes added in v0.14.0

func (w *Witness) FromBytes(msg []byte) (*Witness, error)

type WitnessStore added in v0.14.0

type WitnessStore struct {
	// contains filtered or unexported fields
}

func NewWitnessStore added in v0.14.0

func NewWitnessStore(prefix string, state *storage.State) *WitnessStore

func (*WitnessStore) AddWitness added in v0.14.0

func (ws *WitnessStore) AddWitness(chain chain.Type, apply Stake) error

Add a witness to store

func (*WitnessStore) Exists added in v0.14.0

func (ws *WitnessStore) Exists(chain chain.Type, addr keys.Address) bool

func (*WitnessStore) Get added in v0.14.0

func (ws *WitnessStore) Get(chain chain.Type, addr keys.Address) (*Witness, error)

func (*WitnessStore) GetWitnessAddresses added in v0.14.0

func (ws *WitnessStore) GetWitnessAddresses(chain chain.Type) ([]keys.Address, error)

Get witness addresses

func (*WitnessStore) Init added in v0.14.0

func (ws *WitnessStore) Init(chain chain.Type, nodeValidatorAddress keys.Address)

func (*WitnessStore) IsETHWitness added in v0.14.0

func (ws *WitnessStore) IsETHWitness() bool

This node is a ethereum witness or not

func (*WitnessStore) IsWitnessAddress added in v0.14.0

func (ws *WitnessStore) IsWitnessAddress(chain chain.Type, addr keys.Address) bool

func (*WitnessStore) Iterate added in v0.14.0

func (ws *WitnessStore) Iterate(chain chain.Type, fn func(addr keys.Address, witness *Witness) bool) (stopped bool)

func (*WitnessStore) WithState added in v0.14.0

func (ws *WitnessStore) WithState(state *storage.State) *WitnessStore

Jump to

Keyboard shortcuts

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