types

package
v0.0.0-...-92848d0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: MIT Imports: 30 Imported by: 2

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	EventTypeUnbond  = "vault_unbond"
	EventTypeBond    = "vault_bond"
	EventTypeUnstake = "native_unstake"
)
View Source
const (
	AttributeValueCategory = ModuleName
	AttributeKeyDelegator  = "delegator"
	AttributeKeyValidator  = "validator"
)
View Source
const (
	ModuleName = "mesh-security-provider"

	StoreKey = ModuleName

	RouterKey = ModuleName
)
View Source
const (
	TypeMsgUpdateParams = "update-params"
)

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 (
	// Key defines the store key for mesh security provider module.
	Key       = []byte{0x01}
	ParamsKey = []byte{0x02}
)
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 (
	KeyParamField = []byte("TODO: CHANGE ME")
)

Parameter store keys.

View Source
var (
	ModuleCdc = codec.NewAminoCodec(amino)
)

Functions

func RegisterInterfaces

func RegisterInterfaces(registry types.InterfaceRegistry)

func RegisterLegacyAminoCodec

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

RegisterLegacyAminoCodec registers the necessary x/meshsecurityprovider interfaces and concrete types on the provided LegacyAmino codec. These types are used for Amino JSON serialization.

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 BankKeeper

type BankKeeper interface {
	DelegateCoins(ctx sdk.Context, delegatorAddr, moduleAccAddr sdk.AccAddress, amt sdk.Coins) error
	UndelegateCoins(ctx sdk.Context, moduleAccAddr, delegatorAddr sdk.AccAddress, amt sdk.Coins) error
	UndelegateCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
}

BankKeeper defines the expected interface needed to retrieve account balances.

type GenesisState

type GenesisState struct {
	// params is the container of meshsecurityprovider parameters.
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}

GenesisState defines the meshsecurityprovider module's genesis state.

func DefaultGenesis

func DefaultGenesis() *GenesisState

DefaultGenesis returns the default meshsecurityprovider genesis 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) Validate

func (gs GenesisState) Validate() error

Validate performs basic genesis state validation returning an error upon any failure.

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 MeshSecurityConsumer

type MeshSecurityConsumer interface {
	ScheduleUnjailed(ctx sdk.Context, addr sdk.ValAddress) error
	ScheduleJailed(ctx sdk.Context, addr sdk.ValAddress) error
	ScheduleTombstoned(ctx sdk.Context, addr sdk.ValAddress) error
	ScheduleModified(ctx sdk.Context, addr sdk.ValAddress) error
	ScheduleSlashed(ctx sdk.Context, addr sdk.ValAddress, power int64, height int64, totalSlashAmount math.Int, slashRatio sdk.Dec) error
}

type MsgClient

type MsgClient interface {
	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(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 defines the x/meshsecurityprovider parameters to update.
	Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
}

MsgUpdateParams updates meshsecurityprovider module 's params

func (*MsgUpdateParams) Descriptor

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

func (MsgUpdateParams) GetSignBytes

func (msg MsgUpdateParams) GetSignBytes() []byte

func (MsgUpdateParams) GetSigners

func (msg MsgUpdateParams) GetSigners() []sdk.AccAddress

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) Route

func (msg MsgUpdateParams) Route() string

func (*MsgUpdateParams) Size

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

func (*MsgUpdateParams) String

func (m *MsgUpdateParams) String() string

func (MsgUpdateParams) Type

func (msg MsgUpdateParams) Type() string

func (*MsgUpdateParams) Unmarshal

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

func (MsgUpdateParams) ValidateBasic

func (msg MsgUpdateParams) ValidateBasic() 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 {
	VaultAddress         string `protobuf:"bytes,1,opt,name=vault_address,json=vaultAddress,proto3" json:"vault_address,omitempty" yaml:"vault_address"`
	NativeStakingAddress string `` /* 153-byte string literal not displayed */
}

func DefaultParams

func DefaultParams() Params

DefaultParams are the default meshsecurityprovider module parameters.

func NewParams

func NewParams(vaultAddress string) Params

func (*Params) Descriptor

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

func (*Params) GetNativeStakingAddress

func (m *Params) GetNativeStakingAddress() string

func (*Params) GetVaultAddress

func (m *Params) GetVaultAddress() string

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 validates params.

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 ParamsRequest

type ParamsRequest struct {
}

=============================== Params

func (*ParamsRequest) Descriptor

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

func (*ParamsRequest) Marshal

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

func (*ParamsRequest) MarshalTo

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

func (*ParamsRequest) MarshalToSizedBuffer

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

func (*ParamsRequest) ProtoMessage

func (*ParamsRequest) ProtoMessage()

func (*ParamsRequest) Reset

func (m *ParamsRequest) Reset()

func (*ParamsRequest) Size

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

func (*ParamsRequest) String

func (m *ParamsRequest) String() string

func (*ParamsRequest) Unmarshal

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

func (*ParamsRequest) XXX_DiscardUnknown

func (m *ParamsRequest) XXX_DiscardUnknown()

func (*ParamsRequest) XXX_Marshal

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

func (*ParamsRequest) XXX_Merge

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

func (*ParamsRequest) XXX_Size

func (m *ParamsRequest) XXX_Size() int

func (*ParamsRequest) XXX_Unmarshal

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

type ParamsResponse

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

func (*ParamsResponse) Descriptor

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

func (*ParamsResponse) GetParams

func (m *ParamsResponse) GetParams() Params

func (*ParamsResponse) Marshal

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

func (*ParamsResponse) MarshalTo

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

func (*ParamsResponse) MarshalToSizedBuffer

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

func (*ParamsResponse) ProtoMessage

func (*ParamsResponse) ProtoMessage()

func (*ParamsResponse) Reset

func (m *ParamsResponse) Reset()

func (*ParamsResponse) Size

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

func (*ParamsResponse) String

func (m *ParamsResponse) String() string

func (*ParamsResponse) Unmarshal

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

func (*ParamsResponse) XXX_DiscardUnknown

func (m *ParamsResponse) XXX_DiscardUnknown()

func (*ParamsResponse) XXX_Marshal

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

func (*ParamsResponse) XXX_Merge

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

func (*ParamsResponse) XXX_Size

func (m *ParamsResponse) XXX_Size() int

func (*ParamsResponse) XXX_Unmarshal

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

type ProxyByOwnerResponse

type ProxyByOwnerResponse struct {
	Proxy string `json:"proxy"`
}

type QueryClient

type QueryClient interface {
	Params(ctx context.Context, in *ParamsRequest, opts ...grpc.CallOption) (*ParamsResponse, 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 QueryServer

type QueryServer interface {
	Params(context.Context, *ParamsRequest) (*ParamsResponse, error)
}

QueryServer is the server API for Query service.

type StakingKeeper

type StakingKeeper interface {
	BondDenom(ctx sdk.Context) string
	GetValidator(ctx sdk.Context, addr sdk.ValAddress) (validator stakingtypes.Validator, found bool)
	ValidateUnbondAmount(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, amt math.Int) (shares sdk.Dec, err error)
	Unbond(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, shares sdk.Dec) (amount math.Int, err error)
	Undelegate(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, sharesAmount sdk.Dec) (time.Time, error)
}

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 WasmKeeper

type WasmKeeper interface {
	Sudo(ctx sdk.Context, contractAddress sdk.AccAddress, msg []byte) ([]byte, error)
	HasContractInfo(ctx sdk.Context, contractAddress sdk.AccAddress) bool
	QuerySmart(ctx sdk.Context, contractAddress sdk.AccAddress, queryMsg []byte) ([]byte, error)
}

Jump to

Keyboard shortcuts

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