types

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: LGPL-3.0 Imports: 21 Imported by: 2

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	EventTypeFeeMarket = "fee_market"

	AttributeKeyBaseFee = "base_fee"
)

feemarket module events

View Source
const (
	// ModuleName string name of module
	ModuleName = "feemarket"

	// StoreKey key for base fee and block gas used.
	// The Fee Market module should use a prefix store.
	StoreKey = ModuleName

	// RouterKey uses module name for routing
	RouterKey = ModuleName
)

Variables

View Source
var (
	ErrInvalidLengthFeemarket        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowFeemarket          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupFeemarket = fmt.Errorf("proto: unexpected end of group")
)
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 (
	ParamStoreKeyNoBaseFee                = []byte("NoBaseFee")
	ParamStoreKeyBaseFeeChangeDenominator = []byte("BaseFeeChangeDenominator")
	ParamStoreKeyElasticityMultiplier     = []byte("ElasticityMultiplier")
	ParamStoreKeyBaseFee                  = []byte("BaseFee")
	ParamStoreKeyEnableHeight             = []byte("EnableHeight")
)

Parameter keys

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")
)
View Source
var (
	KeyPrefixBlockGasUsed = []byte{prefixBlockGasUsed}
)

KVStore key prefixes

Functions

func ParamKeyTable

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable returns the parameter key table.

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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type GenesisState

type GenesisState struct {
	// params defines all the paramaters of the module.
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
	// block gas is the amount of gas used on the last block before the upgrade.
	// Zero by default.
	BlockGas uint64 `protobuf:"varint,3,opt,name=block_gas,json=blockGas,proto3" json:"block_gas,omitempty"`
}

GenesisState defines the feemarket module's genesis state.

func DefaultGenesisState

func DefaultGenesisState() *GenesisState

DefaultGenesisState sets default fee market genesis state.

func NewGenesisState

func NewGenesisState(params Params, blockGas uint64) *GenesisState

NewGenesisState creates a new genesis state.

func (*GenesisState) Descriptor

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

func (*GenesisState) GetBlockGas

func (m *GenesisState) GetBlockGas() uint64

func (*GenesisState) GetParams

func (m *GenesisState) GetParams() Params

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

func (gs GenesisState) Validate() error

Validate performs basic genesis state validation returning an error upon any failure.

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 {
	// no base fee forces the EIP-1559 base fee to 0 (needed for 0 price calls)
	NoBaseFee bool `protobuf:"varint,1,opt,name=no_base_fee,json=noBaseFee,proto3" json:"no_base_fee,omitempty"`
	// base fee change denominator bounds the amount the base fee can change
	// between blocks.
	BaseFeeChangeDenominator uint32 `` /* 138-byte string literal not displayed */
	// elasticity multiplier bounds the maximum gas limit an EIP-1559 block may
	// have.
	ElasticityMultiplier uint32 `protobuf:"varint,3,opt,name=elasticity_multiplier,json=elasticityMultiplier,proto3" json:"elasticity_multiplier,omitempty"`
	// height at which the base fee calculation is enabled.
	EnableHeight int64 `protobuf:"varint,5,opt,name=enable_height,json=enableHeight,proto3" json:"enable_height,omitempty"`
	// base fee for EIP-1559 blocks.
	BaseFee github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=base_fee,json=baseFee,proto3,customtype=github.com/reapchain/cosmos-sdk/types.Int" json:"base_fee"`
}

Params defines the EVM module parameters

func DefaultParams

func DefaultParams() Params

DefaultParams returns default evm parameters

func NewParams

func NewParams(noBaseFee bool, baseFeeChangeDenom, elasticityMultiplier uint32, baseFee uint64, enableHeight int64) Params

NewParams creates a new Params instance

func (*Params) Descriptor

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

func (*Params) GetBaseFeeChangeDenominator

func (m *Params) GetBaseFeeChangeDenominator() uint32

func (*Params) GetElasticityMultiplier

func (m *Params) GetElasticityMultiplier() uint32

func (*Params) GetEnableHeight

func (m *Params) GetEnableHeight() int64

func (*Params) GetNoBaseFee

func (m *Params) GetNoBaseFee() bool

func (*Params) IsBaseFeeEnabled

func (p *Params) IsBaseFeeEnabled(height int64) bool

func (*Params) Marshal

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

func (*Params) MarshalTo

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

func (*Params) MarshalToSizedBuffer

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

func (*Params) ParamSetPairs

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

ParamSetPairs returns the parameter set pairs.

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) Size

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

func (*Params) String

func (m *Params) String() string

func (*Params) Unmarshal

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

func (Params) Validate

func (p Params) Validate() error

Validate performs basic validation on fee market parameters.

func (*Params) XXX_DiscardUnknown

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal

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

func (*Params) XXX_Merge

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

func (*Params) XXX_Size

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal

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

type QueryBaseFeeRequest

type QueryBaseFeeRequest struct {
}

QueryBaseFeeRequest defines the request type for querying the EIP1559 base fee.

func (*QueryBaseFeeRequest) Descriptor

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

func (*QueryBaseFeeRequest) Marshal

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

func (*QueryBaseFeeRequest) MarshalTo

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

func (*QueryBaseFeeRequest) MarshalToSizedBuffer

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

func (*QueryBaseFeeRequest) ProtoMessage

func (*QueryBaseFeeRequest) ProtoMessage()

func (*QueryBaseFeeRequest) Reset

func (m *QueryBaseFeeRequest) Reset()

func (*QueryBaseFeeRequest) Size

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

func (*QueryBaseFeeRequest) String

func (m *QueryBaseFeeRequest) String() string

func (*QueryBaseFeeRequest) Unmarshal

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

func (*QueryBaseFeeRequest) XXX_DiscardUnknown

func (m *QueryBaseFeeRequest) XXX_DiscardUnknown()

func (*QueryBaseFeeRequest) XXX_Marshal

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

func (*QueryBaseFeeRequest) XXX_Merge

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

func (*QueryBaseFeeRequest) XXX_Size

func (m *QueryBaseFeeRequest) XXX_Size() int

func (*QueryBaseFeeRequest) XXX_Unmarshal

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

type QueryBaseFeeResponse

type QueryBaseFeeResponse struct {
	BaseFee *github_com_cosmos_cosmos_sdk_types.Int `` /* 135-byte string literal not displayed */
}

BaseFeeResponse returns the EIP1559 base fee.

func (*QueryBaseFeeResponse) Descriptor

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

func (*QueryBaseFeeResponse) Marshal

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

func (*QueryBaseFeeResponse) MarshalTo

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

func (*QueryBaseFeeResponse) MarshalToSizedBuffer

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

func (*QueryBaseFeeResponse) ProtoMessage

func (*QueryBaseFeeResponse) ProtoMessage()

func (*QueryBaseFeeResponse) Reset

func (m *QueryBaseFeeResponse) Reset()

func (*QueryBaseFeeResponse) Size

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

func (*QueryBaseFeeResponse) String

func (m *QueryBaseFeeResponse) String() string

func (*QueryBaseFeeResponse) Unmarshal

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

func (*QueryBaseFeeResponse) XXX_DiscardUnknown

func (m *QueryBaseFeeResponse) XXX_DiscardUnknown()

func (*QueryBaseFeeResponse) XXX_Marshal

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

func (*QueryBaseFeeResponse) XXX_Merge

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

func (*QueryBaseFeeResponse) XXX_Size

func (m *QueryBaseFeeResponse) XXX_Size() int

func (*QueryBaseFeeResponse) XXX_Unmarshal

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

type QueryBlockGasRequest

type QueryBlockGasRequest struct {
}

QueryBlockGasRequest defines the request type for querying the EIP1559 base fee.

func (*QueryBlockGasRequest) Descriptor

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

func (*QueryBlockGasRequest) Marshal

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

func (*QueryBlockGasRequest) MarshalTo

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

func (*QueryBlockGasRequest) MarshalToSizedBuffer

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

func (*QueryBlockGasRequest) ProtoMessage

func (*QueryBlockGasRequest) ProtoMessage()

func (*QueryBlockGasRequest) Reset

func (m *QueryBlockGasRequest) Reset()

func (*QueryBlockGasRequest) Size

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

func (*QueryBlockGasRequest) String

func (m *QueryBlockGasRequest) String() string

func (*QueryBlockGasRequest) Unmarshal

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

func (*QueryBlockGasRequest) XXX_DiscardUnknown

func (m *QueryBlockGasRequest) XXX_DiscardUnknown()

func (*QueryBlockGasRequest) XXX_Marshal

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

func (*QueryBlockGasRequest) XXX_Merge

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

func (*QueryBlockGasRequest) XXX_Size

func (m *QueryBlockGasRequest) XXX_Size() int

func (*QueryBlockGasRequest) XXX_Unmarshal

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

type QueryBlockGasResponse

type QueryBlockGasResponse struct {
	Gas int64 `protobuf:"varint,1,opt,name=gas,proto3" json:"gas,omitempty"`
}

QueryBlockGasResponse returns block gas used for a given height.

func (*QueryBlockGasResponse) Descriptor

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

func (*QueryBlockGasResponse) GetGas

func (m *QueryBlockGasResponse) GetGas() int64

func (*QueryBlockGasResponse) Marshal

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

func (*QueryBlockGasResponse) MarshalTo

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

func (*QueryBlockGasResponse) MarshalToSizedBuffer

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

func (*QueryBlockGasResponse) ProtoMessage

func (*QueryBlockGasResponse) ProtoMessage()

func (*QueryBlockGasResponse) Reset

func (m *QueryBlockGasResponse) Reset()

func (*QueryBlockGasResponse) Size

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

func (*QueryBlockGasResponse) String

func (m *QueryBlockGasResponse) String() string

func (*QueryBlockGasResponse) Unmarshal

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

func (*QueryBlockGasResponse) XXX_DiscardUnknown

func (m *QueryBlockGasResponse) XXX_DiscardUnknown()

func (*QueryBlockGasResponse) XXX_Marshal

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

func (*QueryBlockGasResponse) XXX_Merge

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

func (*QueryBlockGasResponse) XXX_Size

func (m *QueryBlockGasResponse) XXX_Size() int

func (*QueryBlockGasResponse) XXX_Unmarshal

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

type QueryClient

type QueryClient interface {
	// Params queries the parameters of x/feemarket module.
	Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
	// BaseFee queries the base fee of the parent block of the current block.
	BaseFee(ctx context.Context, in *QueryBaseFeeRequest, opts ...grpc.CallOption) (*QueryBaseFeeResponse, error)
	// BlockGas queries the gas used at a given block height
	BlockGas(ctx context.Context, in *QueryBlockGasRequest, opts ...grpc.CallOption) (*QueryBlockGasResponse, 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 QueryParamsRequest

type QueryParamsRequest struct {
}

QueryParamsRequest defines the request type for querying x/evm parameters.

func (*QueryParamsRequest) Descriptor

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

func (*QueryParamsRequest) Marshal

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

func (*QueryParamsRequest) MarshalTo

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

func (*QueryParamsRequest) MarshalToSizedBuffer

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

func (*QueryParamsRequest) ProtoMessage

func (*QueryParamsRequest) ProtoMessage()

func (*QueryParamsRequest) Reset

func (m *QueryParamsRequest) Reset()

func (*QueryParamsRequest) Size

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

func (*QueryParamsRequest) String

func (m *QueryParamsRequest) String() string

func (*QueryParamsRequest) Unmarshal

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

func (*QueryParamsRequest) XXX_DiscardUnknown

func (m *QueryParamsRequest) XXX_DiscardUnknown()

func (*QueryParamsRequest) XXX_Marshal

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

func (*QueryParamsRequest) XXX_Merge

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

func (*QueryParamsRequest) XXX_Size

func (m *QueryParamsRequest) XXX_Size() int

func (*QueryParamsRequest) XXX_Unmarshal

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

type QueryParamsResponse

type QueryParamsResponse struct {
	// params define the evm module parameters.
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}

QueryParamsResponse defines the response type for querying x/evm parameters.

func (*QueryParamsResponse) Descriptor

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

func (*QueryParamsResponse) GetParams

func (m *QueryParamsResponse) GetParams() Params

func (*QueryParamsResponse) Marshal

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

func (*QueryParamsResponse) MarshalTo

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

func (*QueryParamsResponse) MarshalToSizedBuffer

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

func (*QueryParamsResponse) ProtoMessage

func (*QueryParamsResponse) ProtoMessage()

func (*QueryParamsResponse) Reset

func (m *QueryParamsResponse) Reset()

func (*QueryParamsResponse) Size

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

func (*QueryParamsResponse) String

func (m *QueryParamsResponse) String() string

func (*QueryParamsResponse) Unmarshal

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

func (*QueryParamsResponse) XXX_DiscardUnknown

func (m *QueryParamsResponse) XXX_DiscardUnknown()

func (*QueryParamsResponse) XXX_Marshal

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

func (*QueryParamsResponse) XXX_Merge

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

func (*QueryParamsResponse) XXX_Size

func (m *QueryParamsResponse) XXX_Size() int

func (*QueryParamsResponse) XXX_Unmarshal

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

type QueryServer

type QueryServer interface {
	// Params queries the parameters of x/feemarket module.
	Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
	// BaseFee queries the base fee of the parent block of the current block.
	BaseFee(context.Context, *QueryBaseFeeRequest) (*QueryBaseFeeResponse, error)
	// BlockGas queries the gas used at a given block height
	BlockGas(context.Context, *QueryBlockGasRequest) (*QueryBlockGasResponse, error)
}

QueryServer is the server API for Query service.

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) BaseFee

func (*UnimplementedQueryServer) BlockGas

func (*UnimplementedQueryServer) Params

Jump to

Keyboard shortcuts

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