app

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2022 License: Apache-2.0 Imports: 39 Imported by: 0

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.Codec
	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() *baseapp.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(clientCtx client.Context, 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 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 QueryServiceTestHelper

type QueryServiceTestHelper struct {
	*GRPCQueryRouter
	Ctx sdk.Context
}

QueryServiceTestHelper provides a helper for making grpc query service rpc calls in unit tests. It implements both the grpc Server and ClientConn interfaces needed to register a query service server and create a query service client.

func NewQueryServerTestHelper

func NewQueryServerTestHelper(ctx sdk.Context, interfaceRegistry types.InterfaceRegistry) *QueryServiceTestHelper

NewQueryServerTestHelper creates a new QueryServiceTestHelper that wraps the provided sdk.Context

func (*QueryServiceTestHelper) Invoke

func (q *QueryServiceTestHelper) Invoke(_ gocontext.Context, method string, args, reply interface{}, _ ...grpc.CallOption) error

Invoke implements the grpc ClientConn.Invoke method

func (*QueryServiceTestHelper) NewStream

NewStream implements the grpc ClientConn.NewStream method

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

Jump to

Keyboard shortcuts

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