types

package
v0.0.0-...-83dbe79 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	AttributeKeyL1DepositTxType   = "l1_deposit_tx_type"
	AttributeKeyBridgedTokenType  = "bridged_token_type"
	AttributeKeyFromEvmAddress    = "from_evm_address"
	AttributeKeyToEvmAddress      = "to_evm_address"
	AttributeKeyFromCosmosAddress = "from_cosmos_address"
	AttributeKeyToCosmosAddress   = "to_cosmos_address"
	AttributeKeyAmount            = "amount"

	L1SystemDepositTxType = "l1_system_deposit"
	L1UserDepositTxType   = "l1_user_deposit"

	EventTypeMintETH = "mint_eth"
)
View Source
const (
	// ModuleName defines the module name
	ModuleName = "rollup"

	// StoreKey defines the primary module store key
	StoreKey = ModuleName

	// RouterKey is the message route for slashing
	RouterKey = ModuleName

	// QuerierRoute defines the module's query routing key
	QuerierRoute = ModuleName

	// MemStoreKey defines the in-memory store key
	MemStoreKey = "mem_rollup"
)
View Source
const (
	// wrapped Ethers; cannonically bridged from Ethereum
	ETH        = "ETH"
	MintModule = "mint"
	// KeyL1BlockInfo is the key for the L1BlockInfo
	KeyL1BlockInfo = "L1BlockInfo"
)

Variables

View Source
var (
	ErrInvalidL1Txs = registerErr("invalid L1 txs")
	ErrMintETH      = registerErr("failed to mint ETH")
	ErrL1BlockInfo  = registerErr("L1 block info")
)
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 (
	ErrInvalidLengthParams        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowParams          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group")
)
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 (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)
View Source
var KeyAllowedErc20Tokens = []byte("AllowedERC20Tokens")
View Source
var WrapError = sdkerrors.Wrapf

WrapError wraps an Cosmos-SDK error with extra message while keeping the stack trace at where this func is called.

Functions

func AdaptCosmosTxsToEthTxs

func AdaptCosmosTxsToEthTxs(cosmosTxs bfttypes.Txs) (ethtypes.Transactions, error)

func AdaptPayloadTxsToCosmosTxs

func AdaptPayloadTxsToCosmosTxs(ethTxs []hexutil.Bytes) (bfttypes.Txs, error)

func FromL1BlockInfoResponse

func FromL1BlockInfoResponse(resp *QueryL1BlockInfoResponse) derive.L1BlockInfo

FromL1BlockInfoResponse converts a QueryL1BlockInfoResponse to derive.L1BlockInfo.

func ParamKeyTable

func ParamKeyTable() paramtypes.KeyTable

ParamKeyTable the param key table for launch module

func RegisterCodec

func RegisterCodec(cdc *codec.LegacyAmino)

only required for legacy Amino codec

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

RegisterInterfaces registers the module's interface types Msg types are auto registered by msgservice.

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

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)

Types

type GenesisState

type GenesisState struct {
}

GenesisState defines the polyibc module's genesis state.

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

func (m *GenesisState) Validate() 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 MsgClient

type MsgClient interface {
	ApplyL1Txs(ctx context.Context, in *MsgL1Txs, opts ...grpc.CallOption) (*MsgL1TxsResponse, error)
}

MsgClient is the client API for Msg service.

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

func NewMsgClient

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgL1Txs

type MsgL1Txs struct {
	// array of bytes, each bytes is a eth.Transaction.MarshalBinary tx
	// The first tx must be a L1 system deposit tx, and the rest are user txs if present
	TxBytes [][]byte `protobuf:"bytes,1,rep,name=txBytes,proto3" json:"txBytes,omitempty"`
}

MsgL1Txs defines a message for all L1 system and user deposit txs

func (*MsgL1Txs) Descriptor

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

func (*MsgL1Txs) GetSigners

func (*MsgL1Txs) GetSigners() []sdktypes.AccAddress

GetSigners implements types.Msg.

func (*MsgL1Txs) GetTxBytes

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

func (*MsgL1Txs) Marshal

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

func (*MsgL1Txs) MarshalTo

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

func (*MsgL1Txs) MarshalToSizedBuffer

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

func (*MsgL1Txs) ProtoMessage

func (*MsgL1Txs) ProtoMessage()

func (*MsgL1Txs) Reset

func (m *MsgL1Txs) Reset()

func (*MsgL1Txs) Route

func (*MsgL1Txs) Route() string

func (*MsgL1Txs) Size

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

func (*MsgL1Txs) String

func (m *MsgL1Txs) String() string

func (*MsgL1Txs) Type

func (*MsgL1Txs) Type() string

func (*MsgL1Txs) Unmarshal

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

func (*MsgL1Txs) ValidateBasic

func (m *MsgL1Txs) ValidateBasic() error

ValidateBasic implements types.Msg.

func (*MsgL1Txs) XXX_DiscardUnknown

func (m *MsgL1Txs) XXX_DiscardUnknown()

func (*MsgL1Txs) XXX_Marshal

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

func (*MsgL1Txs) XXX_Merge

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

func (*MsgL1Txs) XXX_Size

func (m *MsgL1Txs) XXX_Size() int

func (*MsgL1Txs) XXX_Unmarshal

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

type MsgL1TxsResponse

type MsgL1TxsResponse struct {
}

func (*MsgL1TxsResponse) Descriptor

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

func (*MsgL1TxsResponse) Marshal

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

func (*MsgL1TxsResponse) MarshalTo

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

func (*MsgL1TxsResponse) MarshalToSizedBuffer

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

func (*MsgL1TxsResponse) ProtoMessage

func (*MsgL1TxsResponse) ProtoMessage()

func (*MsgL1TxsResponse) Reset

func (m *MsgL1TxsResponse) Reset()

func (*MsgL1TxsResponse) Size

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

func (*MsgL1TxsResponse) String

func (m *MsgL1TxsResponse) String() string

func (*MsgL1TxsResponse) Unmarshal

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

func (*MsgL1TxsResponse) XXX_DiscardUnknown

func (m *MsgL1TxsResponse) XXX_DiscardUnknown()

func (*MsgL1TxsResponse) XXX_Marshal

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

func (*MsgL1TxsResponse) XXX_Merge

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

func (*MsgL1TxsResponse) XXX_Size

func (m *MsgL1TxsResponse) XXX_Size() int

func (*MsgL1TxsResponse) XXX_Unmarshal

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

type MsgServer

type MsgServer interface {
	ApplyL1Txs(context.Context, *MsgL1Txs) (*MsgL1TxsResponse, error)
}

MsgServer is the server API for Msg service.

type Params

type Params struct {
	// allowed_erc20_tokens defines the list of allowed client state types.
	AllowedErc20Tokens []string `` /* 145-byte string literal not displayed */
}

Params defines the parameters for the module.

func DefaultParams

func DefaultParams() Params

DefaultParams returns a default set of parameters

func NewParams

func NewParams(
	allowedErc20Tokens ...string,
) Params

NewParams creates a new Params instance

func (*Params) Descriptor

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

func (*Params) GetAllowedErc20Tokens

func (m *Params) GetAllowedErc20Tokens() []string

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 implements params.ParamSet

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 (p Params) String() string

String implements the Stringer interface.

func (*Params) Unmarshal

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

func (Params) Validate

func (p Params) Validate() error

Validate validates the set of params

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 QueryClient

type QueryClient interface {
	L1BlockInfo(ctx context.Context, in *QueryL1BlockInfoRequest, opts ...grpc.CallOption) (*QueryL1BlockInfoResponse, 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 QueryL1BlockInfoRequest

type QueryL1BlockInfoRequest struct {
	// L2 block height; use 0 for latest block height
	Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
}

QueryL1BlockInfoRequest is the request type for the Query/L1BlockInfo RPC

func (*QueryL1BlockInfoRequest) Descriptor

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

func (*QueryL1BlockInfoRequest) Marshal

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

func (*QueryL1BlockInfoRequest) MarshalTo

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

func (*QueryL1BlockInfoRequest) MarshalToSizedBuffer

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

func (*QueryL1BlockInfoRequest) ProtoMessage

func (*QueryL1BlockInfoRequest) ProtoMessage()

func (*QueryL1BlockInfoRequest) Reset

func (m *QueryL1BlockInfoRequest) Reset()

func (*QueryL1BlockInfoRequest) Size

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

func (*QueryL1BlockInfoRequest) String

func (m *QueryL1BlockInfoRequest) String() string

func (*QueryL1BlockInfoRequest) Unmarshal

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

func (*QueryL1BlockInfoRequest) XXX_DiscardUnknown

func (m *QueryL1BlockInfoRequest) XXX_DiscardUnknown()

func (*QueryL1BlockInfoRequest) XXX_Marshal

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

func (*QueryL1BlockInfoRequest) XXX_Merge

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

func (*QueryL1BlockInfoRequest) XXX_Size

func (m *QueryL1BlockInfoRequest) XXX_Size() int

func (*QueryL1BlockInfoRequest) XXX_Unmarshal

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

type QueryL1BlockInfoResponse

type QueryL1BlockInfoResponse struct {
	// Block number
	Number uint64 `protobuf:"varint,1,opt,name=number,proto3" json:"number,omitempty"`
	// Block timestamp
	Time uint64 `protobuf:"varint,2,opt,name=time,proto3" json:"time,omitempty"`
	// Base fee for the block
	BaseFee []byte `protobuf:"bytes,3,opt,name=baseFee,proto3" json:"baseFee,omitempty"`
	// Hash of the blocK; bytes32
	BlockHash []byte `protobuf:"bytes,4,opt,name=blockHash,proto3" json:"blockHash,omitempty"`
	// Number of L2 blocks since the start of the epoch
	// Not strictly a piece of L1 information. Represents the number of L2 blocks since the start of the epoch,
	// i.e. when the actual L1 info was first introduced.
	SequenceNumber uint64 `protobuf:"varint,5,opt,name=sequenceNumber,proto3" json:"sequenceNumber,omitempty"`
	// Fields 6,7,8 are SystemConfig
	// Address of the batcher; bytes20
	BatcherAddr []byte `protobuf:"bytes,6,opt,name=batcherAddr,proto3" json:"batcherAddr,omitempty"`
	// Overhead fee for L1; bytes32
	L1FeeOverhead []byte `protobuf:"bytes,7,opt,name=l1FeeOverhead,proto3" json:"l1FeeOverhead,omitempty"`
	// Scalar fee for L1; bytes32
	L1FeeScalar []byte `protobuf:"bytes,8,opt,name=l1FeeScalar,proto3" json:"l1FeeScalar,omitempty"`
}

QueryL1BlockInfoResponse is the stored L1 block info

func ToL1BlockInfoResponse

func ToL1BlockInfoResponse(l1blockInfo *derive.L1BlockInfo) *QueryL1BlockInfoResponse

ToL1BlockInfoResponse converts a derive.L1BlockInfo to QueryL1BlockInfoResponse.

func (*QueryL1BlockInfoResponse) Descriptor

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

func (*QueryL1BlockInfoResponse) Marshal

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

func (*QueryL1BlockInfoResponse) MarshalTo

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

func (*QueryL1BlockInfoResponse) MarshalToSizedBuffer

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

func (*QueryL1BlockInfoResponse) ProtoMessage

func (*QueryL1BlockInfoResponse) ProtoMessage()

func (*QueryL1BlockInfoResponse) Reset

func (m *QueryL1BlockInfoResponse) Reset()

func (*QueryL1BlockInfoResponse) Size

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

func (*QueryL1BlockInfoResponse) String

func (m *QueryL1BlockInfoResponse) String() string

func (*QueryL1BlockInfoResponse) Unmarshal

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

func (*QueryL1BlockInfoResponse) XXX_DiscardUnknown

func (m *QueryL1BlockInfoResponse) XXX_DiscardUnknown()

func (*QueryL1BlockInfoResponse) XXX_Marshal

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

func (*QueryL1BlockInfoResponse) XXX_Merge

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

func (*QueryL1BlockInfoResponse) XXX_Size

func (m *QueryL1BlockInfoResponse) XXX_Size() int

func (*QueryL1BlockInfoResponse) XXX_Unmarshal

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

type QueryServer

type QueryServer interface {
	L1BlockInfo(context.Context, *QueryL1BlockInfoRequest) (*QueryL1BlockInfoResponse, error)
}

QueryServer is the server API for Query service.

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) ApplyL1Txs

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) L1BlockInfo

Jump to

Keyboard shortcuts

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