Documentation ¶
Index ¶
- Constants
- type DummyStorage
- func (s *DummyStorage) Close() error
- func (s *DummyStorage) GetAllPendingTxs() ([]*relay.PendingSubmittedTxInfo, error)
- func (s *DummyStorage) GetLastQueryHeight(queryID uint64) (uint64, bool, error)
- func (s *DummyStorage) SetLastQueryHeight(queryID uint64, block uint64) error
- func (s *DummyStorage) SetTxStatus(queryID uint64, hash string, neutronHash string, status relay.SubmittedTxInfo) (err error)
- func (s *DummyStorage) TxExists(queryID uint64, hash string) (exists bool, err error)
- type LevelDBStorage
- func (s *LevelDBStorage) Close() error
- func (s *LevelDBStorage) GetAllPendingTxs() ([]*relay.PendingSubmittedTxInfo, error)
- func (s *LevelDBStorage) GetLastQueryHeight(queryID uint64) (block uint64, found bool, err error)
- func (s *LevelDBStorage) SetLastQueryHeight(queryID uint64, block uint64) error
- func (s *LevelDBStorage) SetTxStatus(queryID uint64, hash string, neutronHash string, status relay.SubmittedTxInfo) (err error)
- func (s *LevelDBStorage) TxExists(queryID uint64, hash string) (exists bool, err error)
Constants ¶
View Source
const SubmittedTxStatusPrefix = "submitted_txs"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DummyStorage ¶
func NewDummyStorage ¶
func NewDummyStorage() *DummyStorage
func (*DummyStorage) Close ¶
func (s *DummyStorage) Close() error
func (*DummyStorage) GetAllPendingTxs ¶
func (s *DummyStorage) GetAllPendingTxs() ([]*relay.PendingSubmittedTxInfo, error)
func (*DummyStorage) GetLastQueryHeight ¶
func (s *DummyStorage) GetLastQueryHeight(queryID uint64) (uint64, bool, error)
func (*DummyStorage) SetLastQueryHeight ¶
func (s *DummyStorage) SetLastQueryHeight(queryID uint64, block uint64) error
func (*DummyStorage) SetTxStatus ¶
func (s *DummyStorage) SetTxStatus(queryID uint64, hash string, neutronHash string, status relay.SubmittedTxInfo) (err error)
type LevelDBStorage ¶
LevelDBStorage Basically has a simple structure inside: we have 2 maps first one : map of queryID -> last block this query has been processed second one: map of queryID+txHash -> status of sent tx
func NewLevelDBStorage ¶
func NewLevelDBStorage(path string) (*LevelDBStorage, error)
func (*LevelDBStorage) Close ¶
func (s *LevelDBStorage) Close() error
func (*LevelDBStorage) GetAllPendingTxs ¶
func (s *LevelDBStorage) GetAllPendingTxs() ([]*relay.PendingSubmittedTxInfo, error)
func (*LevelDBStorage) GetLastQueryHeight ¶
func (s *LevelDBStorage) GetLastQueryHeight(queryID uint64) (block uint64, found bool, err error)
GetLastQueryHeight returns last update block for KV query
func (*LevelDBStorage) SetLastQueryHeight ¶
func (s *LevelDBStorage) SetLastQueryHeight(queryID uint64, block uint64) error
SetLastQueryHeight sets last processed block to given query
func (*LevelDBStorage) SetTxStatus ¶
func (s *LevelDBStorage) SetTxStatus(queryID uint64, hash string, neutronHash string, status relay.SubmittedTxInfo) (err error)
SetTxStatus sets status for given tx queryID + hash can be one of 4 statuses:
- Error while submitting tx - relay.ErrorOnSubmit
- tx submitted successfully (temporary status, should be updated after neutron tx committed into the block) - relay.Submitted 2.a) failed to commit tx into the block - relay.ErrorOnCommit 2.b) tx successfully committed - relay.Committed
To convert status from "2" to either "2.a" or "2.b" we use additional SubmittedTxStatusPrefix storage to track txs
Click to show internal directories.
Click to hide internal directories.