Documentation ¶
Index ¶
- Constants
- func Execute(deps *std.Deps, env types.Env, info types.MessageInfo, data []byte) (*types.Response, error)
- func Instantiate(_ *std.Deps, _ types.Env, _ types.MessageInfo, _ []byte) (*types.Response, error)
- func Migrate(deps *std.Deps, _ types.Env, _ []byte) (*types.Response, error)
- func Query(deps *std.Deps, _ types.Env, msg []byte) ([]byte, error)
- type CountResponse
- type Dequeue
- type Enqueue
- type ExecuteMsg
- type InstantiateMsg
- type Item
- type ListResponse
- type QueryMsg
- type ReducerResponse
- type SumResponse
Constants ¶
const FirstKey byte = 0
FirstKey defines the value of the default key, when no key is set in the contract so far. NOTE: keys are [1]byte length but in KV they're [n]bytes.
Variables ¶
This section is empty.
Functions ¶
func Execute ¶
func Execute(deps *std.Deps, env types.Env, info types.MessageInfo, data []byte) (*types.Response, error)
Execute runs state modifying handlers of the contract given msg data.
func Instantiate ¶
Instantiate does nothing.
Types ¶
type CountResponse ¶
type CountResponse struct {
Count uint32 `json:"count"`
}
CountResponse is the total number of Item in the queue
func (CountResponse) MarshalJSON ¶
func (v CountResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (CountResponse) MarshalTinyJSON ¶
func (v CountResponse) MarshalTinyJSON(w *jwriter.Writer)
MarshalTinyJSON supports tinyjson.Marshaler interface
func (*CountResponse) UnmarshalJSON ¶
func (v *CountResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (*CountResponse) UnmarshalTinyJSON ¶
func (v *CountResponse) UnmarshalTinyJSON(l *jlexer.Lexer)
UnmarshalTinyJSON supports tinyjson.Unmarshaler interface
type Dequeue ¶
type Dequeue struct{}
Dequeue is the message used to remove an Item from the queue.
func (Dequeue) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (Dequeue) MarshalTinyJSON ¶
MarshalTinyJSON supports tinyjson.Marshaler interface
func (*Dequeue) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
func (*Dequeue) UnmarshalTinyJSON ¶
UnmarshalTinyJSON supports tinyjson.Unmarshaler interface
type Enqueue ¶
type Enqueue struct {
Value int32 `json:"value"`
}
Enqueue is the message used to add an Item to the queue.
func (Enqueue) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (Enqueue) MarshalTinyJSON ¶
MarshalTinyJSON supports tinyjson.Marshaler interface
func (*Enqueue) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
func (*Enqueue) UnmarshalTinyJSON ¶
UnmarshalTinyJSON supports tinyjson.Unmarshaler interface
type ExecuteMsg ¶
type ExecuteMsg struct { // Enqueue adds a value in the queue Enqueue *Enqueue `json:"enqueue"` // Dequeue removes a value from the queue Dequeue *Dequeue `json:"dequeue"` }
ExecuteMsg defines all the messages that modify state that can be sent to the contract.
func (ExecuteMsg) MarshalJSON ¶
func (v ExecuteMsg) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (ExecuteMsg) MarshalTinyJSON ¶
func (v ExecuteMsg) MarshalTinyJSON(w *jwriter.Writer)
MarshalTinyJSON supports tinyjson.Marshaler interface
func (*ExecuteMsg) UnmarshalJSON ¶
func (v *ExecuteMsg) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (*ExecuteMsg) UnmarshalTinyJSON ¶
func (v *ExecuteMsg) UnmarshalTinyJSON(l *jlexer.Lexer)
UnmarshalTinyJSON supports tinyjson.Unmarshaler interface
type InstantiateMsg ¶
type InstantiateMsg struct{}
InstantiateMsg is the instantiation messages.
func (InstantiateMsg) MarshalJSON ¶
func (v InstantiateMsg) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (InstantiateMsg) MarshalTinyJSON ¶
func (v InstantiateMsg) MarshalTinyJSON(w *jwriter.Writer)
MarshalTinyJSON supports tinyjson.Marshaler interface
func (*InstantiateMsg) UnmarshalJSON ¶
func (v *InstantiateMsg) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (*InstantiateMsg) UnmarshalTinyJSON ¶
func (v *InstantiateMsg) UnmarshalTinyJSON(l *jlexer.Lexer)
UnmarshalTinyJSON supports tinyjson.Unmarshaler interface
type Item ¶
type Item struct {
Value int32 `json:"value"`
}
Item defines the state object of the queue values.
func (Item) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (Item) MarshalTinyJSON ¶
MarshalTinyJSON supports tinyjson.Marshaler interface
func (*Item) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
func (*Item) UnmarshalTinyJSON ¶
UnmarshalTinyJSON supports tinyjson.Unmarshaler interface
type ListResponse ¶
type ListResponse struct { Empty []uint32 `json:"empty"` Early []uint32 `json:"early"` Late []uint32 `json:"late"` }
ListResponse is the response returned by the List query
func (ListResponse) MarshalJSON ¶
func (v ListResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (ListResponse) MarshalTinyJSON ¶
func (v ListResponse) MarshalTinyJSON(w *jwriter.Writer)
MarshalTinyJSON supports tinyjson.Marshaler interface
func (*ListResponse) UnmarshalJSON ¶
func (v *ListResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (*ListResponse) UnmarshalTinyJSON ¶
func (v *ListResponse) UnmarshalTinyJSON(l *jlexer.Lexer)
UnmarshalTinyJSON supports tinyjson.Unmarshaler interface
type QueryMsg ¶
type QueryMsg struct { // Count counts how many items in the queue; returns CountResponse Count *struct{} `json:"count"` // Sum the number of values in the queue; returns SumResponse Sum *struct{} `json:"sum"` // Reducer keeps open two iters at once; returns ReducerResponse Reducer *struct{} `json:"reducer"` // List does multiple list operations; returns ListResponse List *struct{} `json:"list"` }
QueryMsg defines all the set of the possible queries that can be sent to the contract.
func (QueryMsg) MarshalJSON ¶
MarshalJSON supports json.Marshaler interface
func (QueryMsg) MarshalTinyJSON ¶
MarshalTinyJSON supports tinyjson.Marshaler interface
func (*QueryMsg) UnmarshalJSON ¶
UnmarshalJSON supports json.Unmarshaler interface
func (*QueryMsg) UnmarshalTinyJSON ¶
UnmarshalTinyJSON supports tinyjson.Unmarshaler interface
type ReducerResponse ¶
type ReducerResponse struct {
Counters [][2]int32 `json:"counters"`
}
func (ReducerResponse) MarshalJSON ¶
func (v ReducerResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (ReducerResponse) MarshalTinyJSON ¶
func (v ReducerResponse) MarshalTinyJSON(w *jwriter.Writer)
MarshalTinyJSON supports tinyjson.Marshaler interface
func (*ReducerResponse) UnmarshalJSON ¶
func (v *ReducerResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (*ReducerResponse) UnmarshalTinyJSON ¶
func (v *ReducerResponse) UnmarshalTinyJSON(l *jlexer.Lexer)
UnmarshalTinyJSON supports tinyjson.Unmarshaler interface
type SumResponse ¶
type SumResponse struct {
Sum int32 `json:"sum"`
}
SumResponse is the total sum of Item in the queue values
func (SumResponse) MarshalJSON ¶
func (v SumResponse) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (SumResponse) MarshalTinyJSON ¶
func (v SumResponse) MarshalTinyJSON(w *jwriter.Writer)
MarshalTinyJSON supports tinyjson.Marshaler interface
func (*SumResponse) UnmarshalJSON ¶
func (v *SumResponse) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
func (*SumResponse) UnmarshalTinyJSON ¶
func (v *SumResponse) UnmarshalTinyJSON(l *jlexer.Lexer)
UnmarshalTinyJSON supports tinyjson.Unmarshaler interface