state

package
v0.0.0-...-dcea795 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 9, 2026 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DesignStateValueHint   = hint.MustNewHint("mitum-contract-design-state-value-v0.0.1")
	ContractStateKeyPrefix = "contract"
	DesignStateKeySuffix   = "design"
)
View Source
var (
	RuntimeStateValueHint = hint.MustNewHint("mitum-contract-runtime-state-value-v0.0.1")
	RuntimeStateKeySuffix = "runtime"

	SnapshotStateValueHint = hint.MustNewHint("mitum-contract-snapshot-state-value-v0.0.1")
	SnapshotStateKeySuffix = "snapshot"
)

Functions

func ContractStateKey

func ContractStateKey(addr base.Address) string

func DesignStateKey

func DesignStateKey(addr base.Address) string

func GetDesignFromState

func GetDesignFromState(st base.State) (types.Design, error)

func IsDesignStateKey

func IsDesignStateKey(key string) bool

func IsRuntimeStateKey

func IsRuntimeStateKey(key string) bool

func IsSnapshotStateKey

func IsSnapshotStateKey(key string) bool

func RuntimeStateKey

func RuntimeStateKey(addr base.Address) string

func SnapshotStateKey

func SnapshotStateKey(addr base.Address) string

Types

type DesignStateValue

type DesignStateValue struct {
	hint.BaseHinter
	Design types.Design
	Schema *types.PersistedContractSchema
}

func GetDesignStateValueFromState

func GetDesignStateValueFromState(st base.State) (DesignStateValue, error)

func NewDesignStateValue

func NewDesignStateValue(design types.Design) DesignStateValue

func NewDesignStateValueWithSchema

func NewDesignStateValueWithSchema(
	design types.Design,
	schema *types.PersistedContractSchema,
) DesignStateValue

func (*DesignStateValue) DecodeBSON

func (sv *DesignStateValue) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*DesignStateValue) DecodeJSON

func (sv *DesignStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error

func (DesignStateValue) HashBytes

func (sv DesignStateValue) HashBytes() []byte

func (DesignStateValue) Hint

func (sv DesignStateValue) Hint() hint.Hint

func (DesignStateValue) IsValid

func (sv DesignStateValue) IsValid([]byte) error

func (DesignStateValue) MarshalBSON

func (sv DesignStateValue) MarshalBSON() ([]byte, error)

func (DesignStateValue) MarshalJSON

func (sv DesignStateValue) MarshalJSON() ([]byte, error)

type DesignStateValueBSONUnmarshaler

type DesignStateValueBSONUnmarshaler struct {
	Hint   string                         `bson:"_hint"`
	Design bson.Raw                       `bson:"design"`
	Schema *types.PersistedContractSchema `bson:"schema"`
}

type DesignStateValueJSONMarshaler

type DesignStateValueJSONMarshaler struct {
	hint.BaseHinter
	Design types.Design                   `json:"design"`
	Schema *types.PersistedContractSchema `json:"schema,omitempty"`
}

type DesignStateValueJSONUnmarshaler

type DesignStateValueJSONUnmarshaler struct {
	Hint   hint.Hint                      `json:"_hint"`
	Design json.RawMessage                `json:"design"`
	Schema *types.PersistedContractSchema `json:"schema"`
}

type RuntimeEngine

type RuntimeEngine string
const (
	RuntimeEngineGnoSnapshot RuntimeEngine = "gno-snapshot-v1"
)

type RuntimeStateValue

type RuntimeStateValue struct {
	hint.BaseHinter
	Engine          RuntimeEngine
	ABIVersion      string
	PackageName     string
	PackagePath     string
	SnapshotVersion uint64
}

func GetRuntimeFromState

func GetRuntimeFromState(st base.State) (RuntimeStateValue, error)

func NewRuntimeStateValue

func NewRuntimeStateValue(
	engine RuntimeEngine,
	abiVersion string,
	packageName string,
	packagePath string,
	snapshotVersion uint64,
) RuntimeStateValue

func (*RuntimeStateValue) DecodeBSON

func (sv *RuntimeStateValue) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*RuntimeStateValue) DecodeJSON

func (sv *RuntimeStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error

func (RuntimeStateValue) HashBytes

func (sv RuntimeStateValue) HashBytes() []byte

func (RuntimeStateValue) Hint

func (sv RuntimeStateValue) Hint() hint.Hint

func (RuntimeStateValue) IsValid

func (sv RuntimeStateValue) IsValid([]byte) error

func (RuntimeStateValue) MarshalBSON

func (sv RuntimeStateValue) MarshalBSON() ([]byte, error)

func (RuntimeStateValue) MarshalJSON

func (sv RuntimeStateValue) MarshalJSON() ([]byte, error)

type RuntimeStateValueBSONUnmarshaler

type RuntimeStateValueBSONUnmarshaler struct {
	Hint            string        `bson:"_hint"`
	Engine          RuntimeEngine `bson:"engine"`
	ABIVersion      string        `bson:"abi_version"`
	PackageName     string        `bson:"package_name"`
	PackagePath     string        `bson:"package_path"`
	SnapshotVersion uint64        `bson:"snapshot_version"`
}

type RuntimeStateValueJSONMarshaler

type RuntimeStateValueJSONMarshaler struct {
	hint.BaseHinter
	Engine          RuntimeEngine `json:"engine"`
	ABIVersion      string        `json:"abi_version"`
	PackageName     string        `json:"package_name"`
	PackagePath     string        `json:"package_path"`
	SnapshotVersion uint64        `json:"snapshot_version"`
}

type RuntimeStateValueJSONUnmarshaler

type RuntimeStateValueJSONUnmarshaler struct {
	Hint            hint.Hint     `json:"_hint"`
	Engine          RuntimeEngine `json:"engine"`
	ABIVersion      string        `json:"abi_version"`
	PackageName     string        `json:"package_name"`
	PackagePath     string        `json:"package_path"`
	SnapshotVersion uint64        `json:"snapshot_version"`
}

type SnapshotStateValue

type SnapshotStateValue struct {
	hint.BaseHinter
	Version  uint64
	Codec    string
	Snapshot []byte
}

func GetSnapshotFromState

func GetSnapshotFromState(st base.State) (SnapshotStateValue, error)

func NewSnapshotStateValue

func NewSnapshotStateValue(version uint64, codec string, snapshot []byte) SnapshotStateValue

func (*SnapshotStateValue) DecodeBSON

func (sv *SnapshotStateValue) DecodeBSON(b []byte, enc *bsonenc.Encoder) error

func (*SnapshotStateValue) DecodeJSON

func (sv *SnapshotStateValue) DecodeJSON(b []byte, enc encoder.Encoder) error

func (SnapshotStateValue) HashBytes

func (sv SnapshotStateValue) HashBytes() []byte

func (SnapshotStateValue) Hint

func (sv SnapshotStateValue) Hint() hint.Hint

func (SnapshotStateValue) IsValid

func (sv SnapshotStateValue) IsValid([]byte) error

func (SnapshotStateValue) MarshalBSON

func (sv SnapshotStateValue) MarshalBSON() ([]byte, error)

func (SnapshotStateValue) MarshalJSON

func (sv SnapshotStateValue) MarshalJSON() ([]byte, error)

type SnapshotStateValueBSONUnmarshaler

type SnapshotStateValueBSONUnmarshaler struct {
	Hint     string `bson:"_hint"`
	Version  uint64 `bson:"version"`
	Codec    string `bson:"codec"`
	Snapshot []byte `bson:"snapshot"`
}

type SnapshotStateValueJSONMarshaler

type SnapshotStateValueJSONMarshaler struct {
	hint.BaseHinter
	Version  uint64 `json:"version"`
	Codec    string `json:"codec"`
	Snapshot []byte `json:"snapshot"`
}

type SnapshotStateValueJSONUnmarshaler

type SnapshotStateValueJSONUnmarshaler struct {
	Hint     hint.Hint `json:"_hint"`
	Version  uint64    `json:"version"`
	Codec    string    `json:"codec"`
	Snapshot []byte    `json:"snapshot"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL