power

package
v1.13.2-rc6 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2022 License: Apache-2.0, MIT Imports: 30 Imported by: 26

Documentation

Index

Constants

This section is empty.

Variables

Functions

func GetActorCodeID added in v1.11.0

func GetActorCodeID(av actors.Version) (cid.Cid, error)

Types

type Claim

type Claim struct {
	// Sum of raw byte power for a miner's sectors.
	RawBytePower abi.StoragePower

	// Sum of quality adjusted power for a miner's sectors.
	QualityAdjPower abi.StoragePower
}

func AddClaims added in v1.1.1

func AddClaims(a Claim, b Claim) Claim

type ClaimChanges added in v1.1.3

type ClaimChanges struct {
	Added    []ClaimInfo
	Modified []ClaimModification
	Removed  []ClaimInfo
}

func DiffClaims added in v1.1.3

func DiffClaims(pre, cur State) (*ClaimChanges, error)

type ClaimInfo added in v1.1.3

type ClaimInfo struct {
	Miner address.Address
	Claim Claim
}

type ClaimModification added in v1.1.3

type ClaimModification struct {
	Miner address.Address
	From  Claim
	To    Claim
}

type State

type State interface {
	cbor.Marshaler

	TotalLocked() (abi.TokenAmount, error)
	TotalPower() (Claim, error)
	TotalCommitted() (Claim, error)
	TotalPowerSmoothed() (builtin.FilterEstimate, error)
	GetState() interface{}

	// MinerCounts returns the number of miners. Participating is the number
	// with power above the minimum miner threshold.
	MinerCounts() (participating, total uint64, err error)
	MinerPower(address.Address) (Claim, bool, error)
	MinerNominalPowerMeetsConsensusMinimum(address.Address) (bool, error)
	ListAllMiners() ([]address.Address, error)
	ForEachClaim(func(miner address.Address, claim Claim) error) error
	ClaimsChanged(State) (bool, error)

	// Testing or genesis setup only
	SetTotalQualityAdjPower(abi.StoragePower) error
	SetTotalRawBytePower(abi.StoragePower) error
	SetThisEpochQualityAdjPower(abi.StoragePower) error
	SetThisEpochRawBytePower(abi.StoragePower) error
	// contains filtered or unexported methods
}

func Load

func Load(store adt.Store, act *types.Actor) (State, error)

func MakeState added in v1.11.0

func MakeState(store adt.Store, av actors.Version) (State, error)

Jump to

Keyboard shortcuts

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