types

package
v0.0.0-...-b0ad14f Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	EventTypeAdminUpdated = "admin_updated"

	AttributeKeyLastAdmin    = "last_admin"
	AttributeKeyCurrentAdmin = "current_admin"
)

sudo module event types

View Source
const (
	// ModuleName defines the module name
	ModuleName = "sudo"

	// StoreKey defines the primary module store key
	StoreKey = ModuleName

	// RouterKey is the message route for slashing
	RouterKey = ModuleName

	// QuerierRoute defines the module's query routing key
	QuerierRoute = ModuleName

	// MemStoreKey defines the in-memory store key
	MemStoreKey = "mem_sudo"
)
View Source
const DefaultIndex uint64 = 1

DefaultIndex is the default capability global index

Variables

View Source
var (
	Amino     = codec.NewLegacyAmino()
	ModuleCdc = codec.NewAminoCodec(Amino)
)
View Source
var (
	ErrCreatorNotAdmin        = sdkerrors.Register(ModuleName, 1, "creator is not admin error")
	ErrLastAdminEqualNewAdmin = sdkerrors.Register(ModuleName, 2, "last admin euqal new admin error")
)

x/sudo module sentinel errors

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 (
	ErrInvalidLengthSudo        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSudo          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupSudo = 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 (
	AdminPrefix = []byte{0x00}
)

Functions

func KeyPrefix

func KeyPrefix(p string) []byte

func RegisterCodec

func RegisterCodec(cdc *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)

Types

type AddrPrefix

type AddrPrefix struct {
	Denom  string `protobuf:"bytes,1,opt,name=denom,proto3" json:"denom,omitempty"`
	Prefix string `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty"`
}

func (*AddrPrefix) Descriptor

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

func (*AddrPrefix) GetDenom

func (m *AddrPrefix) GetDenom() string

func (*AddrPrefix) GetPrefix

func (m *AddrPrefix) GetPrefix() string

func (*AddrPrefix) Marshal

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

func (*AddrPrefix) MarshalTo

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

func (*AddrPrefix) MarshalToSizedBuffer

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

func (*AddrPrefix) ProtoMessage

func (*AddrPrefix) ProtoMessage()

func (*AddrPrefix) Reset

func (m *AddrPrefix) Reset()

func (*AddrPrefix) Size

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

func (*AddrPrefix) String

func (m *AddrPrefix) String() string

func (*AddrPrefix) Unmarshal

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

func (*AddrPrefix) XXX_DiscardUnknown

func (m *AddrPrefix) XXX_DiscardUnknown()

func (*AddrPrefix) XXX_Marshal

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

func (*AddrPrefix) XXX_Merge

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

func (*AddrPrefix) XXX_Size

func (m *AddrPrefix) XXX_Size() int

func (*AddrPrefix) XXX_Unmarshal

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

type GenesisState

type GenesisState struct {
	Admin string `protobuf:"bytes,1,opt,name=admin,proto3" json:"admin,omitempty" yaml:"admin"`
}

GenesisState defines the sudo module's genesis state.

func DefaultGenesis

func DefaultGenesis() *GenesisState

DefaultGenesis returns the default Capability genesis state

func (*GenesisState) Descriptor

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

func (*GenesisState) GetAdmin

func (m *GenesisState) GetAdmin() string

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 MsgClient

type MsgClient interface {
	UpdateAdmin(ctx context.Context, in *MsgUpdateAdmin, opts ...grpc.CallOption) (*MsgUpdateAdminResponse, 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 {
	UpdateAdmin(context.Context, *MsgUpdateAdmin) (*MsgUpdateAdminResponse, error)
}

MsgServer is the server API for Msg service.

type MsgUpdateAdmin

type MsgUpdateAdmin struct {
	Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"`
	Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"`
}

func NewMsgUpdateAdmin

func NewMsgUpdateAdmin(creator sdk.AccAddress, address sdk.AccAddress) *MsgUpdateAdmin

func (*MsgUpdateAdmin) Descriptor

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

func (*MsgUpdateAdmin) GetAddress

func (m *MsgUpdateAdmin) GetAddress() string

func (*MsgUpdateAdmin) GetCreator

func (m *MsgUpdateAdmin) GetCreator() string

func (*MsgUpdateAdmin) GetSignBytes

func (msg *MsgUpdateAdmin) GetSignBytes() []byte

func (*MsgUpdateAdmin) GetSigners

func (msg *MsgUpdateAdmin) GetSigners() []sdk.AccAddress

func (*MsgUpdateAdmin) Marshal

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

func (*MsgUpdateAdmin) MarshalTo

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

func (*MsgUpdateAdmin) MarshalToSizedBuffer

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

func (*MsgUpdateAdmin) ProtoMessage

func (*MsgUpdateAdmin) ProtoMessage()

func (*MsgUpdateAdmin) Reset

func (m *MsgUpdateAdmin) Reset()

func (*MsgUpdateAdmin) Route

func (msg *MsgUpdateAdmin) Route() string

func (*MsgUpdateAdmin) Size

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

func (*MsgUpdateAdmin) String

func (m *MsgUpdateAdmin) String() string

func (*MsgUpdateAdmin) Type

func (msg *MsgUpdateAdmin) Type() string

func (*MsgUpdateAdmin) Unmarshal

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

func (*MsgUpdateAdmin) ValidateBasic

func (msg *MsgUpdateAdmin) ValidateBasic() error

func (*MsgUpdateAdmin) XXX_DiscardUnknown

func (m *MsgUpdateAdmin) XXX_DiscardUnknown()

func (*MsgUpdateAdmin) XXX_Marshal

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

func (*MsgUpdateAdmin) XXX_Merge

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

func (*MsgUpdateAdmin) XXX_Size

func (m *MsgUpdateAdmin) XXX_Size() int

func (*MsgUpdateAdmin) XXX_Unmarshal

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

type MsgUpdateAdminResponse

type MsgUpdateAdminResponse struct {
}

func (*MsgUpdateAdminResponse) Descriptor

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

func (*MsgUpdateAdminResponse) Marshal

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

func (*MsgUpdateAdminResponse) MarshalTo

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

func (*MsgUpdateAdminResponse) MarshalToSizedBuffer

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

func (*MsgUpdateAdminResponse) ProtoMessage

func (*MsgUpdateAdminResponse) ProtoMessage()

func (*MsgUpdateAdminResponse) Reset

func (m *MsgUpdateAdminResponse) Reset()

func (*MsgUpdateAdminResponse) Size

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

func (*MsgUpdateAdminResponse) String

func (m *MsgUpdateAdminResponse) String() string

func (*MsgUpdateAdminResponse) Unmarshal

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

func (*MsgUpdateAdminResponse) XXX_DiscardUnknown

func (m *MsgUpdateAdminResponse) XXX_DiscardUnknown()

func (*MsgUpdateAdminResponse) XXX_Marshal

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

func (*MsgUpdateAdminResponse) XXX_Merge

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

func (*MsgUpdateAdminResponse) XXX_Size

func (m *MsgUpdateAdminResponse) XXX_Size() int

func (*MsgUpdateAdminResponse) XXX_Unmarshal

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

type QueryAdminRequest

type QueryAdminRequest struct {
}

func (*QueryAdminRequest) Descriptor

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

func (*QueryAdminRequest) Marshal

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

func (*QueryAdminRequest) MarshalTo

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

func (*QueryAdminRequest) MarshalToSizedBuffer

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

func (*QueryAdminRequest) ProtoMessage

func (*QueryAdminRequest) ProtoMessage()

func (*QueryAdminRequest) Reset

func (m *QueryAdminRequest) Reset()

func (*QueryAdminRequest) Size

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

func (*QueryAdminRequest) String

func (m *QueryAdminRequest) String() string

func (*QueryAdminRequest) Unmarshal

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

func (*QueryAdminRequest) XXX_DiscardUnknown

func (m *QueryAdminRequest) XXX_DiscardUnknown()

func (*QueryAdminRequest) XXX_Marshal

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

func (*QueryAdminRequest) XXX_Merge

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

func (*QueryAdminRequest) XXX_Size

func (m *QueryAdminRequest) XXX_Size() int

func (*QueryAdminRequest) XXX_Unmarshal

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

type QueryAdminResponse

type QueryAdminResponse struct {
	Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
}

func (*QueryAdminResponse) Descriptor

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

func (*QueryAdminResponse) GetAddress

func (m *QueryAdminResponse) GetAddress() string

func (*QueryAdminResponse) Marshal

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

func (*QueryAdminResponse) MarshalTo

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

func (*QueryAdminResponse) MarshalToSizedBuffer

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

func (*QueryAdminResponse) ProtoMessage

func (*QueryAdminResponse) ProtoMessage()

func (*QueryAdminResponse) Reset

func (m *QueryAdminResponse) Reset()

func (*QueryAdminResponse) Size

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

func (*QueryAdminResponse) String

func (m *QueryAdminResponse) String() string

func (*QueryAdminResponse) Unmarshal

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

func (*QueryAdminResponse) XXX_DiscardUnknown

func (m *QueryAdminResponse) XXX_DiscardUnknown()

func (*QueryAdminResponse) XXX_Marshal

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

func (*QueryAdminResponse) XXX_Merge

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

func (*QueryAdminResponse) XXX_Size

func (m *QueryAdminResponse) XXX_Size() int

func (*QueryAdminResponse) XXX_Unmarshal

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

type QueryClient

type QueryClient interface {
	// Queries a list of admin items.
	Admin(ctx context.Context, in *QueryAdminRequest, opts ...grpc.CallOption) (*QueryAdminResponse, 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 {
	// Queries a list of admin items.
	Admin(context.Context, *QueryAdminRequest) (*QueryAdminResponse, 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) UpdateAdmin

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Admin

Jump to

Keyboard shortcuts

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