Documentation ¶
Index ¶
- type AddressPair
- type BalanceChange
- type BalanceTables
- type ChainAPI
- type ChangedBalances
- type ChangedDeals
- type DiffActorStateFunc
- type DiffAdtArraysFunc
- type DiffBalanceTablesFunc
- type DiffDealProposalsFunc
- type DiffDealStatesFunc
- type DiffInitActorStateFunc
- type DiffMinerActorStateFunc
- type DiffPaymentChannelStateFunc
- type DiffStorageMarketStateFunc
- type DiffTipSetKeyFunc
- type FastChainAPI
- type PayChToSendChange
- type StatePredicates
- func (sp *StatePredicates) AvailableBalanceChangedForAddresses(getAddrs func() []address.Address) DiffBalanceTablesFunc
- func (sp *StatePredicates) DealStateChangedForIDs(dealIds []abi.DealID) DiffDealStatesFunc
- func (sp *StatePredicates) OnActorStateChanged(addr address.Address, diffStateFunc DiffActorStateFunc) DiffTipSetKeyFunc
- func (sp *StatePredicates) OnAddressMapChange() DiffInitActorStateFunc
- func (sp *StatePredicates) OnBalanceChanged(diffBalances DiffBalanceTablesFunc) DiffStorageMarketStateFunc
- func (sp *StatePredicates) OnDealProposalAmtChanged() DiffDealProposalsFunc
- func (sp *StatePredicates) OnDealProposalChanged(diffDealProps DiffDealProposalsFunc) DiffStorageMarketStateFunc
- func (sp *StatePredicates) OnDealStateAmtChanged() DiffDealStatesFunc
- func (sp *StatePredicates) OnDealStateChanged(diffDealStates DiffDealStatesFunc) DiffStorageMarketStateFunc
- func (sp *StatePredicates) OnInitActorChange(diffInitActorState DiffInitActorStateFunc) DiffTipSetKeyFunc
- func (sp *StatePredicates) OnMinerActorChange(minerAddr address.Address, diffMinerActorState DiffMinerActorStateFunc) DiffTipSetKeyFunc
- func (sp *StatePredicates) OnMinerPreCommitChange() DiffMinerActorStateFunc
- func (sp *StatePredicates) OnMinerSectorChange() DiffMinerActorStateFunc
- func (sp *StatePredicates) OnPaymentChannelActorChanged(paychAddr address.Address, diffPaymentChannelState DiffPaymentChannelStateFunc) DiffTipSetKeyFunc
- func (sp *StatePredicates) OnStorageMarketActorChanged(diffStorageMarketState DiffStorageMarketStateFunc) DiffTipSetKeyFunc
- func (sp *StatePredicates) OnToSendAmountChanges() DiffPaymentChannelStateFunc
- type UserData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddressPair ¶
type AddressPair struct { ID address.Address PK address.Address }
type BalanceChange ¶
type BalanceChange struct { From abi.TokenAmount To abi.TokenAmount }
BalanceChange is a change in balance from -> to
type BalanceTables ¶
type BalanceTables struct { EscrowTable market.BalanceTable LockedTable market.BalanceTable }
type ChainAPI ¶
type ChainAPI interface { chain.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
func WrapFastAPI ¶
func WrapFastAPI(api FastChainAPI) ChainAPI
type ChangedBalances ¶
type ChangedBalances map[address.Address]BalanceChange
ChangedBalances is a set of changes to deal state
type ChangedDeals ¶
type ChangedDeals map[abi.DealID]market.DealStateChange
ChangedDeals is a set of changes to deal state
type DiffActorStateFunc ¶
type DiffAdtArraysFunc ¶
type DiffBalanceTablesFunc ¶
type DiffBalanceTablesFunc func(ctx context.Context, oldBalanceTable, newBalanceTable BalanceTables) (changed bool, user UserData, err error)
DiffBalanceTablesFunc compares two balance tables
type DiffDealProposalsFunc ¶
type DiffDealStatesFunc ¶
type DiffInitActorStateFunc ¶
type DiffMinerActorStateFunc ¶
type DiffPaymentChannelStateFunc ¶
type DiffPaymentChannelStateFunc func(ctx context.Context, oldState paych.State, newState paych.State) (changed bool, user UserData, err error)
DiffPaymentChannelStateFunc is function that compares two states for the payment channel
type DiffTipSetKeyFunc ¶
type DiffTipSetKeyFunc func(ctx context.Context, oldState, newState types.TipSetKey) (changed bool, user UserData, err error)
DiffTipSetKeyFunc 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 FastChainAPI ¶
type PayChToSendChange ¶
type PayChToSendChange struct { OldToSend abi.TokenAmount NewToSend abi.TokenAmount }
PayChToSendChange is a difference in the amount to send on a payment channel when the money is collected
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) AvailableBalanceChangedForAddresses ¶
func (sp *StatePredicates) AvailableBalanceChangedForAddresses(getAddrs func() []address.Address) DiffBalanceTablesFunc
AvailableBalanceChangedForAddresses detects changes in the escrow table for the given addresses
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 DiffActorStateFunc) DiffTipSetKeyFunc
OnActorStateChanged calls diffStateFunc when the state changes for the given actor
func (*StatePredicates) OnAddressMapChange ¶
func (sp *StatePredicates) OnAddressMapChange() DiffInitActorStateFunc
func (*StatePredicates) OnBalanceChanged ¶
func (sp *StatePredicates) OnBalanceChanged(diffBalances DiffBalanceTablesFunc) DiffStorageMarketStateFunc
OnBalanceChanged runs when the escrow table for available balances changes
func (*StatePredicates) OnDealProposalAmtChanged ¶
func (sp *StatePredicates) OnDealProposalAmtChanged() DiffDealProposalsFunc
OnDealProposalAmtChanged detects changes in the deal proposal AMT for all deal proposals and returns a MarketProposalsChanges structure containing: - Added Proposals - Modified Proposals - Removed Proposals
func (*StatePredicates) OnDealProposalChanged ¶
func (sp *StatePredicates) OnDealProposalChanged(diffDealProps DiffDealProposalsFunc) DiffStorageMarketStateFunc
OnDealProposalChanged calls diffDealProps when the market proposal state changes
func (*StatePredicates) OnDealStateAmtChanged ¶
func (sp *StatePredicates) OnDealStateAmtChanged() DiffDealStatesFunc
OnDealStateAmtChanged detects changes in the deal state AMT for all deal states and returns a MarketDealStateChanges structure containing: - Added Deals - Modified Deals - Removed Deals
func (*StatePredicates) OnDealStateChanged ¶
func (sp *StatePredicates) OnDealStateChanged(diffDealStates DiffDealStatesFunc) DiffStorageMarketStateFunc
OnDealStateChanged calls diffDealStates when the market deal state changes
func (*StatePredicates) OnInitActorChange ¶
func (sp *StatePredicates) OnInitActorChange(diffInitActorState DiffInitActorStateFunc) DiffTipSetKeyFunc
func (*StatePredicates) OnMinerActorChange ¶
func (sp *StatePredicates) OnMinerActorChange(minerAddr address.Address, diffMinerActorState DiffMinerActorStateFunc) DiffTipSetKeyFunc
func (*StatePredicates) OnMinerPreCommitChange ¶
func (sp *StatePredicates) OnMinerPreCommitChange() DiffMinerActorStateFunc
func (*StatePredicates) OnMinerSectorChange ¶
func (sp *StatePredicates) OnMinerSectorChange() DiffMinerActorStateFunc
func (*StatePredicates) OnPaymentChannelActorChanged ¶
func (sp *StatePredicates) OnPaymentChannelActorChanged(paychAddr address.Address, diffPaymentChannelState DiffPaymentChannelStateFunc) DiffTipSetKeyFunc
OnPaymentChannelActorChanged calls diffPaymentChannelState when the state changes for the the payment channel actor
func (*StatePredicates) OnStorageMarketActorChanged ¶
func (sp *StatePredicates) OnStorageMarketActorChanged(diffStorageMarketState DiffStorageMarketStateFunc) DiffTipSetKeyFunc
OnStorageMarketActorChanged calls diffStorageMarketState when the state changes for the market actor
func (*StatePredicates) OnToSendAmountChanges ¶
func (sp *StatePredicates) OnToSendAmountChanges() DiffPaymentChannelStateFunc
OnToSendAmountChanges monitors changes on the total amount to send from one party to the other on a payment channel