minfee

package
v3.0.0-...-628fb99 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2024 License: Apache-2.0 Imports: 32 Imported by: 0

README

x/minfee

Abstract

The x/minfee module is responsible for managing the gov-modifiable parameter NetworkMinGasPrice introduced in app version 2. NetworkMinGasPrice ensures that all transactions adhere to this network minimum threshold, which is set in the genesis file and can be updated via governance proposals.

Resources

  1. https://github.com/celestiaorg/CIPs/blob/main/cips/cip-6.md

Documentation

Overview

Package minfee is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const ModuleName = "minfee"

Variables

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 (
	KeyNetworkMinGasPrice     = []byte("NetworkMinGasPrice")
	DefaultNetworkMinGasPrice sdk.Dec
)
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")
)

Functions

func ParamKeyTable

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable returns the param key table for the minfee module.

func RegisterMinFeeParamTable

func RegisterMinFeeParamTable(subspace paramtypes.Subspace) paramtypes.Subspace

RegisterMinFeeParamTable returns a subspace with a key table attached.

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)

func ValidateGenesis

func ValidateGenesis(genesis *GenesisState) error

ValidateGenesis performs basic validation of genesis data returning an error for any failed validation criteria.

func ValidateMinGasPrice

func ValidateMinGasPrice(i interface{}) error

Validate validates the param type

Types

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

AppModule implements an application module for the minfee module.

func NewAppModule

func NewAppModule(k params.Keeper) AppModule

NewAppModule creates a new AppModule object

func (AppModule) BeginBlock

func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)

BeginBlock returns the begin blocker for the minfee module.

func (AppModule) ConsensusVersion

func (AppModule) ConsensusVersion() uint64

ConsensusVersion implements AppModule/ConsensusVersion.

func (AppModule) EndBlock

EndBlock returns the end blocker for the minfee module. It returns no validator updates.

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage

ExportGenesis returns the exported genesis state as raw bytes for the minfee module.

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate

InitGenesis performs genesis initialization for the minfee module. It returns no validator updates.

func (AppModule) LegacyQuerierHandler

func (am AppModule) LegacyQuerierHandler(_ *codec.LegacyAmino) sdk.Querier

LegacyQuerierHandler returns the minfee module's Querier.

func (AppModule) QuerierRoute

func (am AppModule) QuerierRoute() string

QuerierRoute returns the minfee module's querier route name.

func (AppModule) RegisterInvariants

func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry)

RegisterInvariants registers the minfee module invariants.

func (AppModule) RegisterServices

func (am AppModule) RegisterServices(cfg sdkmodule.Configurator)

RegisterServices registers module services.

func (AppModule) Route

func (am AppModule) Route() sdk.Route

Route returns the message routing key for the minfee module.

type AppModuleBasic

type AppModuleBasic struct{}

AppModuleBasic defines the basic application module used by the minfee module.

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage

DefaultGenesis returns default genesis state as raw bytes for the minfee module.

func (AppModuleBasic) GetQueryCmd

func (AppModuleBasic) GetQueryCmd() *cobra.Command

GetQueryCmd returns the a dummy command.

func (AppModuleBasic) GetTxCmd

func (a AppModuleBasic) GetTxCmd() *cobra.Command

GetTxCmd returns the minfee module's root tx command.

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

Name returns the minfee module's name.

func (AppModuleBasic) RegisterGRPCGatewayRoutes

func (AppModuleBasic) RegisterGRPCGatewayRoutes(_ client.Context, _ *runtime.ServeMux)

RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module.

func (AppModuleBasic) RegisterInterfaces

func (AppModuleBasic) RegisterInterfaces(_ cdctypes.InterfaceRegistry)

RegisterInterfaces registers the module's interfaces with the interface registry.

func (AppModuleBasic) RegisterLegacyAminoCodec

func (AppModuleBasic) RegisterLegacyAminoCodec(*codec.LegacyAmino)

RegisterLegacyAminoCodec does nothing. MinFee doesn't use Amino.

func (AppModuleBasic) RegisterRESTRoutes

func (AppModuleBasic) RegisterRESTRoutes(_ client.Context, _ *mux.Router)

RegisterRESTRoutes registers the REST service handlers for the module.

func (AppModuleBasic) ValidateGenesis

ValidateGenesis performs genesis state validation for the minfee module.

type GenesisState

type GenesisState struct {
	NetworkMinGasPrice github_com_cosmos_cosmos_sdk_types.Dec `` /* 159-byte string literal not displayed */
}

GenesisState defines the minfee module's genesis state.

func DefaultGenesis

func DefaultGenesis() *GenesisState

DefaultGenesis returns the default genesis state.

func ExportGenesis

func ExportGenesis(ctx sdk.Context, k params.Keeper) *GenesisState

ExportGenesis returns the minfee module's exported genesis.

func (*GenesisState) Descriptor

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

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) 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 Params

type Params struct {
	NetworkMinGasPrice sdk.Dec
}

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs

ParamSetPairs gets the param key-value pair

type QueryClient

type QueryClient interface {
	// NetworkMinGasPrice queries the network wide minimum gas price.
	NetworkMinGasPrice(ctx context.Context, in *QueryNetworkMinGasPrice, opts ...grpc.CallOption) (*QueryNetworkMinGasPriceResponse, 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 QueryNetworkMinGasPrice

type QueryNetworkMinGasPrice struct {
}

QueryNetworkMinGasPrice is the request type for the Query/NetworkMinGasPrice RPC method.

func (*QueryNetworkMinGasPrice) Descriptor

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

func (*QueryNetworkMinGasPrice) Marshal

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

func (*QueryNetworkMinGasPrice) MarshalTo

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

func (*QueryNetworkMinGasPrice) MarshalToSizedBuffer

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

func (*QueryNetworkMinGasPrice) ProtoMessage

func (*QueryNetworkMinGasPrice) ProtoMessage()

func (*QueryNetworkMinGasPrice) Reset

func (m *QueryNetworkMinGasPrice) Reset()

func (*QueryNetworkMinGasPrice) Size

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

func (*QueryNetworkMinGasPrice) String

func (m *QueryNetworkMinGasPrice) String() string

func (*QueryNetworkMinGasPrice) Unmarshal

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

func (*QueryNetworkMinGasPrice) XXX_DiscardUnknown

func (m *QueryNetworkMinGasPrice) XXX_DiscardUnknown()

func (*QueryNetworkMinGasPrice) XXX_Marshal

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

func (*QueryNetworkMinGasPrice) XXX_Merge

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

func (*QueryNetworkMinGasPrice) XXX_Size

func (m *QueryNetworkMinGasPrice) XXX_Size() int

func (*QueryNetworkMinGasPrice) XXX_Unmarshal

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

type QueryNetworkMinGasPriceResponse

type QueryNetworkMinGasPriceResponse struct {
	NetworkMinGasPrice github_com_cosmos_cosmos_sdk_types.Dec `` /* 159-byte string literal not displayed */
}

QueryNetworkMinGasPriceResponse is the response type for Query/NetworkMinGasPrice RPC method.

func (*QueryNetworkMinGasPriceResponse) Descriptor

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

func (*QueryNetworkMinGasPriceResponse) Marshal

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

func (*QueryNetworkMinGasPriceResponse) MarshalTo

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

func (*QueryNetworkMinGasPriceResponse) MarshalToSizedBuffer

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

func (*QueryNetworkMinGasPriceResponse) ProtoMessage

func (*QueryNetworkMinGasPriceResponse) ProtoMessage()

func (*QueryNetworkMinGasPriceResponse) Reset

func (*QueryNetworkMinGasPriceResponse) Size

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

func (*QueryNetworkMinGasPriceResponse) String

func (*QueryNetworkMinGasPriceResponse) Unmarshal

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

func (*QueryNetworkMinGasPriceResponse) XXX_DiscardUnknown

func (m *QueryNetworkMinGasPriceResponse) XXX_DiscardUnknown()

func (*QueryNetworkMinGasPriceResponse) XXX_Marshal

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

func (*QueryNetworkMinGasPriceResponse) XXX_Merge

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

func (*QueryNetworkMinGasPriceResponse) XXX_Size

func (m *QueryNetworkMinGasPriceResponse) XXX_Size() int

func (*QueryNetworkMinGasPriceResponse) XXX_Unmarshal

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

type QueryServer

type QueryServer interface {
	// NetworkMinGasPrice queries the network wide minimum gas price.
	NetworkMinGasPrice(context.Context, *QueryNetworkMinGasPrice) (*QueryNetworkMinGasPriceResponse, error)
}

QueryServer is the server API for Query service.

type QueryServerImpl

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

QueryServerImpl wraps the params keeper and implements the minfee gRPC query server.

func NewQueryServerImpl

func NewQueryServerImpl(paramsKeeper keeper.Keeper) *QueryServerImpl

NewQueryServerImpl creates a new QueryServerImpl.

func (*QueryServerImpl) NetworkMinGasPrice

NetworkMinGasPrice returns the network minimum gas price.

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) NetworkMinGasPrice

Jump to

Keyboard shortcuts

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