src

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func Execute added in v0.2.0

func Execute(deps *std.Deps, env types.Env, info types.MessageInfo, data []byte) (*types.Response, error)

func Instantiate added in v0.2.0

func Instantiate(deps *std.Deps, env types.Env, info types.MessageInfo, msg []byte) (*types.Response, error)

func Migrate

func Migrate(deps *std.Deps, env types.Env, msg []byte) (*types.Response, error)

func Query

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

func SaveState

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

Types

type HandleMsg

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

func (HandleMsg) MarshalJSON added in v0.2.0

func (v HandleMsg) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (HandleMsg) MarshalTinyJSON added in v0.2.0

func (v HandleMsg) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*HandleMsg) UnmarshalJSON added in v0.2.0

func (v *HandleMsg) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*HandleMsg) UnmarshalTinyJSON added in v0.2.0

func (v *HandleMsg) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type InitMsg

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

func (InitMsg) MarshalJSON added in v0.2.0

func (v InitMsg) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (InitMsg) MarshalTinyJSON added in v0.2.0

func (v InitMsg) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*InitMsg) UnmarshalJSON added in v0.2.0

func (v *InitMsg) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*InitMsg) UnmarshalTinyJSON added in v0.2.0

func (v *InitMsg) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type MigrateMsg

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

func (MigrateMsg) MarshalJSON added in v0.2.0

func (v MigrateMsg) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (MigrateMsg) MarshalTinyJSON added in v0.2.0

func (v MigrateMsg) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*MigrateMsg) UnmarshalJSON added in v0.2.0

func (v *MigrateMsg) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*MigrateMsg) UnmarshalTinyJSON added in v0.2.0

func (v *MigrateMsg) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type OtherBalance

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

func (OtherBalance) MarshalJSON added in v0.2.0

func (v OtherBalance) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (OtherBalance) MarshalTinyJSON added in v0.2.0

func (v OtherBalance) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*OtherBalance) UnmarshalJSON added in v0.2.0

func (v *OtherBalance) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*OtherBalance) UnmarshalTinyJSON added in v0.2.0

func (v *OtherBalance) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type QueryMsg

type QueryMsg struct {
	Verifier     *struct{}     `json:"verifier,omitempty"`
	OtherBalance *OtherBalance `json:"other_balance,omitempty"`
	Recurse      *Recurse      `json:"recurse,omitempty"`
	// TODO: remove this when we have queue... this was for a quick and dirty test
	TestRange *struct{} `json:"test_range,omitempty"`
}

func (QueryMsg) MarshalJSON added in v0.2.0

func (v QueryMsg) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (QueryMsg) MarshalTinyJSON added in v0.2.0

func (v QueryMsg) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*QueryMsg) UnmarshalJSON added in v0.2.0

func (v *QueryMsg) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*QueryMsg) UnmarshalTinyJSON added in v0.2.0

func (v *QueryMsg) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type Recurse

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

func (Recurse) MarshalJSON added in v0.2.0

func (v Recurse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (Recurse) MarshalTinyJSON added in v0.2.0

func (v Recurse) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*Recurse) UnmarshalJSON added in v0.2.0

func (v *Recurse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*Recurse) UnmarshalTinyJSON added in v0.2.0

func (v *Recurse) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type RecurseResponse

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

func (RecurseResponse) MarshalJSON added in v0.2.0

func (v RecurseResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (RecurseResponse) MarshalTinyJSON added in v0.2.0

func (v RecurseResponse) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*RecurseResponse) UnmarshalJSON added in v0.2.0

func (v *RecurseResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*RecurseResponse) UnmarshalTinyJSON added in v0.2.0

func (v *RecurseResponse) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

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)

func (State) MarshalJSON added in v0.2.0

func (v State) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (State) MarshalTinyJSON added in v0.2.0

func (v State) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*State) UnmarshalJSON added in v0.2.0

func (v *State) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*State) UnmarshalTinyJSON added in v0.2.0

func (v *State) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type VerifierResponse

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

func (VerifierResponse) MarshalJSON added in v0.2.0

func (v VerifierResponse) MarshalJSON() ([]byte, error)

MarshalJSON supports json.Marshaler interface

func (VerifierResponse) MarshalTinyJSON added in v0.2.0

func (v VerifierResponse) MarshalTinyJSON(w *jwriter.Writer)

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*VerifierResponse) UnmarshalJSON added in v0.2.0

func (v *VerifierResponse) UnmarshalJSON(data []byte) error

UnmarshalJSON supports json.Unmarshaler interface

func (*VerifierResponse) UnmarshalTinyJSON added in v0.2.0

func (v *VerifierResponse) UnmarshalTinyJSON(l *jlexer.Lexer)

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

Jump to

Keyboard shortcuts

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