feat(core,runtime): transaction service (exec mode) (#19953)

This commit is contained in:
Julien Robert
2024-04-05 11:06:04 +00:00
committed by GitHub
parent ab45a85307
commit 60496848d9
8 changed files with 92 additions and 47 deletions
+1
View File
@@ -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 -5
View File
@@ -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
+24
View File
@@ -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
}