txmgr

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CrossState

type CrossState interface {
	//txentry
	GetTxEntry(hash common.Hash) *types.TxEntry
	SaveTxEntry(block *types.Block, txsResult *types.TxsResult)
	DeleteTxEntry(block *types.Block)

	//specialtx
	AddSpecialTx(txs []types.Tx)

	//MultiSign
	GetMultiSignersInfo(txtype types.SupportType) *types.SignersInfo

	//new db batch
	NewDbBatch() dbm.Batch
	//flush db
	Sync()
}

CrossState an interface for txmgr.

type IBlockStore

type IBlockStore interface {
	LoadBlockCommit(height uint64) *types.Commit
	LoadBlock(height uint64) *types.Block
	GetTxFromBlock(block *types.Block, hash common.Hash) types.Tx
}

IBlockStore interface to avoid cycling reference.

type MockCrossState

type MockCrossState struct {
	mock.Mock
}

MockCrossState is an autogenerated mock type for the CrossState type

func (*MockCrossState) AddSpecialTx

func (_m *MockCrossState) AddSpecialTx(txs []types.Tx)

AddSpecialTx provides a mock function with given fields: txs

func (*MockCrossState) GetTxValidators

func (_m *MockCrossState) GetTxValidators(height uint64) ([]*types.Validator, error)

GetTxValidators provides a mock function with given fields: height

func (*MockCrossState) SaveTxEntry

func (_m *MockCrossState) SaveTxEntry(block *types.Block, txsResult *types.TxsResult)

SaveTxEntry provides a mock function with given fields: block, txsResult

func (*MockCrossState) SaveTxValidators

func (_m *MockCrossState) SaveTxValidators(height uint64, validators []*types.Validator)

SaveTxValidators provides a mock function with given fields: height, validators

func (*MockCrossState) Sync

func (_m *MockCrossState) Sync()

Sync provides a mock function with given fields:

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service manage special Txs.

func NewCrossState

func NewCrossState(db dbm.DB, bs IBlockStore) *Service

NewCrossState new a Service object with db blockstore.

func (*Service) AddSpecialTx

func (s *Service) AddSpecialTx(txs []types.Tx)

AddSpecialTx handles MultiSignAccountTx

func (*Service) DeleteTxEntry

func (s *Service) DeleteTxEntry(block *types.Block)

func (*Service) GetMultiSignersInfo

func (s *Service) GetMultiSignersInfo(txtype types.SupportType) *types.SignersInfo

GetMultiSignersInfo return the SignersInfo of txtype setted in MultiSignAccountTx

func (*Service) GetTxEntry

func (s *Service) GetTxEntry(hash common.Hash) *types.TxEntry

GetTxEntry return TxEntry from given hash

func (*Service) NewDbBatch

func (s *Service) NewDbBatch() dbm.Batch

func (*Service) SaveTxEntry

func (s *Service) SaveTxEntry(block *types.Block, txsResult *types.TxsResult)

SaveTxEntry save all txEntry of the block

func (*Service) SetLogger

func (s *Service) SetLogger(l log.Logger)

func (*Service) Sync

func (s *Service) Sync()

Sync flush data to disk.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL