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
63038010
Commit
63038010
authored
Nov 23, 2018
by
wjx@disanbo.com
Committed by
vipwzw
Nov 23, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add recipt check for hashlock and cert
parent
49471eae
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
0 deletions
+27
-0
exec_local.go
plugin/dapp/cert/executor/exec_local.go
+9
-0
exec_del_local.go
plugin/dapp/hashlock/executor/exec_del_local.go
+9
-0
exec_local.go
plugin/dapp/hashlock/executor/exec_local.go
+9
-0
No files found.
plugin/dapp/cert/executor/exec_local.go
100644 → 100755
View file @
63038010
...
@@ -22,6 +22,9 @@ func (c *Cert) ExecLocal_New(payload *ct.CertNew, tx *types.Transaction, receipt
...
@@ -22,6 +22,9 @@ 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."
)
clog
.
Error
(
"Authority is not available. Please check the authority config or authority initialize error logs."
)
return
nil
,
ct
.
ErrInitializeAuthority
return
nil
,
ct
.
ErrInitializeAuthority
}
}
if
receiptData
.
GetTy
()
!=
types
.
ExecOk
{
return
&
types
.
LocalDBSet
{},
nil
}
var
set
types
.
LocalDBSet
var
set
types
.
LocalDBSet
historityCertdata
:=
&
types
.
HistoryCertStore
{}
historityCertdata
:=
&
types
.
HistoryCertStore
{}
...
@@ -51,6 +54,9 @@ func (c *Cert) ExecLocal_Update(payload *ct.CertUpdate, tx *types.Transaction, r
...
@@ -51,6 +54,9 @@ 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."
)
clog
.
Error
(
"Authority is not available. Please check the authority config or authority initialize error logs."
)
return
nil
,
ct
.
ErrInitializeAuthority
return
nil
,
ct
.
ErrInitializeAuthority
}
}
if
receiptData
.
GetTy
()
!=
types
.
ExecOk
{
return
&
types
.
LocalDBSet
{},
nil
}
var
set
types
.
LocalDBSet
var
set
types
.
LocalDBSet
// 写入上一纪录的next-height
// 写入上一纪录的next-height
...
@@ -81,6 +87,9 @@ func (c *Cert) ExecLocal_Normal(payload *ct.CertNormal, tx *types.Transaction, r
...
@@ -81,6 +87,9 @@ 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."
)
clog
.
Error
(
"Authority is not available. Please check the authority config or authority initialize error logs."
)
return
nil
,
ct
.
ErrInitializeAuthority
return
nil
,
ct
.
ErrInitializeAuthority
}
}
if
receiptData
.
GetTy
()
!=
types
.
ExecOk
{
return
&
types
.
LocalDBSet
{},
nil
}
var
set
types
.
LocalDBSet
var
set
types
.
LocalDBSet
return
&
set
,
nil
return
&
set
,
nil
...
...
plugin/dapp/hashlock/executor/exec_del_local.go
View file @
63038010
...
@@ -12,6 +12,9 @@ import (
...
@@ -12,6 +12,9 @@ import (
// ExecDelLocal_Hlock Action
// ExecDelLocal_Hlock Action
func
(
h
*
Hashlock
)
ExecDelLocal_Hlock
(
hlock
*
pty
.
HashlockLock
,
tx
*
types
.
Transaction
,
receipt
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
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
}
info
:=
pty
.
Hashlockquery
{
Time
:
hlock
.
Time
,
Status
:
hashlockLocked
,
Amount
:
hlock
.
Amount
,
CreateTime
:
h
.
GetBlockTime
(),
CurrentTime
:
0
}
kv
,
err
:=
UpdateHashReciver
(
h
.
GetLocalDB
(),
hlock
.
Hash
,
info
)
kv
,
err
:=
UpdateHashReciver
(
h
.
GetLocalDB
(),
hlock
.
Hash
,
info
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -22,6 +25,9 @@ func (h *Hashlock) ExecDelLocal_Hlock(hlock *pty.HashlockLock, tx *types.Transac
...
@@ -22,6 +25,9 @@ func (h *Hashlock) ExecDelLocal_Hlock(hlock *pty.HashlockLock, tx *types.Transac
// ExecDelLocal_Hsend Action
// ExecDelLocal_Hsend Action
func
(
h
*
Hashlock
)
ExecDelLocal_Hsend
(
hsend
*
pty
.
HashlockSend
,
tx
*
types
.
Transaction
,
receipt
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
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
}
info
:=
pty
.
Hashlockquery
{
Time
:
0
,
Status
:
hashlockSent
,
Amount
:
0
,
CreateTime
:
0
,
CurrentTime
:
0
}
kv
,
err
:=
UpdateHashReciver
(
h
.
GetLocalDB
(),
common
.
Sha256
(
hsend
.
Secret
),
info
)
kv
,
err
:=
UpdateHashReciver
(
h
.
GetLocalDB
(),
common
.
Sha256
(
hsend
.
Secret
),
info
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -32,6 +38,9 @@ func (h *Hashlock) ExecDelLocal_Hsend(hsend *pty.HashlockSend, tx *types.Transac
...
@@ -32,6 +38,9 @@ func (h *Hashlock) ExecDelLocal_Hsend(hsend *pty.HashlockSend, tx *types.Transac
// ExecDelLocal_Hunlock Action
// ExecDelLocal_Hunlock Action
func
(
h
*
Hashlock
)
ExecDelLocal_Hunlock
(
hunlock
*
pty
.
HashlockUnlock
,
tx
*
types
.
Transaction
,
receipt
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
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
}
info
:=
pty
.
Hashlockquery
{
Time
:
0
,
Status
:
hashlockUnlocked
,
Amount
:
0
,
CreateTime
:
0
,
CurrentTime
:
0
}
kv
,
err
:=
UpdateHashReciver
(
h
.
GetLocalDB
(),
common
.
Sha256
(
hunlock
.
Secret
),
info
)
kv
,
err
:=
UpdateHashReciver
(
h
.
GetLocalDB
(),
common
.
Sha256
(
hunlock
.
Secret
),
info
)
if
err
!=
nil
{
if
err
!=
nil
{
...
...
plugin/dapp/hashlock/executor/exec_local.go
View file @
63038010
...
@@ -12,6 +12,9 @@ import (
...
@@ -12,6 +12,9 @@ import (
// ExecLocal_Hlock Action
// ExecLocal_Hlock Action
func
(
h
*
Hashlock
)
ExecLocal_Hlock
(
hlock
*
pty
.
HashlockLock
,
tx
*
types
.
Transaction
,
receipt
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
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
}
info
:=
pty
.
Hashlockquery
{
Time
:
hlock
.
Time
,
Status
:
hashlockLocked
,
Amount
:
hlock
.
Amount
,
CreateTime
:
h
.
GetBlockTime
(),
CurrentTime
:
0
}
clog
.
Error
(
"ExecLocal"
,
"info"
,
info
)
clog
.
Error
(
"ExecLocal"
,
"info"
,
info
)
kv
,
err
:=
UpdateHashReciver
(
h
.
GetLocalDB
(),
hlock
.
Hash
,
info
)
kv
,
err
:=
UpdateHashReciver
(
h
.
GetLocalDB
(),
hlock
.
Hash
,
info
)
...
@@ -23,6 +26,9 @@ func (h *Hashlock) ExecLocal_Hlock(hlock *pty.HashlockLock, tx *types.Transactio
...
@@ -23,6 +26,9 @@ func (h *Hashlock) ExecLocal_Hlock(hlock *pty.HashlockLock, tx *types.Transactio
// ExecLocal_Hsend Action
// ExecLocal_Hsend Action
func
(
h
*
Hashlock
)
ExecLocal_Hsend
(
hsend
*
pty
.
HashlockSend
,
tx
*
types
.
Transaction
,
receipt
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
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
}
info
:=
pty
.
Hashlockquery
{
Time
:
0
,
Status
:
hashlockSent
,
Amount
:
0
,
CreateTime
:
0
,
CurrentTime
:
0
}
clog
.
Error
(
"ExecLocal"
,
"info"
,
info
)
clog
.
Error
(
"ExecLocal"
,
"info"
,
info
)
kv
,
err
:=
UpdateHashReciver
(
h
.
GetLocalDB
(),
common
.
Sha256
(
hsend
.
Secret
),
info
)
kv
,
err
:=
UpdateHashReciver
(
h
.
GetLocalDB
(),
common
.
Sha256
(
hsend
.
Secret
),
info
)
...
@@ -34,6 +40,9 @@ func (h *Hashlock) ExecLocal_Hsend(hsend *pty.HashlockSend, tx *types.Transactio
...
@@ -34,6 +40,9 @@ func (h *Hashlock) ExecLocal_Hsend(hsend *pty.HashlockSend, tx *types.Transactio
// ExecLocal_Hunlock Action
// ExecLocal_Hunlock Action
func
(
h
*
Hashlock
)
ExecLocal_Hunlock
(
hunlock
*
pty
.
HashlockUnlock
,
tx
*
types
.
Transaction
,
receipt
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
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
}
info
:=
pty
.
Hashlockquery
{
Time
:
0
,
Status
:
hashlockUnlocked
,
Amount
:
0
,
CreateTime
:
0
,
CurrentTime
:
0
}
clog
.
Error
(
"ExecLocal"
,
"info"
,
info
)
clog
.
Error
(
"ExecLocal"
,
"info"
,
info
)
kv
,
err
:=
UpdateHashReciver
(
h
.
GetLocalDB
(),
common
.
Sha256
(
hunlock
.
Secret
),
info
)
kv
,
err
:=
UpdateHashReciver
(
h
.
GetLocalDB
(),
common
.
Sha256
(
hunlock
.
Secret
),
info
)
...
...
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