keeper

package
v0.2.0-dev.2 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyFilter added in v0.1.4

func ApplyFilter(filter []byte, reveals []RevealBody) ([]int, bool, error)

ApplyFilter processes filter of the type specified in the first byte of consensus filter. It returns an outlier list, which is a boolean list where true at index i means that the reveal at index i is an outlier, consensus boolean, and error.

func NewMsgServerImpl

func NewMsgServerImpl(keeper Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the MsgServer interface for the provided Keeper.

func NewQuerierImpl

func NewQuerierImpl(keeper Keeper) types.QueryServer

Types

type DataResult added in v0.1.4

type DataResult struct {
	Version        string `json:"version"`
	ID             string `json:"dr_id"`
	BlockHeight    uint64 `json:"block_height"`
	ExitCode       byte   `json:"exit_code"`
	GasUsed        string `json:"gas_used"`
	Result         []byte `json:"result"`
	PaybackAddress string `json:"payback_address"`
	SedaPayload    string `json:"seda_payload"`
	Consensus      bool   `json:"consensus"`
}

type EventStoreDataRequestWasmWrapper

type EventStoreDataRequestWasmWrapper struct {
	*types.EventStoreDataRequestWasm
}

func (EventStoreDataRequestWasmWrapper) MarshalJSON

func (e EventStoreDataRequestWasmWrapper) MarshalJSON() ([]byte, error)

MarshalJSON customizes the JSON encoding of the type that implements it

type EventStoreOverlayWasmWrapper

type EventStoreOverlayWasmWrapper struct {
	*types.EventStoreOverlayWasm
}

func (EventStoreOverlayWasmWrapper) MarshalJSON

func (e EventStoreOverlayWasmWrapper) MarshalJSON() ([]byte, error)

type Keeper

type Keeper struct {
	Schema                collections.Schema
	DataRequestWasm       collections.Map[[]byte, types.Wasm]
	OverlayWasm           collections.Map[[]byte, types.Wasm]
	WasmExpiration        collections.KeySet[collections.Pair[int64, []byte]]
	ProxyContractRegistry collections.Item[string]
	Params                collections.Item[types.Params]
	// contains filtered or unexported fields
}

func (Keeper) EndBlock added in v0.1.4

func (k Keeper) EndBlock(ctx sdk.Context) (err error)

func (Keeper) GetAllWasms

func (k Keeper) GetAllWasms(ctx sdk.Context) []types.Wasm

func (Keeper) GetAuthority added in v0.0.6

func (k Keeper) GetAuthority() string

GetAuthority returns the module's authority.

func (Keeper) GetExpiredWasmKeys added in v0.1.4

func (k Keeper) GetExpiredWasmKeys(ctx sdk.Context, expirationHeight int64) ([][]byte, error)

GetExpiredWasmKeys retrieves the keys of the data request wasms that will expire at the given block height.

func (Keeper) IterateAllDataRequestWasms

func (k Keeper) IterateAllDataRequestWasms(ctx sdk.Context, callback func(wasm types.Wasm) (stop bool)) error

IterateAllDataRequestWasms iterates over the all the stored Data Request Wasms and performs a given callback function.

func (Keeper) IterateAllOverlayWasms

func (k Keeper) IterateAllOverlayWasms(ctx sdk.Context, callback func(wasm types.Wasm) (stop bool)) error

IterateAllOverlayWasms iterates over the all the stored Overlay Wasms and performs a given callback function.

func (Keeper) ListDataRequestWasms

func (k Keeper) ListDataRequestWasms(ctx sdk.Context) []string

ListDataRequestWasms returns hashes and types of all Data Request Wasms in the store.

func (Keeper) ListOverlayWasms

func (k Keeper) ListOverlayWasms(ctx sdk.Context) []string

ListOverlayWasms returns hashes and types of all Overlay Wasms in the store.

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

func (Keeper) ProcessExpiredWasms added in v0.1.4

func (k Keeper) ProcessExpiredWasms(ctx sdk.Context) error

func (Keeper) ProcessTallies

func (k Keeper) ProcessTallies(ctx sdk.Context) error

ProcessTallies fetches from the proxy contract the list of requests to be tallied and then goes through it to filter and tally.

type Request added in v0.1.4

type Request struct {
	DrBinaryID        string                `json:"dr_binary_id"`
	DrInputs          string                `json:"dr_inputs"`
	GasLimit          string                `json:"gas_limit"`
	GasPrice          string                `json:"gas_price"`
	Height            uint64                `json:"height"`
	ID                string                `json:"id"`
	Memo              string                `json:"memo"`
	PaybackAddress    string                `json:"payback_address"`
	ReplicationFactor int64                 `json:"replication_factor"`
	ConsensusFilter   string                `json:"consensus_filter"`
	Reveals           map[string]RevealBody `json:"reveals"`
	SedaPayload       string                `json:"seda_payload"`
	TallyBinaryID     string                `json:"tally_binary_id"`
	TallyInputs       string                `json:"tally_inputs"`
	Version           string                `json:"version"`
}

type RevealBody added in v0.1.4

type RevealBody struct {
	Salt     []byte `json:"salt"`
	ExitCode byte   `json:"exit_code"`
	GasUsed  string `json:"gas_used"`
	Reveal   string `json:"reveal"` // base64-encoded string
}

func (*RevealBody) MarshalJSON added in v0.1.4

func (u *RevealBody) MarshalJSON() ([]byte, error)

type Sudo added in v0.1.4

type Sudo struct {
	ID       string     `json:"dr_id"`
	Result   DataResult `json:"result"`
	ExitCode byte       `json:"exit_code"`
}

type VMResult added in v0.1.4

type VMResult struct {
	Salt        []byte `json:"salt"`
	ExitCode    byte   `json:"exit_code"`
	GasUsed     string `json:"gas_used"`
	Reveal      []byte `json:"reveal"`
	InConsensus byte   `json:"inConsensus"`
}

Directories

Path Synopsis
Package testutil is a generated GoMock package.
Package testutil is a generated GoMock package.

Jump to

Keyboard shortcuts

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