Documentation ¶
Index ¶
- func DiffAdtArray(preArr, curArr *adt.Array, out AdtArrayDiff) error
- func DiffAdtMap(preMap, curMap *adt.Map, out AdtMapDiff) error
- type AddressChange
- type AddressPair
- type AdtArrayDiff
- type AdtMapDiff
- type BalanceChange
- type BalanceTables
- type ChainAPI
- type ChangedBalances
- type ChangedDeals
- type DealIDState
- type DealStateChange
- type DiffActorStateFunc
- type DiffAdtArraysFunc
- type DiffBalanceTablesFunc
- type DiffInitActorStateFunc
- type DiffMinerActorStateFunc
- type DiffPaymentChannelStateFunc
- type DiffStorageMarketStateFunc
- type DiffTipSetKeyFunc
- type InitActorAddressChanges
- func (i *InitActorAddressChanges) Add(key string, val *typegen.Deferred) error
- func (i *InitActorAddressChanges) AsKey(key string) (adt.Keyer, error)
- func (i *InitActorAddressChanges) Modify(key string, from, to *typegen.Deferred) error
- func (i *InitActorAddressChanges) Remove(key string, val *typegen.Deferred) error
- type MarketDealProposalChanges
- type MarketDealStateChanges
- type MinerPreCommitChanges
- func (m *MinerPreCommitChanges) Add(key string, val *typegen.Deferred) error
- func (m *MinerPreCommitChanges) AsKey(key string) (adt.Keyer, error)
- func (m *MinerPreCommitChanges) Modify(key string, from, to *typegen.Deferred) error
- func (m *MinerPreCommitChanges) Remove(key string, val *typegen.Deferred) error
- type MinerSectorChanges
- type PayChToSendChange
- type ProposalIDState
- type SectorExtensions
- type StatePredicates
- func (sp *StatePredicates) AvailableBalanceChangedForAddresses(getAddrs func() []address.Address) DiffBalanceTablesFunc
- func (sp *StatePredicates) DealStateChangedForIDs(dealIds []abi.DealID) DiffAdtArraysFunc
- 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() DiffAdtArraysFunc
- func (sp *StatePredicates) OnDealProposalChanged(diffDealProps DiffAdtArraysFunc) DiffStorageMarketStateFunc
- func (sp *StatePredicates) OnDealStateAmtChanged() DiffAdtArraysFunc
- func (sp *StatePredicates) OnDealStateChanged(diffDealStates DiffAdtArraysFunc) 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 ¶
func DiffAdtArray ¶ added in v0.5.0
func DiffAdtArray(preArr, curArr *adt.Array, out AdtArrayDiff) error
DiffAdtArray accepts two *adt.Array's and an AdtArrayDiff implementation. It does the following: - All values that exist in preArr and not in curArr are passed to AdtArrayDiff.Remove() - All values that exist in curArr nnd not in prevArr are passed to adtArrayDiff.Add() - All values that exist in preArr and in curArr are passed to AdtArrayDiff.Modify()
- It is the responsibility of AdtArrayDiff.Modify() to determine if the values it was passed have been modified.
func DiffAdtMap ¶ added in v0.5.0
func DiffAdtMap(preMap, curMap *adt.Map, out AdtMapDiff) error
Types ¶
type AddressChange ¶ added in v0.5.0
type AddressChange struct { From AddressPair To AddressPair }
type AddressPair ¶ added in v0.5.0
type AddressPair struct { ID address.Address PK address.Address }
type AdtArrayDiff ¶ added in v0.5.0
type AdtArrayDiff interface { Add(key uint64, val *typegen.Deferred) error Modify(key uint64, from, to *typegen.Deferred) error Remove(key uint64, val *typegen.Deferred) error }
AdtArrayDiff generalizes adt.Array diffing by accepting a Deferred type that can unmarshalled to its corresponding struct in an interface implantation. Add should be called when a new k,v is added to the array Modify should be called when a value is modified in the array Remove should be called when a value is removed from the array
type AdtMapDiff ¶ added in v0.5.0
type AdtMapDiff interface { AsKey(key string) (adt.Keyer, error) Add(key string, val *typegen.Deferred) error Modify(key string, from, to *typegen.Deferred) error Remove(key string, val *typegen.Deferred) error }
AdtMapDiff generalizes adt.Map diffing by accepting a Deferred type that can unmarshalled to its corresponding struct in an interface implantation. AsKey should return the Keyer implementation specific to the map Add should be called when a new k,v is added to the map Modify should be called when a value is modified in the map Remove should be called when a value is removed from the map
type BalanceChange ¶ added in v0.5.0
type BalanceChange struct { From abi.TokenAmount To abi.TokenAmount }
BalanceChange is a change in balance from -> to
type BalanceTables ¶ added in v0.5.0
type BalanceTables struct { EscrowTable *adt.BalanceTable LockedTable *adt.BalanceTable }
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 ChangedBalances ¶ added in v0.5.0
type ChangedBalances map[address.Address]BalanceChange
ChangedBalances is a set of changes to deal state
type ChangedDeals ¶
type ChangedDeals map[abi.DealID]DealStateChange
ChangedDeals is a set of changes to deal state
type DealStateChange ¶
DealStateChange is a change in deal state from -> to
type DiffActorStateFunc ¶ added in v0.5.0
type DiffAdtArraysFunc ¶ added in v0.5.0
type DiffBalanceTablesFunc ¶ added in v0.5.0
type DiffBalanceTablesFunc func(ctx context.Context, oldBalanceTable, newBalanceTable BalanceTables) (changed bool, user UserData, err error)
DiffBalanceTablesFunc compares two balance tables
type DiffInitActorStateFunc ¶ added in v0.5.0
type DiffMinerActorStateFunc ¶ added in v0.5.0
type DiffPaymentChannelStateFunc ¶ added in v0.5.0
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 ¶ added in v0.5.0
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 InitActorAddressChanges ¶ added in v0.5.0
type InitActorAddressChanges struct { Added []AddressPair Modified []AddressChange Removed []AddressPair }
func (*InitActorAddressChanges) Add ¶ added in v0.5.0
func (i *InitActorAddressChanges) Add(key string, val *typegen.Deferred) error
func (*InitActorAddressChanges) AsKey ¶ added in v0.5.0
func (i *InitActorAddressChanges) AsKey(key string) (adt.Keyer, error)
type MarketDealProposalChanges ¶ added in v0.5.0
type MarketDealProposalChanges struct { Added []ProposalIDState Removed []ProposalIDState }
func (*MarketDealProposalChanges) Add ¶ added in v0.5.0
func (m *MarketDealProposalChanges) Add(key uint64, val *typegen.Deferred) error
type MarketDealStateChanges ¶ added in v0.5.0
type MarketDealStateChanges struct { Added []DealIDState Modified []DealStateChange Removed []DealIDState }
func (*MarketDealStateChanges) Add ¶ added in v0.5.0
func (m *MarketDealStateChanges) Add(key uint64, val *typegen.Deferred) error
type MinerPreCommitChanges ¶ added in v0.5.0
type MinerPreCommitChanges struct { Added []miner.SectorPreCommitOnChainInfo Removed []miner.SectorPreCommitOnChainInfo }
func (*MinerPreCommitChanges) Add ¶ added in v0.5.0
func (m *MinerPreCommitChanges) Add(key string, val *typegen.Deferred) error
func (*MinerPreCommitChanges) AsKey ¶ added in v0.5.0
func (m *MinerPreCommitChanges) AsKey(key string) (adt.Keyer, error)
type MinerSectorChanges ¶ added in v0.5.0
type MinerSectorChanges struct { Added []miner.SectorOnChainInfo Extended []SectorExtensions Removed []miner.SectorOnChainInfo }
func (*MinerSectorChanges) Add ¶ added in v0.5.0
func (m *MinerSectorChanges) Add(key uint64, val *typegen.Deferred) error
type PayChToSendChange ¶ added in v0.5.0
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 ProposalIDState ¶ added in v0.5.0
type ProposalIDState struct { ID abi.DealID Proposal market.DealProposal }
type SectorExtensions ¶ added in v0.5.0
type SectorExtensions struct { From miner.SectorOnChainInfo To miner.SectorOnChainInfo }
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 ¶ added in v0.5.0
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) DiffAdtArraysFunc
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 ¶ added in v0.5.0
func (sp *StatePredicates) OnAddressMapChange() DiffInitActorStateFunc
func (*StatePredicates) OnBalanceChanged ¶ added in v0.5.0
func (sp *StatePredicates) OnBalanceChanged(diffBalances DiffBalanceTablesFunc) DiffStorageMarketStateFunc
OnBalanceChanged runs when the escrow table for available balances changes
func (*StatePredicates) OnDealProposalAmtChanged ¶ added in v0.5.0
func (sp *StatePredicates) OnDealProposalAmtChanged() DiffAdtArraysFunc
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 ¶ added in v0.5.0
func (sp *StatePredicates) OnDealProposalChanged(diffDealProps DiffAdtArraysFunc) DiffStorageMarketStateFunc
OnDealProposalChanged calls diffDealProps when the market proposal state changes
func (*StatePredicates) OnDealStateAmtChanged ¶ added in v0.5.0
func (sp *StatePredicates) OnDealStateAmtChanged() DiffAdtArraysFunc
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 DiffAdtArraysFunc) DiffStorageMarketStateFunc
OnDealStateChanged calls diffDealStates when the market deal state changes
func (*StatePredicates) OnInitActorChange ¶ added in v0.5.0
func (sp *StatePredicates) OnInitActorChange(diffInitActorState DiffInitActorStateFunc) DiffTipSetKeyFunc
func (*StatePredicates) OnMinerActorChange ¶ added in v0.5.0
func (sp *StatePredicates) OnMinerActorChange(minerAddr address.Address, diffMinerActorState DiffMinerActorStateFunc) DiffTipSetKeyFunc
func (*StatePredicates) OnMinerPreCommitChange ¶ added in v0.5.0
func (sp *StatePredicates) OnMinerPreCommitChange() DiffMinerActorStateFunc
func (*StatePredicates) OnMinerSectorChange ¶ added in v0.5.0
func (sp *StatePredicates) OnMinerSectorChange() DiffMinerActorStateFunc
func (*StatePredicates) OnPaymentChannelActorChanged ¶ added in v0.5.0
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 ¶ added in v0.5.0
func (sp *StatePredicates) OnToSendAmountChanges() DiffPaymentChannelStateFunc
OnToSendAmountChanges monitors changes on the total amount to send from one party to the other on a payment channel