src

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StateKey = []byte("config")

Functions

func Handle

func Handle(deps *std.Deps, env std.Env, info std.MessageInfo, data []byte) (*std.HandleResultOk, error)

func Init

func Init(deps *std.Deps, env std.Env, info std.MessageInfo, msg []byte) (*std.InitResultOk, error)

func Migrate

func Migrate(deps *std.Deps, env std.Env, info std.MessageInfo, msg []byte) (*std.MigrateResultOk, error)

func Query

func Query(deps *std.Deps, env std.Env, data []byte) (*std.QueryResponse, error)

func SaveState

func SaveState(storage std.Storage, state *State) error

Types

type HandleMsg

type HandleMsg struct {
	Release              ezjson.EmptyStruct `json:"release,opt_seen,omitempty"`
	CpuLoop              ezjson.EmptyStruct `json:"cpu_loop,opt_seen,omitempty"`
	StorageLoop          ezjson.EmptyStruct `json:"storage_loop,opt_seen,omitempty"`
	MemoryLoop           ezjson.EmptyStruct `json:"memory_loop,opt_seen,omitempty"`
	AllocateLargeMemory  ezjson.EmptyStruct `json:"allocate_large_memory,opt_seen,omitempty"`
	Panic                ezjson.EmptyStruct `json:"panic,opt_seen,omitempty"`
	UserErrorsInApiCalls ezjson.EmptyStruct `json:"user_errors_in_api_calls,opt_seen,omitempty"`
}

type InitMsg

type InitMsg struct {
	Verifier    string `json:"verifier"`
	Beneficiary string `json:"beneficiary"`
}

type MigrateMsg

type MigrateMsg struct {
	Verifier string `json:"verifier"`
}

type OtherBalance

type OtherBalance struct {
	Address string `json:"address,omitempty"`
}

type QueryMsg

type QueryMsg struct {
	Verifier     ezjson.EmptyStruct `json:"verifier,opt_seen,omitempty"`
	OtherBalance OtherBalance       `json:"other_balance,omitempty"`
	Recurse      Recurse            `json:"recurse,omitempty"`
}

type Recurse

type Recurse struct {
	Depth uint32 `json:"depth,omitempty"`
	Work  uint32 `json:"work,omitempty"`
}

type RecurseResponse

type RecurseResponse struct {
	// this should be base64 binary - we just encode it manually outside of ezjson
	Hashed string `json:"hashed"`
}

type State

type State struct {
	// TODO: convert to canonical addresses when that is supported by ezjson
	Verifier    string `json:"VERIFIER"`
	Beneficiary string `json:"BENEFICIARY"`
	Funder      string `json:"FUNDER"`
}

this is what we store

func LoadState

func LoadState(storage std.Storage) (*State, error)

type VerifierResponse

type VerifierResponse struct {
	Verifier string `json:"verifier"`
}

Jump to

Keyboard shortcuts

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