types

package
v2.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	// ModuleName is the module's name
	ModuleName = "safety"

	// StoreKey is the module's store key
	StoreKey = ModuleName

	// RouterKey is the module's message route
	RouterKey = ModuleName

	// QuerierRoute is the module's querier route
	QuerierRoute = ModuleName
)

Variables

View Source
var (
	ErrInvalidProposalAmount    = errors.Register(ModuleName, 2, "invalid safety fund spend proposal amount")
	ErrInvalidProposalAuthority = errors.Register(ModuleName, 3, "invalid safety fund spend proposal authority")
	ErrInvalidProposalRecipient = errors.Register(ModuleName, 4, "invalid safety fund spend proposal recipient")
)
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 (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)

Functions

func RegisterInterfaces

func RegisterInterfaces(registry codectypes.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)

Types

type AccountKeeper

type AccountKeeper interface {
	GetModuleAddress(name string) sdk.AccAddress
	GetModuleAccount(ctx sdk.Context, name string) authtypes.ModuleAccountI
}

AccountKeeper defines the expected interface for the auth module keeper

type BankKeeper

type BankKeeper interface {
	GetAllBalances(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins
	SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error
}

BankKeeper defines the expected interface for the bank module keeper

type GenesisState

type GenesisState struct {
}

GenesisState defines the safety module's genesis state

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

DefaultGenesisState returns the default genesis state of the module

func (*GenesisState) Descriptor

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

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 (GenesisState) Validate() error

ValidateGenesis validates the given instance of the module's genesis state

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 MsgClient

type MsgClient interface {
	// SafetyFundSpend is a governance operation for sending tokens from the
	// safety fund module account to the designated recipient.
	//
	// NOTE: For now, this is just a copy of the distribution module's
	// `CommunityFundSpend` method. The recipient is expected to be a multisig
	// consisting of trusted community members who are respondible for using the
	// funds appropriately to cover any bad debt.
	//
	// In the long term, the goal is that the module
	// is able to detect bad debts incurred in the outposts via interchain query,
	// and automatically dispense the appropriate amount of funds, without having
	// to go through the governance process.
	SafetyFundSpend(ctx context.Context, in *MsgSafetyFundSpend, opts ...grpc.CallOption) (*MsgSafetyFundSpendResponse, 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 MsgSafetyFundSpend

type MsgSafetyFundSpend struct {
	// Authority is the account executing the safety fund spend.
	// It should be the gov module account.
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	// Recipient is the account to receive the funds
	Recipient string `protobuf:"bytes,2,opt,name=recipient,proto3" json:"recipient,omitempty"`
	// Amount is the coins that are to be released from the safety funds
	Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"`
}

MsgSafetyFundSpend defines the message for sending tokens from the safety fund to a designated recipient.

This message is typically executed via a governance proposal with the gov module being the executing authority.

func (*MsgSafetyFundSpend) Descriptor

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

func (*MsgSafetyFundSpend) GetAmount

func (*MsgSafetyFundSpend) GetAuthority

func (m *MsgSafetyFundSpend) GetAuthority() string

func (*MsgSafetyFundSpend) GetRecipient

func (m *MsgSafetyFundSpend) GetRecipient() string

func (*MsgSafetyFundSpend) GetSigners

func (m *MsgSafetyFundSpend) GetSigners() []sdk.AccAddress

GetSigners returns the expected signers for the message

func (*MsgSafetyFundSpend) Marshal

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

func (*MsgSafetyFundSpend) MarshalTo

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

func (*MsgSafetyFundSpend) MarshalToSizedBuffer

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

func (*MsgSafetyFundSpend) ProtoMessage

func (*MsgSafetyFundSpend) ProtoMessage()

func (*MsgSafetyFundSpend) Reset

func (m *MsgSafetyFundSpend) Reset()

func (*MsgSafetyFundSpend) Size

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

func (*MsgSafetyFundSpend) String

func (m *MsgSafetyFundSpend) String() string

func (*MsgSafetyFundSpend) Unmarshal

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

func (*MsgSafetyFundSpend) ValidateBasic

func (m *MsgSafetyFundSpend) ValidateBasic() error

ValidateBasic does a sanity check on the provided data.

func (*MsgSafetyFundSpend) XXX_DiscardUnknown

func (m *MsgSafetyFundSpend) XXX_DiscardUnknown()

func (*MsgSafetyFundSpend) XXX_Marshal

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

func (*MsgSafetyFundSpend) XXX_Merge

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

func (*MsgSafetyFundSpend) XXX_Size

func (m *MsgSafetyFundSpend) XXX_Size() int

func (*MsgSafetyFundSpend) XXX_Unmarshal

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

type MsgSafetyFundSpendResponse

type MsgSafetyFundSpendResponse struct {
}

MsgSafetyFundSpendResponse defines the response to executing a MsgSafetyFundSpend message.

func (*MsgSafetyFundSpendResponse) Descriptor

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

func (*MsgSafetyFundSpendResponse) Marshal

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

func (*MsgSafetyFundSpendResponse) MarshalTo

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

func (*MsgSafetyFundSpendResponse) MarshalToSizedBuffer

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

func (*MsgSafetyFundSpendResponse) ProtoMessage

func (*MsgSafetyFundSpendResponse) ProtoMessage()

func (*MsgSafetyFundSpendResponse) Reset

func (m *MsgSafetyFundSpendResponse) Reset()

func (*MsgSafetyFundSpendResponse) Size

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

func (*MsgSafetyFundSpendResponse) String

func (m *MsgSafetyFundSpendResponse) String() string

func (*MsgSafetyFundSpendResponse) Unmarshal

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

func (*MsgSafetyFundSpendResponse) XXX_DiscardUnknown

func (m *MsgSafetyFundSpendResponse) XXX_DiscardUnknown()

func (*MsgSafetyFundSpendResponse) XXX_Marshal

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

func (*MsgSafetyFundSpendResponse) XXX_Merge

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

func (*MsgSafetyFundSpendResponse) XXX_Size

func (m *MsgSafetyFundSpendResponse) XXX_Size() int

func (*MsgSafetyFundSpendResponse) XXX_Unmarshal

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

type MsgServer

type MsgServer interface {
	// SafetyFundSpend is a governance operation for sending tokens from the
	// safety fund module account to the designated recipient.
	//
	// NOTE: For now, this is just a copy of the distribution module's
	// `CommunityFundSpend` method. The recipient is expected to be a multisig
	// consisting of trusted community members who are respondible for using the
	// funds appropriately to cover any bad debt.
	//
	// In the long term, the goal is that the module
	// is able to detect bad debts incurred in the outposts via interchain query,
	// and automatically dispense the appropriate amount of funds, without having
	// to go through the governance process.
	SafetyFundSpend(context.Context, *MsgSafetyFundSpend) (*MsgSafetyFundSpendResponse, error)
}

MsgServer is the server API for Msg service.

type QueryBalancesRequest

type QueryBalancesRequest struct {
}

QueBalancesRequest is the request type of the QuerBalancesRPC method

func (*QueryBalancesRequest) Descriptor

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

func (*QueryBalancesRequest) Marshal

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

func (*QueryBalancesRequest) MarshalTo

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

func (*QueryBalancesRequest) MarshalToSizedBuffer

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

func (*QueryBalancesRequest) ProtoMessage

func (*QueryBalancesRequest) ProtoMessage()

func (*QueryBalancesRequest) Reset

func (m *QueryBalancesRequest) Reset()

func (*QueryBalancesRequest) Size

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

func (*QueryBalancesRequest) String

func (m *QueryBalancesRequest) String() string

func (*QueryBalancesRequest) Unmarshal

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

func (*QueryBalancesRequest) XXX_DiscardUnknown

func (m *QueryBalancesRequest) XXX_DiscardUnknown()

func (*QueryBalancesRequest) XXX_Marshal

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

func (*QueryBalancesRequest) XXX_Merge

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

func (*QueryBalancesRequest) XXX_Size

func (m *QueryBalancesRequest) XXX_Size() int

func (*QueryBalancesRequest) XXX_Unmarshal

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

type QueryBalancesResponse

type QueryBalancesResponse struct {
	// Balances is the coins available in the safety fund
	Balances github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=balances,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"balances"`
}

QueBalancesResponse is the response type of the QuerBalancesRPC method

func (*QueryBalancesResponse) Descriptor

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

func (*QueryBalancesResponse) GetBalances

func (*QueryBalancesResponse) Marshal

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

func (*QueryBalancesResponse) MarshalTo

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

func (*QueryBalancesResponse) MarshalToSizedBuffer

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

func (*QueryBalancesResponse) ProtoMessage

func (*QueryBalancesResponse) ProtoMessage()

func (*QueryBalancesResponse) Reset

func (m *QueryBalancesResponse) Reset()

func (*QueryBalancesResponse) Size

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

func (*QueryBalancesResponse) String

func (m *QueryBalancesResponse) String() string

func (*QueryBalancesResponse) Unmarshal

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

func (*QueryBalancesResponse) XXX_DiscardUnknown

func (m *QueryBalancesResponse) XXX_DiscardUnknown()

func (*QueryBalancesResponse) XXX_Marshal

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

func (*QueryBalancesResponse) XXX_Merge

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

func (*QueryBalancesResponse) XXX_Size

func (m *QueryBalancesResponse) XXX_Size() int

func (*QueryBalancesResponse) XXX_Unmarshal

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

type QueryClient

type QueryClient interface {
	// Balances queries coins available in the safety fund
	Balances(ctx context.Context, in *QueryBalancesRequest, opts ...grpc.CallOption) (*QueryBalancesResponse, 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 {
	// Balances queries coins available in the safety fund
	Balances(context.Context, *QueryBalancesRequest) (*QueryBalancesResponse, error)
}

QueryServer is the server API for Query service.

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) SafetyFundSpend

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Balances

Jump to

Keyboard shortcuts

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