model

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2019 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddrListDbDeserialize

func AddrListDbDeserialize(buf []byte) ([]types.Address, error)

func AddrListDbSerialize

func AddrListDbSerialize(addrList []types.Address) ([]byte, error)

Types

type ContractCallerList added in v1.2.0

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

func (*ContractCallerList) AddNewTx added in v1.2.0

func (cList *ContractCallerList) AddNewTx(block *ledger.AccountBlock)

func (*ContractCallerList) AddTotalNum added in v1.2.0

func (cList *ContractCallerList) AddTotalNum()

func (*ContractCallerList) GetCurrentIndex added in v1.2.0

func (cList *ContractCallerList) GetCurrentIndex() int

func (*ContractCallerList) GetNextTx added in v1.2.0

func (cList *ContractCallerList) GetNextTx() *ledger.AccountBlock

func (*ContractCallerList) Len added in v1.2.0

func (cList *ContractCallerList) Len() int

func (*ContractCallerList) SubTotalNum added in v1.2.0

func (cList *ContractCallerList) SubTotalNum()

func (*ContractCallerList) TxRemain added in v1.2.0

func (cList *ContractCallerList) TxRemain() int

type OnroadAccountInfo

type OnroadAccountInfo struct {
	Mutex               sync.RWMutex
	AccountAddress      *types.Address
	TotalNumber         uint64
	TokenBalanceInfoMap map[types.TokenTypeId]*TokenBalanceInfo
}

type OnroadBlocksPool

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

obtaining the account info from cache or db and manage the cache lifecycle

func NewOnroadBlocksPool

func NewOnroadBlocksPool(dbAccess *UAccess) *OnroadBlocksPool

func (*OnroadBlocksPool) AcquireFullOnroadBlocksCache

func (p *OnroadBlocksPool) AcquireFullOnroadBlocksCache(addr types.Address)

func (*OnroadBlocksPool) AcquireOnroadSortedContractCache added in v1.2.0

func (p *OnroadBlocksPool) AcquireOnroadSortedContractCache(addr types.Address)

func (*OnroadBlocksPool) AddCommonTxLis

func (p *OnroadBlocksPool) AddCommonTxLis(addr types.Address, f func())

func (*OnroadBlocksPool) AddContractLis

func (p *OnroadBlocksPool) AddContractLis(gid types.Gid, f func(address types.Address))

func (*OnroadBlocksPool) Close

func (p *OnroadBlocksPool) Close() error

func (*OnroadBlocksPool) DeleteContractCache added in v1.2.0

func (p *OnroadBlocksPool) DeleteContractCache(gid types.Gid)

func (*OnroadBlocksPool) DeleteDirect

func (p *OnroadBlocksPool) DeleteDirect(sendBlock *ledger.AccountBlock) error

func (*OnroadBlocksPool) GetContractCallerList added in v1.2.0

func (p *OnroadBlocksPool) GetContractCallerList(addr types.Address) *ContractCallerList

func (*OnroadBlocksPool) GetNextCommonTx

func (p *OnroadBlocksPool) GetNextCommonTx(addr types.Address) *ledger.AccountBlock

func (*OnroadBlocksPool) GetNextContractTx added in v1.2.0

func (p *OnroadBlocksPool) GetNextContractTx(addr types.Address) *ledger.AccountBlock

func (*OnroadBlocksPool) GetOnroadAccountInfo

func (p *OnroadBlocksPool) GetOnroadAccountInfo(addr types.Address) (*OnroadAccountInfo, error)

func (*OnroadBlocksPool) NewSignalToWorker

func (p *OnroadBlocksPool) NewSignalToWorker(block *ledger.AccountBlock)

func (*OnroadBlocksPool) ReleaseContractCache added in v1.2.0

func (p *OnroadBlocksPool) ReleaseContractCache(addr types.Address)

func (*OnroadBlocksPool) ReleaseFullOnroadBlocksCache

func (p *OnroadBlocksPool) ReleaseFullOnroadBlocksCache(addr types.Address) error

func (*OnroadBlocksPool) RemoveCommonTxLis

func (p *OnroadBlocksPool) RemoveCommonTxLis(addr types.Address)

func (*OnroadBlocksPool) RemoveContractLis

func (p *OnroadBlocksPool) RemoveContractLis(gid types.Gid)

func (*OnroadBlocksPool) ResetCacheCursor

func (p *OnroadBlocksPool) ResetCacheCursor(addr types.Address)

func (*OnroadBlocksPool) RevertOnroad

func (p *OnroadBlocksPool) RevertOnroad(batch *leveldb.Batch, subLedger map[types.Address][]*ledger.AccountBlock) error

RevertOnroad means to revert according to bifurcation

func (*OnroadBlocksPool) RevertOnroadSuccess

func (p *OnroadBlocksPool) RevertOnroadSuccess(subLedger map[types.Address][]*ledger.AccountBlock)

func (*OnroadBlocksPool) WriteOnroad

func (p *OnroadBlocksPool) WriteOnroad(batch *leveldb.Batch, blockList []*vm_context.VmAccountBlock) error

func (*OnroadBlocksPool) WriteOnroadSuccess

func (p *OnroadBlocksPool) WriteOnroadSuccess(blocks []*vm_context.VmAccountBlock)

type OnroadMeta

type OnroadMeta struct {
	Gid     []byte
	Address types.Address
	Hash    types.Hash
}

type OnroadSet

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

func NewOnroadSet

func NewOnroadSet(chain chain.Chain) *OnroadSet

func (*OnroadSet) DeleteMeta

func (ucf *OnroadSet) DeleteMeta(batch *leveldb.Batch, addr *types.Address, hash *types.Hash) error

func (*OnroadSet) GetContractAddrList

func (ucf *OnroadSet) GetContractAddrList(gid *types.Gid) ([]types.Address, error)

func (*OnroadSet) GetCountByAddress

func (ucf *OnroadSet) GetCountByAddress(addr *types.Address) (count uint64, err error)

func (*OnroadSet) GetHashList

func (ucf *OnroadSet) GetHashList(addr *types.Address) (hashs []*types.Hash, err error)

func (*OnroadSet) GetHashsByCount

func (ucf *OnroadSet) GetHashsByCount(count uint64, addr *types.Address) (hashs []*types.Hash, err error)

func (*OnroadSet) WriteGidAddrList

func (ucf *OnroadSet) WriteGidAddrList(batch *leveldb.Batch, gid *types.Gid, addrList []types.Address) error

func (*OnroadSet) WriteMeta

func (ucf *OnroadSet) WriteMeta(batch *leveldb.Batch, addr *types.Address, hash *types.Hash) error

type TokenBalanceInfo

type TokenBalanceInfo struct {
	TotalAmount big.Int
	Number      uint64
}

type UAccess

type UAccess struct {
	Chain chain.Chain
	// contains filtered or unexported fields
}

func NewUAccess

func NewUAccess() *UAccess

func (*UAccess) DeleteContractAddrFromGid

func (access *UAccess) DeleteContractAddrFromGid(batch *leveldb.Batch, gid types.Gid, address types.Address) error

func (*UAccess) GetAllOnroadBlocks

func (access *UAccess) GetAllOnroadBlocks(addr types.Address) (blockList []*ledger.AccountBlock, err error)

func (*UAccess) GetCommonAccInfo

func (access *UAccess) GetCommonAccInfo(addr *types.Address) (info *OnroadAccountInfo, err error)

func (*UAccess) GetCommonAccTokenInfoMap

func (access *UAccess) GetCommonAccTokenInfoMap(addr *types.Address) (map[types.TokenTypeId]*TokenBalanceInfo, uint64, error)

func (*UAccess) GetContractAddrListByGid

func (access *UAccess) GetContractAddrListByGid(gid *types.Gid) ([]types.Address, error)

func (*UAccess) GetOnroadBlocks

func (access *UAccess) GetOnroadBlocks(index, num, count uint64, addr *types.Address) (blockList []*ledger.AccountBlock, err error)

func (*UAccess) GetOnroadHashs

func (access *UAccess) GetOnroadHashs(index, num, count uint64, addr *types.Address) ([]*types.Hash, error)

func (*UAccess) Init

func (access *UAccess) Init(chain chain.Chain)

func (*UAccess) WriteContractAddrToGid

func (access *UAccess) WriteContractAddrToGid(batch *leveldb.Batch, gid types.Gid, address types.Address) error

Jump to

Keyboard shortcuts

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