types

package
v0.5.0-dev.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: GPL-3.0 Imports: 42 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	EventTypeTallyCompletion = "tally_completion"
	EventTypeGasMeter        = "gas_calculation"

	AttributeDataRequestID     = "dr_id"
	AttributeDataRequestHeight = "dr_height"
	AttributeDataResultID      = "id"
	AttributeTypeConsensus     = "consensus"
	AttributeTallyVMStdOut     = "tally_vm_stdout"
	AttributeTallyVMStdErr     = "tally_vm_stderr"
	AttributeExecGasUsed       = "exec_gas_used"
	AttributeTallyGasUsed      = "tally_gas_used"
	AttributeTallyExitCode     = "exit_code"
	AttributeProxyPubKeys      = "proxy_public_keys"
	AttributeTallyGas          = "tally_gas"
	AttributeDataProxyGas      = "data_proxy_gas"
	AttributeExecutorGas       = "executor_reward_gas"
	AttributeReducedPayout     = "reduced_payout"
	AttributeReducedPayoutBurn = "reduced_payout_burn"
)
View Source
const (
	ModuleName = "tally"
	StoreKey   = ModuleName
)
View Source
const (
	DefaultMaxTallyGasLimit              = 150_000_000_000_000
	DefaultFilterGasCostNone             = 100_000
	DefaultFilterGasCostMultiplierMode   = 100_000
	DefaultFilterGasCostMultiplierStddev = 100_000
	DefaultGasCostBase                   = 1_000_000_000_000
	DefaultExecutionGasCostFallback      = 5_000_000_000_000
)

Variables

View Source
var (
	// Errors used in filter:
	ErrInvalidFilterType   = errors.Register("tally", 2, "invalid filter type")
	ErrFilterInputTooShort = errors.Register("tally", 3, "filter input length too short")
	ErrInvalidPathLen      = errors.Register("tally", 4, "invalid JSON path length")
	ErrInvalidNumberType   = errors.Register("tally", 5, "invalid number type specified")
	ErrInvalidFilterInput  = errors.Register("tally", 6, "invalid filter input")
	ErrOutofTallyGas       = errors.Register("tally", 7, "out of tally gas")
	ErrConsensusInError    = errors.Register("tally", 8, "consensus in error")
	ErrNoConsensus         = errors.Register("tally", 9, "> 1/3 of reveals do not agree on reveal data")
	ErrNoBasicConsensus    = errors.Register("tally", 10, "> 1/3 of reveals do not agree on (exit_code_success, proxy_pub_keys)")
	// Errors used in tally program execution:
	ErrDecodingPaybackAddress  = errors.Register("tally", 11, "failed to decode payback address")
	ErrFindingTallyProgram     = errors.Register("tally", 12, "failed to find tally program")
	ErrDecodingTallyInputs     = errors.Register("tally", 13, "failed to decode tally inputs")
	ErrConstructingTallyVMArgs = errors.Register("tally", 14, "failed to construct tally VM arguments")
	ErrGettingMaxTallyGasLimit = errors.Register("tally", 15, "failed to get max tally gas limit")
)
View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTally        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTally          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTally = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)
View Source
var DefaultBurnRatio = math.LegacyNewDecWithPrec(2, 1)
View Source
var Msg_serviceDesc = _Msg_serviceDesc
View Source
var ParamsPrefix = collections.NewPrefix(0)
View Source
var Query_serviceDesc = _Query_serviceDesc

Functions

func MarshalSudoRemoveDataRequests

func MarshalSudoRemoveDataRequests(processedReqs map[string][]Distribution) ([]byte, error)

func RegisterCodec

func RegisterCodec(_ *codec.LegacyAmino)

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryHandler

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterQueryHandlerClient

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.

func RegisterQueryHandlerFromEndpoint

func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterQueryHandlerServer

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

func ValidateGenesis

func ValidateGenesis(state GenesisState) error

ValidateGenesis validates batching genesis data.

Types

type BatchingKeeper

type BatchingKeeper interface {
	SetDataResultForBatching(ctx context.Context, result batchingtypes.DataResult) error
}

type DataProxyKeeper

type DataProxyKeeper interface {
	GetDataProxyConfig(ctx context.Context, pubKey []byte) (result dataproxytypes.ProxyConfig, err error)
}

type Distribution

type Distribution struct {
	Burn            *DistributionBurn            `json:"burn,omitempty"`
	ExecutorReward  *DistributionExecutorReward  `json:"executor_reward,omitempty"`
	DataProxyReward *DistributionDataProxyReward `json:"data_proxy_reward,omitempty"`
}

func NewBurn

func NewBurn(amount, gasPrice math.Int) Distribution

func NewDataProxyReward

func NewDataProxyReward(pubKey []byte, amount, gasPrice math.Int) Distribution

func NewExecutorReward

func NewExecutorReward(identity string, amount, gasPrice math.Int) Distribution

type DistributionBurn

type DistributionBurn struct {
	Amount math.Int `json:"amount"`
}

type DistributionDataProxyReward

type DistributionDataProxyReward struct {
	To     []byte   `json:"to"`
	Amount math.Int `json:"amount"`
}

type DistributionExecutorReward

type DistributionExecutorReward struct {
	Amount   math.Int `json:"amount"`
	Identity string   `json:"identity"`
}

type ExecutorGasUsed

type ExecutorGasUsed struct {
	PublicKey string
	Amount    math.Int
}

type Filter

type Filter interface {
	// ApplyFilter takes in a list of reveals and returns an outlier
	// list, whose value at index i indicates whether i-th reveal is
	// an outlier, and a boolean indicating whether consensus in reveal
	// data has been reached.
	ApplyFilter(reveals []RevealBody, errors []bool) ([]bool, bool)
}

type FilterMode

type FilterMode struct {
	// contains filtered or unexported fields
}

func NewFilterMode

func NewFilterMode(input []byte, gasCostMultiplier uint64, replicationFactor uint16, gasMeter *GasMeter) (FilterMode, error)

NewFilterMode constructs a new FilerMode object given a filter input. Mode filter input looks as follows: 0 1 9 9+data_path_length | filter_type | data_path_length | data_path |

func (FilterMode) ApplyFilter

func (f FilterMode) ApplyFilter(reveals []RevealBody, errors []bool) ([]bool, bool)

ApplyFilter applies the Mode Filter and returns an outlier list. A reveal is declared an outlier if it does not match the mode value. If less than 2/3 of the reveals are non-outliers, "no consensus" error is returned along with an outlier list.

type FilterNone

type FilterNone struct{}

func NewFilterNone

func NewFilterNone(gasCost uint64, gasMeter *GasMeter) (FilterNone, error)

NewFilterNone constructs a new FilterNone object.

func (FilterNone) ApplyFilter

func (f FilterNone) ApplyFilter(reveals []RevealBody, _ []bool) ([]bool, bool)

FilterNone declares all reveals as non-outliers.

type FilterStdDev

type FilterStdDev struct {
	// contains filtered or unexported fields
}

func NewFilterStdDev

func NewFilterStdDev(input []byte, gasCostMultiplier uint64, replicationFactor uint16, gasMeter *GasMeter) (FilterStdDev, error)

NewFilterStdDev constructs a new FilterStdDev object given a filter input. Standard deviation filter input looks as follows: 0 1 9 10 18 18+json_path_length | filter_type | max_sigma | number_type | json_path_length | json_path |

func (FilterStdDev) ApplyFilter

func (f FilterStdDev) ApplyFilter(reveals []RevealBody, errors []bool) ([]bool, bool)

ApplyFilter applies the Standard Deviation Filter and returns an outlier list. (i) If more than 1/3 of reveals are corrupted (i.e. invalid json path, invalid bytes, etc.), a corrupt reveals error is returned without an outlier list. (ii) If the number type is invalid, an error is returned without an outlier list. (iii) Otherwise, an outlier list is returned. A reveal is declared an outlier if it deviates from the median by more than the given max sigma. If less than 2/3 of the reveals are non-outliers, "no consensus" error is returned as well.

type GasMeter

type GasMeter struct {
	Proxies       []ProxyGasUsed
	Executors     []ExecutorGasUsed
	ReducedPayout bool
	// contains filtered or unexported fields
}

GasMeter stores the results of the canonical gas consumption calculations.

func NewGasMeter

func NewGasMeter(tallyGasLimit, execGasLimit, maxTallyGasLimit uint64, gasPrice math.Int, baseGasCost uint64) *GasMeter

NewGasMeter creates a new gas meter and incurs the base gas cost.

func (*GasMeter) ConsumeExecGasForExecutor

func (g *GasMeter) ConsumeExecGasForExecutor(executorPubKey string, amount uint64) bool

ConsumeExecGasForExecutor consumes execution gas for executor payout and records the payout information. It returns true if the execution gas runs out during the process.

func (*GasMeter) ConsumeExecGasForProxy

func (g *GasMeter) ConsumeExecGasForProxy(proxyPubKey []byte, gasUsedPerExec uint64, replicationFactor uint16) bool

ConsumeExecGasForProxy consumes execution gas for data proxy payout and records the payout information. It returns true if the execution gas runs out during the process.

func (*GasMeter) ConsumeTallyGas

func (g *GasMeter) ConsumeTallyGas(amount uint64) bool

ConsumeTallyGas consumes tally gas as much as possible, returning true if the tally gas limit is not sufficient to cover the amount.

func (GasMeter) CorrectExecGasReportWithProxyGas

func (g GasMeter) CorrectExecGasReportWithProxyGas(gasReport uint64) uint64

func (GasMeter) ExecutionGasUsed

func (g GasMeter) ExecutionGasUsed() uint64

func (GasMeter) GasPrice

func (g GasMeter) GasPrice() math.Int

func (GasMeter) RemainingExecGas

func (g GasMeter) RemainingExecGas() uint64

func (GasMeter) RemainingTallyGas

func (g GasMeter) RemainingTallyGas() uint64

func (*GasMeter) SetReducedPayoutMode

func (g *GasMeter) SetReducedPayoutMode()

func (GasMeter) TallyGasUsed

func (g GasMeter) TallyGasUsed() uint64

func (GasMeter) TotalGasUsed

func (g GasMeter) TotalGasUsed() *math.Int

type GenesisState

type GenesisState struct {
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}

GenesisState defines tally module's genesis state.

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

DefaultGenesisState creates a default GenesisState object.

func (*GenesisState) Descriptor

func (*GenesisState) Descriptor() ([]byte, []int)

func (*GenesisState) GetParams

func (m *GenesisState) GetParams() Params

func (*GenesisState) Marshal

func (m *GenesisState) Marshal() (dAtA []byte, err error)

func (*GenesisState) MarshalTo

func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)

func (*GenesisState) MarshalToSizedBuffer

func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) Size

func (m *GenesisState) Size() (n int)

func (*GenesisState) String

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal

func (m *GenesisState) Unmarshal(dAtA []byte) error

func (*GenesisState) XXX_DiscardUnknown

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal

func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*GenesisState) XXX_Merge

func (m *GenesisState) XXX_Merge(src proto.Message)

func (*GenesisState) XXX_Size

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal

func (m *GenesisState) XXX_Unmarshal(b []byte) error

type HalfStepInt

type HalfStepInt[T constraints.Integer] struct {
	// contains filtered or unexported fields
}

HalfStepInt is an integer type with half-step increments (0.5).

func (HalfStepInt[T]) IsWithinSigma

func (h HalfStepInt[T]) IsWithinSigma(x T, maxSigma Sigma) bool

IsWithinSigma returns true if and only if the integer x is within the maxSigma range from the halfStepInt h. That is, IsWithinSigma returns true if and only if the absolute difference between x and h is less than or equal to maxSigma.

func (*HalfStepInt[T]) Mid

func (h *HalfStepInt[T]) Mid(x, y T) *HalfStepInt[T]

Mid sets h to the middle point between the two integers x and y and returns h.

type MsgClient

type MsgClient interface {
	// The UpdateParams method updates the module's parameters.
	UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMsgClient

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgServer

type MsgServer interface {
	// The UpdateParams method updates the module's parameters.
	UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
}

MsgServer is the server API for Msg service.

type MsgUpdateParams

type MsgUpdateParams struct {
	// authority is the address that controls the module (defaults to x/gov unless
	// overwritten).
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	Params    Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
}

The request message for the UpdateParams method.

func (*MsgUpdateParams) Descriptor

func (*MsgUpdateParams) Descriptor() ([]byte, []int)

func (*MsgUpdateParams) GetAuthority

func (m *MsgUpdateParams) GetAuthority() string

func (*MsgUpdateParams) GetParams

func (m *MsgUpdateParams) GetParams() Params

func (*MsgUpdateParams) Marshal

func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error)

func (*MsgUpdateParams) MarshalTo

func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error)

func (*MsgUpdateParams) MarshalToSizedBuffer

func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgUpdateParams) ProtoMessage

func (*MsgUpdateParams) ProtoMessage()

func (*MsgUpdateParams) Reset

func (m *MsgUpdateParams) Reset()

func (*MsgUpdateParams) Size

func (m *MsgUpdateParams) Size() (n int)

func (*MsgUpdateParams) String

func (m *MsgUpdateParams) String() string

func (*MsgUpdateParams) Unmarshal

func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error

func (*MsgUpdateParams) XXX_DiscardUnknown

func (m *MsgUpdateParams) XXX_DiscardUnknown()

func (*MsgUpdateParams) XXX_Marshal

func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgUpdateParams) XXX_Merge

func (m *MsgUpdateParams) XXX_Merge(src proto.Message)

func (*MsgUpdateParams) XXX_Size

func (m *MsgUpdateParams) XXX_Size() int

func (*MsgUpdateParams) XXX_Unmarshal

func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error

type MsgUpdateParamsResponse

type MsgUpdateParamsResponse struct {
}

The response message for the UpdateParams method.

func (*MsgUpdateParamsResponse) Descriptor

func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int)

func (*MsgUpdateParamsResponse) Marshal

func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error)

func (*MsgUpdateParamsResponse) MarshalTo

func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error)

func (*MsgUpdateParamsResponse) MarshalToSizedBuffer

func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgUpdateParamsResponse) ProtoMessage

func (*MsgUpdateParamsResponse) ProtoMessage()

func (*MsgUpdateParamsResponse) Reset

func (m *MsgUpdateParamsResponse) Reset()

func (*MsgUpdateParamsResponse) Size

func (m *MsgUpdateParamsResponse) Size() (n int)

func (*MsgUpdateParamsResponse) String

func (m *MsgUpdateParamsResponse) String() string

func (*MsgUpdateParamsResponse) Unmarshal

func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error

func (*MsgUpdateParamsResponse) XXX_DiscardUnknown

func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown()

func (*MsgUpdateParamsResponse) XXX_Marshal

func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MsgUpdateParamsResponse) XXX_Merge

func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message)

func (*MsgUpdateParamsResponse) XXX_Size

func (m *MsgUpdateParamsResponse) XXX_Size() int

func (*MsgUpdateParamsResponse) XXX_Unmarshal

func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error

type Params

type Params struct {
	// MaxTallyGasLimit is the maximum gas limit for a tally request.
	MaxTallyGasLimit uint64 `protobuf:"varint,1,opt,name=max_tally_gas_limit,json=maxTallyGasLimit,proto3" json:"max_tally_gas_limit,omitempty"`
	// FilterGasCostNone is the gas cost for a filter type none.
	FilterGasCostNone uint64 `protobuf:"varint,2,opt,name=filter_gas_cost_none,json=filterGasCostNone,proto3" json:"filter_gas_cost_none,omitempty"`
	// FilterGasCostMultiplierMode is the gas cost multiplier for a filter type
	// mode.
	FilterGasCostMultiplierMode uint64 `` /* 149-byte string literal not displayed */
	// FilterGasCostMultiplierStdDev is the gas cost multiplier for a filter type
	// stddev.
	FilterGasCostMultiplierStdDev uint64 `` /* 157-byte string literal not displayed */
	// GasCostBase is the base gas cost for a data request.
	GasCostBase uint64 `protobuf:"varint,5,opt,name=gas_cost_base,json=gasCostBase,proto3" json:"gas_cost_base,omitempty"`
	// GasCostFallback is the gas cost incurred for data request execution when
	// even basic consensus has not been reached.
	ExecutionGasCostFallback uint64 `` /* 138-byte string literal not displayed */
	// BurnRatio is the ratio of the gas cost to be burned in case of reduced
	// payout scenarios.
	BurnRatio cosmossdk_io_math.LegacyDec `protobuf:"bytes,7,opt,name=burn_ratio,json=burnRatio,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"burn_ratio"`
}

Params defines the parameters for the tally module.

func DefaultParams

func DefaultParams() Params

DefaultParams returns default tally module parameters.

func (*Params) Descriptor

func (*Params) Descriptor() ([]byte, []int)

func (*Params) GetExecutionGasCostFallback

func (m *Params) GetExecutionGasCostFallback() uint64

func (*Params) GetFilterGasCostMultiplierMode

func (m *Params) GetFilterGasCostMultiplierMode() uint64

func (*Params) GetFilterGasCostMultiplierStdDev

func (m *Params) GetFilterGasCostMultiplierStdDev() uint64

func (*Params) GetFilterGasCostNone

func (m *Params) GetFilterGasCostNone() uint64

func (*Params) GetGasCostBase

func (m *Params) GetGasCostBase() uint64

func (*Params) GetMaxTallyGasLimit

func (m *Params) GetMaxTallyGasLimit() uint64

func (*Params) Marshal

func (m *Params) Marshal() (dAtA []byte, err error)

func (*Params) MarshalTo

func (m *Params) MarshalTo(dAtA []byte) (int, error)

func (*Params) MarshalToSizedBuffer

func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) Size

func (m *Params) Size() (n int)

func (*Params) String

func (m *Params) String() string

func (*Params) Unmarshal

func (m *Params) Unmarshal(dAtA []byte) error

func (*Params) Validate

func (p *Params) Validate() error

ValidateBasic performs basic validation on tally module parameters.

func (*Params) XXX_DiscardUnknown

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal

func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*Params) XXX_Merge

func (m *Params) XXX_Merge(src proto.Message)

func (*Params) XXX_Size

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal

func (m *Params) XXX_Unmarshal(b []byte) error

type ProxyGasUsed

type ProxyGasUsed struct {
	PublicKey []byte
	Amount    math.Int
}

type QueryClient

type QueryClient interface {
	// Params returns the total set of tally parameters.
	Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryParamsRequest

type QueryParamsRequest struct {
}

QueryParamsRequest is the request type for the Query/Params RPC method.

func (*QueryParamsRequest) Descriptor

func (*QueryParamsRequest) Descriptor() ([]byte, []int)

func (*QueryParamsRequest) Marshal

func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error)

func (*QueryParamsRequest) MarshalTo

func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsRequest) MarshalToSizedBuffer

func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsRequest) ProtoMessage

func (*QueryParamsRequest) ProtoMessage()

func (*QueryParamsRequest) Reset

func (m *QueryParamsRequest) Reset()

func (*QueryParamsRequest) Size

func (m *QueryParamsRequest) Size() (n int)

func (*QueryParamsRequest) String

func (m *QueryParamsRequest) String() string

func (*QueryParamsRequest) Unmarshal

func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error

func (*QueryParamsRequest) XXX_DiscardUnknown

func (m *QueryParamsRequest) XXX_DiscardUnknown()

func (*QueryParamsRequest) XXX_Marshal

func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsRequest) XXX_Merge

func (m *QueryParamsRequest) XXX_Merge(src proto.Message)

func (*QueryParamsRequest) XXX_Size

func (m *QueryParamsRequest) XXX_Size() int

func (*QueryParamsRequest) XXX_Unmarshal

func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error

type QueryParamsResponse

type QueryParamsResponse struct {
	// params defines the parameters of the module.
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}

QueryParamsResponse is the response type for the Query/Params RPC method.

func (*QueryParamsResponse) Descriptor

func (*QueryParamsResponse) Descriptor() ([]byte, []int)

func (*QueryParamsResponse) GetParams

func (m *QueryParamsResponse) GetParams() Params

func (*QueryParamsResponse) Marshal

func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error)

func (*QueryParamsResponse) MarshalTo

func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error)

func (*QueryParamsResponse) MarshalToSizedBuffer

func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*QueryParamsResponse) ProtoMessage

func (*QueryParamsResponse) ProtoMessage()

func (*QueryParamsResponse) Reset

func (m *QueryParamsResponse) Reset()

func (*QueryParamsResponse) Size

func (m *QueryParamsResponse) Size() (n int)

func (*QueryParamsResponse) String

func (m *QueryParamsResponse) String() string

func (*QueryParamsResponse) Unmarshal

func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error

func (*QueryParamsResponse) XXX_DiscardUnknown

func (m *QueryParamsResponse) XXX_DiscardUnknown()

func (*QueryParamsResponse) XXX_Marshal

func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*QueryParamsResponse) XXX_Merge

func (m *QueryParamsResponse) XXX_Merge(src proto.Message)

func (*QueryParamsResponse) XXX_Size

func (m *QueryParamsResponse) XXX_Size() int

func (*QueryParamsResponse) XXX_Unmarshal

func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error

type QueryServer

type QueryServer interface {
	// Params returns the total set of tally parameters.
	Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
}

QueryServer is the server API for Query service.

type Request

type Request struct {
	ID                string                `json:"id"`
	Height            uint64                `json:"height"`
	ExecProgramID     string                `json:"exec_program_id"`
	ExecInputs        string                `json:"exec_inputs"`
	ExecGasLimit      uint64                `json:"exec_gas_limit"`
	TallyProgramID    string                `json:"tally_program_id"`
	TallyInputs       string                `json:"tally_inputs"`
	TallyGasLimit     uint64                `json:"tally_gas_limit"`
	GasPrice          string                `json:"gas_price"`
	Memo              string                `json:"memo"`
	PaybackAddress    string                `json:"payback_address"`
	ReplicationFactor uint16                `json:"replication_factor"`
	ConsensusFilter   string                `json:"consensus_filter"`
	Commits           map[string][]byte     `json:"commits"`
	Reveals           map[string]RevealBody `json:"reveals"`
	SedaPayload       string                `json:"seda_payload"`
	Version           string                `json:"version"`
}

type RevealBody

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

func (*RevealBody) MarshalJSON

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

func (*RevealBody) TryHash

func (u *RevealBody) TryHash() (string, error)

type Sigma

type Sigma uint64

Sigma is a 10^6 precision fixed-point unsigned number represented by a uint64, whose last 6 digits represent the fractional part.

func NewSigma

func NewSigma(data []byte) (Sigma, error)

func (Sigma) FractionalPart

func (s Sigma) FractionalPart() uint64

FractionalPart returns Sigma's fractional part as a uint64. For example, the fractional part of Sigma(1_500_000) is 500_000, representing the fraction 500_000 / 1_000_000.

func (Sigma) WholeNumber

func (s Sigma) WholeNumber() uint64

WholeNumber returns Sigma's whole number part. For example, the whole number part of Sigma(1_000_000) is 1.

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) UpdateParams

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Params

type WasmStorageKeeper

type WasmStorageKeeper interface {
	GetCoreContractAddr(ctx context.Context) (sdk.AccAddress, error)
	GetOracleProgram(ctx context.Context, hash string) (types.OracleProgram, error)
}

Jump to

Keyboard shortcuts

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