feat: add changes from server modular to main (#20583)

This commit is contained in:
Marko
2024-06-06 13:00:01 +00:00
committed by GitHub
parent 031b0c94ed
commit 514830e56a
11 changed files with 60 additions and 29 deletions
+11
View File
@@ -0,0 +1,11 @@
package context
import (
"testing"
"github.com/stretchr/testify/require"
)
func Test_Sanity(t *testing.T) {
require.NotEqual(t, CometInfoKey, ExecModeKey)
}
+13 -7
View File
@@ -2,12 +2,18 @@ package context
type contextKey uint8
const (
ExecModeKey contextKey = iota
CometInfoKey contextKey = iota
type (
execModeKey struct{}
cometInfoKey struct{}
environmentKey struct{}
)
// EnvironmentContextKey is the context key for the environment.
// A caller should not assume the environment is available in each context.
// ref: https://github.com/cosmos/cosmos-sdk/issues/19640
var EnvironmentContextKey = struct{}{}
var (
ExecModeKey = execModeKey{}
CometInfoKey = cometInfoKey{}
// EnvironmentContextKey is the context key for the environment.
// A caller should not assume the environment is available in each context.
// ref: https://github.com/cosmos/cosmos-sdk/issues/19640
EnvironmentContextKey = environmentKey{}
)
+2 -2
View File
@@ -133,7 +133,7 @@ var _ KVStore = (Writer)(nil)
// ReaderMap represents a readonly view over all the accounts state.
type ReaderMap interface {
// ReaderMap must return the state for the provided actor.
// GetReader must return the state for the provided actor.
// Storage implements might treat this as a prefix store over an actor.
// Prefix safety is on the implementer.
GetReader(actor []byte) (Reader, error)
@@ -142,7 +142,7 @@ type ReaderMap interface {
// WriterMap represents a writable actor state.
type WriterMap interface {
ReaderMap
// WriterMap must the return a WritableState
// GetWriter must the return a WritableState
// for the provided actor namespace.
GetWriter(actor []byte) (Writer, error)
// ApplyStateChanges applies all the state changes