Documentation
¶
Index ¶
- func ComparePrice(hi, hj *cc.CrossTransactionWithSignatures) bool
- func NewCacheDb(chainID *big.Int, db ethdb.KeyValueStore, cacheSize uint64) *cacheDB
- func NewIndexDB(chainID *big.Int, rootDB *storm.DB, cacheSize uint64) *indexDB
- func OpenEtherDB(ctx ServiceContext, name string) (ethdb.Database, error)
- func OpenStormDB(ctx ServiceContext, name string) (*storm.DB, error)
- type CrossTransactionIndexed
- type CtxDB
- type CtxSortedByBlockNum
- func (m *CtxSortedByBlockNum) Get(txId common.Hash) *cc.CrossTransactionWithSignatures
- func (m *CtxSortedByBlockNum) Len() int
- func (m *CtxSortedByBlockNum) Map(do func(*cc.CrossTransactionWithSignatures) bool)
- func (m *CtxSortedByBlockNum) Put(ctx *cc.CrossTransactionWithSignatures, number uint64)
- func (m *CtxSortedByBlockNum) RemoveByHash(hash common.Hash)
- func (m *CtxSortedByBlockNum) RemoveUnderNum(num uint64)
- type CtxSortedByPrice
- func (t *CtxSortedByPrice) Add(tx *cc.CrossTransactionWithSignatures)
- func (t *CtxSortedByPrice) Cap() uint64
- func (t *CtxSortedByPrice) Count() int
- func (t *CtxSortedByPrice) Get(id common.Hash) *cc.CrossTransactionWithSignatures
- func (t *CtxSortedByPrice) GetAll() map[common.Hash]*cc.CrossTransactionWithSignatures
- func (t *CtxSortedByPrice) GetList(filter func(*cc.CrossTransactionWithSignatures) bool, pageSize int) []*cc.CrossTransactionWithSignatures
- func (t *CtxSortedByPrice) Remove(id common.Hash) bool
- func (t *CtxSortedByPrice) Update(id common.Hash, updater func(*cc.CrossTransactionWithSignatures))
- type CtxToBlockHash
- type ErrCtxDbFailure
- type FieldName
- type Filter
- type IndexDbCache
- func (m *IndexDbCache) Get(index FieldName, key interface{}) *CrossTransactionIndexed
- func (m *IndexDbCache) Has(index FieldName, key interface{}) bool
- func (m *IndexDbCache) Put(index FieldName, key interface{}, ctx *CrossTransactionIndexed)
- func (m *IndexDbCache) Remove(index FieldName, key interface{})
- type ServiceContext
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComparePrice ¶
func ComparePrice(hi, hj *cc.CrossTransactionWithSignatures) bool
func NewCacheDb ¶
func NewCacheDb(chainID *big.Int, db ethdb.KeyValueStore, cacheSize uint64) *cacheDB
func NewIndexDB ¶
func OpenEtherDB ¶
func OpenEtherDB(ctx ServiceContext, name string) (ethdb.Database, error)
func OpenStormDB ¶
func OpenStormDB(ctx ServiceContext, name string) (*storm.DB, error)
Types ¶
type CrossTransactionIndexed ¶
type CrossTransactionIndexed struct {
PK uint64 `storm:"id,increment"`
CtxId common.Hash `storm:"unique"`
From common.Address `storm:"index"`
TxHash common.Hash `storm:"index"`
Price *big.Float `storm:"index"`
BlockNum uint64 `storm:"index"`
// normal field
Status cc.CtxStatus
Value *big.Int
BlockHash common.Hash
DestinationId *big.Int
DestinationValue *big.Int `storm:"index"`
Input []byte
V []*big.Int
R []*big.Int
S []*big.Int
}
func NewCrossTransactionIndexed ¶
func NewCrossTransactionIndexed(ctx *cc.CrossTransactionWithSignatures) *CrossTransactionIndexed
func (CrossTransactionIndexed) ToCrossTransaction ¶
func (c CrossTransactionIndexed) ToCrossTransaction() *cc.CrossTransactionWithSignatures
type CtxDB ¶
type CtxDB interface {
io.Closer
ChainID() *big.Int
//Size() int
Count(filter ...q.Matcher) int
Height() uint64
Load() error
Repair() error
Write(ctx *cc.CrossTransactionWithSignatures) error
Read(ctxId common.Hash) (*cc.CrossTransactionWithSignatures, error)
One(field FieldName, key interface{}) *cc.CrossTransactionWithSignatures
//ReadAll(ctxId common.Hash) (common.Hash, error)
//Delete(ctxId common.Hash, atNumber uint64) error
Update(id common.Hash, updater func(ctx *CrossTransactionIndexed)) error
Has(id common.Hash) bool
Query(pageSize int, startPage int, orderBy FieldName, filter ...q.Matcher) []*cc.CrossTransactionWithSignatures
RangeByNumber(begin, end uint64, pageSize int) []*cc.CrossTransactionWithSignatures
}
type CtxSortedByBlockNum ¶
type CtxSortedByBlockNum struct {
// contains filtered or unexported fields
}
func NewCtxSortedMap ¶
func NewCtxSortedMap() *CtxSortedByBlockNum
func (*CtxSortedByBlockNum) Get ¶
func (m *CtxSortedByBlockNum) Get(txId common.Hash) *cc.CrossTransactionWithSignatures
func (*CtxSortedByBlockNum) Len ¶
func (m *CtxSortedByBlockNum) Len() int
func (*CtxSortedByBlockNum) Map ¶ added in v1.0.4
func (m *CtxSortedByBlockNum) Map(do func(*cc.CrossTransactionWithSignatures) bool)
func (*CtxSortedByBlockNum) Put ¶
func (m *CtxSortedByBlockNum) Put(ctx *cc.CrossTransactionWithSignatures, number uint64)
func (*CtxSortedByBlockNum) RemoveByHash ¶
func (m *CtxSortedByBlockNum) RemoveByHash(hash common.Hash)
func (*CtxSortedByBlockNum) RemoveUnderNum ¶
func (m *CtxSortedByBlockNum) RemoveUnderNum(num uint64)
type CtxSortedByPrice ¶
type CtxSortedByPrice struct {
// contains filtered or unexported fields
}
func NewCtxSortedByPrice ¶
func NewCtxSortedByPrice(cap uint64) *CtxSortedByPrice
func (*CtxSortedByPrice) Add ¶
func (t *CtxSortedByPrice) Add(tx *cc.CrossTransactionWithSignatures)
func (*CtxSortedByPrice) Cap ¶
func (t *CtxSortedByPrice) Cap() uint64
func (*CtxSortedByPrice) Count ¶
func (t *CtxSortedByPrice) Count() int
Count returns the current number of items in the all.
func (*CtxSortedByPrice) Get ¶
func (t *CtxSortedByPrice) Get(id common.Hash) *cc.CrossTransactionWithSignatures
func (*CtxSortedByPrice) GetAll ¶
func (t *CtxSortedByPrice) GetAll() map[common.Hash]*cc.CrossTransactionWithSignatures
func (*CtxSortedByPrice) GetList ¶
func (t *CtxSortedByPrice) GetList(filter func(*cc.CrossTransactionWithSignatures) bool, pageSize int) []*cc.CrossTransactionWithSignatures
func (*CtxSortedByPrice) Remove ¶
func (t *CtxSortedByPrice) Remove(id common.Hash) bool
Remove removes a transaction from the all.
func (*CtxSortedByPrice) Update ¶
func (t *CtxSortedByPrice) Update(id common.Hash, updater func(*cc.CrossTransactionWithSignatures))
Update
type CtxToBlockHash ¶
func NewCtxToBlockHash ¶
func NewCtxToBlockHash(cap int) *CtxToBlockHash
type ErrCtxDbFailure ¶
type ErrCtxDbFailure struct {
// contains filtered or unexported fields
}
func (ErrCtxDbFailure) Error ¶
func (e ErrCtxDbFailure) Error() string
type Filter ¶
type Filter func(ctx *cc.CrossTransactionWithSignatures) bool
type IndexDbCache ¶
func (*IndexDbCache) Get ¶
func (m *IndexDbCache) Get(index FieldName, key interface{}) *CrossTransactionIndexed
func (*IndexDbCache) Has ¶
func (m *IndexDbCache) Has(index FieldName, key interface{}) bool
func (*IndexDbCache) Put ¶
func (m *IndexDbCache) Put(index FieldName, key interface{}, ctx *CrossTransactionIndexed)
func (*IndexDbCache) Remove ¶
func (m *IndexDbCache) Remove(index FieldName, key interface{})
Click to show internal directories.
Click to hide internal directories.