Documentation ¶
Overview ¶
Package types is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func AllSquareSizes(msgSize int) []uint64
- func BroadcastTx(ctx context.Context, conn *grpc.ClientConn, mode tx.BroadcastMode, ...) (*tx.BroadcastTxResponse, error)
- func BuildPayForDataTxFromWireTx(origTx authsigning.Tx, builder sdkclient.TxBuilder, signature []byte, ...) (authsigning.Tx, error)
- func CreateCommitment(squareSize uint64, namespace, message []byte) ([]byte, error)
- func HasWirePayForData(tx sdk.Tx) bool
- func InheritTxConfig(builder sdkclient.TxBuilder, tx authsigning.Tx) sdkclient.TxBuilder
- func KeyPrefix(p string) []byte
- func MsgSharesUsed(msgSize int) int
- func NewPayForDataEvent(signer string, size uint64) sdk.Event
- func NextHigherPowerOf2(v uint64) uint64
- func QueryAccount(ctx context.Context, conn *grpc.ClientConn, encCfg encoding.Config, ...) (accNum uint64, seqNum uint64, err error)
- func RegisterCodec(cdc *codec.LegacyAmino)
- func RegisterInterfaces(registry codectypes.InterfaceRegistry)
- func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error
- func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error
- func RegisterMsgServer(s grpc1.Server, srv MsgServer)
- func RegisterQueryServer(s grpc1.Server, srv QueryServer)
- func ValidateMessageNamespaceID(ns namespace.ID) error
- func VerifyPFDSigs(signerData authsigning.SignerData, txConfig client.TxConfig, ...) (bool, error)
- func VerifySig(signerData authsigning.SignerData, txConfig client.TxConfig, ...) (bool, error)
- type GenesisState
- func (*GenesisState) Descriptor() ([]byte, []int)
- func (m *GenesisState) Marshal() (dAtA []byte, err error)
- func (m *GenesisState) MarshalTo(dAtA []byte) (int, error)
- func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*GenesisState) ProtoMessage()
- func (m *GenesisState) Reset()
- func (m *GenesisState) Size() (n int)
- func (m *GenesisState) String() string
- func (m *GenesisState) Unmarshal(dAtA []byte) error
- func (gs GenesisState) Validate() error
- func (m *GenesisState) XXX_DiscardUnknown()
- func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *GenesisState) XXX_Merge(src proto.Message)
- func (m *GenesisState) XXX_Size() int
- func (m *GenesisState) XXX_Unmarshal(b []byte) error
- type KeyringSigner
- func (k *KeyringSigner) BuildSignedTx(builder sdkclient.TxBuilder, msg sdktypes.Msg) (authsigning.Tx, error)
- func (k *KeyringSigner) EncodeTx(tx sdktypes.Tx) ([]byte, error)
- func (k *KeyringSigner) GetSignerData() (authsigning.SignerData, error)
- func (k *KeyringSigner) GetSignerInfo() *keyring.Record
- func (k *KeyringSigner) NewTxBuilder(opts ...TxBuilderOption) sdkclient.TxBuilder
- func (k *KeyringSigner) QueryAccountNumber(ctx context.Context, conn *grpc.ClientConn) error
- func (k *KeyringSigner) SetAccountNumber(n uint64)
- func (k *KeyringSigner) SetKeyringAccName(name string)
- func (k *KeyringSigner) SetSequence(n uint64)
- func (k *KeyringSigner) UpdateAccountFromClient(clientCtx client.Context) error
- type MsgClient
- type MsgPayForData
- func (*MsgPayForData) Descriptor() ([]byte, []int)
- func (m *MsgPayForData) GetMessageNamespaceId() []byte
- func (m *MsgPayForData) GetMessageShareCommitment() []byte
- func (m *MsgPayForData) GetMessageSize() uint64
- func (msg *MsgPayForData) GetSignBytes() []byte
- func (m *MsgPayForData) GetSigner() string
- func (msg *MsgPayForData) GetSigners() []sdk.AccAddress
- func (m *MsgPayForData) Marshal() (dAtA []byte, err error)
- func (m *MsgPayForData) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgPayForData) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgPayForData) ProtoMessage()
- func (m *MsgPayForData) Reset()
- func (msg *MsgPayForData) Route() string
- func (m *MsgPayForData) Size() (n int)
- func (m *MsgPayForData) String() string
- func (msg *MsgPayForData) Type() string
- func (m *MsgPayForData) Unmarshal(dAtA []byte) error
- func (msg *MsgPayForData) ValidateBasic() error
- func (m *MsgPayForData) XXX_DiscardUnknown()
- func (m *MsgPayForData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgPayForData) XXX_Merge(src proto.Message)
- func (m *MsgPayForData) XXX_Size() int
- func (m *MsgPayForData) XXX_Unmarshal(b []byte) error
- type MsgPayForDataResponse
- func (*MsgPayForDataResponse) Descriptor() ([]byte, []int)
- func (m *MsgPayForDataResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgPayForDataResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgPayForDataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgPayForDataResponse) ProtoMessage()
- func (m *MsgPayForDataResponse) Reset()
- func (m *MsgPayForDataResponse) Size() (n int)
- func (m *MsgPayForDataResponse) String() string
- func (m *MsgPayForDataResponse) Unmarshal(dAtA []byte) error
- func (m *MsgPayForDataResponse) XXX_DiscardUnknown()
- func (m *MsgPayForDataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgPayForDataResponse) XXX_Merge(src proto.Message)
- func (m *MsgPayForDataResponse) XXX_Size() int
- func (m *MsgPayForDataResponse) XXX_Unmarshal(b []byte) error
- type MsgServer
- type MsgWirePayForData
- func (*MsgWirePayForData) Descriptor() ([]byte, []int)
- func (m *MsgWirePayForData) GetMessage() []byte
- func (m *MsgWirePayForData) GetMessageNamespaceId() []byte
- func (m *MsgWirePayForData) GetMessageShareCommitment() []ShareCommitAndSignature
- func (m *MsgWirePayForData) GetMessageSize() uint64
- func (m *MsgWirePayForData) GetSigner() string
- func (msg *MsgWirePayForData) GetSigners() []sdk.AccAddress
- func (m *MsgWirePayForData) Marshal() (dAtA []byte, err error)
- func (m *MsgWirePayForData) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgWirePayForData) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgWirePayForData) ProtoMessage()
- func (m *MsgWirePayForData) Reset()
- func (msg *MsgWirePayForData) Route() string
- func (msg *MsgWirePayForData) SignShareCommitments(signer *KeyringSigner, options ...TxBuilderOption) error
- func (m *MsgWirePayForData) Size() (n int)
- func (m *MsgWirePayForData) String() string
- func (m *MsgWirePayForData) Unmarshal(dAtA []byte) error
- func (msg *MsgWirePayForData) ValidateAllSquareSizesCommitedTo() error
- func (msg *MsgWirePayForData) ValidateBasic() error
- func (msg *MsgWirePayForData) ValidateMessageShareCommitments() error
- func (m *MsgWirePayForData) XXX_DiscardUnknown()
- func (m *MsgWirePayForData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgWirePayForData) XXX_Merge(src proto.Message)
- func (m *MsgWirePayForData) XXX_Size() int
- func (m *MsgWirePayForData) XXX_Unmarshal(b []byte) error
- type MsgWirePayForDataResponse
- func (*MsgWirePayForDataResponse) Descriptor() ([]byte, []int)
- func (m *MsgWirePayForDataResponse) Marshal() (dAtA []byte, err error)
- func (m *MsgWirePayForDataResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *MsgWirePayForDataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*MsgWirePayForDataResponse) ProtoMessage()
- func (m *MsgWirePayForDataResponse) Reset()
- func (m *MsgWirePayForDataResponse) Size() (n int)
- func (m *MsgWirePayForDataResponse) String() string
- func (m *MsgWirePayForDataResponse) Unmarshal(dAtA []byte) error
- func (m *MsgWirePayForDataResponse) XXX_DiscardUnknown()
- func (m *MsgWirePayForDataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MsgWirePayForDataResponse) XXX_Merge(src proto.Message)
- func (m *MsgWirePayForDataResponse) XXX_Size() int
- func (m *MsgWirePayForDataResponse) XXX_Unmarshal(b []byte) error
- type QueryClient
- type QueryServer
- type ShareCommitAndSignature
- func (*ShareCommitAndSignature) Descriptor() ([]byte, []int)
- func (m *ShareCommitAndSignature) GetShareCommitment() []byte
- func (m *ShareCommitAndSignature) GetSignature() []byte
- func (m *ShareCommitAndSignature) GetSquareSize() uint64
- func (m *ShareCommitAndSignature) Marshal() (dAtA []byte, err error)
- func (m *ShareCommitAndSignature) MarshalTo(dAtA []byte) (int, error)
- func (m *ShareCommitAndSignature) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ShareCommitAndSignature) ProtoMessage()
- func (m *ShareCommitAndSignature) Reset()
- func (m *ShareCommitAndSignature) Size() (n int)
- func (m *ShareCommitAndSignature) String() string
- func (m *ShareCommitAndSignature) Unmarshal(dAtA []byte) error
- func (m *ShareCommitAndSignature) XXX_DiscardUnknown()
- func (m *ShareCommitAndSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ShareCommitAndSignature) XXX_Merge(src proto.Message)
- func (m *ShareCommitAndSignature) XXX_Size() int
- func (m *ShareCommitAndSignature) XXX_Unmarshal(b []byte) error
- type TxBuilderOption
- func SetFeeAmount(fees sdk.Coins) TxBuilderOption
- func SetFeeGranter(feeGranter sdk.AccAddress) TxBuilderOption
- func SetFeePayer(feePayer sdk.AccAddress) TxBuilderOption
- func SetGasLimit(limit uint64) TxBuilderOption
- func SetMemo(memo string) TxBuilderOption
- func SetTimeoutHeight(height uint64) TxBuilderOption
- func SetTip(tip *tx.Tip) TxBuilderOption
- type UnimplementedMsgServer
- type UnimplementedQueryServer
Constants ¶
const ( EventTypePayForData = "payfordata" AttributeKeySigner = "signer" AttributeKeySize = "size" )
const ( // ModuleName defines the module name ModuleName = "payment" // 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_payment" )
const ( URLMsgWirePayForData = "/payment.MsgWirePayForData" URLMsgPayForData = "/payment.MsgPayForData" SquareSize = appconsts.MaxSquareSize NamespaceIDSize = appconsts.NamespaceSize )
const DefaultIndex uint64 = 1
DefaultIndex is the default capability global index
Variables ¶
var ( ErrReservedNamespace = sdkerrors.Register(ModuleName, 11110, "cannot use reserved namespace IDs") ErrInvalidNamespaceLen = sdkerrors.Register(ModuleName, 11111, "invalid namespace length") ErrInvalidDataSize = sdkerrors.Register(ModuleName, 11112, "data must be multiple of shareSize") ErrDeclaredActualDataSizeMismatch = sdkerrors.Register(ModuleName, 11113, "declared data size does not match actual size") ErrCommittedSquareSizeNotPowOf2 = sdkerrors.Register(ModuleName, 11114, "committed to invalid square size: must be power of two") ErrCalculateCommit = sdkerrors.Register(ModuleName, 11115, "unexpected error calculating commit for share") ErrTailPaddingNamespace = sdkerrors.Register(ModuleName, 11118, "cannot use tail padding namespace ID") ErrTxNamespace = sdkerrors.Register(ModuleName, 11119, "cannot use transaction namespace ID") ErrEvidenceNamespace = sdkerrors.Register(ModuleName, 11120, "cannot use evidence namespace ID") )
var ( ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") )
var ModuleCdc = codec.NewProtoCodec(codectypes.NewInterfaceRegistry())
Functions ¶
func AllSquareSizes ¶ added in v0.5.1
AllSquareSizes calculates all of the square sizes that message could possibly fit in
func BroadcastTx ¶
func BroadcastTx(ctx context.Context, conn *grpc.ClientConn, mode tx.BroadcastMode, txBytes []byte) (*tx.BroadcastTxResponse, error)
BroadcastTx uses the provided grpc connection to broadcast a signed and encoded transaction
func BuildPayForDataTxFromWireTx ¶ added in v0.4.0
func BuildPayForDataTxFromWireTx( origTx authsigning.Tx, builder sdkclient.TxBuilder, signature []byte, msg *MsgPayForData, ) (authsigning.Tx, error)
BuildPayForDataTxFromWireTx creates an authsigning.Tx using data from the original MsgWirePayForData sdk.Tx and the signature provided. This is used while processing the MsgWirePayForDatas into Signed MsgPayForData
func CreateCommitment ¶
CreateCommitment generates the commit bytes for a given squareSize, namespace, and message using a namespace merkle tree and the rules described at https://github.com/celestiaorg/celestia-specs/blob/master/src/rationale/message_block_layout.md#message-layout-rationale
func HasWirePayForData ¶ added in v0.5.4
HasWirePayForData performs a quick but not definitive check to see if a tx contains a MsgWirePayForData. The check is quick but not definitive because it only uses a proto.Message generated method instead of performing a full type check.
func InheritTxConfig ¶ added in v0.5.4
InheritTxConfig sets all of the accessible configurations from a given tx into a a give client.TxBuilder
func MsgSharesUsed ¶ added in v0.5.1
MsgSharesUsed calculates the minimum number of shares a message will take up. It accounts for the necessary delimiter and potential padding.
func NewPayForDataEvent ¶ added in v0.4.0
NewPayForDataEvent constructs a new payformessge sdk.Event
func NextHigherPowerOf2 ¶ added in v0.7.0
NextHigherPowerOf2 returns the next power of 2 that is higher than v. Examples: NextHigherPowerOf2(1) = 2 NextHigherPowerOf2(2) = 4 NextHigherPowerOf2(5) = 8
func QueryAccount ¶
func QueryAccount(ctx context.Context, conn *grpc.ClientConn, encCfg encoding.Config, address string) (accNum uint64, seqNum uint64, err error)
QueryAccount fetches the account number and sequence number from the celestia-app node.
func RegisterCodec ¶
func RegisterCodec(cdc *codec.LegacyAmino)
func RegisterInterfaces ¶
func RegisterInterfaces(registry codectypes.InterfaceRegistry)
func RegisterMsgHandler ¶
RegisterMsgHandler registers the http handlers for service Msg to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterMsgHandlerClient ¶
RegisterMsgHandlerClient registers the http handlers for service Msg to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "MsgClient" to call the correct interceptors.
func RegisterMsgHandlerFromEndpoint ¶
func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterMsgHandlerServer ¶
RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". UnaryRPC :call MsgServer 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 RegisterMsgHandlerFromEndpoint instead.
func RegisterMsgServer ¶
func RegisterQueryServer ¶
func RegisterQueryServer(s grpc1.Server, srv QueryServer)
func ValidateMessageNamespaceID ¶ added in v0.7.0
ValidateMessageNamespaceID returns an error if the provided namespace.ID is an invalid or reserved namespace id.
func VerifyPFDSigs ¶ added in v0.5.4
func VerifyPFDSigs(signerData authsigning.SignerData, txConfig client.TxConfig, wirePFDTx authsigning.Tx) (bool, error)
VerifyPFDSigs checks that all of the signatures for a transaction that contains a MsgWirePayForData message by going through the entire malleation process.
func VerifySig ¶ added in v0.5.4
func VerifySig(signerData authsigning.SignerData, txConfig client.TxConfig, authTx authsigning.Tx) (bool, error)
VerifySig checks that the signature over the provided transaction is valid using the provided signer data.
Types ¶
type GenesisState ¶
type GenesisState struct { }
GenesisState defines the capability module's genesis state.
func DefaultGenesis ¶
func DefaultGenesis() *GenesisState
DefaultGenesis returns the default Capability genesis state
func (*GenesisState) Descriptor ¶
func (*GenesisState) Descriptor() ([]byte, []int)
func (*GenesisState) Marshal ¶
func (m *GenesisState) Marshal() (dAtA []byte, err 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 KeyringSigner ¶
type KeyringSigner struct { keyring.Keyring sync.RWMutex // contains filtered or unexported fields }
KeyringSigner uses a keyring to sign and build celestia-app transactions
func NewKeyringSigner ¶
func NewKeyringSigner(ring keyring.Keyring, name string, chainID string) *KeyringSigner
NewKeyringSigner returns a new KeyringSigner using the provided keyring
func (*KeyringSigner) BuildSignedTx ¶
func (k *KeyringSigner) BuildSignedTx(builder sdkclient.TxBuilder, msg sdktypes.Msg) (authsigning.Tx, error)
BuildSignedTx creates and signs a sdk.Tx that contains the provided message. The interal account number must be set by calling k.QueryAccountNumber or by manually setting it via k.SetAccountNumber for the built transactions to be valid.
func (*KeyringSigner) EncodeTx ¶
func (k *KeyringSigner) EncodeTx(tx sdktypes.Tx) ([]byte, error)
EncodeTx uses the keyring signer's encoding config to encode the provided sdk transaction
func (*KeyringSigner) GetSignerData ¶ added in v0.5.0
func (k *KeyringSigner) GetSignerData() (authsigning.SignerData, error)
func (*KeyringSigner) GetSignerInfo ¶
func (k *KeyringSigner) GetSignerInfo() *keyring.Record
GetSignerInfo returns the signer info for the KeyringSigner's account. panics if the account in KeyringSigner does not exist.
func (*KeyringSigner) NewTxBuilder ¶
func (k *KeyringSigner) NewTxBuilder(opts ...TxBuilderOption) sdkclient.TxBuilder
NewTxBuilder returns the default sdk Tx builder using the celestia-app encoding config
func (*KeyringSigner) QueryAccountNumber ¶
func (k *KeyringSigner) QueryAccountNumber(ctx context.Context, conn *grpc.ClientConn) error
QueryAccountNumber queries the application to find the latest account number and sequence, updating the respective internal fields. The internal account number must be set by this method or by manually calling k.SetAccountNumber in order for any built transactions to be valid
func (*KeyringSigner) SetAccountNumber ¶
func (k *KeyringSigner) SetAccountNumber(n uint64)
SetAccountNumber manually sets the underlying account number
func (*KeyringSigner) SetKeyringAccName ¶
func (k *KeyringSigner) SetKeyringAccName(name string)
SetKeyringAccName manually sets the underlying keyring account name
func (*KeyringSigner) SetSequence ¶
func (k *KeyringSigner) SetSequence(n uint64)
SetSequence manually sets the underlying sequence number
func (*KeyringSigner) UpdateAccountFromClient ¶ added in v0.5.0
func (k *KeyringSigner) UpdateAccountFromClient(clientCtx client.Context) error
type MsgClient ¶
type MsgClient interface { // PayForData allows the user to pay for the inclusion of a message PayForData(ctx context.Context, in *MsgPayForData, opts ...grpc.CallOption) (*MsgPayForDataResponse, 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 MsgPayForData ¶ added in v0.4.0
type MsgPayForData struct { Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` MessageNamespaceId []byte `protobuf:"bytes,2,opt,name=message_namespace_id,json=messageNamespaceId,proto3" json:"message_namespace_id,omitempty"` MessageSize uint64 `protobuf:"varint,3,opt,name=message_size,json=messageSize,proto3" json:"message_size,omitempty"` }
MsgPayForData is what gets signed by users when creating ShareCommitSignatures.
Multiple versions are signed and included, each version creates a commitment for a
specific square size.
func ProcessWirePayForData ¶ added in v0.4.0
func ProcessWirePayForData(msg *MsgWirePayForData, squareSize uint64) (*tmproto.Message, *MsgPayForData, []byte, error)
ProcessWirePayForData performs the malleation process that occurs before creating a block. It parses the MsgWirePayForData to produce the components needed to create a single MsgPayForData.
func (*MsgPayForData) Descriptor ¶ added in v0.4.0
func (*MsgPayForData) Descriptor() ([]byte, []int)
func (*MsgPayForData) GetMessageNamespaceId ¶ added in v0.4.0
func (m *MsgPayForData) GetMessageNamespaceId() []byte
func (*MsgPayForData) GetMessageShareCommitment ¶ added in v0.4.0
func (m *MsgPayForData) GetMessageShareCommitment() []byte
func (*MsgPayForData) GetMessageSize ¶ added in v0.4.0
func (m *MsgPayForData) GetMessageSize() uint64
func (*MsgPayForData) GetSignBytes ¶ added in v0.4.0
func (msg *MsgPayForData) GetSignBytes() []byte
GetSignBytes fullfills the sdk.Msg interface by reterning a deterministic set of bytes to sign over
func (*MsgPayForData) GetSigner ¶ added in v0.4.0
func (m *MsgPayForData) GetSigner() string
func (*MsgPayForData) GetSigners ¶ added in v0.4.0
func (msg *MsgPayForData) GetSigners() []sdk.AccAddress
GetSigners fullfills the sdk.Msg interface by returning the signer's address
func (*MsgPayForData) Marshal ¶ added in v0.4.0
func (m *MsgPayForData) Marshal() (dAtA []byte, err error)
func (*MsgPayForData) MarshalTo ¶ added in v0.4.0
func (m *MsgPayForData) MarshalTo(dAtA []byte) (int, error)
func (*MsgPayForData) MarshalToSizedBuffer ¶ added in v0.4.0
func (m *MsgPayForData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgPayForData) ProtoMessage ¶ added in v0.4.0
func (*MsgPayForData) ProtoMessage()
func (*MsgPayForData) Reset ¶ added in v0.4.0
func (m *MsgPayForData) Reset()
func (*MsgPayForData) Route ¶ added in v0.4.0
func (msg *MsgPayForData) Route() string
Route fullfills the sdk.Msg interface
func (*MsgPayForData) Size ¶ added in v0.4.0
func (m *MsgPayForData) Size() (n int)
func (*MsgPayForData) String ¶ added in v0.4.0
func (m *MsgPayForData) String() string
func (*MsgPayForData) Type ¶ added in v0.4.0
func (msg *MsgPayForData) Type() string
Type fullfills the sdk.Msg interface
func (*MsgPayForData) Unmarshal ¶ added in v0.4.0
func (m *MsgPayForData) Unmarshal(dAtA []byte) error
func (*MsgPayForData) ValidateBasic ¶ added in v0.4.0
func (msg *MsgPayForData) ValidateBasic() error
ValidateBasic fullfills the sdk.Msg interface by performing stateless validity checks on the msg that also don't require having the actual message
func (*MsgPayForData) XXX_DiscardUnknown ¶ added in v0.4.0
func (m *MsgPayForData) XXX_DiscardUnknown()
func (*MsgPayForData) XXX_Marshal ¶ added in v0.4.0
func (m *MsgPayForData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgPayForData) XXX_Merge ¶ added in v0.4.0
func (m *MsgPayForData) XXX_Merge(src proto.Message)
func (*MsgPayForData) XXX_Size ¶ added in v0.4.0
func (m *MsgPayForData) XXX_Size() int
func (*MsgPayForData) XXX_Unmarshal ¶ added in v0.4.0
func (m *MsgPayForData) XXX_Unmarshal(b []byte) error
type MsgPayForDataResponse ¶ added in v0.4.0
type MsgPayForDataResponse struct { }
MsgPayForDataResponse describes the response returned after the submission of a PayForData
func (*MsgPayForDataResponse) Descriptor ¶ added in v0.4.0
func (*MsgPayForDataResponse) Descriptor() ([]byte, []int)
func (*MsgPayForDataResponse) Marshal ¶ added in v0.4.0
func (m *MsgPayForDataResponse) Marshal() (dAtA []byte, err error)
func (*MsgPayForDataResponse) MarshalTo ¶ added in v0.4.0
func (m *MsgPayForDataResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgPayForDataResponse) MarshalToSizedBuffer ¶ added in v0.4.0
func (m *MsgPayForDataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgPayForDataResponse) ProtoMessage ¶ added in v0.4.0
func (*MsgPayForDataResponse) ProtoMessage()
func (*MsgPayForDataResponse) Reset ¶ added in v0.4.0
func (m *MsgPayForDataResponse) Reset()
func (*MsgPayForDataResponse) Size ¶ added in v0.4.0
func (m *MsgPayForDataResponse) Size() (n int)
func (*MsgPayForDataResponse) String ¶ added in v0.4.0
func (m *MsgPayForDataResponse) String() string
func (*MsgPayForDataResponse) Unmarshal ¶ added in v0.4.0
func (m *MsgPayForDataResponse) Unmarshal(dAtA []byte) error
func (*MsgPayForDataResponse) XXX_DiscardUnknown ¶ added in v0.4.0
func (m *MsgPayForDataResponse) XXX_DiscardUnknown()
func (*MsgPayForDataResponse) XXX_Marshal ¶ added in v0.4.0
func (m *MsgPayForDataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgPayForDataResponse) XXX_Merge ¶ added in v0.4.0
func (m *MsgPayForDataResponse) XXX_Merge(src proto.Message)
func (*MsgPayForDataResponse) XXX_Size ¶ added in v0.4.0
func (m *MsgPayForDataResponse) XXX_Size() int
func (*MsgPayForDataResponse) XXX_Unmarshal ¶ added in v0.4.0
func (m *MsgPayForDataResponse) XXX_Unmarshal(b []byte) error
type MsgServer ¶
type MsgServer interface { // PayForData allows the user to pay for the inclusion of a message PayForData(context.Context, *MsgPayForData) (*MsgPayForDataResponse, error) }
MsgServer is the server API for Msg service.
type MsgWirePayForData ¶ added in v0.4.0
type MsgWirePayForData struct { Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` MessageNamespaceId []byte `protobuf:"bytes,2,opt,name=message_namespace_id,json=messageNamespaceId,proto3" json:"message_namespace_id,omitempty"` MessageSize uint64 `protobuf:"varint,3,opt,name=message_size,json=messageSize,proto3" json:"message_size,omitempty"` Message []byte `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"` }
MsgWirePayForData describes the format of data that is sent over the wire for each PayForData
func ExtractMsgWirePayForData ¶ added in v0.5.4
func ExtractMsgWirePayForData(tx sdk.Tx) (*MsgWirePayForData, error)
ExtractMsgWirePayForData attempts to extract a MsgWirePayForData from a provided sdk.Tx. It returns an error if no MsgWirePayForData is found.
func NewWirePayForData ¶ added in v0.4.0
func NewWirePayForData(namespace, message []byte, sizes ...uint64) (*MsgWirePayForData, error)
NewWirePayForData creates a new MsgWirePayForData by using the namespace and message to generate share commitments for the provided square sizes Note that the share commitments generated still need to be signed using the SignShareCommitments method.
func (*MsgWirePayForData) Descriptor ¶ added in v0.4.0
func (*MsgWirePayForData) Descriptor() ([]byte, []int)
func (*MsgWirePayForData) GetMessage ¶ added in v0.4.0
func (m *MsgWirePayForData) GetMessage() []byte
func (*MsgWirePayForData) GetMessageNamespaceId ¶ added in v0.7.0
func (m *MsgWirePayForData) GetMessageNamespaceId() []byte
func (*MsgWirePayForData) GetMessageShareCommitment ¶ added in v0.4.0
func (m *MsgWirePayForData) GetMessageShareCommitment() []ShareCommitAndSignature
func (*MsgWirePayForData) GetMessageSize ¶ added in v0.4.0
func (m *MsgWirePayForData) GetMessageSize() uint64
func (*MsgWirePayForData) GetSigner ¶ added in v0.4.0
func (m *MsgWirePayForData) GetSigner() string
func (*MsgWirePayForData) GetSigners ¶ added in v0.4.0
func (msg *MsgWirePayForData) GetSigners() []sdk.AccAddress
GetSigners returns the addresses of the message signers
func (*MsgWirePayForData) Marshal ¶ added in v0.4.0
func (m *MsgWirePayForData) Marshal() (dAtA []byte, err error)
func (*MsgWirePayForData) MarshalTo ¶ added in v0.4.0
func (m *MsgWirePayForData) MarshalTo(dAtA []byte) (int, error)
func (*MsgWirePayForData) MarshalToSizedBuffer ¶ added in v0.4.0
func (m *MsgWirePayForData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgWirePayForData) ProtoMessage ¶ added in v0.4.0
func (*MsgWirePayForData) ProtoMessage()
func (*MsgWirePayForData) Reset ¶ added in v0.4.0
func (m *MsgWirePayForData) Reset()
func (*MsgWirePayForData) Route ¶ added in v0.4.0
func (msg *MsgWirePayForData) Route() string
func (*MsgWirePayForData) SignShareCommitments ¶ added in v0.4.0
func (msg *MsgWirePayForData) SignShareCommitments(signer *KeyringSigner, options ...TxBuilderOption) error
SignShareCommitments creates and signs MsgPayForDatas for each square size configured in the MsgWirePayForData to complete each shares commitment.
func (*MsgWirePayForData) Size ¶ added in v0.4.0
func (m *MsgWirePayForData) Size() (n int)
func (*MsgWirePayForData) String ¶ added in v0.4.0
func (m *MsgWirePayForData) String() string
func (*MsgWirePayForData) Unmarshal ¶ added in v0.4.0
func (m *MsgWirePayForData) Unmarshal(dAtA []byte) error
func (*MsgWirePayForData) ValidateAllSquareSizesCommitedTo ¶ added in v0.7.0
func (msg *MsgWirePayForData) ValidateAllSquareSizesCommitedTo() error
ValidateAllSquareSizesCommitedTo returns an error if the list of square sizes committed to don't match all square sizes expected for this message size.
func (*MsgWirePayForData) ValidateBasic ¶ added in v0.4.0
func (msg *MsgWirePayForData) ValidateBasic() error
ValidateBasic checks for valid namespace length, declared message size, share commitments, signatures for those share commitments, and fulfills the sdk.Msg interface.
func (*MsgWirePayForData) ValidateMessageShareCommitments ¶ added in v0.7.0
func (msg *MsgWirePayForData) ValidateMessageShareCommitments() error
ValidateMessageShareCommitments returns an error if the message share commitments are invalid.
func (*MsgWirePayForData) XXX_DiscardUnknown ¶ added in v0.4.0
func (m *MsgWirePayForData) XXX_DiscardUnknown()
func (*MsgWirePayForData) XXX_Marshal ¶ added in v0.4.0
func (m *MsgWirePayForData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgWirePayForData) XXX_Merge ¶ added in v0.4.0
func (m *MsgWirePayForData) XXX_Merge(src proto.Message)
func (*MsgWirePayForData) XXX_Size ¶ added in v0.4.0
func (m *MsgWirePayForData) XXX_Size() int
func (*MsgWirePayForData) XXX_Unmarshal ¶ added in v0.4.0
func (m *MsgWirePayForData) XXX_Unmarshal(b []byte) error
type MsgWirePayForDataResponse ¶ added in v0.4.0
type MsgWirePayForDataResponse struct { }
MsgWirePayForDataResponse describes the response returned after the submission of a WirePayForData
func (*MsgWirePayForDataResponse) Descriptor ¶ added in v0.4.0
func (*MsgWirePayForDataResponse) Descriptor() ([]byte, []int)
func (*MsgWirePayForDataResponse) Marshal ¶ added in v0.4.0
func (m *MsgWirePayForDataResponse) Marshal() (dAtA []byte, err error)
func (*MsgWirePayForDataResponse) MarshalTo ¶ added in v0.4.0
func (m *MsgWirePayForDataResponse) MarshalTo(dAtA []byte) (int, error)
func (*MsgWirePayForDataResponse) MarshalToSizedBuffer ¶ added in v0.4.0
func (m *MsgWirePayForDataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*MsgWirePayForDataResponse) ProtoMessage ¶ added in v0.4.0
func (*MsgWirePayForDataResponse) ProtoMessage()
func (*MsgWirePayForDataResponse) Reset ¶ added in v0.4.0
func (m *MsgWirePayForDataResponse) Reset()
func (*MsgWirePayForDataResponse) Size ¶ added in v0.4.0
func (m *MsgWirePayForDataResponse) Size() (n int)
func (*MsgWirePayForDataResponse) String ¶ added in v0.4.0
func (m *MsgWirePayForDataResponse) String() string
func (*MsgWirePayForDataResponse) Unmarshal ¶ added in v0.4.0
func (m *MsgWirePayForDataResponse) Unmarshal(dAtA []byte) error
func (*MsgWirePayForDataResponse) XXX_DiscardUnknown ¶ added in v0.4.0
func (m *MsgWirePayForDataResponse) XXX_DiscardUnknown()
func (*MsgWirePayForDataResponse) XXX_Marshal ¶ added in v0.4.0
func (m *MsgWirePayForDataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*MsgWirePayForDataResponse) XXX_Merge ¶ added in v0.4.0
func (m *MsgWirePayForDataResponse) XXX_Merge(src proto.Message)
func (*MsgWirePayForDataResponse) XXX_Size ¶ added in v0.4.0
func (m *MsgWirePayForDataResponse) XXX_Size() int
func (*MsgWirePayForDataResponse) XXX_Unmarshal ¶ added in v0.4.0
func (m *MsgWirePayForDataResponse) XXX_Unmarshal(b []byte) error
type QueryClient ¶
type QueryClient interface { }
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 ShareCommitAndSignature ¶
type ShareCommitAndSignature struct {}
ShareCommitAndSignature defines the
func (*ShareCommitAndSignature) Descriptor ¶
func (*ShareCommitAndSignature) Descriptor() ([]byte, []int)
func (*ShareCommitAndSignature) GetShareCommitment ¶
func (m *ShareCommitAndSignature) GetShareCommitment() []byte
func (*ShareCommitAndSignature) GetSignature ¶
func (m *ShareCommitAndSignature) GetSignature() []byte
func (*ShareCommitAndSignature) GetSquareSize ¶ added in v0.7.0
func (m *ShareCommitAndSignature) GetSquareSize() uint64
func (*ShareCommitAndSignature) Marshal ¶
func (m *ShareCommitAndSignature) Marshal() (dAtA []byte, err error)
func (*ShareCommitAndSignature) MarshalTo ¶
func (m *ShareCommitAndSignature) MarshalTo(dAtA []byte) (int, error)
func (*ShareCommitAndSignature) MarshalToSizedBuffer ¶
func (m *ShareCommitAndSignature) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ShareCommitAndSignature) ProtoMessage ¶
func (*ShareCommitAndSignature) ProtoMessage()
func (*ShareCommitAndSignature) Reset ¶
func (m *ShareCommitAndSignature) Reset()
func (*ShareCommitAndSignature) Size ¶
func (m *ShareCommitAndSignature) Size() (n int)
func (*ShareCommitAndSignature) String ¶
func (m *ShareCommitAndSignature) String() string
func (*ShareCommitAndSignature) Unmarshal ¶
func (m *ShareCommitAndSignature) Unmarshal(dAtA []byte) error
func (*ShareCommitAndSignature) XXX_DiscardUnknown ¶
func (m *ShareCommitAndSignature) XXX_DiscardUnknown()
func (*ShareCommitAndSignature) XXX_Marshal ¶
func (m *ShareCommitAndSignature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ShareCommitAndSignature) XXX_Merge ¶
func (m *ShareCommitAndSignature) XXX_Merge(src proto.Message)
func (*ShareCommitAndSignature) XXX_Size ¶
func (m *ShareCommitAndSignature) XXX_Size() int
func (*ShareCommitAndSignature) XXX_Unmarshal ¶
func (m *ShareCommitAndSignature) XXX_Unmarshal(b []byte) error
type TxBuilderOption ¶ added in v0.1.0
func SetFeeAmount ¶ added in v0.1.0
func SetFeeAmount(fees sdk.Coins) TxBuilderOption
func SetFeeGranter ¶ added in v0.5.4
func SetFeeGranter(feeGranter sdk.AccAddress) TxBuilderOption
func SetFeePayer ¶ added in v0.5.4
func SetFeePayer(feePayer sdk.AccAddress) TxBuilderOption
func SetGasLimit ¶ added in v0.1.0
func SetGasLimit(limit uint64) TxBuilderOption
func SetMemo ¶ added in v0.5.4
func SetMemo(memo string) TxBuilderOption
func SetTimeoutHeight ¶ added in v0.5.4
func SetTimeoutHeight(height uint64) TxBuilderOption
func SetTip ¶ added in v0.5.4
func SetTip(tip *tx.Tip) TxBuilderOption
type UnimplementedMsgServer ¶
type UnimplementedMsgServer struct { }
UnimplementedMsgServer can be embedded to have forward compatible implementations.
func (*UnimplementedMsgServer) PayForData ¶ added in v0.4.0
func (*UnimplementedMsgServer) PayForData(ctx context.Context, req *MsgPayForData) (*MsgPayForDataResponse, error)
type UnimplementedQueryServer ¶
type UnimplementedQueryServer struct { }
UnimplementedQueryServer can be embedded to have forward compatible implementations.