feat(core,runtime): transaction service (exec mode) (#19953)
This commit is contained in:
@@ -38,6 +38,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
|
||||
|
||||
### Features
|
||||
|
||||
* [#19953](https://github.com/cosmos/cosmos-sdk/pull/19953) Add transaction service.
|
||||
* [#18379](https://github.com/cosmos/cosmos-sdk/pull/18379) Add branch service.
|
||||
* [#18457](https://github.com/cosmos/cosmos-sdk/pull/18457) Add branch.ExecuteWithGasLimit.
|
||||
* [#19041](https://github.com/cosmos/cosmos-sdk/pull/19041) Add `appmodule.Environment` interface to fetch different services
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"cosmossdk.io/core/header"
|
||||
"cosmossdk.io/core/router"
|
||||
"cosmossdk.io/core/store"
|
||||
"cosmossdk.io/core/transaction"
|
||||
"cosmossdk.io/log"
|
||||
)
|
||||
|
||||
@@ -14,11 +15,12 @@ import (
|
||||
type Environment struct {
|
||||
Logger log.Logger
|
||||
|
||||
BranchService branch.Service
|
||||
EventService event.Service
|
||||
GasService gas.Service
|
||||
HeaderService header.Service
|
||||
RouterService router.Service
|
||||
BranchService branch.Service
|
||||
EventService event.Service
|
||||
GasService gas.Service
|
||||
HeaderService header.Service
|
||||
RouterService router.Service
|
||||
TransactionService transaction.Service
|
||||
|
||||
KVStoreService store.KVStoreService
|
||||
MemStoreService store.MemoryStoreService
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package transaction
|
||||
|
||||
import "context"
|
||||
|
||||
// ExecMode defines the execution mode
|
||||
type ExecMode uint8
|
||||
|
||||
// All possible execution modes.
|
||||
// For backwards compatibility and easier casting, the exec mode values must be the same as in cosmos/cosmos-sdk/types package.
|
||||
const (
|
||||
ExecModeCheck ExecMode = iota
|
||||
_
|
||||
ExecModeSimulate
|
||||
_
|
||||
_
|
||||
_
|
||||
_
|
||||
ExecModeFinalize
|
||||
)
|
||||
|
||||
// Service creates a transaction service.
|
||||
type Service interface {
|
||||
ExecMode(ctx context.Context) ExecMode
|
||||
}
|
||||
Reference in New Issue
Block a user