exbalance

package
v0.0.0-...-868bdbc Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2020 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadDB

func LoadDB() db.DB

func New

func New() *memory

func NewDB

func NewDB(db db.DB) *memory

Types

type AccountCache

type AccountCache struct {
	Account              statedb.Account
	LastExtHERBalance    *big.Int
	CurrentExtHERBalance *big.Int
	IsFirstHEREntry      bool
	IsNewHERAmountUpdate bool
	LastExtBalance       map[string]*big.Int
	CurrentExtBalance    map[string]*big.Int
	IsFirstEntry         map[string]bool
	IsNewAmountUpdate    map[string]bool
}

AccountCache holds the balance detail of an Account that we need to use while updating balances of external assets

func (AccountCache) UpdateAccount

func (ac AccountCache) UpdateAccount(account statedb.Account) AccountCache

func (AccountCache) UpdateCurrentExtBalanceByKey

func (as AccountCache) UpdateCurrentExtBalanceByKey(key string, val *big.Int) AccountCache

func (AccountCache) UpdateCurrentExtHERBalance

func (ac AccountCache) UpdateCurrentExtHERBalance(lchb *big.Int) AccountCache

func (AccountCache) UpdateIsFirstEntryByKey

func (as AccountCache) UpdateIsFirstEntryByKey(key string, val bool) AccountCache

func (AccountCache) UpdateIsFirstHER

func (ac AccountCache) UpdateIsFirstHER(isFirst bool) AccountCache

func (AccountCache) UpdateIsNewAmountUpdateByKey

func (as AccountCache) UpdateIsNewAmountUpdateByKey(key string, val bool) AccountCache

func (AccountCache) UpdateIsNewHERAmountUpdate

func (ac AccountCache) UpdateIsNewHERAmountUpdate(isnew bool) AccountCache

func (AccountCache) UpdateLastExtBalanceByKey

func (as AccountCache) UpdateLastExtBalanceByKey(key string, val *big.Int) AccountCache

func (AccountCache) UpdateLastExtHERBalance

func (ac AccountCache) UpdateLastExtHERBalance(lehb *big.Int) AccountCache

type BalanceStorage

type BalanceStorage interface {
	Set(k string, x AccountCache)
	Get(k string) (AccountCache, bool)
	GetAll() map[string]AccountCache
	Close()
}

Jump to

Keyboard shortcuts

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