Documentation ¶
Index ¶
- Constants
- func MarshalBlobTx(tx []byte, blobs ...*share.Blob) ([]byte, error)
- func MarshalIndexWrapper(tx []byte, shareIndexes ...uint32) ([]byte, error)
- func NewIndexWrapper(tx []byte, shareIndexes ...uint32) *v1.IndexWrapper
- func UnmarshalIndexWrapper(tx []byte) (*v1.IndexWrapper, bool)
- type BlobTx
Constants ¶
const ( // ProtoBlobTxTypeID is included in each encoded BlobTx to help prevent // decoding binaries that are not actually BlobTxs. ProtoBlobTxTypeID = "BLOB" )
const ( // ProtoIndexWrapperTypeID is included in each encoded IndexWrapper to help prevent // decoding binaries that are not actually IndexWrappers. ProtoIndexWrapperTypeID = "INDX" )
Variables ¶
This section is empty.
Functions ¶
func MarshalBlobTx ¶
MarshalBlobTx creates a BlobTx using a normal transaction and some number of blobs.
NOTE: Any checks on the blobs or the transaction must be performed in the application
func MarshalIndexWrapper ¶
MarshalIndexWrapper creates a wrapped Tx that includes the original transaction and the share index of the start of its blob.
NOTE: must be unwrapped to be a viable sdk.Tx
func NewIndexWrapper ¶
func NewIndexWrapper(tx []byte, shareIndexes ...uint32) *v1.IndexWrapper
NewIndexWrapper creates a new IndexWrapper transaction.
func UnmarshalIndexWrapper ¶
func UnmarshalIndexWrapper(tx []byte) (*v1.IndexWrapper, bool)
UnmarshalIndexWrapper attempts to unmarshal the provided transaction into an IndexWrapper transaction. It returns true if the provided transaction is an IndexWrapper transaction. An IndexWrapper transaction is a transaction that contains a MsgPayForBlob that has been wrapped with a share index.
NOTE: protobuf sometimes does not throw an error if the transaction passed is not a IndexWrapper, since the protobuf definition for MsgPayForBlob is kept in the app, we cannot perform further checks without creating an import cycle.