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
aa1bced9
Commit
aa1bced9
authored
Nov 26, 2018
by
Hugo
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'branch_dev_hugo' of github.com:Hugo-Huang/plugin into branch_dev_hugo
parents
cb944409
7e3eddc0
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
24 additions
and
26 deletions
+24
-26
consensus_state.go
plugin/consensus/tendermint/consensus_state.go
+1
-1
node.go
plugin/consensus/tendermint/node.go
+0
-0
secret_connection.go
plugin/consensus/tendermint/secret_connection.go
+1
-1
tendermint.go
plugin/consensus/tendermint/tendermint.go
+0
-0
nonePerf.go
plugin/consensus/tendermint/tools/nonePerf.go
+1
-0
block.go
plugin/consensus/tendermint/types/block.go
+0
-0
evidence.go
plugin/consensus/tendermint/types/evidence.go
+0
-0
util.go
plugin/consensus/tendermint/types/util.go
+1
-0
vote_set.go
plugin/consensus/tendermint/types/vote_set.go
+0
-0
exec_local.go
plugin/dapp/cert/executor/exec_local.go
+3
-3
exec_del_local.go
plugin/dapp/hashlock/executor/exec_del_local.go
+3
-3
exec_local.go
plugin/dapp/hashlock/executor/exec_local.go
+3
-3
exec_del_local.go
plugin/dapp/retrieve/executor/exec_del_local.go
+4
-4
exec_local.go
plugin/dapp/retrieve/executor/exec_local.go
+4
-4
executor.go
vendor/github.com/33cn/chain33/types/executor.go
+2
-2
reflect.go
vendor/github.com/33cn/chain33/types/reflect.go
+1
-5
No files found.
plugin/consensus/tendermint/consensus_state.go
View file @
aa1bced9
...
...
@@ -216,7 +216,7 @@ func (cs *ConsensusState) Start() {
// Stop timer and receive routine
func
(
cs
*
ConsensusState
)
Stop
()
{
cs
.
timeoutTicker
.
Stop
()
cs
.
Quit
<-
struct
{}{}
cs
.
Quit
<-
struct
{}{}
}
//------------------------------------------------------------
...
...
plugin/consensus/tendermint/node.go
View file @
aa1bced9
plugin/consensus/tendermint/secret_connection.go
View file @
aa1bced9
...
...
@@ -352,7 +352,7 @@ func incr2Nonce(nonce *[24]byte) {
// increment nonce big-endian by 1 with wraparound.
func
incrNonce
(
nonce
*
[
24
]
byte
)
{
for
i
:=
23
;
0
<=
i
;
i
--
{
nonce
[
i
]
++
nonce
[
i
]
++
if
nonce
[
i
]
!=
0
{
return
}
...
...
plugin/consensus/tendermint/tendermint.go
View file @
aa1bced9
plugin/consensus/tendermint/tools/nonePerf.go
View file @
aa1bced9
...
...
@@ -29,6 +29,7 @@ const fee = 1e6
const
letterBytes
=
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
var
r
*
rand
.
Rand
// TxHeightOffset needed
var
TxHeightOffset
int64
...
...
plugin/consensus/tendermint/types/block.go
View file @
aa1bced9
plugin/consensus/tendermint/types/evidence.go
View file @
aa1bced9
plugin/consensus/tendermint/types/util.go
View file @
aa1bced9
...
...
@@ -143,6 +143,7 @@ func MinInt(a, b int) int {
}
return
b
}
// MaxInt ...
func
MaxInt
(
a
,
b
int
)
int
{
if
a
>
b
{
...
...
plugin/consensus/tendermint/types/vote_set.go
View file @
aa1bced9
plugin/dapp/cert/executor/exec_local.go
View file @
aa1bced9
...
...
@@ -17,7 +17,7 @@ func calcCertHeightKey(height int64) []byte {
}
// ExecLocal_New 启用证书交易执行
func
(
c
*
Cert
)
ExecLocal_New
(
payload
*
ct
.
CertNew
,
tx
*
types
.
Transaction
,
receiptData
types
.
ExecTypeGet
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
func
(
c
*
Cert
)
ExecLocal_New
(
payload
*
ct
.
CertNew
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
!
authority
.
IsAuthEnable
{
clog
.
Error
(
"Authority is not available. Please check the authority config or authority initialize error logs."
)
return
nil
,
ct
.
ErrInitializeAuthority
...
...
@@ -49,7 +49,7 @@ func (c *Cert) ExecLocal_New(payload *ct.CertNew, tx *types.Transaction, receipt
}
// ExecLocal_Update 更新证书交易执行
func
(
c
*
Cert
)
ExecLocal_Update
(
payload
*
ct
.
CertUpdate
,
tx
*
types
.
Transaction
,
receiptData
types
.
ExecTypeGet
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
func
(
c
*
Cert
)
ExecLocal_Update
(
payload
*
ct
.
CertUpdate
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
!
authority
.
IsAuthEnable
{
clog
.
Error
(
"Authority is not available. Please check the authority config or authority initialize error logs."
)
return
nil
,
ct
.
ErrInitializeAuthority
...
...
@@ -82,7 +82,7 @@ func (c *Cert) ExecLocal_Update(payload *ct.CertUpdate, tx *types.Transaction, r
}
// ExecLocal_Normal 非证书变更交易执行
func
(
c
*
Cert
)
ExecLocal_Normal
(
payload
*
ct
.
CertNormal
,
tx
*
types
.
Transaction
,
receiptData
types
.
ExecTypeGet
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
func
(
c
*
Cert
)
ExecLocal_Normal
(
payload
*
ct
.
CertNormal
,
tx
*
types
.
Transaction
,
receiptData
*
types
.
ReceiptData
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
if
!
authority
.
IsAuthEnable
{
clog
.
Error
(
"Authority is not available. Please check the authority config or authority initialize error logs."
)
return
nil
,
ct
.
ErrInitializeAuthority
...
...
plugin/dapp/hashlock/executor/exec_del_local.go
View file @
aa1bced9
...
...
@@ -11,7 +11,7 @@ import (
)
// ExecDelLocal_Hlock Action
func
(
h
*
Hashlock
)
ExecDelLocal_Hlock
(
hlock
*
pty
.
HashlockLock
,
tx
*
types
.
Transaction
,
receipt
types
.
ExecTypeGet
,
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
}
...
...
@@ -24,7 +24,7 @@ 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
.
ExecTypeGet
,
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
}
...
...
@@ -37,7 +37,7 @@ 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
.
ExecTypeGet
,
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
}
...
...
plugin/dapp/hashlock/executor/exec_local.go
View file @
aa1bced9
...
...
@@ -11,7 +11,7 @@ import (
)
// ExecLocal_Hlock Action
func
(
h
*
Hashlock
)
ExecLocal_Hlock
(
hlock
*
pty
.
HashlockLock
,
tx
*
types
.
Transaction
,
receipt
types
.
ExecTypeGet
,
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
}
...
...
@@ -25,7 +25,7 @@ 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
.
ExecTypeGet
,
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
}
...
...
@@ -39,7 +39,7 @@ 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
.
ExecTypeGet
,
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
}
...
...
plugin/dapp/retrieve/executor/exec_del_local.go
View file @
aa1bced9
...
...
@@ -49,7 +49,7 @@ 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
.
ExecTypeGet
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
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
...
...
@@ -70,7 +70,7 @@ 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
.
ExecTypeGet
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
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
...
...
@@ -91,7 +91,7 @@ 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
.
ExecTypeGet
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
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
...
...
@@ -112,7 +112,7 @@ 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
.
ExecTypeGet
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
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
...
...
plugin/dapp/retrieve/executor/exec_local.go
View file @
aa1bced9
...
...
@@ -52,7 +52,7 @@ 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
.
ExecTypeGet
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
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
...
...
@@ -72,7 +72,7 @@ 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
.
ExecTypeGet
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
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
...
...
@@ -93,7 +93,7 @@ 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
.
ExecTypeGet
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
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
...
...
@@ -114,7 +114,7 @@ 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
.
ExecTypeGet
,
index
int
)
(
*
types
.
LocalDBSet
,
error
)
{
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
...
...
vendor/github.com/33cn/chain33/types/executor.go
View file @
aa1bced9
...
...
@@ -251,7 +251,7 @@ type ExecutorType interface {
GetAssets
(
tx
*
Transaction
)
([]
*
Asset
,
error
)
}
type
E
xecTypeGet
interface
{
type
e
xecTypeGet
interface
{
GetTy
()
int32
}
...
...
@@ -466,7 +466,7 @@ func (base *ExecTypeBase) ActionName(tx *Transaction) string {
return
"unknown-err"
}
tm
:=
base
.
child
.
GetTypeMap
()
if
get
,
ok
:=
payload
.
(
E
xecTypeGet
);
ok
{
if
get
,
ok
:=
payload
.
(
e
xecTypeGet
);
ok
{
ty
:=
get
.
GetTy
()
for
k
,
v
:=
range
tm
{
if
v
==
ty
{
...
...
vendor/github.com/33cn/chain33/types/reflect.go
View file @
aa1bced9
...
...
@@ -87,15 +87,11 @@ func ListMethodByType(typ reflect.Type) map[string]reflect.Method {
return
methods
}
type
ExecutorAction
interface
{
GetTy
()
int32
}
var
nilValue
=
reflect
.
ValueOf
(
nil
)
func
GetActionValue
(
action
interface
{},
funclist
map
[
string
]
reflect
.
Method
)
(
string
,
int32
,
reflect
.
Value
)
{
var
ty
int32
if
a
,
ok
:=
action
.
(
ExecutorAction
);
ok
{
if
a
,
ok
:=
action
.
(
execTypeGet
);
ok
{
ty
=
a
.
GetTy
()
}
value
:=
reflect
.
ValueOf
(
action
)
...
...
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