Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
link33
plugin
Commits
3379eea3
Commit
3379eea3
authored
Nov 26, 2018
by
mdj33
Committed by
33cn
Nov 27, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
unit check receipt ok
parent
86594f10
Hide whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
83 additions
and
94 deletions
+83
-94
round_state.go
plugin/consensus/tendermint/types/round_state.go
+3
-3
blackwhite.go
plugin/dapp/blackwhite/executor/blackwhite.go
+5
-0
cert.go
plugin/dapp/cert/executor/cert.go
+5
-0
exec_local.go
plugin/dapp/cert/executor/exec_local.go
+0
-9
evm.go
plugin/dapp/evm/executor/evm.go
+5
-0
exec_del_local.go
plugin/dapp/game/executor/exec_del_local.go
+0
-3
exec_local.go
plugin/dapp/game/executor/exec_local.go
+0
-3
game.go
plugin/dapp/game/executor/game.go
+5
-0
exec_del_local.go
plugin/dapp/hashlock/executor/exec_del_local.go
+0
-9
exec_local.go
plugin/dapp/hashlock/executor/exec_local.go
+0
-9
hashlock.go
plugin/dapp/hashlock/executor/hashlock.go
+5
-0
exec_del_local.go
plugin/dapp/lottery/executor/exec_del_local.go
+0
-3
exec_local.go
plugin/dapp/lottery/executor/exec_local.go
+0
-3
lottery.go
plugin/dapp/lottery/executor/lottery.go
+5
-0
norm.go
plugin/dapp/norm/executor/norm.go
+5
-0
paracross.go
plugin/dapp/paracross/executor/paracross.go
+5
-0
exec_del_local.go
plugin/dapp/pokerbull/executor/exec_del_local.go
+0
-3
exec_local.go
plugin/dapp/pokerbull/executor/exec_local.go
+0
-3
pokerbull.go
plugin/dapp/pokerbull/executor/pokerbull.go
+5
-0
exec_del_local.go
plugin/dapp/privacy/executor/exec_del_local.go
+0
-4
privacy.go
plugin/dapp/privacy/executor/privacy.go
+5
-0
relay.go
plugin/dapp/relay/executor/relay.go
+5
-0
exec_del_local.go
plugin/dapp/retrieve/executor/exec_del_local.go
+0
-12
exec_local.go
plugin/dapp/retrieve/executor/exec_local.go
+0
-12
retrieve.go
plugin/dapp/retrieve/executor/retrieve.go
+5
-0
exec_del_local.go
plugin/dapp/ticket/executor/exec_del_local.go
+0
-3
exec_local.go
plugin/dapp/ticket/executor/exec_local.go
+0
-3
ticket.go
plugin/dapp/ticket/executor/ticket.go
+5
-0
token.go
plugin/dapp/token/executor/token.go
+5
-0
trade.go
plugin/dapp/trade/executor/trade.go
+5
-0
exec_del_local.go
plugin/dapp/valnode/executor/exec_del_local.go
+0
-6
exec_local.go
plugin/dapp/valnode/executor/exec_local.go
+0
-6
valnode.go
plugin/dapp/valnode/executor/valnode.go
+5
-0
No files found.
plugin/consensus/tendermint/types/round_state.go
View file @
3379eea3
...
...
@@ -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
()),
}
...
...
plugin/dapp/blackwhite/executor/blackwhite.go
View file @
3379eea3
...
...
@@ -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
}
plugin/dapp/cert/executor/cert.go
View file @
3379eea3
...
...
@@ -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
}
plugin/dapp/cert/executor/exec_local.go
View file @
3379eea3
...
...
@@ -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
...
...
plugin/dapp/evm/executor/evm.go
View file @
3379eea3
...
...
@@ -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
)
...
...
plugin/dapp/game/executor/exec_del_local.go
View file @
3379eea3
...
...
@@ -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
:
...
...
plugin/dapp/game/executor/exec_local.go
View file @
3379eea3
...
...
@@ -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
:
...
...
plugin/dapp/game/executor/game.go
View file @
3379eea3
...
...
@@ -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
}
plugin/dapp/hashlock/executor/exec_del_local.go
View file @
3379eea3
...
...
@@ -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
{
...
...
plugin/dapp/hashlock/executor/exec_local.go
View file @
3379eea3
...
...
@@ -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
)
...
...
plugin/dapp/hashlock/executor/hashlock.go
View file @
3379eea3
...
...
@@ -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
}
plugin/dapp/lottery/executor/exec_del_local.go
View file @
3379eea3
...
...
@@ -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
:
...
...
plugin/dapp/lottery/executor/exec_local.go
View file @
3379eea3
...
...
@@ -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
:
...
...
plugin/dapp/lottery/executor/lottery.go
View file @
3379eea3
...
...
@@ -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
}
plugin/dapp/norm/executor/norm.go
View file @
3379eea3
...
...
@@ -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
}
plugin/dapp/paracross/executor/paracross.go
View file @
3379eea3
...
...
@@ -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
}
plugin/dapp/pokerbull/executor/exec_del_local.go
View file @
3379eea3
...
...
@@ -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
:
...
...
plugin/dapp/pokerbull/executor/exec_local.go
View file @
3379eea3
...
...
@@ -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
{
...
...
plugin/dapp/pokerbull/executor/pokerbull.go
View file @
3379eea3
...
...
@@ -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
}
plugin/dapp/privacy/executor/exec_del_local.go
View file @
3379eea3
...
...
@@ -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
{
...
...
plugin/dapp/privacy/executor/privacy.go
View file @
3379eea3
...
...
@@ -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
}
plugin/dapp/relay/executor/relay.go
View file @
3379eea3
...
...
@@ -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
}
plugin/dapp/retrieve/executor/exec_del_local.go
View file @
3379eea3
...
...
@@ -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
}
...
...
plugin/dapp/retrieve/executor/exec_local.go
View file @
3379eea3
...
...
@@ -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
}
...
...
plugin/dapp/retrieve/executor/retrieve.go
View file @
3379eea3
...
...
@@ -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
}
plugin/dapp/ticket/executor/exec_del_local.go
View file @
3379eea3
...
...
@@ -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
{
...
...
plugin/dapp/ticket/executor/exec_local.go
View file @
3379eea3
...
...
@@ -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
{
...
...
plugin/dapp/ticket/executor/ticket.go
View file @
3379eea3
...
...
@@ -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
}
plugin/dapp/token/executor/token.go
View file @
3379eea3
...
...
@@ -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
}
plugin/dapp/trade/executor/trade.go
View file @
3379eea3
...
...
@@ -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
}
plugin/dapp/valnode/executor/exec_del_local.go
View file @
3379eea3
...
...
@@ -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
...
...
plugin/dapp/valnode/executor/exec_local.go
View file @
3379eea3
...
...
@@ -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
...
...
plugin/dapp/valnode/executor/valnode.go
View file @
3379eea3
...
...
@@ -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
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment