market

package
v1.29.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2024 License: Apache-2.0, MIT Imports: 56 Imported by: 30

Documentation

Index

Constants

This section is empty.

Variables

Functions

func AllCodes added in v1.20.0

func AllCodes() []cid.Cid

func DealStatesEqual added in v1.26.0

func DealStatesEqual(a, b DealState) bool

func GetDealFees added in v1.16.0

func GetDealFees(deal markettypes.DealProposal, height abi.ChainEpoch) (abi.TokenAmount, abi.TokenAmount)

returns the earned fees and pending fees for a given deal

func IsDealActive added in v1.17.1

func IsDealActive(state DealState) bool

Types

type BalanceTable

type BalanceTable interface {
	ForEach(cb func(address.Address, abi.TokenAmount) error) error
	Get(key address.Address) (abi.TokenAmount, error)
}

type DealIDState

type DealIDState struct {
	ID   abi.DealID
	Deal DealState
}

type DealLabel added in v1.17.2

type DealLabel = markettypes.DealLabel

type DealProposal

type DealProposal = markettypes.DealProposal

type DealProposalChanges

type DealProposalChanges struct {
	Added   []ProposalIDState
	Removed []ProposalIDState
}

func DiffDealProposals

func DiffDealProposals(pre, cur DealProposals) (*DealProposalChanges, error)

type DealProposals

type DealProposals interface {
	ForEach(cb func(id abi.DealID, dp markettypes.DealProposal) error) error
	Get(id abi.DealID) (*markettypes.DealProposal, bool, error)
	// contains filtered or unexported methods
}

type DealState

type DealState interface {
	SectorNumber() abi.SectorNumber   // 0 if not yet included in proven sector (0 is also a valid sector number)
	SectorStartEpoch() abi.ChainEpoch // -1 if not yet included in proven sector
	LastUpdatedEpoch() abi.ChainEpoch // -1 if deal state never updated
	SlashEpoch() abi.ChainEpoch       // -1 if deal never slashed

	Equals(other DealState) bool
}

func EmptyDealState

func EmptyDealState() DealState

type DealStateChange

type DealStateChange struct {
	ID   abi.DealID
	From DealState
	To   DealState
}

DealStateChange is a change in deal state from -> to

type DealStateChanges

type DealStateChanges struct {
	Added    []DealIDState
	Modified []DealStateChange
	Removed  []DealIDState
}

func DiffDealStates

func DiffDealStates(pre, cur DealStates) (*DealStateChanges, error)

type DealStates

type DealStates interface {
	ForEach(cb func(id abi.DealID, ds DealState) error) error
	Get(id abi.DealID) (DealState, bool, error)
	// contains filtered or unexported methods
}

type ProposalIDState

type ProposalIDState struct {
	ID       abi.DealID
	Proposal markettypes.DealProposal
}

type PublishStorageDealsReturn

type PublishStorageDealsReturn interface {
	DealIDs() ([]abi.DealID, error)
	// Note that this index is based on the batch of deals that were published, NOT the DealID
	IsDealValid(index uint64) (bool, int, error)
}

func DecodePublishStorageDealsReturn added in v1.12.0

func DecodePublishStorageDealsReturn(b []byte, nv network.Version) (PublishStorageDealsReturn, error)

type State

type State interface {
	cbor.Marshaler

	Code() cid.Cid
	ActorKey() string
	ActorVersion() actorstypes.Version

	BalancesChanged(State) (bool, error)
	EscrowTable() (BalanceTable, error)
	LockedTable() (BalanceTable, error)
	TotalLocked() (abi.TokenAmount, error)
	StatesChanged(State) (bool, error)
	States() (DealStates, error)
	ProposalsChanged(State) (bool, error)
	Proposals() (DealProposals, error)
	VerifyDealsForActivation(
		minerAddr address.Address, deals []abi.DealID, currEpoch, sectorExpiry abi.ChainEpoch,
	) (weight, verifiedWeight abi.DealWeight, err error)
	NextID() (abi.DealID, error)
	GetState() interface{}
	GetAllocationIdForPendingDeal(dealId abi.DealID) (verifregtypes.AllocationId, error)
}

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 actorstypes.Version) (State, error)

Jump to

Keyboard shortcuts

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