Documentation ¶
Index ¶
- Variables
- func NewEventService() event.Service
- func NewGasMeterService() gas.Service
- func NewKVStoreService(address []byte) store.KVStoreService
- func NewMemoryStoreService(address []byte) store.MemoryStoreService
- func NewMsgRouterService(msgRouterBuilder *MsgRouterBuilder) router.Service
- func NewQueryRouterService(queryRouterBuilder *MsgRouterBuilder) router.Service
- func TypedEventToEvent(tev gogoproto.Message) (event.Event, error)
- type BranchService
- type HeaderService
- type MsgRouterBuilder
- func (b *MsgRouterBuilder) Build() (appmodulev2.Handler, error)
- func (b *MsgRouterBuilder) HandlerExists(msgType string) bool
- func (b *MsgRouterBuilder) RegisterGlobalPostHandler(handler appmodulev2.PostMsgHandler)
- func (b *MsgRouterBuilder) RegisterGlobalPreHandler(handler appmodulev2.PreMsgHandler)
- func (b *MsgRouterBuilder) RegisterHandler(msgType string, handler appmodulev2.Handler) error
- func (b *MsgRouterBuilder) RegisterPostHandler(msgType string, handler appmodulev2.PostMsgHandler)
- func (b *MsgRouterBuilder) RegisterPreHandler(msgType string, handler appmodulev2.PreMsgHandler)
- type STF
- func (s STF[T]) DeliverBlock(ctx context.Context, block *appmanager.BlockRequest[T], state store.ReaderMap) (blockResult *appmanager.BlockResponse, newState store.WriterMap, err error)
- func (s STF[T]) Message(ctx context.Context, msg transaction.Msg) (response transaction.Msg, err error)
- func (s STF[T]) Query(ctx context.Context, state store.ReaderMap, gasLimit uint64, ...) (transaction.Msg, error)
- func (s STF[T]) RunWithCtx(ctx context.Context, state store.ReaderMap, ...) (store.WriterMap, error)
- func (s STF[T]) Simulate(ctx context.Context, state store.ReaderMap, gasLimit uint64, tx T) (appmanager.TxResult, store.WriterMap)
- func (s STF[T]) ValidateTx(ctx context.Context, state store.ReaderMap, gasLimit uint64, tx T) appmanager.TxResult
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func NewGasMeterService ¶
NewGasMeterService creates a new instance of the gas meter service.
func NewKVStoreService ¶
func NewKVStoreService(address []byte) store.KVStoreService
func NewMemoryStoreService ¶
func NewMemoryStoreService(address []byte) store.MemoryStoreService
func NewMsgRouterService ¶
func NewMsgRouterService(msgRouterBuilder *MsgRouterBuilder) router.Service
NewMsgRouterService implements router.Service.
func NewQueryRouterService ¶
func NewQueryRouterService(queryRouterBuilder *MsgRouterBuilder) router.Service
NewQueryRouterService implements router.Service.
Types ¶
type HeaderService ¶
type HeaderService struct{}
type MsgRouterBuilder ¶
type MsgRouterBuilder struct {
// contains filtered or unexported fields
}
func NewMsgRouterBuilder ¶
func NewMsgRouterBuilder() *MsgRouterBuilder
NewMsgRouterBuilder is a router that routes messages to their respective handlers.
func (*MsgRouterBuilder) Build ¶
func (b *MsgRouterBuilder) Build() (appmodulev2.Handler, error)
func (*MsgRouterBuilder) HandlerExists ¶
func (b *MsgRouterBuilder) HandlerExists(msgType string) bool
func (*MsgRouterBuilder) RegisterGlobalPostHandler ¶
func (b *MsgRouterBuilder) RegisterGlobalPostHandler(handler appmodulev2.PostMsgHandler)
func (*MsgRouterBuilder) RegisterGlobalPreHandler ¶
func (b *MsgRouterBuilder) RegisterGlobalPreHandler(handler appmodulev2.PreMsgHandler)
func (*MsgRouterBuilder) RegisterHandler ¶
func (b *MsgRouterBuilder) RegisterHandler(msgType string, handler appmodulev2.Handler) error
func (*MsgRouterBuilder) RegisterPostHandler ¶
func (b *MsgRouterBuilder) RegisterPostHandler(msgType string, handler appmodulev2.PostMsgHandler)
func (*MsgRouterBuilder) RegisterPreHandler ¶
func (b *MsgRouterBuilder) RegisterPreHandler(msgType string, handler appmodulev2.PreMsgHandler)
type STF ¶
type STF[T transaction.Tx] struct { // contains filtered or unexported fields }
STF is a struct that manages the state transition component of the app.
func NewSTF ¶
func NewSTF[T transaction.Tx]( handleMsg func(ctx context.Context, msg transaction.Msg) (transaction.Msg, error), handleQuery func(ctx context.Context, req transaction.Msg) (transaction.Msg, error), doPreBlock func(ctx context.Context, txs []T) error, doBeginBlock func(ctx context.Context) error, doEndBlock func(ctx context.Context) error, doTxValidation func(ctx context.Context, tx T) error, doValidatorUpdate func(ctx context.Context) ([]appmodulev2.ValidatorUpdate, error), postTxExec func(ctx context.Context, tx T, success bool) error, branch func(store store.ReaderMap) store.WriterMap, ) *STF[T]
NewSTF returns a new STF instance.
func (STF[T]) DeliverBlock ¶
func (s STF[T]) DeliverBlock( ctx context.Context, block *appmanager.BlockRequest[T], state store.ReaderMap, ) (blockResult *appmanager.BlockResponse, newState store.WriterMap, err error)
DeliverBlock is our state transition function. It takes a read only view of the state to apply the block to, executes the block and returns the block results and the new state.
func (STF[T]) Message ¶
func (s STF[T]) Message(ctx context.Context, msg transaction.Msg) (response transaction.Msg, err error)
func (STF[T]) Query ¶
func (s STF[T]) Query( ctx context.Context, state store.ReaderMap, gasLimit uint64, req transaction.Msg, ) (transaction.Msg, error)
Query executes the query on the provided state with the provided gas limits.
func (STF[T]) RunWithCtx ¶
func (s STF[T]) RunWithCtx( ctx context.Context, state store.ReaderMap, closure func(ctx context.Context) error, ) (store.WriterMap, error)
RunWithCtx is made to support genesis, if genesis was just the execution of messages instead of being something custom then we would not need this. PLEASE DO NOT USE. TODO: Remove