app

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2021 License: Apache-2.0 Imports: 34 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)
View Source
var JSONTxDecoder = tx.DefaultJSONTxDecoder

Functions

This section is empty.

Types

type AnteHandlerProvider

type AnteHandlerProvider func(
	ibcKeeper ibckeeper.Keeper,
	sigGasConsumer ante.SignatureVerificationGasConsumer,
) sdk.AnteHandler

AnteHandlerProvider provides an anteHandler

type Application

type Application interface {
	InitChain(appStateBytes []byte) error
	RunTx(stub shim.ChaincodeStubInterface, txBytes []byte) (result *sdk.Result, err error)
	Query(req abci.RequestQuery) abci.ResponseQuery

	MakeCacheContext(header tmproto.Header) (ctx sdk.Context, writer func())
	AppCodec() codec.Marshaler
	GetIBCKeeper() ibckeeper.Keeper
}

type BaseApp

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

func NewBaseApp

func NewBaseApp(
	name string, logger log.Logger, db dbm.DB, txDecoder sdk.TxDecoder,
) *BaseApp

func (BaseApp) BlockProvider

func (app BaseApp) BlockProvider() BlockProvider

func (*BaseApp) GRPCQueryRouter

func (app *BaseApp) GRPCQueryRouter() *GRPCQueryRouter

GRPCQueryRouter returns the GRPCQueryRouter of a BaseApp.

func (*BaseApp) InitChain

func (app *BaseApp) InitChain(appStateBytes []byte) error

func (*BaseApp) IsSealed

func (app *BaseApp) IsSealed() bool

IsSealed returns true if the BaseApp is sealed and false otherwise.

func (*BaseApp) LoadLatestVersion

func (app *BaseApp) LoadLatestVersion() error

func (*BaseApp) Logger

func (app *BaseApp) Logger() log.Logger

Logger returns the logger of the BaseApp.

func (*BaseApp) MakeCacheContext

func (app *BaseApp) MakeCacheContext(header tmproto.Header) (ctx sdk.Context, writer func())

func (*BaseApp) MountKVStores

func (app *BaseApp) MountKVStores(keys map[string]*sdk.KVStoreKey)

MountStores mounts all IAVL or DB stores to the provided keys in the BaseApp multistore.

func (*BaseApp) MountMemoryStores

func (app *BaseApp) MountMemoryStores(keys map[string]*sdk.MemoryStoreKey)

MountMemoryStores mounts all in-memory KVStores with the BaseApp's internal commit multi-store.

func (*BaseApp) MountStore

func (app *BaseApp) MountStore(key sdk.StoreKey, typ sdk.StoreType)

MountStore mounts a store to the provided key in the BaseApp multistore, using the default DB.

func (*BaseApp) MountStoreWithDB

func (app *BaseApp) MountStoreWithDB(key sdk.StoreKey, typ sdk.StoreType, db dbm.DB)

MountStoreWithDB mounts a store to the provided key in the BaseApp multistore, using a specified DB.

func (*BaseApp) MountTransientStores

func (app *BaseApp) MountTransientStores(keys map[string]*sdk.TransientStoreKey)

MountStores mounts all IAVL or DB stores to the provided keys in the BaseApp multistore.

func (*BaseApp) MsgServiceRouter

func (app *BaseApp) MsgServiceRouter() *MsgServiceRouter

MsgServiceRouter returns the MsgServiceRouter of a BaseApp.

func (*BaseApp) Name

func (app *BaseApp) Name() string

Name returns the name of the BaseApp.

func (*BaseApp) Query

func (app *BaseApp) Query(req abci.RequestQuery) abci.ResponseQuery

Query implements the ABCI interface. It delegates to CommitMultiStore if it implements Queryable.

func (*BaseApp) QueryRouter

func (app *BaseApp) QueryRouter() sdk.QueryRouter

QueryRouter returns the QueryRouter of a BaseApp.

func (*BaseApp) RegisterGRPCServer

func (app *BaseApp) RegisterGRPCServer(server gogogrpc.Server)

RegisterGRPCServer registers gRPC services directly with the gRPC server.

func (*BaseApp) Router

func (app *BaseApp) Router() sdk.Router

Router returns the router of the BaseApp.

func (*BaseApp) RunTx

func (app *BaseApp) RunTx(stub shim.ChaincodeStubInterface, txBytes []byte) (result *sdk.Result, err error)

func (*BaseApp) Seal

func (app *BaseApp) Seal()

Seal seals a BaseApp. It prohibits any further modifications to a BaseApp.

func (*BaseApp) SetAnteHandler

func (app *BaseApp) SetAnteHandler(ah sdk.AnteHandler)

func (*BaseApp) SetBlockProvider

func (app *BaseApp) SetBlockProvider(blockProvider BlockProvider)

func (*BaseApp) SetInitChainer

func (app *BaseApp) SetInitChainer(initChainer InitChainer)

func (*BaseApp) SetInterfaceRegistry

func (app *BaseApp) SetInterfaceRegistry(registry types.InterfaceRegistry)

SetInterfaceRegistry sets the InterfaceRegistry.

func (*BaseApp) SetParamStore

func (app *BaseApp) SetParamStore(ps ParamStore)

SetParamStore sets a parameter store on the BaseApp.

func (*BaseApp) SetRouter

func (app *BaseApp) SetRouter(router sdk.Router)

SetRouter allows us to customize the router.

type Block

type Block interface {
	Height() int64
	Timestamp() int64
}

type BlockProvider

type BlockProvider func() Block

type GRPCQueryHandler

type GRPCQueryHandler = func(ctx sdk.Context, req abci.RequestQuery) (abci.ResponseQuery, error)

GRPCQueryHandler defines a function type which handles ABCI Query requests using gRPC

type GRPCQueryRouter

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

GRPCQueryRouter routes ABCI Query requests to GRPC handlers

func NewGRPCQueryRouter

func NewGRPCQueryRouter() *GRPCQueryRouter

NewGRPCQueryRouter creates a new GRPCQueryRouter

func (*GRPCQueryRouter) RegisterService

func (qrt *GRPCQueryRouter) RegisterService(sd *grpc.ServiceDesc, handler interface{})

RegisterService implements the gRPC Server.RegisterService method. sd is a gRPC service description, handler is an object which implements that gRPC service/

This functions PANICS: - if a protobuf service is registered twice.

func (*GRPCQueryRouter) Route

func (qrt *GRPCQueryRouter) Route(path string) GRPCQueryHandler

Route returns the GRPCQueryHandler for a given query route path or nil if not found

func (*GRPCQueryRouter) SetInterfaceRegistry

func (qrt *GRPCQueryRouter) SetInterfaceRegistry(interfaceRegistry codectypes.InterfaceRegistry)

SetInterfaceRegistry sets the interface registry for the router. This will also register the interface reflection gRPC service.

type InitChainer

type InitChainer func(ctx sdk.Context, appStateBytes []byte) error

type MsgServiceHandler

type MsgServiceHandler = func(ctx sdk.Context, req sdk.MsgRequest) (*sdk.Result, error)

MsgServiceHandler defines a function type which handles Msg service message.

type MsgServiceRouter

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

MsgServiceRouter routes fully-qualified Msg service methods to their handler.

func NewMsgServiceRouter

func NewMsgServiceRouter() *MsgServiceRouter

NewMsgServiceRouter creates a new MsgServiceRouter.

func (*MsgServiceRouter) Handler

func (msr *MsgServiceRouter) Handler(methodName string) MsgServiceHandler

Handler returns the MsgServiceHandler for a given query route path or nil if not found.

func (*MsgServiceRouter) RegisterService

func (msr *MsgServiceRouter) RegisterService(sd *grpc.ServiceDesc, handler interface{})

RegisterService implements the gRPC Server.RegisterService method. sd is a gRPC service description, handler is an object which implements that gRPC service.

This function PANICs:

  • if it is called before the service `Msg`s have been registered using RegisterInterfaces,
  • or if a service is being registered twice.

func (*MsgServiceRouter) SetInterfaceRegistry

func (msr *MsgServiceRouter) SetInterfaceRegistry(interfaceRegistry codectypes.InterfaceRegistry)

SetInterfaceRegistry sets the interface registry for the router.

type ParamStore

type ParamStore interface {
	Get(ctx sdk.Context, key []byte, ptr interface{})
	Has(ctx sdk.Context, key []byte) bool
	Set(ctx sdk.Context, key []byte, param interface{})
}

ParamStore defines the interface the parameter store used by the BaseApp must fulfill.

type QueryRouter

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

func NewQueryRouter

func NewQueryRouter() *QueryRouter

NewQueryRouter returns a reference to a new QueryRouter.

func (*QueryRouter) AddRoute

func (qrt *QueryRouter) AddRoute(path string, q sdk.Querier) sdk.QueryRouter

AddRoute adds a query path to the router with a given Querier. It will panic if a duplicate route is given. The route must be alphanumeric.

func (*QueryRouter) Route

func (qrt *QueryRouter) Route(path string) sdk.Querier

Route returns the Querier for a given query route path.

type RequestQuery

type RequestQuery struct {
	Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data"`
	Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path"`
}

func (*RequestQuery) Descriptor

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

func (*RequestQuery) GetData

func (m *RequestQuery) GetData() string

func (*RequestQuery) GetPath

func (m *RequestQuery) GetPath() string

func (*RequestQuery) Marshal

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

func (*RequestQuery) MarshalTo

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

func (*RequestQuery) MarshalToSizedBuffer

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

func (*RequestQuery) ProtoMessage

func (*RequestQuery) ProtoMessage()

func (*RequestQuery) Reset

func (m *RequestQuery) Reset()

func (*RequestQuery) Size

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

func (*RequestQuery) String

func (m *RequestQuery) String() string

func (*RequestQuery) Unmarshal

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

func (*RequestQuery) XXX_DiscardUnknown

func (m *RequestQuery) XXX_DiscardUnknown()

func (*RequestQuery) XXX_Marshal

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

func (*RequestQuery) XXX_Merge

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

func (*RequestQuery) XXX_Size

func (m *RequestQuery) XXX_Size() int

func (*RequestQuery) XXX_Unmarshal

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

type ResponseQuery

type ResponseQuery struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value"`
}

func (*ResponseQuery) Descriptor

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

func (*ResponseQuery) GetKey

func (m *ResponseQuery) GetKey() string

func (*ResponseQuery) GetValue

func (m *ResponseQuery) GetValue() string

func (*ResponseQuery) Marshal

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

func (*ResponseQuery) MarshalTo

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

func (*ResponseQuery) MarshalToSizedBuffer

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

func (*ResponseQuery) ProtoMessage

func (*ResponseQuery) ProtoMessage()

func (*ResponseQuery) Reset

func (m *ResponseQuery) Reset()

func (*ResponseQuery) Size

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

func (*ResponseQuery) String

func (m *ResponseQuery) String() string

func (*ResponseQuery) Unmarshal

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

func (*ResponseQuery) XXX_DiscardUnknown

func (m *ResponseQuery) XXX_DiscardUnknown()

func (*ResponseQuery) XXX_Marshal

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

func (*ResponseQuery) XXX_Merge

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

func (*ResponseQuery) XXX_Size

func (m *ResponseQuery) XXX_Size() int

func (*ResponseQuery) XXX_Unmarshal

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

type ResponseTx

type ResponseTx struct {
	Data   string `protobuf:"bytes,1,opt,name=data,proto3" json:"data"`
	Log    string `protobuf:"bytes,2,opt,name=log,proto3" json:"log"`
	Events string `protobuf:"bytes,3,opt,name=events,proto3" json:"events"`
}

func (*ResponseTx) Descriptor

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

func (*ResponseTx) GetData

func (m *ResponseTx) GetData() string

func (*ResponseTx) GetEvents

func (m *ResponseTx) GetEvents() string

func (*ResponseTx) GetLog

func (m *ResponseTx) GetLog() string

func (*ResponseTx) Marshal

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

func (*ResponseTx) MarshalTo

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

func (*ResponseTx) MarshalToSizedBuffer

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

func (*ResponseTx) ProtoMessage

func (*ResponseTx) ProtoMessage()

func (*ResponseTx) Reset

func (m *ResponseTx) Reset()

func (*ResponseTx) Size

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

func (*ResponseTx) String

func (m *ResponseTx) String() string

func (*ResponseTx) Unmarshal

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

func (*ResponseTx) XXX_DiscardUnknown

func (m *ResponseTx) XXX_DiscardUnknown()

func (*ResponseTx) XXX_Marshal

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

func (*ResponseTx) XXX_Merge

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

func (*ResponseTx) XXX_Size

func (m *ResponseTx) XXX_Size() int

func (*ResponseTx) XXX_Unmarshal

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

type Router

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

func NewRouter

func NewRouter() *Router

NewRouter returns a reference to a new router.

func (*Router) AddRoute

func (rtr *Router) AddRoute(route sdk.Route) sdk.Router

AddRoute adds a route path to the router with a given handler. The route must be alphanumeric.

func (*Router) Route

func (rtr *Router) Route(_ sdk.Context, path string) sdk.Handler

Route returns a handler for a given route path.

TODO: Handle expressive matches.

Jump to

Keyboard shortcuts

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