types

package
v0.4.9-rc9 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AspectContextKey cosmos.ContextKey = "aspect-ctx"

	AspectModuleName = "aspect"
)

Variables

This section is empty.

Functions

func InitStoreKeys

func InitStoreKeys(evmStoreKey storetypes.StoreKey, aspectStoreKey storetypes.StoreKey)

func NewBindingPriorityComparator

func NewBindingPriorityComparator(x []*AspectMeta) func(i, j int) bool

Types

type AspectContext

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

func NewAspectContext

func NewAspectContext() *AspectContext

func (*AspectContext) Add

func (c *AspectContext) Add(address common.Address, key string, value []byte)

func (*AspectContext) Clear

func (c *AspectContext) Clear()

func (*AspectContext) Get

func (c *AspectContext) Get(address common.Address, key string) []byte

type AspectInfo

type AspectInfo struct {
	AspectId common.Address `json:"AspectId"`
	Version  uint64         `json:"Version"`
	Priority int8           `json:"Priority"`
}

type AspectMeta

type AspectMeta struct {
	Id       common.Address `json:"id"`
	Version  *uint256.Int   `json:"version"`
	Priority int64          `json:"priority"`
}

type AspectRuntimeContext

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

AspectRuntimeContext is the contextual object required for Aspect execution, containing information related to transactions (tx) and blocks. Aspects at different join points can access this context, and consequently, the context dynamically adjusts its content based on the actual execution of blocks and transactions. Here is the execution scenario of this context in the lifecycle of a tx process, listed in the order of tx execution: 1. initialization: Before each transaction execution, create the AspectRuntimeContext and establish a bidirectional connection with the sdk context. 2. withBlockConfig: Write information before the start of each block and destroy it at the end of each block. Transfer it to the AspectRuntimeContext before the execution of tx in the deliver state through WithExtBlock. 3. withEVM: Before Pre-tx-execute, incorporate the EVM context, including evm, stateDB, evm tracer, message, message from, etc., and pass it to the AspectRuntimeContext through WithTxContext. 4. withReceipt: After the execution of the EVM, store the result in TxContext, enabling subsequent JoinPoints to access the execution details of the tx. 5. commit: Decide whether to commit at the end of each transaction. If committing is necessary, write the result to the sdk context. 6. destroy: After each transaction execution, destroy the AspectRuntimeContext.

func NewAspectRuntimeContext

func NewAspectRuntimeContext() *AspectRuntimeContext

func (*AspectRuntimeContext) AspectContext

func (c *AspectRuntimeContext) AspectContext() *AspectContext

func (*AspectRuntimeContext) AspectState

func (c *AspectRuntimeContext) AspectState() *AspectState

func (*AspectRuntimeContext) AspectStoreKey

func (c *AspectRuntimeContext) AspectStoreKey() storetypes.StoreKey

func (*AspectRuntimeContext) ClearBlockContext

func (c *AspectRuntimeContext) ClearBlockContext()

func (*AspectRuntimeContext) CosmosContext

func (c *AspectRuntimeContext) CosmosContext() cosmos.Context

func (*AspectRuntimeContext) CreateStateObject

func (c *AspectRuntimeContext) CreateStateObject()

func (*AspectRuntimeContext) Deadline

func (c *AspectRuntimeContext) Deadline() (deadline time.Time, ok bool)

func (*AspectRuntimeContext) Debug

func (c *AspectRuntimeContext) Debug(msg string, keyvals ...interface{})

func (*AspectRuntimeContext) Destroy

func (c *AspectRuntimeContext) Destroy()

func (*AspectRuntimeContext) Done

func (c *AspectRuntimeContext) Done() <-chan struct{}

func (*AspectRuntimeContext) EVMStoreKey

func (c *AspectRuntimeContext) EVMStoreKey() storetypes.StoreKey

func (*AspectRuntimeContext) Err

func (c *AspectRuntimeContext) Err() error

func (*AspectRuntimeContext) EthBlockContext

func (c *AspectRuntimeContext) EthBlockContext() *EthBlockContext

func (*AspectRuntimeContext) EthTxContext

func (c *AspectRuntimeContext) EthTxContext() *EthTxContext

func (*AspectRuntimeContext) GetAspectProperty

func (c *AspectRuntimeContext) GetAspectProperty(ctx *artelatypes.RunnerContext, version uint64, key string) []byte

func (*AspectRuntimeContext) GetAspectState

func (c *AspectRuntimeContext) GetAspectState(ctx *artelatypes.RunnerContext, key string) []byte

func (*AspectRuntimeContext) JITManager

func (c *AspectRuntimeContext) JITManager() *inherent.Manager

func (*AspectRuntimeContext) Logger

func (c *AspectRuntimeContext) Logger() log.Logger

func (*AspectRuntimeContext) SetAspectState

func (c *AspectRuntimeContext) SetAspectState(ctx *artelatypes.RunnerContext, key string, value []byte)

func (*AspectRuntimeContext) SetEthBlockContext

func (c *AspectRuntimeContext) SetEthBlockContext(newBlockCtx *EthBlockContext)

func (*AspectRuntimeContext) SetEthTxContext

func (c *AspectRuntimeContext) SetEthTxContext(newTxCtx *EthTxContext, jitManager *inherent.Manager)

func (*AspectRuntimeContext) StateDb

func (c *AspectRuntimeContext) StateDb() vm.StateDB

func (*AspectRuntimeContext) Value

func (c *AspectRuntimeContext) Value(key interface{}) interface{}

func (*AspectRuntimeContext) WithCosmosContext

func (c *AspectRuntimeContext) WithCosmosContext(newTxCtx cosmos.Context)

type AspectState

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

func NewAspectState

func NewAspectState(ctx cosmos.Context, logger log.Logger) *AspectState

func (*AspectState) Get

func (k *AspectState) Get(aspectID common.Address, key string) []byte

func (*AspectState) Set

func (k *AspectState) Set(aspectID common.Address, key string, value []byte)

type BoundAspectCode

type BoundAspectCode struct {
	AspectId common.Address `json:"aspectId"`
	Version  *uint256.Int   `json:"version"`
	Priority int64          `json:"priority"`
	Code     []byte         `json:"code"`
}

type ContextBuilder

type ContextBuilder func(height int64, prove bool) (cosmos.Context, error)

type EthBlockContext

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

func NewEthBlockContextFromABCIBeginBlockReq

func NewEthBlockContextFromABCIBeginBlockReq(req abci.RequestBeginBlock) *EthBlockContext

func NewEthBlockContextFromHeight

func NewEthBlockContextFromHeight(height int64) *EthBlockContext

func NewEthBlockContextFromQuery

func NewEthBlockContextFromQuery(sdkCtx cosmos.Context, queryCtx client.Context) *EthBlockContext

func (*EthBlockContext) BlockHeader

func (c *EthBlockContext) BlockHeader() *ethtypes.Header

type EthTxContext

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

func NewEthTxContext

func NewEthTxContext(ethTx *ethtypes.Transaction) *EthTxContext

func (*EthTxContext) ClearEvmObject

func (c *EthTxContext) ClearEvmObject() *EthTxContext

func (*EthTxContext) Commit

func (c *EthTxContext) Commit() bool

func (*EthTxContext) EvmCfg

func (c *EthTxContext) EvmCfg() *statedb.EVMConfig

func (*EthTxContext) LastEvm

func (c *EthTxContext) LastEvm() *vm.EVM

func (*EthTxContext) Message

func (c *EthTxContext) Message() *core.Message

func (*EthTxContext) Receipt

func (c *EthTxContext) Receipt() *ethtypes.Receipt

func (*EthTxContext) TxContent

func (c *EthTxContext) TxContent() *ethtypes.Transaction

func (*EthTxContext) TxFrom

func (c *EthTxContext) TxFrom() common.Address

func (*EthTxContext) TxIndex

func (c *EthTxContext) TxIndex() uint64

func (*EthTxContext) TxTo

func (c *EthTxContext) TxTo() string

func (*EthTxContext) VmStateDB

func (c *EthTxContext) VmStateDB() vm.StateDB

func (*EthTxContext) VmTracer

func (c *EthTxContext) VmTracer() *vm.Tracer

func (*EthTxContext) WithCommit

func (c *EthTxContext) WithCommit(commit bool) *EthTxContext

func (*EthTxContext) WithEVM

func (c *EthTxContext) WithEVM(
	from common.Address,
	msg *core.Message,
	lastEvm *vm.EVM,
	monitor *vm.Tracer,
	db vm.StateDB,
) *EthTxContext

func (*EthTxContext) WithEVMConfig

func (c *EthTxContext) WithEVMConfig(cfg *statedb.EVMConfig) *EthTxContext

func (*EthTxContext) WithReceipt

func (c *EthTxContext) WithReceipt(receipt *ethtypes.Receipt) *EthTxContext

func (*EthTxContext) WithStateDB

func (c *EthTxContext) WithStateDB(stateDB vm.StateDB) *EthTxContext

func (*EthTxContext) WithTxIndex

func (c *EthTxContext) WithTxIndex(index uint64) *EthTxContext

type GetLastBlockHeight

type GetLastBlockHeight func() int64

type HistoryStoreBuilder

type HistoryStoreBuilder func(height int64, keyPrefix string) (prefix.Store, error)

type Property

type Property struct {
	Key   string `json:"Key"`
	Value []byte `json:"Value"`
}

Jump to

Keyboard shortcuts

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