Commit 3379eea3 authored by mdj33's avatar mdj33 Committed by 33cn

unit check receipt ok

parent 86594f10
......@@ -117,9 +117,9 @@ type RoundState struct {
// RoundStateMessage ...
func (rs *RoundState) RoundStateMessage() *tmtypes.NewRoundStepMsg {
return &tmtypes.NewRoundStepMsg{
Height: rs.Height,
Round: int32(rs.Round),
Step: int32(rs.Step),
Height: rs.Height,
Round: int32(rs.Round),
Step: int32(rs.Step),
SecondsSinceStartTime: int32(time.Since(rs.StartTime).Seconds()),
LastCommitRound: int32(rs.LastCommit.Round()),
}
......
......@@ -285,3 +285,8 @@ func heightIndexToIndex(height int64, index int32) int64 {
func (c *Blackwhite) GetPayloadValue() types.Message {
return &gt.BlackwhiteAction{}
}
// CheckReceiptExecOk return true to check if receipt ty is ok
func (c *Blackwhite) CheckReceiptExecOk() bool {
return true
}
......@@ -139,3 +139,8 @@ func (c *Cert) loadHistoryByHeight() error {
}
return ct.ErrGetHistoryCertData
}
// CheckReceiptExecOk return true to check if receipt ty is ok
func (c *Cert) CheckReceiptExecOk() bool {
return true
}
......@@ -22,9 +22,6 @@ func (c *Cert) ExecLocal_New(payload *ct.CertNew, tx *types.Transaction, receipt
clog.Error("Authority is not available. Please check the authority config or authority initialize error logs.")
return nil, ct.ErrInitializeAuthority
}
if receiptData.GetTy() != types.ExecOk {
return &types.LocalDBSet{}, nil
}
var set types.LocalDBSet
historityCertdata := &types.HistoryCertStore{}
......@@ -54,9 +51,6 @@ func (c *Cert) ExecLocal_Update(payload *ct.CertUpdate, tx *types.Transaction, r
clog.Error("Authority is not available. Please check the authority config or authority initialize error logs.")
return nil, ct.ErrInitializeAuthority
}
if receiptData.GetTy() != types.ExecOk {
return &types.LocalDBSet{}, nil
}
var set types.LocalDBSet
// 写入上一纪录的next-height
......@@ -87,9 +81,6 @@ func (c *Cert) ExecLocal_Normal(payload *ct.CertNormal, tx *types.Transaction, r
clog.Error("Authority is not available. Please check the authority config or authority initialize error logs.")
return nil, ct.ErrInitializeAuthority
}
if receiptData.GetTy() != types.ExecOk {
return &types.LocalDBSet{}, nil
}
var set types.LocalDBSet
return &set, nil
......
......@@ -117,6 +117,11 @@ func (evm *EVMExecutor) IsFriend(myexec, writekey []byte, othertx *types.Transac
return false
}
// CheckReceiptExecOk return true to check if receipt ty is ok
func (c *EVMExecutor) CheckReceiptExecOk() bool {
return true
}
// 生成一个新的合约对象地址
func (evm *EVMExecutor) getNewAddr(txHash []byte) common.Address {
return common.NewAddress(txHash)
......
......@@ -12,9 +12,6 @@ import (
// roll back local db data
func (g *Game) execDelLocal(receiptData *types.ReceiptData) (*types.LocalDBSet, error) {
dbSet := &types.LocalDBSet{}
if receiptData.GetTy() != types.ExecOk {
return dbSet, nil
}
for _, log := range receiptData.Logs {
switch log.GetTy() {
case gt.TyLogCreateGame, gt.TyLogMatchGame, gt.TyLogCloseGame, gt.TyLogCancleGame:
......
......@@ -12,9 +12,6 @@ import (
// save receiptData to local db
func (g *Game) execLocal(receiptData *types.ReceiptData) (*types.LocalDBSet, error) {
dbSet := &types.LocalDBSet{}
if receiptData.GetTy() != types.ExecOk {
return dbSet, nil
}
for _, log := range receiptData.Logs {
switch log.Ty {
case gt.TyLogCreateGame, gt.TyLogMatchGame, gt.TyLogCloseGame, gt.TyLogCancleGame:
......
......@@ -174,3 +174,8 @@ func (g *Game) GetTypeMap() map[string]int32 {
"Close": gt.GameActionClose,
}
}
// CheckReceiptExecOk return true to check if receipt ty is ok
func (g *Game) CheckReceiptExecOk() bool {
return true
}
......@@ -12,9 +12,6 @@ import (
// ExecDelLocal_Hlock Action
func (h *Hashlock) ExecDelLocal_Hlock(hlock *pty.HashlockLock, tx *types.Transaction, receipt *types.ReceiptData, index int) (*types.LocalDBSet, error) {
if receipt.GetTy() != types.ExecOk {
return &types.LocalDBSet{}, nil
}
info := pty.Hashlockquery{Time: hlock.Time, Status: hashlockLocked, Amount: hlock.Amount, CreateTime: h.GetBlockTime(), CurrentTime: 0}
kv, err := UpdateHashReciver(h.GetLocalDB(), hlock.Hash, info)
if err != nil {
......@@ -25,9 +22,6 @@ func (h *Hashlock) ExecDelLocal_Hlock(hlock *pty.HashlockLock, tx *types.Transac
// ExecDelLocal_Hsend Action
func (h *Hashlock) ExecDelLocal_Hsend(hsend *pty.HashlockSend, tx *types.Transaction, receipt *types.ReceiptData, index int) (*types.LocalDBSet, error) {
if receipt.GetTy() != types.ExecOk {
return &types.LocalDBSet{}, nil
}
info := pty.Hashlockquery{Time: 0, Status: hashlockSent, Amount: 0, CreateTime: 0, CurrentTime: 0}
kv, err := UpdateHashReciver(h.GetLocalDB(), common.Sha256(hsend.Secret), info)
if err != nil {
......@@ -38,9 +32,6 @@ func (h *Hashlock) ExecDelLocal_Hsend(hsend *pty.HashlockSend, tx *types.Transac
// ExecDelLocal_Hunlock Action
func (h *Hashlock) ExecDelLocal_Hunlock(hunlock *pty.HashlockUnlock, tx *types.Transaction, receipt *types.ReceiptData, index int) (*types.LocalDBSet, error) {
if receipt.GetTy() != types.ExecOk {
return &types.LocalDBSet{}, nil
}
info := pty.Hashlockquery{Time: 0, Status: hashlockUnlocked, Amount: 0, CreateTime: 0, CurrentTime: 0}
kv, err := UpdateHashReciver(h.GetLocalDB(), common.Sha256(hunlock.Secret), info)
if err != nil {
......
......@@ -12,9 +12,6 @@ import (
// ExecLocal_Hlock Action
func (h *Hashlock) ExecLocal_Hlock(hlock *pty.HashlockLock, tx *types.Transaction, receipt *types.ReceiptData, index int) (*types.LocalDBSet, error) {
if receipt.GetTy() != types.ExecOk {
return &types.LocalDBSet{}, nil
}
info := pty.Hashlockquery{Time: hlock.Time, Status: hashlockLocked, Amount: hlock.Amount, CreateTime: h.GetBlockTime(), CurrentTime: 0}
clog.Error("ExecLocal", "info", info)
kv, err := UpdateHashReciver(h.GetLocalDB(), hlock.Hash, info)
......@@ -26,9 +23,6 @@ func (h *Hashlock) ExecLocal_Hlock(hlock *pty.HashlockLock, tx *types.Transactio
// ExecLocal_Hsend Action
func (h *Hashlock) ExecLocal_Hsend(hsend *pty.HashlockSend, tx *types.Transaction, receipt *types.ReceiptData, index int) (*types.LocalDBSet, error) {
if receipt.GetTy() != types.ExecOk {
return &types.LocalDBSet{}, nil
}
info := pty.Hashlockquery{Time: 0, Status: hashlockSent, Amount: 0, CreateTime: 0, CurrentTime: 0}
clog.Error("ExecLocal", "info", info)
kv, err := UpdateHashReciver(h.GetLocalDB(), common.Sha256(hsend.Secret), info)
......@@ -40,9 +34,6 @@ func (h *Hashlock) ExecLocal_Hsend(hsend *pty.HashlockSend, tx *types.Transactio
// ExecLocal_Hunlock Action
func (h *Hashlock) ExecLocal_Hunlock(hunlock *pty.HashlockUnlock, tx *types.Transaction, receipt *types.ReceiptData, index int) (*types.LocalDBSet, error) {
if receipt.GetTy() != types.ExecOk {
return &types.LocalDBSet{}, nil
}
info := pty.Hashlockquery{Time: 0, Status: hashlockUnlocked, Amount: 0, CreateTime: 0, CurrentTime: 0}
clog.Error("ExecLocal", "info", info)
kv, err := UpdateHashReciver(h.GetLocalDB(), common.Sha256(hunlock.Secret), info)
......
......@@ -52,3 +52,8 @@ func (h *Hashlock) GetDriverName() string {
func (h *Hashlock) CheckTx(tx *types.Transaction, index int) error {
return nil
}
// CheckReceiptExecOk return true to check if receipt ty is ok
func (h *Hashlock) CheckReceiptExecOk() bool {
return true
}
......@@ -12,9 +12,6 @@ import (
func (l *Lottery) execDelLocal(tx *types.Transaction, receiptData *types.ReceiptData) (*types.LocalDBSet, error) {
set := &types.LocalDBSet{}
if receiptData.GetTy() != types.ExecOk {
return set, nil
}
for _, item := range receiptData.Logs {
switch item.Ty {
case pty.TyLogLotteryCreate, pty.TyLogLotteryBuy, pty.TyLogLotteryDraw, pty.TyLogLotteryClose:
......
......@@ -12,9 +12,6 @@ import (
func (l *Lottery) execLocal(tx *types.Transaction, receipt *types.ReceiptData) (*types.LocalDBSet, error) {
set := &types.LocalDBSet{}
if receipt.GetTy() != types.ExecOk {
return set, nil
}
for _, item := range receipt.Logs {
switch item.Ty {
case pty.TyLogLotteryCreate, pty.TyLogLotteryBuy, pty.TyLogLotteryDraw, pty.TyLogLotteryClose:
......
......@@ -229,3 +229,8 @@ func dellottery(lotteryID string, status int32) *types.KeyValue {
func (lott *Lottery) GetPayloadValue() types.Message {
return &pty.LotteryAction{}
}
// CheckReceiptExecOk return true to check if receipt ty is ok
func (lott *Lottery) CheckReceiptExecOk() bool {
return true
}
......@@ -58,3 +58,8 @@ func Key(str []byte) (key []byte) {
key = append(key, str...)
return key
}
// CheckReceiptExecOk return true to check if receipt ty is ok
func (n *Norm) CheckReceiptExecOk() bool {
return true
}
......@@ -354,3 +354,8 @@ func (c *Paracross) allowIsParaAssetTx(execer []byte) bool {
}
return false
}
// CheckReceiptExecOk return true to check if receipt ty is ok
func (c *Paracross) CheckReceiptExecOk() bool {
return true
}
......@@ -25,9 +25,6 @@ func (g *PokerBull) rollbackIndex(log *pkt.ReceiptPBGame) (kvs []*types.KeyValue
func (g *PokerBull) execDelLocal(receiptData *types.ReceiptData) (*types.LocalDBSet, error) {
dbSet := &types.LocalDBSet{}
if receiptData.GetTy() != types.ExecOk {
return dbSet, nil
}
for _, log := range receiptData.Logs {
switch log.GetTy() {
case pkt.TyLogPBGameStart, pkt.TyLogPBGameContinue, pkt.TyLogPBGameQuit:
......
......@@ -55,9 +55,6 @@ func (c *PokerBull) updateIndex(log *pkt.ReceiptPBGame) (kvs []*types.KeyValue)
func (c *PokerBull) execLocal(receipt *types.ReceiptData) (*types.LocalDBSet, error) {
dbSet := &types.LocalDBSet{}
if receipt.GetTy() != types.ExecOk {
return dbSet, nil
}
for i := 0; i < len(receipt.Logs); i++ {
item := receipt.Logs[i]
if item.Ty == pkt.TyLogPBGameStart || item.Ty == pkt.TyLogPBGameContinue || item.Ty == pkt.TyLogPBGameQuit {
......
......@@ -139,3 +139,8 @@ func delPBGameStatusAndPlayer(status int32, player int32, value, index int64) *t
kv.Value = nil
return kv
}
// CheckReceiptExecOk return true to check if receipt ty is ok
func (g *PokerBull) CheckReceiptExecOk() bool {
return true
}
......@@ -13,10 +13,6 @@ import (
func (p *privacy) execDelLocal(tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
txhashstr := common.Bytes2Hex(tx.Hash())
dbSet := &types.LocalDBSet{}
if receiptData.GetTy() != types.ExecOk {
privacylog.Error("execDelLocal", "txhash", txhashstr, "receipt.GetTy() = ", receiptData.GetTy())
return dbSet, nil
}
localDB := p.GetLocalDB()
for i, item := range receiptData.Logs {
if item.Ty != ty.TyLogPrivacyOutput {
......
......@@ -331,3 +331,8 @@ func (p *privacy) checkPubKeyValid(keys [][]byte, pubkeys [][]byte) (bool, int32
return true, invalidIndex
}
// CheckReceiptExecOk return true to check if receipt ty is ok
func (p *privacy) CheckReceiptExecOk() bool {
return true
}
......@@ -243,3 +243,8 @@ func deleteCreateOrderKeyValue(kv []*types.KeyValue, order *ty.RelayOrder, statu
return kv
}
// CheckReceiptExecOk return true to check if receipt ty is ok
func (r *relay) CheckReceiptExecOk() bool {
return true
}
......@@ -51,9 +51,6 @@ func DelRetrieveInfo(info *rt.RetrieveQuery, Status int64, db dbm.KVDB) (*types.
// ExecDelLocal_Backup Action
func (c *Retrieve) ExecDelLocal_Backup(backup *rt.BackupRetrieve, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
set := &types.LocalDBSet{}
if receiptData.GetTy() != types.ExecOk {
return set, nil
}
rlog.Debug("Retrieve ExecDelLocal_Backup")
info := rt.RetrieveQuery{BackupAddress: backup.BackupAddress, DefaultAddress: backup.DefaultAddress, DelayPeriod: backup.DelayPeriod, PrepareTime: zeroPrepareTime, RemainTime: zeroRemainTime, Status: retrieveBackup}
......@@ -72,9 +69,6 @@ func (c *Retrieve) ExecDelLocal_Backup(backup *rt.BackupRetrieve, tx *types.Tran
// ExecDelLocal_Prepare Action
func (c *Retrieve) ExecDelLocal_Prepare(pre *rt.PrepareRetrieve, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
set := &types.LocalDBSet{}
if receiptData.GetTy() != types.ExecOk {
return set, nil
}
rlog.Debug("Retrieve ExecDelLocal_Prepare")
info := rt.RetrieveQuery{BackupAddress: pre.BackupAddress, DefaultAddress: pre.DefaultAddress, DelayPeriod: zeroDelay, PrepareTime: c.GetBlockTime(), RemainTime: zeroRemainTime, Status: retrievePrepare}
......@@ -93,9 +87,6 @@ func (c *Retrieve) ExecDelLocal_Prepare(pre *rt.PrepareRetrieve, tx *types.Trans
// ExecDelLocal_Perform Action
func (c *Retrieve) ExecDelLocal_Perform(perf *rt.PerformRetrieve, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
set := &types.LocalDBSet{}
if receiptData.GetTy() != types.ExecOk {
return set, nil
}
rlog.Debug("Retrieve ExecDelLocal_Perform")
info := rt.RetrieveQuery{BackupAddress: perf.BackupAddress, DefaultAddress: perf.DefaultAddress, DelayPeriod: zeroDelay, PrepareTime: zeroPrepareTime, RemainTime: zeroRemainTime, Status: retrievePerform}
......@@ -114,9 +105,6 @@ func (c *Retrieve) ExecDelLocal_Perform(perf *rt.PerformRetrieve, tx *types.Tran
// ExecDelLocal_Cancel Action
func (c *Retrieve) ExecDelLocal_Cancel(cancel *rt.CancelRetrieve, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
set := &types.LocalDBSet{}
if receiptData.GetTy() != types.ExecOk {
return set, nil
}
rlog.Debug("Retrieve ExecDelLocal_Cancel")
info := rt.RetrieveQuery{BackupAddress: cancel.BackupAddress, DefaultAddress: cancel.DefaultAddress, DelayPeriod: zeroDelay, PrepareTime: zeroPrepareTime, RemainTime: zeroRemainTime, Status: retrieveCancel}
......
......@@ -54,9 +54,6 @@ func SaveRetrieveInfo(info *rt.RetrieveQuery, Status int64, db dbm.KVDB) (*types
// ExecLocal_Backup Action
func (c *Retrieve) ExecLocal_Backup(backup *rt.BackupRetrieve, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
set := &types.LocalDBSet{}
if receiptData.GetTy() != types.ExecOk {
return set, nil
}
rlog.Debug("Retrieve ExecLocal_Backup")
info := rt.RetrieveQuery{BackupAddress: backup.BackupAddress, DefaultAddress: backup.DefaultAddress, DelayPeriod: backup.DelayPeriod, PrepareTime: zeroPrepareTime, RemainTime: zeroRemainTime, Status: retrieveBackup}
kv, err := SaveRetrieveInfo(&info, retrieveBackup, c.GetLocalDB())
......@@ -74,9 +71,6 @@ func (c *Retrieve) ExecLocal_Backup(backup *rt.BackupRetrieve, tx *types.Transac
// ExecLocal_Prepare Action
func (c *Retrieve) ExecLocal_Prepare(pre *rt.PrepareRetrieve, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
set := &types.LocalDBSet{}
if receiptData.GetTy() != types.ExecOk {
return set, nil
}
rlog.Debug("Retrieve ExecLocal_Prepare")
info := rt.RetrieveQuery{BackupAddress: pre.BackupAddress, DefaultAddress: pre.DefaultAddress, DelayPeriod: zeroDelay, PrepareTime: zeroPrepareTime, RemainTime: zeroRemainTime, Status: retrievePrepare}
......@@ -95,9 +89,6 @@ func (c *Retrieve) ExecLocal_Prepare(pre *rt.PrepareRetrieve, tx *types.Transact
// ExecLocal_Perform Action
func (c *Retrieve) ExecLocal_Perform(perf *rt.PerformRetrieve, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
set := &types.LocalDBSet{}
if receiptData.GetTy() != types.ExecOk {
return set, nil
}
rlog.Debug("Retrieve ExecLocal_Perf")
info := rt.RetrieveQuery{BackupAddress: perf.BackupAddress, DefaultAddress: perf.DefaultAddress, DelayPeriod: zeroDelay, PrepareTime: zeroPrepareTime, RemainTime: zeroRemainTime, Status: retrievePerform}
......@@ -116,9 +107,6 @@ func (c *Retrieve) ExecLocal_Perform(perf *rt.PerformRetrieve, tx *types.Transac
// ExecLocal_Cancel Action
func (c *Retrieve) ExecLocal_Cancel(cancel *rt.CancelRetrieve, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
set := &types.LocalDBSet{}
if receiptData.GetTy() != types.ExecOk {
return set, nil
}
rlog.Debug("Retrieve ExecLocal_Cancel")
info := rt.RetrieveQuery{BackupAddress: cancel.BackupAddress, DefaultAddress: cancel.DefaultAddress, DelayPeriod: zeroDelay, PrepareTime: zeroPrepareTime, RemainTime: zeroRemainTime, Status: retrieveCancel}
......
......@@ -82,3 +82,8 @@ func getRetrieveInfo(db dbm.KVDB, backupAddr string, defaultAddr string) (*rt.Re
}
return &info, nil
}
// CheckReceiptExecOk return true to check if receipt ty is ok
func (r *Retrieve) CheckReceiptExecOk() bool {
return true
}
......@@ -11,9 +11,6 @@ import (
func (t *Ticket) execDelLocal(receiptData *types.ReceiptData) (*types.LocalDBSet, error) {
dbSet := &types.LocalDBSet{}
if receiptData.GetTy() != types.ExecOk {
return dbSet, nil
}
for _, item := range receiptData.Logs {
//这三个是ticket 的log
if item.Ty == ty.TyLogNewTicket || item.Ty == ty.TyLogMinerTicket || item.Ty == ty.TyLogCloseTicket {
......
......@@ -11,9 +11,6 @@ import (
func (t *Ticket) execLocal(receiptData *types.ReceiptData) (*types.LocalDBSet, error) {
dbSet := &types.LocalDBSet{}
if receiptData.GetTy() != types.ExecOk {
return dbSet, nil
}
for _, item := range receiptData.Logs {
//这三个是ticket 的log
if item.Ty == ty.TyLogNewTicket || item.Ty == ty.TyLogMinerTicket || item.Ty == ty.TyLogCloseTicket {
......
......@@ -186,3 +186,8 @@ func (t *Ticket) CheckTx(tx *types.Transaction, index int) error {
}
return nil
}
// CheckReceiptExecOk return true to check if receipt ty is ok
func (t *Ticket) CheckReceiptExecOk() bool {
return true
}
......@@ -338,3 +338,8 @@ func (t *token) getTxByToken(req *tokenty.ReqTokenTx) (types.Message, error) {
}
return &replyTxInfos, nil
}
// CheckReceiptExecOk return true to check if receipt ty is ok
func (t *token) CheckReceiptExecOk() bool {
return true
}
......@@ -202,3 +202,8 @@ func saveBuyMarketOrderKeyValue(kv []*types.KeyValue, receipt *pty.ReceiptBuyBas
func deleteBuyMarketOrderKeyValue(kv []*types.KeyValue, receipt *pty.ReceiptBuyBase, status int32, height int64) []*types.KeyValue {
return genBuyMarketOrderKeyValue(kv, receipt, status, height, nil)
}
// CheckReceiptExecOk return true to check if receipt ty is ok
func (t *trade) CheckReceiptExecOk() bool {
return true
}
......@@ -12,9 +12,6 @@ import (
// ExecDelLocal_Node method
func (val *ValNode) ExecDelLocal_Node(node *pty.ValNode, tx *types.Transaction, receipt *types.ReceiptData, index int) (*types.LocalDBSet, error) {
set := &types.LocalDBSet{}
if receipt.GetTy() != types.ExecOk {
return set, nil
}
key := CalcValNodeUpdateHeightIndexKey(val.GetHeight(), index)
set.KV = append(set.KV, &types.KeyValue{Key: key, Value: nil})
return set, nil
......@@ -23,9 +20,6 @@ func (val *ValNode) ExecDelLocal_Node(node *pty.ValNode, tx *types.Transaction,
// ExecDelLocal_BlockInfo method
func (val *ValNode) ExecDelLocal_BlockInfo(blockInfo *pty.TendermintBlockInfo, tx *types.Transaction, receipt *types.ReceiptData, index int) (*types.LocalDBSet, error) {
set := &types.LocalDBSet{}
if receipt.GetTy() != types.ExecOk {
return set, nil
}
key := CalcValNodeBlockInfoHeightKey(val.GetHeight())
set.KV = append(set.KV, &types.KeyValue{Key: key, Value: nil})
return set, nil
......
......@@ -14,9 +14,6 @@ import (
// ExecLocal_Node method
func (val *ValNode) ExecLocal_Node(node *pty.ValNode, tx *types.Transaction, receipt *types.ReceiptData, index int) (*types.LocalDBSet, error) {
set := &types.LocalDBSet{}
if receipt.GetTy() != types.ExecOk {
return set, nil
}
if len(node.GetPubKey()) == 0 {
return nil, errors.New("validator pubkey is empty")
}
......@@ -32,9 +29,6 @@ func (val *ValNode) ExecLocal_Node(node *pty.ValNode, tx *types.Transaction, rec
// ExecLocal_BlockInfo method
func (val *ValNode) ExecLocal_BlockInfo(blockInfo *pty.TendermintBlockInfo, tx *types.Transaction, receipt *types.ReceiptData, index int) (*types.LocalDBSet, error) {
set := &types.LocalDBSet{}
if receipt.GetTy() != types.ExecOk {
return set, nil
}
key := CalcValNodeBlockInfoHeightKey(val.GetHeight())
set.KV = append(set.KV, &types.KeyValue{Key: key, Value: types.Encode(blockInfo)})
return set, nil
......
......@@ -68,3 +68,8 @@ func CalcValNodeUpdateHeightKey(height int64) []byte {
func CalcValNodeBlockInfoHeightKey(height int64) []byte {
return []byte(fmt.Sprintf("LODB-valnode-BlockInfo:%18d:", height))
}
// CheckReceiptExecOk return true to check if receipt ty is ok
func (val *ValNode) CheckReceiptExecOk() bool {
return true
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment