Documentation ¶
Index ¶
- Variables
- func BitMapBit(bitmap []byte, index uint32) bool
- func CalcBitMap(bases, subs [][]byte, subData []*types.ReceiptData) []byte
- func CalcBitMapByBitMap(bases, subs [][]byte, bitmap []byte) []byte
- func CalcSingleBitMap(bases [][]byte, data []*types.ReceiptData) []byte
- func CheckBlock(client queue.Client, block *types.BlockDetail) error
- func CheckDupTx(client queue.Client, txs []*types.Transaction, height int64) (transactions []*types.Transaction, err error)
- func CheckTxDup(client queue.Client, txs []*types.TransactionCache, height int64) (transactions []*types.TransactionCache, err error)
- func CloseTestDB(dir string, dbm db.DB)
- func CreateCoinsBlock(priv crypto.PrivKey, n int64) *types.Block
- func CreateCoinsTx(priv crypto.PrivKey, to string, amount int64) *types.Transaction
- func CreateManageTx(priv crypto.PrivKey, key, op, value string) *types.Transaction
- func CreateNewBlock(parent *types.Block, txs []*types.Transaction) *types.Block
- func CreateNoneBlock(priv crypto.PrivKey, n int64) *types.Block
- func CreateNoneTx(priv crypto.PrivKey) *types.Transaction
- func CreateTestDB() (string, db.DB, db.KVDB)
- func CreateTxWithExecer(priv crypto.PrivKey, execer string) *types.Transaction
- func CreateTxWithTxHeight(priv crypto.PrivKey, to string, amount, expire int64) *types.Transaction
- func DelDupKey(kvs []*types.KeyValue) []*types.KeyValue
- func DelDupTx(txs []*types.TransactionCache) (ret []*types.TransactionCache)
- func ExecAndCheckBlock(qclient queue.Client, block *types.Block, txs []*types.Transaction, ...) (*types.Block, error)
- func ExecAndCheckBlockCB(qclient queue.Client, block *types.Block, txs []*types.Transaction, ...) (*types.Block, error)
- func ExecBlock(client queue.Client, prevStateRoot []byte, block *types.Block, ...) (*types.BlockDetail, []*types.Transaction, error)
- func ExecBlockUpgrade(client queue.Client, prevStateRoot []byte, block *types.Block, sync bool) error
- func ExecKVMemSet(client queue.Client, prevStateRoot []byte, height int64, ...) ([]byte, error)
- func ExecKVSetCommit(client queue.Client, hash []byte, upgrade bool) error
- func ExecKVSetRollback(client queue.Client, hash []byte) error
- func ExecTx(client queue.Client, prevStateRoot []byte, block *types.Block) (*types.Receipts, error)
- func GenCoinsTxs(priv crypto.PrivKey, n int64) (txs []*types.Transaction)
- func GenNoneTxs(priv crypto.PrivKey, n int64) (txs []*types.Transaction)
- func GenTxsTxHeigt(priv crypto.PrivKey, n, height int64) (txs []*types.Transaction)
- func Genaddress() (string, crypto.PrivKey)
- func GetParaExecName(paraName string, name string) string
- func HexToPrivkey(key string) crypto.PrivKey
- func JSONPrint(t TestingT, input interface{})
- func MakeStringToLower(in string, pos, count int) (out string, err error)
- func MakeStringToUpper(in string, pos, count int) (out string, err error)
- func PrintKV(kvs []*types.KeyValue)
- func ReportErrEventToFront(logger log.Logger, client queue.Client, frommodule string, tomodule string, ...)
- func ResetDatadir(cfg *types.Config, datadir string) string
- func SaveKVList(kvdb db.DB, kvs []*types.KeyValue)
- type HealthCheckServer
- type MockModule
- type TestingT
Constants ¶
This section is empty.
Variables ¶
var TestPrivkeyHex = []string{
"4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01",
"CC38546E9E659D15E6B4893F0AB32A06D103931A8230B0BDE71459D2B27D6944",
"B0BB75BC49A787A71F4834DA18614763B53A18291ECE6B5EDEC3AD19D150C3E7",
"56942AD84CCF4788ED6DACBC005A1D0C4F91B63BCF0C99A02BE03C8DEAE71138",
"2AFF1981291355322C7A6308D46A9C9BA311AA21D94F36B43FC6A6021A1334CF",
"2116459C0EC8ED01AA0EEAE35CAC5C96F94473F7816F114873291217303F6989",
}
TestPrivkeyHex :
var TestPrivkeyList = []crypto.PrivKey{ HexToPrivkey("4257D8692EF7FE13C68B65D6A52F03933DB2FA5CE8FAF210B5B8B80C721CED01"), HexToPrivkey("CC38546E9E659D15E6B4893F0AB32A06D103931A8230B0BDE71459D2B27D6944"), HexToPrivkey("B0BB75BC49A787A71F4834DA18614763B53A18291ECE6B5EDEC3AD19D150C3E7"), HexToPrivkey("56942AD84CCF4788ED6DACBC005A1D0C4F91B63BCF0C99A02BE03C8DEAE71138"), HexToPrivkey("2AFF1981291355322C7A6308D46A9C9BA311AA21D94F36B43FC6A6021A1334CF"), HexToPrivkey("2116459C0EC8ED01AA0EEAE35CAC5C96F94473F7816F114873291217303F6989"), }
TestPrivkeyList : crypto.PrivKey list addr:12qyocayNF7Lv6C9qW4avxs2E7U41fKSfv addr:14KEKbYtKKQm4wMthSK9J4La4nAiidGozt addr:1EbDHAXpoiewjPLX9uqoz38HsKqMXayZrF addr:1PUiGcbsccfxW3zuvHXZBJfznziph5miAo addr:1KcCVZLSQYRUwE5EXTsAoQs9LuJW6xwfQa addr:1EDnnePAZN48aC2hiTDzhkczfF39g1pZZX
Functions ¶
func CalcBitMap ¶
func CalcBitMap(bases, subs [][]byte, subData []*types.ReceiptData) []byte
CalcBitMap subs are align with subData,get the bases' tx's bitmap from subs result if the tx ty is OK in subs, find the tx in base and set the index to 1, this function return base's bitmap if all tx failed, the setBit will normalize result and just return nil slice
func CalcBitMapByBitMap ¶
CalcBitMapByBitMap bitmap align with subs
func CalcSingleBitMap ¶
func CalcSingleBitMap(bases [][]byte, data []*types.ReceiptData) []byte
CalcSingleBitMap calc bitmap to bases by data
func CheckBlock ¶
func CheckBlock(client queue.Client, block *types.BlockDetail) error
CheckBlock : To check the block's validaty
func CheckDupTx ¶
func CheckDupTx(client queue.Client, txs []*types.Transaction, height int64) (transactions []*types.Transaction, err error)
CheckDupTx : check use txs []*types.Transaction and not []*types.TransactionCache
func CheckTxDup ¶
func CheckTxDup(client queue.Client, txs []*types.TransactionCache, height int64) (transactions []*types.TransactionCache, err error)
CheckTxDup : check whether the tx is duplicated within the while chain
func CreateCoinsBlock ¶
CreateCoinsBlock : create coins block, n size
func CreateCoinsTx ¶
CreateCoinsTx : Create Coins Tx
func CreateManageTx ¶
func CreateManageTx(priv crypto.PrivKey, key, op, value string) *types.Transaction
CreateManageTx : Create Manage Tx
func CreateNewBlock ¶
CreateNewBlock : Create a New Block
func CreateNoneBlock ¶
CreateNoneBlock : Create None Block
func CreateNoneTx ¶
func CreateNoneTx(priv crypto.PrivKey) *types.Transaction
CreateNoneTx : Create None Tx
func CreateTxWithExecer ¶
func CreateTxWithExecer(priv crypto.PrivKey, execer string) *types.Transaction
CreateTxWithExecer : Create Tx With Execer
func CreateTxWithTxHeight ¶
CreateTxWithTxHeight : Create Tx With Tx Height
func DelDupTx ¶
func DelDupTx(txs []*types.TransactionCache) (ret []*types.TransactionCache)
DelDupTx 删除重复的交易
func ExecAndCheckBlock ¶
func ExecAndCheckBlock(qclient queue.Client, block *types.Block, txs []*types.Transaction, result []int) (*types.Block, error)
ExecAndCheckBlock2 :
func ExecAndCheckBlockCB ¶
func ExecAndCheckBlockCB(qclient queue.Client, block *types.Block, txs []*types.Transaction, cb func(int, *types.ReceiptData) error) (*types.Block, error)
ExecAndCheckBlockCB :
func ExecBlock ¶
func ExecBlock(client queue.Client, prevStateRoot []byte, block *types.Block, errReturn, sync, checkblock bool) (*types.BlockDetail, []*types.Transaction, error)
ExecBlock : just exec block
func ExecBlockUpgrade ¶
func ExecBlockUpgrade(client queue.Client, prevStateRoot []byte, block *types.Block, sync bool) error
ExecBlockUpgrade : just exec block
func ExecKVMemSet ¶
func ExecKVMemSet(client queue.Client, prevStateRoot []byte, height int64, kvset []*types.KeyValue, sync bool, upgrade bool) ([]byte, error)
ExecKVMemSet : send kv values to memory store and set it in db
func ExecKVSetCommit ¶
ExecKVSetCommit : commit the data set opetation to db
func ExecKVSetRollback ¶
ExecKVSetRollback : do the db's roll back operation
func GenCoinsTxs ¶
func GenCoinsTxs(priv crypto.PrivKey, n int64) (txs []*types.Transaction)
GenCoinsTxs : generate txs to be executed on exector coin
func GenNoneTxs ¶
func GenNoneTxs(priv crypto.PrivKey, n int64) (txs []*types.Transaction)
GenNoneTxs : 创建一些 none 执行器的 交易列表,一般用于测试
func GenTxsTxHeigt ¶
func GenTxsTxHeigt(priv crypto.PrivKey, n, height int64) (txs []*types.Transaction)
GenTxsTxHeigt : Gen Txs with Heigt
func GetParaExecName ¶
GetParaExecName : 如果 name 没有 paraName 前缀,那么加上这个前缀
func HexToPrivkey ¶
HexToPrivkey : convert hex string to private key
func MakeStringToLower ¶
MakeStringToLower : 将给定的in字符串从pos开始一共count个转换为小写字母
func MakeStringToUpper ¶
MakeStringToUpper : 将给定的in字符串从pos开始一共count个转换为大写字母
func ReportErrEventToFront ¶
func ReportErrEventToFront(logger log.Logger, client queue.Client, frommodule string, tomodule string, err error)
ReportErrEventToFront 上报指定错误信息到指定模块,目前只支持从store,blockchain,wallet写数据库失败时上报错误信息到wallet模块, 然后由钱包模块前端定时调用显示给客户
func ResetDatadir ¶
ResetDatadir 重写datadir
Types ¶
type HealthCheckServer ¶
type HealthCheckServer struct {
// contains filtered or unexported fields
}
HealthCheckServer a node's health check server
func NewHealthCheckServer ¶
func NewHealthCheckServer(c queue.Client) *HealthCheckServer
NewHealthCheckServer new json rpcserver object
func (*HealthCheckServer) Close ¶
func (s *HealthCheckServer) Close()
Close NewHealthCheckServer close
func (*HealthCheckServer) Start ¶
func (s *HealthCheckServer) Start(cfg *types.HealthCheck)
Start HealthCheckServer start
type MockModule ¶
type MockModule struct {
Key string
}
MockModule struct
func (*MockModule) SetQueueClient ¶
func (m *MockModule) SetQueueClient(client queue.Client)
SetQueueClient method