state

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2020 License: Apache-2.0, MIT Imports: 10 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChainAPI

type ChainAPI interface {
	apibstore.ChainIO
	StateGetActor(ctx context.Context, actor address.Address, tsk types.TipSetKey) (*types.Actor, error)
}

ChainAPI abstracts out calls made by this class to external APIs

type ChangedDeals

type ChangedDeals map[abi.DealID]DealStateChange

ChangedDeals is a set of changes to deal state

type DealStateChange

type DealStateChange struct {
	From market.DealState
	To   market.DealState
}

DealStateChange is a change in deal state from -> to

type DiffDealStatesFunc

type DiffDealStatesFunc func(ctx context.Context, oldDealStateRoot *amt.Root, newDealStateRoot *amt.Root) (changed bool, user UserData, err error)

type DiffFunc

type DiffFunc func(ctx context.Context, oldState, newState *types.TipSet) (changed bool, user UserData, err error)

DiffFunc check if there's a change form oldState to newState, and returns - changed: was there a change - user: user-defined data representing the state change - err

type DiffStateFunc

type DiffStateFunc func(ctx context.Context, oldActorStateHead, newActorStateHead cid.Cid) (changed bool, user UserData, err error)

type DiffStorageMarketStateFunc

type DiffStorageMarketStateFunc func(ctx context.Context, oldState *market.State, newState *market.State) (changed bool, user UserData, err error)

type StatePredicates

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

StatePredicates has common predicates for responding to state changes

func NewStatePredicates

func NewStatePredicates(api ChainAPI) *StatePredicates

func (*StatePredicates) DealStateChangedForIDs

func (sp *StatePredicates) DealStateChangedForIDs(dealIds []abi.DealID) DiffDealStatesFunc

DealStateChangedForIDs detects changes in the deal state AMT for the given deal IDs

func (*StatePredicates) OnActorStateChanged

func (sp *StatePredicates) OnActorStateChanged(addr address.Address, diffStateFunc DiffStateFunc) DiffFunc

OnActorStateChanged calls diffStateFunc when the state changes for the given actor

func (*StatePredicates) OnDealStateChanged

func (sp *StatePredicates) OnDealStateChanged(diffDealStates DiffDealStatesFunc) DiffStorageMarketStateFunc

OnDealStateChanged calls diffDealStates when the market state changes

func (*StatePredicates) OnStorageMarketActorChanged

func (sp *StatePredicates) OnStorageMarketActorChanged(diffStorageMarketState DiffStorageMarketStateFunc) DiffFunc

OnStorageMarketActorChanged calls diffStorageMarketState when the state changes for the market actor

type UserData

type UserData interface{}

UserData is the data returned from the DiffFunc

Jump to

Keyboard shortcuts

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