tx

package
v3.3.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package tx is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthService        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowService          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupService = fmt.Errorf("proto: unexpected end of group")
)

Functions

func RegisterGRPCGatewayRoutes

func RegisterGRPCGatewayRoutes(clientConn gogogrpc.ClientConn, mux *runtime.ServeMux)

RegisterGRPCGatewayRoutes mounts the tx service's GRPC-gateway routes on the given Mux.

func RegisterServiceHandler

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

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

func RegisterServiceHandlerClient

func RegisterServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ServiceClient) error

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

func RegisterServiceHandlerFromEndpoint

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

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

func RegisterServiceHandlerServer

func RegisterServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ServiceServer) error

RegisterServiceHandlerServer registers the http handlers for service Service to "mux". UnaryRPC :call ServiceServer 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 RegisterServiceHandlerFromEndpoint instead.

func RegisterServiceServer

func RegisterServiceServer(s grpc1.Server, srv ServiceServer)

func RegisterTxService

func RegisterTxService(
	qrt gogogrpc.Server,
	clientCtx client.Context,
	treasuryKeeper customante.TreasuryKeeper,
	taxKeeper customante.TaxKeeper,
)

RegisterTxService registers the tx service on the gRPC router.

Types

type ComputeTaxRequest

type ComputeTaxRequest struct {
	// tx is the transaction to simulate.
	// Deprecated. Send raw tx bytes instead.
	Tx *tx.Tx `protobuf:"bytes,1,opt,name=tx,proto3" json:"tx,omitempty"` // Deprecated: Do not use.
	// tx_bytes is the raw transaction.
	TxBytes []byte `protobuf:"bytes,2,opt,name=tx_bytes,json=txBytes,proto3" json:"tx_bytes,omitempty"`
}

ComputeTaxRequest is the request type for the Service.ComputeTax RPC method.

func (*ComputeTaxRequest) Descriptor

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

func (*ComputeTaxRequest) GetTx deprecated

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

Deprecated: Do not use.

func (*ComputeTaxRequest) GetTxBytes

func (m *ComputeTaxRequest) GetTxBytes() []byte

func (*ComputeTaxRequest) Marshal

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

func (*ComputeTaxRequest) MarshalTo

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

func (*ComputeTaxRequest) MarshalToSizedBuffer

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

func (*ComputeTaxRequest) ProtoMessage

func (*ComputeTaxRequest) ProtoMessage()

func (*ComputeTaxRequest) Reset

func (m *ComputeTaxRequest) Reset()

func (*ComputeTaxRequest) Size

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

func (*ComputeTaxRequest) String

func (m *ComputeTaxRequest) String() string

func (*ComputeTaxRequest) Unmarshal

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

func (ComputeTaxRequest) UnpackInterfaces

func (m ComputeTaxRequest) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error

UnpackInterfaces implements the UnpackInterfacesMessage interface.

func (*ComputeTaxRequest) XXX_DiscardUnknown

func (m *ComputeTaxRequest) XXX_DiscardUnknown()

func (*ComputeTaxRequest) XXX_Marshal

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

func (*ComputeTaxRequest) XXX_Merge

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

func (*ComputeTaxRequest) XXX_Size

func (m *ComputeTaxRequest) XXX_Size() int

func (*ComputeTaxRequest) XXX_Unmarshal

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

type ComputeTaxResponse

type ComputeTaxResponse struct {
	// amount is the amount of coins to be paid as a fee
	TaxAmount github_com_cosmos_cosmos_sdk_types.Coins `` /* 132-byte string literal not displayed */
}

ComputeTaxResponse is the response type for the Service.ComputeTax RPC method.

func (*ComputeTaxResponse) Descriptor

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

func (*ComputeTaxResponse) GetTaxAmount

func (*ComputeTaxResponse) Marshal

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

func (*ComputeTaxResponse) MarshalTo

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

func (*ComputeTaxResponse) MarshalToSizedBuffer

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

func (*ComputeTaxResponse) ProtoMessage

func (*ComputeTaxResponse) ProtoMessage()

func (*ComputeTaxResponse) Reset

func (m *ComputeTaxResponse) Reset()

func (*ComputeTaxResponse) Size

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

func (*ComputeTaxResponse) String

func (m *ComputeTaxResponse) String() string

func (*ComputeTaxResponse) Unmarshal

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

func (*ComputeTaxResponse) XXX_DiscardUnknown

func (m *ComputeTaxResponse) XXX_DiscardUnknown()

func (*ComputeTaxResponse) XXX_Marshal

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

func (*ComputeTaxResponse) XXX_Merge

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

func (*ComputeTaxResponse) XXX_Size

func (m *ComputeTaxResponse) XXX_Size() int

func (*ComputeTaxResponse) XXX_Unmarshal

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

type ServiceClient

type ServiceClient interface {
	// EstimateFee simulates executing a transaction for estimating gas usage.
	ComputeTax(ctx context.Context, in *ComputeTaxRequest, opts ...grpc.CallOption) (*ComputeTaxResponse, error)
}

ServiceClient is the client API for Service service.

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

func NewServiceClient

func NewServiceClient(cc grpc1.ClientConn) ServiceClient

type ServiceServer

type ServiceServer interface {
	// EstimateFee simulates executing a transaction for estimating gas usage.
	ComputeTax(context.Context, *ComputeTaxRequest) (*ComputeTaxResponse, error)
}

ServiceServer is the server API for Service service.

func NewTxServer

func NewTxServer(clientCtx client.Context, treasuryKeeper customante.TreasuryKeeper, taxKeeper customante.TaxKeeper) ServiceServer

NewTxServer creates a new Tx service server.

type UnimplementedServiceServer

type UnimplementedServiceServer struct {
}

UnimplementedServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedServiceServer) ComputeTax

Jump to

Keyboard shortcuts

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