simulate

package
v0.40.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package simulate is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthSimulate        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSimulate          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupSimulate = fmt.Errorf("proto: unexpected end of group")
)

Functions

func RegisterSimulateServiceHandler

func RegisterSimulateServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterSimulateServiceHandler registers the http handlers for service SimulateService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterSimulateServiceHandlerClient

func RegisterSimulateServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client SimulateServiceClient) error

RegisterSimulateServiceHandlerClient registers the http handlers for service SimulateService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "SimulateServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "SimulateServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "SimulateServiceClient" to call the correct interceptors.

func RegisterSimulateServiceHandlerFromEndpoint

func RegisterSimulateServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterSimulateServiceHandlerFromEndpoint is same as RegisterSimulateServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterSimulateServiceHandlerServer

func RegisterSimulateServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server SimulateServiceServer) error

RegisterSimulateServiceHandlerServer registers the http handlers for service SimulateService to "mux". UnaryRPC :call SimulateServiceServer 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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterSimulateServiceHandlerFromEndpoint instead.

func RegisterSimulateServiceServer

func RegisterSimulateServiceServer(s grpc1.Server, srv SimulateServiceServer)

Types

type BaseAppSimulateFn

type BaseAppSimulateFn func(txBytes []byte) (sdk.GasInfo, *sdk.Result, error)

BaseAppSimulateFn is the signature of the Baseapp#Simulate function.

type SimulateRequest

type SimulateRequest struct {
	// tx is the transaction to simulate.
	Tx *tx.Tx `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"`
}

SimulateRequest is the request type for the SimulateServiceService.Simulate RPC method.

func (*SimulateRequest) Descriptor

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

func (*SimulateRequest) GetTx

func (m *SimulateRequest) GetTx() *tx.Tx

func (*SimulateRequest) Marshal

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

func (*SimulateRequest) MarshalTo

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

func (*SimulateRequest) MarshalToSizedBuffer

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

func (*SimulateRequest) ProtoMessage

func (*SimulateRequest) ProtoMessage()

func (*SimulateRequest) Reset

func (m *SimulateRequest) Reset()

func (*SimulateRequest) Size

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

func (*SimulateRequest) String

func (m *SimulateRequest) String() string

func (*SimulateRequest) Unmarshal

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

func (*SimulateRequest) XXX_DiscardUnknown

func (m *SimulateRequest) XXX_DiscardUnknown()

func (*SimulateRequest) XXX_Marshal

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

func (*SimulateRequest) XXX_Merge

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

func (*SimulateRequest) XXX_Size

func (m *SimulateRequest) XXX_Size() int

func (*SimulateRequest) XXX_Unmarshal

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

type SimulateResponse

type SimulateResponse struct {
	// gas_info is the information about gas used in the simulation.
	GasInfo *types.GasInfo `protobuf:"bytes,1,opt,name=gas_info,json=gasInfo,proto3" json:"gas_info,omitempty"`
	// result is the result of the simulation.
	Result *types.Result `protobuf:"bytes,2,opt,name=result,proto3" json:"result,omitempty"`
}

SimulateResponse is the response type for the SimulateServiceService.SimulateRPC method.

func (*SimulateResponse) Descriptor

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

func (*SimulateResponse) GetGasInfo

func (m *SimulateResponse) GetGasInfo() *types.GasInfo

func (*SimulateResponse) GetResult

func (m *SimulateResponse) GetResult() *types.Result

func (*SimulateResponse) Marshal

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

func (*SimulateResponse) MarshalTo

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

func (*SimulateResponse) MarshalToSizedBuffer

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

func (*SimulateResponse) ProtoMessage

func (*SimulateResponse) ProtoMessage()

func (*SimulateResponse) Reset

func (m *SimulateResponse) Reset()

func (*SimulateResponse) Size

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

func (*SimulateResponse) String

func (m *SimulateResponse) String() string

func (*SimulateResponse) Unmarshal

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

func (*SimulateResponse) XXX_DiscardUnknown

func (m *SimulateResponse) XXX_DiscardUnknown()

func (*SimulateResponse) XXX_Marshal

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

func (*SimulateResponse) XXX_Merge

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

func (*SimulateResponse) XXX_Size

func (m *SimulateResponse) XXX_Size() int

func (*SimulateResponse) XXX_Unmarshal

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

type SimulateServiceClient

type SimulateServiceClient interface {
	// Simulate simulates executing a transaction for estimating gas usage.
	Simulate(ctx context.Context, in *SimulateRequest, opts ...grpc.CallOption) (*SimulateResponse, error)
}

SimulateServiceClient is the client API for SimulateService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewSimulateServiceClient

func NewSimulateServiceClient(cc grpc1.ClientConn) SimulateServiceClient

type SimulateServiceServer

type SimulateServiceServer interface {
	// Simulate simulates executing a transaction for estimating gas usage.
	Simulate(context.Context, *SimulateRequest) (*SimulateResponse, error)
}

SimulateServiceServer is the server API for SimulateService service.

func NewSimulateServer

func NewSimulateServer(simulate BaseAppSimulateFn, interfaceRegistry codectypes.InterfaceRegistry) SimulateServiceServer

NewSimulateServer creates a new SimulateServer.

type UnimplementedSimulateServiceServer

type UnimplementedSimulateServiceServer struct {
}

UnimplementedSimulateServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedSimulateServiceServer) Simulate

Jump to

Keyboard shortcuts

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