src

package
v0.5.1-0...-974247a Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2022 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

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

func Instantiate

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

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

MarshalJSON supports json.Marshaler interface

func (HandleMsg) MarshalTinyJSON

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

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*HandleMsg) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

func (*HandleMsg) UnmarshalTinyJSON

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

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

MarshalJSON supports json.Marshaler interface

func (InitMsg) MarshalTinyJSON

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

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*InitMsg) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

func (*InitMsg) UnmarshalTinyJSON

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

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type MigrateMsg

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

func (MigrateMsg) MarshalJSON

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

MarshalJSON supports json.Marshaler interface

func (MigrateMsg) MarshalTinyJSON

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

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*MigrateMsg) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

func (*MigrateMsg) UnmarshalTinyJSON

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

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

MarshalJSON supports json.Marshaler interface

func (OtherBalance) MarshalTinyJSON

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

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*OtherBalance) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

func (*OtherBalance) UnmarshalTinyJSON

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

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

MarshalJSON supports json.Marshaler interface

func (QueryMsg) MarshalTinyJSON

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

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*QueryMsg) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

func (*QueryMsg) UnmarshalTinyJSON

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

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

MarshalJSON supports json.Marshaler interface

func (Recurse) MarshalTinyJSON

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

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*Recurse) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

func (*Recurse) UnmarshalTinyJSON

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

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

MarshalJSON supports json.Marshaler interface

func (RecurseResponse) MarshalTinyJSON

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

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*RecurseResponse) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

func (*RecurseResponse) UnmarshalTinyJSON

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

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

MarshalJSON supports json.Marshaler interface

func (State) MarshalTinyJSON

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

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*State) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

func (*State) UnmarshalTinyJSON

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

UnmarshalTinyJSON supports tinyjson.Unmarshaler interface

type VerifierResponse

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

func (VerifierResponse) MarshalJSON

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

MarshalJSON supports json.Marshaler interface

func (VerifierResponse) MarshalTinyJSON

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

MarshalTinyJSON supports tinyjson.Marshaler interface

func (*VerifierResponse) UnmarshalJSON

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

UnmarshalJSON supports json.Unmarshaler interface

func (*VerifierResponse) UnmarshalTinyJSON

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