Documentation
¶
Index ¶
- Constants
- Variables
- func AddWithdrawal(txn *badger.Txn, address string, amount uint64, add bool) error
- func BroadcastedBlobTxKey(id TxID) []byte
- func BroadcastedWithdrawalTxKey(id TxID) []byte
- func CommittedBlobKey(id BlobID) []byte
- func ExpiredBlobKey(id BlobID) []byte
- func Hash(b []byte) []byte
- func HeightFromBytes(heightBytes []byte) uint64
- func HeightToBytes(h uint64) []byte
- func LastBlobIDKey() []byte
- func NewBlobMeta(signer string, fee uint64) *wire.BlobMeta
- func NonceKey(nonce uint64) []byte
- func ParseAddressFromKey(withdrawalKey []byte) string
- func PendingBlobKey(id BlobID) []byte
- func ToUint64s(ids []BlobID) []uint64
- func WithdrawalKey(address string) []byte
- type Blob
- func (b *Blob) BlobMeta() *wire.BlobMeta
- func (b *Blob) Blobs() [][]byte
- func (b *Blob) Compact() bool
- func (b *Blob) EstimatedGas() uint64
- func (b *Blob) ExpiryHeight() uint64
- func (b *Blob) Fee() uint64
- func (b *Blob) Hash() []byte
- func (b *Blob) ID() BlobID
- func (b *Blob) InsertHeight() uint64
- func (b *Blob) Namespace() []byte
- func (b *Blob) NamespaceVersion() uint32
- func (b *Blob) ShareVersion() uint32
- func (b *Blob) Signer() string
- func (b *Blob) TimeoutBlocks() uint64
- type BlobID
- type Pool
- func (p *Pool) Add(signer string, namespace []byte, blobs [][]byte, fee, estimatedGas uint64, ...) (BlobID, error)
- func (p *Pool) Cancel(id BlobID) error
- func (p *Pool) CommitTx(txn *badger.Txn, txID TxID, pfbHash []byte) error
- func (p *Pool) GetAllWithdrawals() map[string]uint64
- func (p *Pool) GetPendingTx(id BlobID) *Blob
- func (p *Pool) GetPendingWithdrawalAmount(address string) uint64
- func (p *Pool) MarkBroadcasted(txID TxID, blobIDs []BlobID, timeoutHeight uint64) error
- func (p *Pool) MarkFailed(txID TxID, height uint64) error
- func (p *Pool) MarkWithdrawalTxBroadcasted(txID TxID, withdrawals map[string]uint64, timeoutHeight uint64) error
- func (p *Pool) MarkWithdrawalTxFailed(txID TxID) error
- func (p *Pool) MarkWithdrawalsComplete(txID TxID) (int, error)
- func (p *Pool) ProcessWithdrawal(address string, amount uint64) error
- func (p *Pool) Pull(gasPrice float64, fixedPFBGas uint64) []*Blob
- func (p *Pool) Status(id BlobID) *wire.StatusResponse
- func (p *Pool) Update(height uint64) (int, error)
- func (p *Pool) WasBroadcasted(txID TxID) bool
- func (p *Pool) WasWithdrawalBroadcasted(txID TxID) bool
- type Store
- func (s *Store) DeleteCommittedTxs(ids []BlobID) error
- func (s *Store) DeleteExpiredTxs(ids []BlobID) error
- func (s *Store) DeletePendingBlob(id BlobID, hook func(txn *badger.Txn) error) error
- func (s *Store) DeleteWithdrawalTx(txID TxID) error
- func (s *Store) GetBlobMeta(id BlobID) (*wire.BlobMeta, error)
- func (s *Store) GetCommittedBlob(id BlobID) (*wire.BlobMeta, error)
- func (s *Store) GetExpired(id BlobID) (uint64, error)
- func (s *Store) GetLastBlobKey() (BlobID, error)
- func (s *Store) GetMostRecentCommittedTxs(limit BlobID) (map[BlobID]*wire.BlobMeta, error)
- func (s *Store) LoadAllBroadcastedBlobTxs() (map[TxID]*wire.BlobTx, error)
- func (s *Store) LoadRecentlyExpiredTxs(limit BlobID) (map[BlobID]uint64, error)
- func (s *Store) MarkAsTimedOut(txs []TxID, blobs []*Blob, height uint64) error
- func (s *Store) MarkBroadcasted(txID TxID, ids []BlobID, height uint64) error
- func (s *Store) MarkCommitted(txn *badger.Txn, blobIds []BlobID, txHash []byte) error
- func (s *Store) MarkExpired(blobs []*Blob, height uint64) error
- func (s *Store) MarkFailed(txID TxID, blobs []*Blob, height uint64) error
- func (s *Store) MoveWithdrawalToBroadcast(txID TxID, withdrawalTx *wire.WithdrawalTx) error
- func (s *Store) MoveWithdrawalToPending(txID TxID) error
- func (s *Store) RefundLostPendingTxs(height uint64) (map[BlobID]uint64, error)
- func (s *Store) SetPendingBlob(blobMeta *wire.BlobMeta, hook func(txn *badger.Txn) error) (BlobID, error)
- func (s *Store) SetWidthdrawal(address string, amount uint64) error
- type TxID
Constants ¶
Variables ¶
View Source
var ErrTxNotFound = errors.New("transaction not found")
Functions ¶
func AddWithdrawal ¶
func BroadcastedBlobTxKey ¶
func CommittedBlobKey ¶
func ExpiredBlobKey ¶
func HeightFromBytes ¶
func HeightToBytes ¶
func LastBlobIDKey ¶
func LastBlobIDKey() []byte
func ParseAddressFromKey ¶
func PendingBlobKey ¶
func WithdrawalKey ¶
Types ¶
type Blob ¶
type Blob struct {
// contains filtered or unexported fields
}
func (*Blob) EstimatedGas ¶
func (*Blob) ExpiryHeight ¶
func (*Blob) Hash ¶
Hash is the sha256 of the signer, namespace, blobs and fee It is used to represent uniqueness of a transaction
func (*Blob) InsertHeight ¶
func (*Blob) NamespaceVersion ¶
func (*Blob) ShareVersion ¶
func (*Blob) TimeoutBlocks ¶
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
func (*Pool) GetAllWithdrawals ¶
func (*Pool) GetPendingTx ¶
func (*Pool) GetPendingWithdrawalAmount ¶
func (*Pool) MarkBroadcasted ¶
func (*Pool) MarkWithdrawalTxBroadcasted ¶
func (*Pool) MarkWithdrawalTxFailed ¶
func (*Pool) MarkWithdrawalsComplete ¶
func (*Pool) ProcessWithdrawal ¶
func (*Pool) WasBroadcasted ¶
func (*Pool) WasWithdrawalBroadcasted ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) DeleteCommittedTxs ¶
func (*Store) DeleteExpiredTxs ¶
func (*Store) DeletePendingBlob ¶
func (*Store) DeleteWithdrawalTx ¶
func (*Store) GetCommittedBlob ¶
func (*Store) GetLastBlobKey ¶
func (*Store) GetMostRecentCommittedTxs ¶
func (*Store) LoadAllBroadcastedBlobTxs ¶
func (*Store) LoadRecentlyExpiredTxs ¶
func (*Store) MarkAsTimedOut ¶
func (*Store) MarkBroadcasted ¶
func (*Store) MarkCommitted ¶
func (*Store) MarkFailed ¶
func (*Store) MoveWithdrawalToBroadcast ¶
func (s *Store) MoveWithdrawalToBroadcast(txID TxID, withdrawalTx *wire.WithdrawalTx) error
func (*Store) MoveWithdrawalToPending ¶
func (*Store) RefundLostPendingTxs ¶
func (*Store) SetPendingBlob ¶
type TxID ¶
type TxID string
ID is the sha256 hash of the raw tx that is submitted and committed in a block. In the case of a blob tx, the pfb tx is used
func TxIDFromKey ¶
Click to show internal directories.
Click to hide internal directories.