keeper

package
v0.0.0-...-f0abe85 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeginBlocker

func BeginBlocker(ctx sdk.Context, k Keeper) error

func HashCairoPayload

func HashCairoPayload(cairoPayload []string) (*big.Int, error)

HashCairoPayload hashes cairo payload

func MaybeSettleTx

func MaybeSettleTx(k Keeper, ctx sdk.Context, txHash []byte) error

MaybeSettleTx attemps to settle whole transactions. Public for testing.

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) zktx.MsgServer

NewMsgServerImpl returns an implementation of the module MsgServer interface.

func NewQueryServerImpl

func NewQueryServerImpl(k Keeper) zktx.QueryServer

NewQueryServerImpl returns an implementation of the module QueryServer.

func ParseCairoPayload

func ParseCairoPayload(payload []byte) []string

ParseCairoPayload parses cairo payload

Types

type Keeper

type Keeper struct {

	// state management
	Schema    collections.Schema
	Params    collections.Item[zktx.Params]
	Contracts collections.Map[string, zktx.Contract]

	// Proof stuff
	ProvenPayload collections.Map[collections.Pair[[]byte, uint32], zktx.PayloadMetadata]
	Timeout       collections.Map[int64, zktx.TxTimeout]

	// Optimisation for Cosmos
	SettledTx collections.Map[[]byte, bool] // if present, TX is fully settled, then true/false for accepted/rejected
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, addressCodec address.Codec, storeService storetypes.KVStoreService, authority string) Keeper

NewKeeper creates a new Keeper instance

func (*Keeper) ExportGenesis

func (k *Keeper) ExportGenesis(ctx context.Context) (*zktx.GenesisState, error)

ExportGenesis exports the module state to a genesis state.

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the module's authority.

func (*Keeper) InitGenesis

func (k *Keeper) InitGenesis(ctx context.Context, data *zktx.GenesisState) error

InitGenesis initializes the module state from a genesis state.

type Migrator

type Migrator struct {
	// contains filtered or unexported fields
}

Migrator is a struct for handling in-place state migrations.

func NewMigrator

func NewMigrator(k Keeper) Migrator

NewMigrator returns Migrator instance for the state migration.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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