forked from cosmos/cosmos-sdk
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core,runtime): transaction service (exec mode) (cosmos#19953)
- Loading branch information
1 parent
ab45a85
commit 6049684
Showing
8 changed files
with
92 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package runtime | ||
|
||
import ( | ||
"context" | ||
|
||
"cosmossdk.io/core/transaction" | ||
|
||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
) | ||
|
||
var _ transaction.Service = TransactionService{} | ||
|
||
type TransactionService struct{} | ||
|
||
// ExecMode implements transaction.Service. | ||
func (t TransactionService) ExecMode(ctx context.Context) transaction.ExecMode { | ||
sdkCtx := sdk.UnwrapSDKContext(ctx) | ||
return transaction.ExecMode(sdkCtx.ExecMode()) | ||
} |