matrixstate

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: May 17, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOptNotExist  = errors.New("operator not exist in manager")
	ErrStateDBNil   = errors.New("state db is nil")
	ErrParamReflect = errors.New("param reflect failed")
	ErrDataEmpty    = errors.New("data is empty")
	ErrParamNil     = errors.New("param is nil")
	ErrAccountNil   = errors.New("account is empty account")
	ErrDataSize     = errors.New("data size err")
	ErrFindManager  = errors.New("find manger err")
)

Functions

func GetAccountBlackList

func GetAccountBlackList(st StateDB) ([]common.Address, error)

func GetBlkCalc

func GetBlkCalc(st StateDB) (string, error)

func GetBlkRewardCfg

func GetBlkRewardCfg(st StateDB) (*mc.BlkRewardCfg, error)

/////////////////////////////////////////////////////////////////// 区块奖励相关

func GetBlockProduceBlackList

func GetBlockProduceBlackList(st StateDB) (*mc.BlockProduceSlashBlackList, error)

func GetBlockProduceSlashCfg

func GetBlockProduceSlashCfg(st StateDB) (*mc.BlockProduceSlashCfg, error)

func GetBlockProduceStats

func GetBlockProduceStats(st StateDB) (*mc.BlockProduceStats, error)

func GetBlockProduceStatsStatus

func GetBlockProduceStatsStatus(st StateDB) (*mc.BlockProduceSlashStatsStatus, error)

func GetBlockSuperAccounts

func GetBlockSuperAccounts(st StateDB) ([]common.Address, error)

func GetBroadcastAccounts

func GetBroadcastAccounts(st StateDB) ([]common.Address, error)

func GetBroadcastInterval

func GetBroadcastInterval(st StateDB) (*mc.BCIntervalInfo, error)

func GetBroadcastIntervalByVersion

func GetBroadcastIntervalByVersion(st StateDB, version string) (*mc.BCIntervalInfo, error)

func GetBroadcastTxs

func GetBroadcastTxs(st StateDB) (common.BroadTxSlice, error)

func GetBroadcastTxs(st StateDB) (map[string]map[common.Address][]byte, error)

func GetCoinConfig added in v1.1.2

func GetCoinConfig(st StateDB) ([]common.CoinConfig, error)
func GetCoinConfig(st StateDB) ([]common.CoinConfig, error) {
	version := GetVersionInfo(st)
	mgr := GetManager(version)
	if mgr == nil {
		return nil, ErrFindManager
	}
	opt, err := mgr.FindOperator(mc.MSCurrencyConfig)
	if err != nil {
		return nil, err
	}
	value, err := opt.GetValue(st)
	if err != nil {
		return nil, err
	}
	return value.([]common.CoinConfig), nil
}

func GetElectBlackList

func GetElectBlackList(st StateDB) ([]common.Address, error)

func GetElectConfigInfo

func GetElectConfigInfo(st StateDB) (*mc.ElectConfigInfo, error)

func GetElectGenTime

func GetElectGenTime(st StateDB) (*mc.ElectGenTimeStruct, error)

func GetElectGraph

func GetElectGraph(st StateDB) (*mc.ElectGraph, error)

func GetElectMinerNum

func GetElectMinerNum(st StateDB) (*mc.ElectMinerNumStruct, error)

func GetElectOnlineState

func GetElectOnlineState(st StateDB) (*mc.ElectOnlineStatus, error)

func GetElectWhiteList

func GetElectWhiteList(st StateDB) ([]common.Address, error)

func GetElectWhiteListSwitcher

func GetElectWhiteListSwitcher(st StateDB) (bool, error)

func GetFoundationAccount

func GetFoundationAccount(st StateDB) (common.Address, error)

func GetInnerMinerAccounts

func GetInnerMinerAccounts(st StateDB) ([]common.Address, error)

func GetInterestCalc

func GetInterestCalc(st StateDB) (string, error)

func GetInterestCalcNum

func GetInterestCalcNum(st StateDB) (uint64, error)

func GetInterestCfg

func GetInterestCfg(st StateDB) (*mc.InterestCfg, error)

/////////////////////////////////////////////////////////////////// 利息相关

func GetInterestPayNum

func GetInterestPayNum(st StateDB) (uint64, error)

func GetLeaderConfig

func GetLeaderConfig(st StateDB) (*mc.LeaderConfig, error)

func GetLotteryAccount

func GetLotteryAccount(st StateDB) (*mc.LotteryFrom, error)

func GetLotteryCalc

func GetLotteryCalc(st StateDB) (string, error)

func GetLotteryCfg

func GetLotteryCfg(st StateDB) (*mc.LotteryCfg, error)

/////////////////////////////////////////////////////////////////// 彩票相关

func GetLotteryNum

func GetLotteryNum(st StateDB) (uint64, error)

func GetMinHash

func GetMinHash(st StateDB) (*mc.RandomInfoStruct, error)

func GetMultiCoinSuperAccounts

func GetMultiCoinSuperAccounts(st StateDB) ([]common.Address, error)

func GetPreBroadcastRoot

func GetPreBroadcastRoot(st StateDB) (*mc.PreBroadStateRoot, error)

func GetPreMinerBlkReward

func GetPreMinerBlkReward(st StateDB) (*mc.MinerOutReward, error)

///////////////////////////////////////////////////////////////////

func GetPreMinerMultiCoinTxsReward added in v1.1.3

func GetPreMinerMultiCoinTxsReward(st StateDB) ([]mc.MultiCoinMinerOutReward, error)

func GetPreMinerTxsReward

func GetPreMinerTxsReward(st StateDB) (*mc.MinerOutReward, error)

func GetSlashCalc

func GetSlashCalc(st StateDB) (string, error)

func GetSlashCfg

func GetSlashCfg(st StateDB) (*mc.SlashCfg, error)

/////////////////////////////////////////////////////////////////// 惩罚相关

func GetSlashNum

func GetSlashNum(st StateDB) (uint64, error)

func GetSubChainSuperAccounts

func GetSubChainSuperAccounts(st StateDB) ([]common.Address, error)

func GetSuperBlockCfg

func GetSuperBlockCfg(st StateDB) (*mc.SuperBlkCfg, error)

func GetTopologyGraph

func GetTopologyGraph(st StateDB) (*mc.TopologyGraph, error)

func GetTopologyGraphByVersion

func GetTopologyGraphByVersion(st StateDB, version string) (*mc.TopologyGraph, error)

func GetTxpoolGasLimit

func GetTxpoolGasLimit(st StateDB) (*big.Int, error)

func GetTxsCalc

func GetTxsCalc(st StateDB) (string, error)

func GetTxsRewardCfg

func GetTxsRewardCfg(st StateDB) (*mc.TxsRewardCfg, error)

/////////////////////////////////////////////////////////////////// 交易奖励相关

func GetUpTimeNum

func GetUpTimeNum(st StateDB) (uint64, error)

func GetVIPConfig

func GetVIPConfig(st StateDB) ([]mc.VIPConfig, error)

func GetVersionInfo

func GetVersionInfo(st StateDB) string

func GetVersionSuperAccounts

func GetVersionSuperAccounts(st StateDB) ([]common.Address, error)

func IsInBlackList

func IsInBlackList(addr common.Address, blacklist []common.Address) bool

func SetBlkCalc

func SetBlkCalc(st StateDB, Calc string) error

func SetBlkRewardCfg

func SetBlkRewardCfg(st StateDB, cfg *mc.BlkRewardCfg) error

func SetBlockProduceBlackList

func SetBlockProduceBlackList(st StateDB, status *mc.BlockProduceSlashBlackList) error

func SetBlockProduceSlashCfg

func SetBlockProduceSlashCfg(st StateDB, cfg *mc.BlockProduceSlashCfg) error

func SetBlockProduceStats

func SetBlockProduceStats(st StateDB, status *mc.BlockProduceStats) error

func SetBlockProduceStatsStatus

func SetBlockProduceStatsStatus(st StateDB, status *mc.BlockProduceSlashStatsStatus) error

func SetBlockSuperAccounts

func SetBlockSuperAccounts(st StateDB, accounts []common.Address) error

func SetBroadcastAccounts

func SetBroadcastAccounts(st StateDB, accounts []common.Address) error

func SetBroadcastInterval

func SetBroadcastInterval(st StateDB, interval *mc.BCIntervalInfo) error

func SetBroadcastTxs

func SetBroadcastTxs(st StateDB, txs common.BroadTxSlice) error

func SetElectBlackList

func SetElectBlackList(st StateDB, accounts []common.Address) error

func SetElectConfigInfo

func SetElectConfigInfo(st StateDB, cfg *mc.ElectConfigInfo) error

func SetElectGenTime

func SetElectGenTime(st StateDB, genTime *mc.ElectGenTimeStruct) error

func SetElectGraph

func SetElectGraph(st StateDB, graph *mc.ElectGraph) error

func SetElectMinerNum

func SetElectMinerNum(st StateDB, num *mc.ElectMinerNumStruct) error

func SetElectOnlineState

func SetElectOnlineState(st StateDB, onlineState *mc.ElectOnlineStatus) error

func SetElectWhiteList

func SetElectWhiteList(st StateDB, accounts []common.Address) error

func SetElectWhiteListSwitcher

func SetElectWhiteListSwitcher(st StateDB, switcher bool) error

func SetFoundationAccount

func SetFoundationAccount(st StateDB, account common.Address) error

func SetInnerMinerAccounts

func SetInnerMinerAccounts(st StateDB, accounts []common.Address) error

func SetInterestCalc

func SetInterestCalc(st StateDB, Calc string) error

func SetInterestCalcNum

func SetInterestCalcNum(st StateDB, num uint64) error

func SetInterestCfg

func SetInterestCfg(st StateDB, cfg *mc.InterestCfg) error

func SetInterestPayNum

func SetInterestPayNum(st StateDB, num uint64) error

func SetLeaderConfig

func SetLeaderConfig(st StateDB, cfg *mc.LeaderConfig) error

func SetLotteryAccount

func SetLotteryAccount(st StateDB, account *mc.LotteryFrom) error

func SetLotteryCalc

func SetLotteryCalc(st StateDB, Calc string) error

func SetLotteryCfg

func SetLotteryCfg(st StateDB, cfg *mc.LotteryCfg) error

func SetLotteryNum

func SetLotteryNum(st StateDB, num uint64) error

func SetMultiCoinSuperAccounts

func SetMultiCoinSuperAccounts(st StateDB, accounts []common.Address) error

func SetPreMinerBlkReward

func SetPreMinerBlkReward(st StateDB, reward *mc.MinerOutReward) error

func SetPreMinerMultiCoinTxsReward added in v1.1.3

func SetPreMinerMultiCoinTxsReward(st StateDB, reward []mc.MultiCoinMinerOutReward) error

func SetPreMinerTxsReward

func SetPreMinerTxsReward(st StateDB, reward *mc.MinerOutReward) error

func SetSlashCalc

func SetSlashCalc(st StateDB, Calc string) error

func SetSlashCfg

func SetSlashCfg(st StateDB, cfg *mc.SlashCfg) error

func SetSlashNum

func SetSlashNum(st StateDB, num uint64) error

func SetSubChainSuperAccounts

func SetSubChainSuperAccounts(st StateDB, accounts []common.Address) error

func SetSuperBlockCfg

func SetSuperBlockCfg(st StateDB, cfg *mc.SuperBlkCfg) error

func SetTopologyGraph

func SetTopologyGraph(st StateDB, graph *mc.TopologyGraph) error

func SetTxsCalc

func SetTxsCalc(st StateDB, Calc string) error

func SetTxsRewardCfg

func SetTxsRewardCfg(st StateDB, cfg *mc.TxsRewardCfg) error

func SetUpTimeNum

func SetUpTimeNum(st StateDB, num uint64) error

func SetVIPConfig

func SetVIPConfig(st StateDB, cfgs []mc.VIPConfig) error

func SetVersionInfo

func SetVersionInfo(st StateDB, version string) error

func SetVersionSuperAccounts

func SetVersionSuperAccounts(st StateDB, accounts []common.Address) error

Types

type Manager

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

func GetManager

func GetManager(version string) *Manager

func (*Manager) FindOperator

func (self *Manager) FindOperator(key string) (MatrixOperator, error)

func (*Manager) Version

func (self *Manager) Version() string

type MatrixOperator

type MatrixOperator interface {
	KeyHash() common.Hash
	GetValue(st StateDB) (interface{}, error)
	SetValue(st StateDB, value interface{}) error
}

type StateDB

type StateDB interface {
	GetMatrixData(hash common.Hash) (val []byte)
	SetMatrixData(hash common.Hash, val []byte)
}

Jump to

Keyboard shortcuts

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