types

package
v30.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	ModuleName = "votingsnapshot"
	StoreKey   = ModuleName

	// TransientStoreKey backs the per-block dirty-delegator set. Staking
	// hooks mark delegators dirty here; the module EndBlocker drains the
	// set into persistent snapshots and the store auto-resets on commit.
	TransientStoreKey = "transient_votingsnapshot"
)
View Source
const DefaultPruneInterval uint64 = 1

DefaultPruneInterval — once per block. Lets governance batch the prune sweep on busy chains by lifting this knob via params update. 0 and 1 are treated as equivalent at the keeper.

View Source
const DefaultRetentionWindowHeights uint64 = 0

DefaultRetentionWindowHeights — pruning is disabled by default at v30 launch. The on-chain history is small at activation and the safer failure mode (unbounded growth) is preferable to the alternative (a buggy or mis-tuned prune sweep silently dropping snapshots). A future governance proposal can flip this to, e.g., ~1 year at 2.5s blocks (12_614_400) once operators have observed the growth curve.

Variables

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 (
	ParamsKey      = collections.NewPrefix(0)
	VotingPowerKey = collections.NewPrefix(1) // (delegator, height) -> sdkmath.Int
	TotalPowerKey  = collections.NewPrefix(2) // height           -> sdkmath.Int
)

persistent store prefixes

View Source
var (
	TransientDirtyDelegatorsKey = collections.NewPrefix(0) // delegator -> ()
	TransientTotalDirtyKey      = collections.NewPrefix(1) // () -> bool
)

transient store prefixes (separate store — no clash with the above)

View Source
var (
	ErrDuplicateLSTEntry = errors.New("duplicate LST allowlist address")
	ErrParamOutOfRange   = errors.New("parameter exceeds int64 range")
)

static validation errors (err113-friendly; also matchable via errors.Is)

View Source
var (
	ErrInvalidLengthParams        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowParams          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupParams = 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 (
	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 Msg_serviceDesc = _Msg_serviceDesc
View Source
var Query_serviceDesc = _Query_serviceDesc

Functions

func NewTransientKVStoreService

func NewTransientKVStoreService(key *storetypes.TransientStoreKey) corestore.KVStoreService

NewTransientKVStoreService adapts a *storetypes.TransientStoreKey into a corestore.KVStoreService so collections can be built over a transient store. The SDK's runtime package (v0.53) only offers runtime.NewTransientStoreService, which returns the narrower core/store.TransientStoreService interface that collections cannot consume — this adapter mirrors runtime's unexported kvStoreService but opens the store via a transient key. The backing store resets on every commit, which is exactly the lifetime the dirty-delegator set needs.

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

RegisterInterfaces registers the module's sdk.Msg implementations with the InterfaceRegistry so they can be encoded/decoded across the SDK's tx pipeline.

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)

Types

type GenesisState

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

GenesisState is the x/voting-snapshot module's genesis-state structure.

func DefaultGenesis

func DefaultGenesis() *GenesisState

DefaultGenesis returns the module's genesis-time state.

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 HeightPower

type HeightPower struct {
	Height int64  `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
	Power  string `protobuf:"bytes,2,opt,name=power,proto3" json:"power,omitempty"`
}

func (*HeightPower) Descriptor

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

func (*HeightPower) GetHeight

func (m *HeightPower) GetHeight() int64

func (*HeightPower) GetPower

func (m *HeightPower) GetPower() string

func (*HeightPower) Marshal

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

func (*HeightPower) MarshalTo

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

func (*HeightPower) MarshalToSizedBuffer

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

func (*HeightPower) ProtoMessage

func (*HeightPower) ProtoMessage()

func (*HeightPower) Reset

func (m *HeightPower) Reset()

func (*HeightPower) Size

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

func (*HeightPower) String

func (m *HeightPower) String() string

func (*HeightPower) Unmarshal

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

func (*HeightPower) XXX_DiscardUnknown

func (m *HeightPower) XXX_DiscardUnknown()

func (*HeightPower) XXX_Marshal

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

func (*HeightPower) XXX_Merge

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

func (*HeightPower) XXX_Size

func (m *HeightPower) XXX_Size() int

func (*HeightPower) XXX_Unmarshal

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

type MsgClient

type MsgClient interface {
	// UpdateParams updates the module parameters. Authority-only —
	// the gov module address.
	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 {
	// UpdateParams updates the module parameters. Authority-only —
	// the gov module address.
	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 the
	// governance module account).
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	// params is the full new parameter set.
	Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
}

MsgUpdateParams sets new module parameters. Sent by the governance module after a passing proposal.

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 {
}

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 {
	LstAllowlist           []string `protobuf:"bytes,1,rep,name=lst_allowlist,json=lstAllowlist,proto3" json:"lst_allowlist,omitempty"`
	RetentionWindowHeights uint64   `` /* 130-byte string literal not displayed */
	PruneInterval          uint64   `protobuf:"varint,3,opt,name=prune_interval,json=pruneInterval,proto3" json:"prune_interval,omitempty"`
}

Params is the governance-controlled config for x/voting-snapshot.

LSTAllowlist: bech32 addresses of LST contracts whose delegations must NOT count toward voting power. Empty at v30 launch.

RetentionWindowHeights: snapshots older than this many blocks are pruned by the EndBlocker. Zero disables pruning. Default is 0 at v30 launch — pruning is an opt-in operation governance can turn on once the on-chain history outgrows what the chain wants to keep.

PruneInterval: only run the prune sweep when block_height % prune_interval == 0. Lets governance batch the sweep to amortize its iteration cost on busy chains. Zero/one both mean "every block".

func DefaultParams

func DefaultParams() Params

DefaultParams returns the module's default parameter set.

LST allowlist is empty at v30 launch (no live LST contracts on Juno per memory/juno-voting-design.md). Default-deny: an unknown LST counts as voting power until governance lists it.

func (*Params) Descriptor

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

func (*Params) Equal

func (this *Params) Equal(that interface{}) bool

func (*Params) GetLstAllowlist

func (m *Params) GetLstAllowlist() []string

func (*Params) GetPruneInterval

func (m *Params) GetPruneInterval() uint64

func (*Params) GetRetentionWindowHeights

func (m *Params) GetRetentionWindowHeights() 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

Validate stateless-checks a Params value. Called from MsgUpdateParams handling and genesis validation so malformed params can never be committed:

  • every LST allowlist entry must be a valid bech32 account address (a bad entry would make computeTotalPower / IsLST comparisons silently miss the intended contract);
  • allowlist entries must be unique (duplicates would double-subtract the LST's stake from TotalPower);
  • RetentionWindowHeights and PruneInterval must fit in an int64, as the prune path casts them to block-height arithmetic.

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 QueryClient

type QueryClient interface {
	// Params returns the current x/voting-snapshot module parameters.
	Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
	// VotingPowerAt returns the bonded voting power of `address` at
	// `at_height`, excluding LST-held delegations. Resolves to the
	// most recent snapshot at-or-before the requested height. Returns
	// zero (with no error) if no snapshot exists.
	VotingPowerAt(ctx context.Context, in *QueryVotingPowerAtRequest, opts ...grpc.CallOption) (*QueryVotingPowerAtResponse, error)
	// TotalVotingPowerAt returns the chain-wide bonded supply at
	// `at_height`. Same at-or-before semantics as VotingPowerAt.
	TotalVotingPowerAt(ctx context.Context, in *QueryTotalVotingPowerAtRequest, opts ...grpc.CallOption) (*QueryTotalVotingPowerAtResponse, error)
	// VotingPowerOverRange returns every recorded snapshot for `address`
	// in [from_height, to_height]. Useful for time-decay schemes.
	VotingPowerOverRange(ctx context.Context, in *QueryVotingPowerOverRangeRequest, opts ...grpc.CallOption) (*QueryVotingPowerOverRangeResponse, 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 {
}

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 Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}

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 current x/voting-snapshot module parameters.
	Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
	// VotingPowerAt returns the bonded voting power of `address` at
	// `at_height`, excluding LST-held delegations. Resolves to the
	// most recent snapshot at-or-before the requested height. Returns
	// zero (with no error) if no snapshot exists.
	VotingPowerAt(context.Context, *QueryVotingPowerAtRequest) (*QueryVotingPowerAtResponse, error)
	// TotalVotingPowerAt returns the chain-wide bonded supply at
	// `at_height`. Same at-or-before semantics as VotingPowerAt.
	TotalVotingPowerAt(context.Context, *QueryTotalVotingPowerAtRequest) (*QueryTotalVotingPowerAtResponse, error)
	// VotingPowerOverRange returns every recorded snapshot for `address`
	// in [from_height, to_height]. Useful for time-decay schemes.
	VotingPowerOverRange(context.Context, *QueryVotingPowerOverRangeRequest) (*QueryVotingPowerOverRangeResponse, error)
}

QueryServer is the server API for Query service.

type QueryTotalVotingPowerAtRequest

type QueryTotalVotingPowerAtRequest struct {
	AtHeight int64 `protobuf:"varint,1,opt,name=at_height,json=atHeight,proto3" json:"at_height,omitempty"`
}

func (*QueryTotalVotingPowerAtRequest) Descriptor

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

func (*QueryTotalVotingPowerAtRequest) GetAtHeight

func (m *QueryTotalVotingPowerAtRequest) GetAtHeight() int64

func (*QueryTotalVotingPowerAtRequest) Marshal

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

func (*QueryTotalVotingPowerAtRequest) MarshalTo

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

func (*QueryTotalVotingPowerAtRequest) MarshalToSizedBuffer

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

func (*QueryTotalVotingPowerAtRequest) ProtoMessage

func (*QueryTotalVotingPowerAtRequest) ProtoMessage()

func (*QueryTotalVotingPowerAtRequest) Reset

func (m *QueryTotalVotingPowerAtRequest) Reset()

func (*QueryTotalVotingPowerAtRequest) Size

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

func (*QueryTotalVotingPowerAtRequest) String

func (*QueryTotalVotingPowerAtRequest) Unmarshal

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

func (*QueryTotalVotingPowerAtRequest) XXX_DiscardUnknown

func (m *QueryTotalVotingPowerAtRequest) XXX_DiscardUnknown()

func (*QueryTotalVotingPowerAtRequest) XXX_Marshal

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

func (*QueryTotalVotingPowerAtRequest) XXX_Merge

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

func (*QueryTotalVotingPowerAtRequest) XXX_Size

func (m *QueryTotalVotingPowerAtRequest) XXX_Size() int

func (*QueryTotalVotingPowerAtRequest) XXX_Unmarshal

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

type QueryTotalVotingPowerAtResponse

type QueryTotalVotingPowerAtResponse struct {
	Power string `protobuf:"bytes,1,opt,name=power,proto3" json:"power,omitempty"`
}

func (*QueryTotalVotingPowerAtResponse) Descriptor

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

func (*QueryTotalVotingPowerAtResponse) GetPower

func (*QueryTotalVotingPowerAtResponse) Marshal

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

func (*QueryTotalVotingPowerAtResponse) MarshalTo

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

func (*QueryTotalVotingPowerAtResponse) MarshalToSizedBuffer

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

func (*QueryTotalVotingPowerAtResponse) ProtoMessage

func (*QueryTotalVotingPowerAtResponse) ProtoMessage()

func (*QueryTotalVotingPowerAtResponse) Reset

func (*QueryTotalVotingPowerAtResponse) Size

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

func (*QueryTotalVotingPowerAtResponse) String

func (*QueryTotalVotingPowerAtResponse) Unmarshal

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

func (*QueryTotalVotingPowerAtResponse) XXX_DiscardUnknown

func (m *QueryTotalVotingPowerAtResponse) XXX_DiscardUnknown()

func (*QueryTotalVotingPowerAtResponse) XXX_Marshal

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

func (*QueryTotalVotingPowerAtResponse) XXX_Merge

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

func (*QueryTotalVotingPowerAtResponse) XXX_Size

func (m *QueryTotalVotingPowerAtResponse) XXX_Size() int

func (*QueryTotalVotingPowerAtResponse) XXX_Unmarshal

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

type QueryVotingPowerAtRequest

type QueryVotingPowerAtRequest struct {
	Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	// at_height is the chain height to look up power for. Named
	// distinctly from `height` so it doesn't collide with cosmos-sdk's
	// standard query --height flag in autocli output.
	AtHeight int64 `protobuf:"varint,2,opt,name=at_height,json=atHeight,proto3" json:"at_height,omitempty"`
}

func (*QueryVotingPowerAtRequest) Descriptor

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

func (*QueryVotingPowerAtRequest) GetAddress

func (m *QueryVotingPowerAtRequest) GetAddress() string

func (*QueryVotingPowerAtRequest) GetAtHeight

func (m *QueryVotingPowerAtRequest) GetAtHeight() int64

func (*QueryVotingPowerAtRequest) Marshal

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

func (*QueryVotingPowerAtRequest) MarshalTo

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

func (*QueryVotingPowerAtRequest) MarshalToSizedBuffer

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

func (*QueryVotingPowerAtRequest) ProtoMessage

func (*QueryVotingPowerAtRequest) ProtoMessage()

func (*QueryVotingPowerAtRequest) Reset

func (m *QueryVotingPowerAtRequest) Reset()

func (*QueryVotingPowerAtRequest) Size

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

func (*QueryVotingPowerAtRequest) String

func (m *QueryVotingPowerAtRequest) String() string

func (*QueryVotingPowerAtRequest) Unmarshal

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

func (*QueryVotingPowerAtRequest) XXX_DiscardUnknown

func (m *QueryVotingPowerAtRequest) XXX_DiscardUnknown()

func (*QueryVotingPowerAtRequest) XXX_Marshal

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

func (*QueryVotingPowerAtRequest) XXX_Merge

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

func (*QueryVotingPowerAtRequest) XXX_Size

func (m *QueryVotingPowerAtRequest) XXX_Size() int

func (*QueryVotingPowerAtRequest) XXX_Unmarshal

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

type QueryVotingPowerAtResponse

type QueryVotingPowerAtResponse struct {
	// power is the bonded stake amount as a base-10 string (uint).
	Power string `protobuf:"bytes,1,opt,name=power,proto3" json:"power,omitempty"`
}

func (*QueryVotingPowerAtResponse) Descriptor

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

func (*QueryVotingPowerAtResponse) GetPower

func (m *QueryVotingPowerAtResponse) GetPower() string

func (*QueryVotingPowerAtResponse) Marshal

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

func (*QueryVotingPowerAtResponse) MarshalTo

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

func (*QueryVotingPowerAtResponse) MarshalToSizedBuffer

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

func (*QueryVotingPowerAtResponse) ProtoMessage

func (*QueryVotingPowerAtResponse) ProtoMessage()

func (*QueryVotingPowerAtResponse) Reset

func (m *QueryVotingPowerAtResponse) Reset()

func (*QueryVotingPowerAtResponse) Size

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

func (*QueryVotingPowerAtResponse) String

func (m *QueryVotingPowerAtResponse) String() string

func (*QueryVotingPowerAtResponse) Unmarshal

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

func (*QueryVotingPowerAtResponse) XXX_DiscardUnknown

func (m *QueryVotingPowerAtResponse) XXX_DiscardUnknown()

func (*QueryVotingPowerAtResponse) XXX_Marshal

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

func (*QueryVotingPowerAtResponse) XXX_Merge

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

func (*QueryVotingPowerAtResponse) XXX_Size

func (m *QueryVotingPowerAtResponse) XXX_Size() int

func (*QueryVotingPowerAtResponse) XXX_Unmarshal

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

type QueryVotingPowerOverRangeRequest

type QueryVotingPowerOverRangeRequest struct {
	Address    string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
	FromHeight int64  `protobuf:"varint,2,opt,name=from_height,json=fromHeight,proto3" json:"from_height,omitempty"`
	ToHeight   int64  `protobuf:"varint,3,opt,name=to_height,json=toHeight,proto3" json:"to_height,omitempty"`
}

func (*QueryVotingPowerOverRangeRequest) Descriptor

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

func (*QueryVotingPowerOverRangeRequest) GetAddress

func (m *QueryVotingPowerOverRangeRequest) GetAddress() string

func (*QueryVotingPowerOverRangeRequest) GetFromHeight

func (m *QueryVotingPowerOverRangeRequest) GetFromHeight() int64

func (*QueryVotingPowerOverRangeRequest) GetToHeight

func (m *QueryVotingPowerOverRangeRequest) GetToHeight() int64

func (*QueryVotingPowerOverRangeRequest) Marshal

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

func (*QueryVotingPowerOverRangeRequest) MarshalTo

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

func (*QueryVotingPowerOverRangeRequest) MarshalToSizedBuffer

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

func (*QueryVotingPowerOverRangeRequest) ProtoMessage

func (*QueryVotingPowerOverRangeRequest) ProtoMessage()

func (*QueryVotingPowerOverRangeRequest) Reset

func (*QueryVotingPowerOverRangeRequest) Size

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

func (*QueryVotingPowerOverRangeRequest) String

func (*QueryVotingPowerOverRangeRequest) Unmarshal

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

func (*QueryVotingPowerOverRangeRequest) XXX_DiscardUnknown

func (m *QueryVotingPowerOverRangeRequest) XXX_DiscardUnknown()

func (*QueryVotingPowerOverRangeRequest) XXX_Marshal

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

func (*QueryVotingPowerOverRangeRequest) XXX_Merge

func (*QueryVotingPowerOverRangeRequest) XXX_Size

func (m *QueryVotingPowerOverRangeRequest) XXX_Size() int

func (*QueryVotingPowerOverRangeRequest) XXX_Unmarshal

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

type QueryVotingPowerOverRangeResponse

type QueryVotingPowerOverRangeResponse struct {
	Rows []HeightPower `protobuf:"bytes,1,rep,name=rows,proto3" json:"rows"`
}

func (*QueryVotingPowerOverRangeResponse) Descriptor

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

func (*QueryVotingPowerOverRangeResponse) GetRows

func (*QueryVotingPowerOverRangeResponse) Marshal

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

func (*QueryVotingPowerOverRangeResponse) MarshalTo

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

func (*QueryVotingPowerOverRangeResponse) MarshalToSizedBuffer

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

func (*QueryVotingPowerOverRangeResponse) ProtoMessage

func (*QueryVotingPowerOverRangeResponse) ProtoMessage()

func (*QueryVotingPowerOverRangeResponse) Reset

func (*QueryVotingPowerOverRangeResponse) Size

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

func (*QueryVotingPowerOverRangeResponse) String

func (*QueryVotingPowerOverRangeResponse) Unmarshal

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

func (*QueryVotingPowerOverRangeResponse) XXX_DiscardUnknown

func (m *QueryVotingPowerOverRangeResponse) XXX_DiscardUnknown()

func (*QueryVotingPowerOverRangeResponse) XXX_Marshal

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

func (*QueryVotingPowerOverRangeResponse) XXX_Merge

func (*QueryVotingPowerOverRangeResponse) XXX_Size

func (m *QueryVotingPowerOverRangeResponse) XXX_Size() int

func (*QueryVotingPowerOverRangeResponse) XXX_Unmarshal

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

type StakingKeeper

type StakingKeeper interface {
	TotalBondedTokens(ctx context.Context) (math.Int, error)
	IterateAllDelegations(ctx context.Context, fn func(stakingtypes.Delegation) bool) error
	GetValidatorDelegations(ctx context.Context, valAddr sdk.ValAddress) ([]stakingtypes.Delegation, error)
	IterateDelegatorDelegations(ctx context.Context, delegator sdk.AccAddress, cb func(delegation stakingtypes.Delegation) (stop bool)) error
	GetValidator(ctx context.Context, addr sdk.ValAddress) (stakingtypes.Validator, error)
}

StakingKeeper is the subset of the SDK staking keeper that x/voting-snapshot reads to compute and backfill power snapshots.

Note: we deliberately do NOT use staking's GetDelegatorBonded — it sums delegations to validators in every bond status, while TotalBondedTokens only counts the bonded pool. The keeper computes bonded-validator-only power itself via IterateDelegatorDelegations + GetValidator so the numerator and denominator share the same basis.

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

func (*UnimplementedQueryServer) TotalVotingPowerAt

func (*UnimplementedQueryServer) VotingPowerAt

Jump to

Keyboard shortcuts

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