lens

package
v0.20.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: Apache-2.0, MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API interface {
	StoreAPI
	ChainAPI
	StateAPI
	VMAPI
	EthModuleAPI
	ActorEventAPI

	GetMessageExecutionsForTipSet(ctx context.Context, ts, pts *types.TipSet) ([]*MessageExecution, error)
}

type ActorEventAPI added in v0.18.0

type ActorEventAPI interface {
	GetActorEventsRaw(ctx context.Context, filter *types.ActorEventFilter) ([]*types.ActorEvent, error)
}

type BlockMessageReceipts added in v0.12.0

type BlockMessageReceipts struct {
	Block *types.BlockHeader
	// Messages contained in Block.
	Messages []types.ChainMsg
	// Receipts contained in Block.
	Receipts []*types.MessageReceipt
	// MessageExectionIndex contains a mapping of Messages to their execution order in the tipset they were included.
	MessageExecutionIndex map[types.ChainMsg]int
}

BlockMessageReceipts contains a block its messages and their corresponding receipts. The Receipts are one-to-one with Messages index.

func (*BlockMessageReceipts) Iterator added in v0.12.0

Iterator returns a MessageReceiptIterator to conveniently iterate messages, their execution index, and their respective receipts.

type BlockMessages

type BlockMessages struct {
	Block        *types.BlockHeader     // block messages appeared in
	BlsMessages  []*types.Message       // BLS messages in block `Block`
	SecpMessages []*types.SignedMessage // SECP messages in block `Block`
}

type ChainAPI

type ChainAPI interface {
	ChainNotify(context.Context) (<-chan []*api.HeadChange, error)
	ChainHead(context.Context) (*types.TipSet, error)

	ChainHasObj(ctx context.Context, obj cid.Cid) (bool, error)
	ChainReadObj(ctx context.Context, obj cid.Cid) ([]byte, error)

	ChainGetGenesis(ctx context.Context) (*types.TipSet, error)
	ChainGetTipSet(context.Context, types.TipSetKey) (*types.TipSet, error)
	ChainGetTipSetByHeight(context.Context, abi.ChainEpoch, types.TipSetKey) (*types.TipSet, error)
	ChainGetTipSetAfterHeight(context.Context, abi.ChainEpoch, types.TipSetKey) (*types.TipSet, error)

	ChainGetBlockMessages(ctx context.Context, msg cid.Cid) (*api.BlockMessages, error)
	ChainGetParentMessages(ctx context.Context, blockCid cid.Cid) ([]api.Message, error)
	ChainGetMessagesInTipset(ctx context.Context, tsk types.TipSetKey) ([]api.Message, error)

	ComputeBaseFee(ctx context.Context, ts *types.TipSet) (abi.TokenAmount, error)

	MessagesForTipSetBlocks(ctx context.Context, ts *types.TipSet) ([]*BlockMessages, error)
	TipSetMessageReceipts(ctx context.Context, ts, pts *types.TipSet) ([]*BlockMessageReceipts, error)
	MessagesWithDeduplicationForTipSet(ctx context.Context, ts *types.TipSet) (map[cid.Cid]types.ChainMsg, error)

	// added during hyperspace
	ChainGetEvents(ctx context.Context, root cid.Cid) ([]types.Event, error)
}

type EthModuleAPI added in v0.17.0

type EthModuleAPI interface {
	EthGetBlockByHash(ctx context.Context, blkHash ethtypes.EthHash, fullTxInfo bool) (ethtypes.EthBlock, error)
	EthGetTransactionReceipt(ctx context.Context, txHash ethtypes.EthHash) (*api.EthTxReceipt, error)
	EthGetTransactionByHash(ctx context.Context, txHash *ethtypes.EthHash) (*ethtypes.EthTx, error)
}

type MessageExecution

type MessageExecution struct {
	Cid       cid.Cid
	StateRoot cid.Cid
	Height    abi.ChainEpoch

	Message *types.Message
	Ret     *vm.ApplyRet

	FromActorCode cid.Cid // code of the actor the message is from
	ToActorCode   cid.Cid // code of the actor the message is to

	Implicit bool
}

type MessageReceiptIterator added in v0.12.0

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

func (*MessageReceiptIterator) HasNext added in v0.12.0

func (mri *MessageReceiptIterator) HasNext() bool

HasNext returns `true` while there are messages/receipts to iterate.

func (*MessageReceiptIterator) Next added in v0.12.0

Next returns the next message, its execution index, and receipt in the MessageReceiptIterator.

func (*MessageReceiptIterator) Reset added in v0.12.0

func (mri *MessageReceiptIterator) Reset()

Reset resets the MessageReceiptIterator to the first message/receipt.

type ShouldBurnFn added in v0.12.0

type ShouldBurnFn func(ctx context.Context, msg *types.Message, errcode exitcode.ExitCode) (bool, error)

type StateAPI

type StateAPI interface {
	StateGetActor(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*types.Actor, error)
	StateLookupRobustAddress(ctx context.Context, addr address.Address, tsk types.TipSetKey) (address.Address, error)
	StateListActors(context.Context, types.TipSetKey) ([]address.Address, error)
	StateChangedActors(context.Context, cid.Cid, cid.Cid) (map[string]types.Actor, error)

	StateMinerPower(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*api.MinerPower, error)

	StateMarketDeals(context.Context, types.TipSetKey) (map[string]*api.MarketDeal, error)

	StateReadState(ctx context.Context, addr address.Address, tsk types.TipSetKey) (*api.ActorState, error)
	StateGetReceipt(ctx context.Context, bcid cid.Cid, tsk types.TipSetKey) (*types.MessageReceipt, error)
	CirculatingSupply(context.Context, types.TipSetKey) (api.CirculatingSupply, error)
	StateNetworkName(context.Context) (dtypes.NetworkName, error)
}

type StoreAPI

type StoreAPI interface {
	// TODO this should be the lotus store not the specs-actors store.
	Store() adt.Store
}

type VMAPI added in v0.12.0

type VMAPI interface {
	BurnFundsFn(ctx context.Context, ts *types.TipSet) (ShouldBurnFn, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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