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
6add8072
Commit
6add8072
authored
Oct 16, 2020
by
QM
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
supervision cade updata
parent
8fbbee7c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
225 additions
and
24 deletions
+225
-24
testcase.sh
plugin/dapp/paracross/cmd/build/testcase.sh
+97
-10
test-rpc.sh
plugin/dapp/paracross/cmd/test/test-rpc.sh
+2
-1
paracross.go
plugin/dapp/paracross/commands/paracross.go
+38
-1
action.go
plugin/dapp/paracross/executor/action.go
+0
-1
exec_del_local.go
plugin/dapp/paracross/executor/exec_del_local.go
+13
-0
exec_local.go
plugin/dapp/paracross/executor/exec_local.go
+13
-0
kv.go
plugin/dapp/paracross/executor/kv.go
+28
-2
query.go
plugin/dapp/paracross/executor/query.go
+26
-0
supervisionaccount.go
plugin/dapp/paracross/executor/supervisionaccount.go
+0
-0
supervisionaccount_test.go
plugin/dapp/paracross/executor/supervisionaccount_test.go
+8
-9
No files found.
plugin/dapp/paracross/cmd/build/testcase.sh
View file @
6add8072
...
...
@@ -260,7 +260,7 @@ function para_configkey() {
function
query_tx
()
{
block_wait
"
${
1
}
"
1
local times
=
20
local times
=
20
0
while
true
;
do
ret
=
$(${
1
}
tx query
-s
"
${
2
}
"
| jq
-r
".tx.hash"
)
echo
"query hash is
${
2
}
, return
${
ret
}
"
...
...
@@ -759,8 +759,39 @@ function para_create_nodegroup() {
fi
}
# $1 status
function
check_supervision_node_list
()
{
newid
=
$(${
PARA_CLI
}
para supervision_node list
-s
"
$1
"
| jq
-r
".ids[0].id"
)
if
[
-z
"
$newid
"
]
;
then
${
PARA_CLI
}
para supervision_node list
-s
"
$1
"
echo
"cancel status error "
exit
1
fi
}
# $1 status
function
check_supervision_node_status
()
{
status
=
$(${
PARA_CLI
}
para supervision_node status | jq
-r
".status"
)
if
[
"
$status
"
!=
"
$1
"
]
;
then
${
PARA_CLI
}
para supervision_node status
echo
"status
$status
not eq target status
$1
"
exit
1
fi
}
# $1 status
function
check_supervision_node_addr_status
()
{
status
=
$(${
PARA_CLI
}
para supervision_node addr_status
-a
"15HmJz2abkExxgcmSRt2Q5D4hZg6zJUD1h"
| jq
-r
".status"
)
if
[
"
$status
"
!=
"
$1
"
]
;
then
${
PARA_CLI
}
para supervision_node addr_status
-a
"15HmJz2abkExxgcmSRt2Q5D4hZg6zJUD1h"
echo
"addr_status
$status
not eq target status
$1
"
exit
1
fi
}
function
para_create_supervision_nodegroup
()
{
echo
"=========== # para chain create supervision node group ============="
echo
"=========== # para chain apply supervision node group 1 ============="
balancePre
=
$(${
CLI
}
account balance
-a
1Ka7EPFRqs3v9yreXG6qA4RQbNmbPJCZPj
-e
paracross | jq
-r
".frozen"
)
##apply
txhash
=
$(${
PARA_CLI
}
send para supervision_node apply
-a
"15HmJz2abkExxgcmSRt2Q5D4hZg6zJUD1h"
-c
6
-p
"
$BLSPUB_5H
"
-k
0xd165c84ed37c2a427fea487470ee671b7a0495d68d82607cafbc6348bf23bec5
)
...
...
@@ -769,6 +800,9 @@ function para_create_supervision_nodegroup() {
id
=
$txhash
check_balance_1ka
"
$balancePre
"
6
check_supervision_node_list 1
check_supervision_node_status 1
check_supervision_node_addr_status 1
echo
"=========== # para chain cancel supervision node group ============="
balancePre
=
$(${
CLI
}
account balance
-a
1Ka7EPFRqs3v9yreXG6qA4RQbNmbPJCZPj
-e
paracross | jq
-r
".frozen"
)
...
...
@@ -776,13 +810,11 @@ function para_create_supervision_nodegroup() {
txhash
=
$(${
PARA_CLI
}
send para supervision_node cancel
-i
"
$id
"
-k
0xd165c84ed37c2a427fea487470ee671b7a0495d68d82607cafbc6348bf23bec5
)
echo
"tx=
$txhash
"
query_tx
"
${
PARA_CLI
}
"
"
${
txhash
}
"
# newid=$(${PARA_CLI} para supervision_node list -s 4 | jq -r ".ids[0].id")
# if [ -z "$newid" ]; then
# ${PARA_CLI} para supervision_node list -s 4
# echo "cancel status error "
# # exit 1
# fi
check_balance_1ka
"
$balancePre
"
-6
check_supervision_node_list 4
check_supervision_node_status 4
check_supervision_node_addr_status 4
echo
"=========== # para chain create supervision node group again ============="
balancePre
=
$(${
CLI
}
account balance
-a
1Ka7EPFRqs3v9yreXG6qA4RQbNmbPJCZPj
-e
paracross | jq
-r
".frozen"
)
...
...
@@ -793,6 +825,9 @@ function para_create_supervision_nodegroup() {
id
=
$txhash
check_balance_1ka
"
$balancePre
"
6
check_supervision_node_list 1
check_supervision_node_status 1
check_supervision_node_addr_status 1
echo
"=========== # para chain approve supervision node group ============="
##approve
...
...
@@ -800,13 +835,65 @@ function para_create_supervision_nodegroup() {
echo
"tx=
$txhash
"
query_tx
"
${
PARA_CLI
}
"
"
${
txhash
}
"
check_supervision_node_list 2
check_supervision_node_status 2
check_supervision_node_addr_status 2
addrs
=
$(${
PARA_CLI
}
para supervision_node addrs | jq
-r
".value"
)
if
[
"
$addrs
"
!=
"15HmJz2abkExxgcmSRt2Q5D4hZg6zJUD1h"
]
;
then
${
PARA_CLI
}
para supervision_node addrs
echo
"supervision group addrs
$addrs
"
exit
1
fi
echo
"=========== # para chain quit supervision node group ============="
balancePre
=
$(${
CLI
}
account balance
-a
1Ka7EPFRqs3v9yreXG6qA4RQbNmbPJCZPj
-e
paracross | jq
-r
".frozen"
)
txhash
=
$(${
PARA_CLI
}
send para supervision_node quit
-a
"15HmJz2abkExxgcmSRt2Q5D4hZg6zJUD1h"
-k
0xc34b5d9d44ac7b754806f761d3d4d2c4fe5214f6b074c19f069c4f5c2a29c8cc
)
echo
"tx=
$txhash
"
query_tx
"
${
PARA_CLI
}
"
"
${
txhash
}
"
status
=
$(${
PARA_CLI
}
para supervision_node status | jq
-r
".status"
)
if
[
"
$status
"
!=
2
]
;
then
echo
"status not approve status=
$status
"
check_balance_1ka
"
$balancePre
"
-6
check_supervision_node_list 3
check_supervision_node_status 3
check_supervision_node_addr_status 3
addrs
=
$(${
PARA_CLI
}
para supervision_node addrs | jq
-r
".value"
)
if
[
"
$addrs
"
!=
null
]
;
then
${
PARA_CLI
}
para supervision_node addrs
echo
"supervision group addrs
$addrs
"
exit
1
fi
${
PARA_CLI
}
para supervision_node addrs
echo
"=========== # para chain create supervision node group again ============="
balancePre
=
$(${
CLI
}
account balance
-a
1Ka7EPFRqs3v9yreXG6qA4RQbNmbPJCZPj
-e
paracross | jq
-r
".frozen"
)
##apply
txhash
=
$(${
PARA_CLI
}
send para supervision_node apply
-a
"15HmJz2abkExxgcmSRt2Q5D4hZg6zJUD1h"
-c
6
-p
"
$BLSPUB_5H
"
-k
0xd165c84ed37c2a427fea487470ee671b7a0495d68d82607cafbc6348bf23bec5
)
echo
"tx=
$txhash
"
query_tx
"
${
PARA_CLI
}
"
"
${
txhash
}
"
id
=
$txhash
check_balance_1ka
"
$balancePre
"
6
check_supervision_node_list 1
check_supervision_node_status 1
check_supervision_node_addr_status 1
echo
"=========== # para chain approve supervision node group ============="
##approve
txhash
=
$(${
PARA_CLI
}
send para supervision_node approve
-i
"
$id
"
-c
6
-k
0xc34b5d9d44ac7b754806f761d3d4d2c4fe5214f6b074c19f069c4f5c2a29c8cc
)
echo
"tx=
$txhash
"
query_tx
"
${
PARA_CLI
}
"
"
${
txhash
}
"
check_supervision_node_list 2
check_supervision_node_status 2
check_supervision_node_addr_status 2
addrs
=
$(${
PARA_CLI
}
para supervision_node addrs | jq
-r
".value"
)
if
[
"
$addrs
"
!=
"15HmJz2abkExxgcmSRt2Q5D4hZg6zJUD1h"
]
;
then
${
PARA_CLI
}
para supervision_node addrs
echo
"supervision group addrs
$addrs
"
exit
1
fi
echo
"=========== # para chain approve supervision node group end ============="
}
...
...
plugin/dapp/paracross/cmd/test/test-rpc.sh
View file @
6add8072
...
...
@@ -237,7 +237,8 @@ function paracross_GetSupervisionInfo() {
chain33_Http
'{"method":"Chain33.Query","params":[{ "execer":"paracross", "funcName":"GetSupervisionNodeGroupAddrs","payload":{"title":"user.p.para."}}]}'
${
UNIT_HTTP
}
'(.error|not) and (.result| [has("key","value"),true])'
"GetSupervisionNodeGroupAddrs"
chain33_Http
'{"method":"Chain33.Query","params":[{ "execer":"paracross", "funcName":"GetSupervisionNodeGroupStatus","payload":{"title":"user.p.para."}}]}'
${
UNIT_HTTP
}
'(.error|not) and (.result| [has("status"),true])'
"GetSupervisionNodeGroupStatus"
chain33_Http
'{"method":"Chain33.Query","params":[{ "execer":"paracross", "funcName":"ListSupervisionNodeGroupStatus","payload":{"title":"user.p.para.","status":2}}]}'
${
UNIT_HTTP
}
'(.error|not) and (.result| [has("status"),true])'
"ListSupervisionNodeGroupStatus status:2"
# chain33_Http '{"method":"Chain33.Query","params":[{ "execer":"paracross", "funcName":"ListSupervisionNodeGroupStatus","payload":{"title":"user.p.para.","status":4}}]}' ${UNIT_HTTP} '(.error|not) and (.result| [has("status"),true])' "ListSupervisionNodeGroupStatus status:4"
chain33_Http
'{"method":"Chain33.Query","params":[{ "execer":"paracross", "funcName":"ListSupervisionNodeGroupStatus","payload":{"title":"user.p.para.","status":3}}]}'
${
UNIT_HTTP
}
'(.error|not) and (.result| [has("status"),true])'
"ListSupervisionNodeGroupStatus status:3"
chain33_Http
'{"method":"Chain33.Query","params":[{ "execer":"paracross", "funcName":"ListSupervisionNodeGroupStatus","payload":{"title":"user.p.para.","status":4}}]}'
${
UNIT_HTTP
}
'(.error|not) and (.result| [has("status"),true])'
"ListSupervisionNodeGroupStatus status:4"
}
para_test_addr
=
"1MAuE8QSbbech3bVKK2JPJJxYxNtT95oSU"
...
...
plugin/dapp/paracross/commands/paracross.go
View file @
6add8072
...
...
@@ -1527,6 +1527,7 @@ func supervisionNodeCmd() *cobra.Command {
cmd
.
AddCommand
(
getSupervisionNodeGroupAddrsCmd
())
cmd
.
AddCommand
(
supervisionNodeGroupStatusCmd
())
cmd
.
AddCommand
(
supervisionNodeGroupListCmd
())
cmd
.
AddCommand
(
getSupervisionNodeInfoCmd
())
return
cmd
}
...
...
@@ -1740,7 +1741,7 @@ func supervisionNodeGroupListCmd() *cobra.Command {
}
func
getSupervisionNodeGroupListCmdFlags
(
cmd
*
cobra
.
Command
)
{
cmd
.
Flags
()
.
Int32P
(
"status"
,
"s"
,
0
,
"status:1:apply, 2:approve, 3:quit"
)
cmd
.
Flags
()
.
Int32P
(
"status"
,
"s"
,
0
,
"status:1:apply, 2:approve, 3:quit
, 4:cancel
"
)
_
=
cmd
.
MarkFlagRequired
(
"status"
)
}
...
...
@@ -1760,3 +1761,39 @@ func supervisionNodeGroupList(cmd *cobra.Command, args []string) {
ctx
:=
jsonclient
.
NewRPCCtx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
Run
()
}
// getNodeInfoCmd get node current status
func
getSupervisionNodeInfoCmd
()
*
cobra
.
Command
{
cmd
:=
&
cobra
.
Command
{
Use
:
"addr_status"
,
Short
:
"Get node current status:1:apply, 2:approve, 3:quit, 4:cancel from supervision group"
,
Run
:
supervisionNodeInfo
,
}
addSupervisionNodeInfoCmdFlags
(
cmd
)
return
cmd
}
func
addSupervisionNodeInfoCmdFlags
(
cmd
*
cobra
.
Command
)
{
cmd
.
Flags
()
.
StringP
(
"addr"
,
"a"
,
""
,
"addr apply for super user"
)
_
=
cmd
.
MarkFlagRequired
(
"addr"
)
}
func
supervisionNodeInfo
(
cmd
*
cobra
.
Command
,
args
[]
string
)
{
rpcLaddr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"rpc_laddr"
)
paraName
,
_
:=
cmd
.
Flags
()
.
GetString
(
"paraName"
)
addr
,
_
:=
cmd
.
Flags
()
.
GetString
(
"addr"
)
var
params
rpctypes
.
Query4Jrpc
params
.
Execer
=
pt
.
ParaX
params
.
FuncName
=
"GetNodeAddrInfo"
req
:=
pt
.
ReqParacrossNodeInfo
{
Title
:
paraName
,
Addr
:
addr
,
}
params
.
Payload
=
types
.
MustPBToJSON
(
&
req
)
var
res
pt
.
ParaNodeAddrIdStatus
ctx
:=
jsonclient
.
NewRPCCtx
(
rpcLaddr
,
"Chain33.Query"
,
params
,
&
res
)
ctx
.
Run
()
}
plugin/dapp/paracross/executor/action.go
View file @
6add8072
...
...
@@ -885,7 +885,6 @@ func (a *action) loopCommitTxDone(title string) (*types.Receipt, error) {
return
receipt
,
nil
}
receipt
=
mergeReceipt
(
receipt
,
r
)
}
}
...
...
plugin/dapp/paracross/executor/exec_del_local.go
View file @
6add8072
...
...
@@ -155,6 +155,19 @@ func (e *Paracross) ExecDelLocal_SupervisionNodeGroupConfig(payload *pt.ParaNode
set
.
KV
=
append
(
set
.
KV
,
&
types
.
KeyValue
{
Key
:
calcLocalSupervisionNodeGroupStatusTitle
(
g
.
Current
.
Status
,
g
.
Current
.
Title
,
g
.
Current
.
Id
),
Value
:
nil
})
}
else
if
log
.
Ty
==
pt
.
TyLogParaSupervisionNodeConfig
{
var
g
pt
.
ReceiptParaNodeConfig
err
:=
types
.
Decode
(
log
.
Log
,
&
g
)
if
err
!=
nil
{
return
nil
,
err
}
if
g
.
Prev
!=
nil
{
set
.
KV
=
append
(
set
.
KV
,
&
types
.
KeyValue
{
Key
:
calcLocalSupervisionNodeStatusTitle
(
g
.
Prev
.
Status
,
g
.
Current
.
Title
,
g
.
Current
.
TargetAddr
,
g
.
Current
.
Id
),
Value
:
types
.
Encode
(
g
.
Prev
)})
}
set
.
KV
=
append
(
set
.
KV
,
&
types
.
KeyValue
{
Key
:
calcLocalSupervisionNodeStatusTitle
(
g
.
Current
.
Status
,
g
.
Current
.
Title
,
g
.
Current
.
TargetAddr
,
g
.
Current
.
Id
),
Value
:
nil
})
}
}
return
&
set
,
nil
...
...
plugin/dapp/paracross/executor/exec_local.go
View file @
6add8072
...
...
@@ -156,6 +156,19 @@ func (e *Paracross) ExecLocal_SupervisionNodeGroupConfig(payload *pt.ParaNodeAdd
set
.
KV
=
append
(
set
.
KV
,
&
types
.
KeyValue
{
Key
:
calcLocalSupervisionNodeGroupStatusTitle
(
g
.
Current
.
Status
,
g
.
Current
.
Title
,
g
.
Current
.
Id
),
Value
:
types
.
Encode
(
g
.
Current
)})
}
else
if
log
.
Ty
==
pt
.
TyLogParaSupervisionNodeConfig
{
var
g
pt
.
ReceiptParaNodeConfig
err
:=
types
.
Decode
(
log
.
Log
,
&
g
)
if
err
!=
nil
{
return
nil
,
err
}
if
g
.
Prev
!=
nil
{
set
.
KV
=
append
(
set
.
KV
,
&
types
.
KeyValue
{
Key
:
calcLocalSupervisionNodeStatusTitle
(
g
.
Prev
.
Status
,
g
.
Current
.
Title
,
g
.
Current
.
TargetAddr
,
g
.
Current
.
Id
),
Value
:
types
.
Encode
(
g
.
Prev
)})
}
set
.
KV
=
append
(
set
.
KV
,
&
types
.
KeyValue
{
Key
:
calcLocalSupervisionNodeStatusTitle
(
g
.
Current
.
Status
,
g
.
Current
.
Title
,
g
.
Current
.
TargetAddr
,
g
.
Current
.
Id
),
Value
:
nil
})
}
}
return
&
set
,
nil
...
...
plugin/dapp/paracross/executor/kv.go
View file @
6add8072
...
...
@@ -43,9 +43,12 @@ var (
paraSupervisionNodes
string
paraSupervisionNodeGroupStatusAddrs
string
paraSupervisionNodeGroupIDPrefix
string
paraSupervisionSelfConsensStages
string
//paraSupervisionNodeStatusAddrs string
paraSupervisionNodeIDPrefix
string
paraSupervisionSelfConsensStages
string
localSupervisionNodeGroupStatusTitle
string
localSupervisionNodeStatusTitle
string
)
func
setPrefix
()
{
...
...
@@ -76,11 +79,14 @@ func setPrefix() {
localNodeGroupStatusTitle
=
"LODB-paracross-nodegroupStatusTitle-"
paraSupervisionNodes
=
"mavl-paracross-supervision-nodes-title-"
paraSupervisionNodeGroupStatusAddrs
=
"mavl-paracross-supervision-nodegroup-
apply
-title-"
paraSupervisionNodeGroupStatusAddrs
=
"mavl-paracross-supervision-nodegroup-
status
-title-"
paraSupervisionNodeGroupIDPrefix
=
"mavl-paracross-title-nodegroupid-supervision-"
//paraSupervisionNodeStatusAddrs = "mavl-paracross-supervision-node-status-title-"
paraSupervisionNodeIDPrefix
=
"mavl-paracross-title-nodeid-supervision-"
paraSupervisionSelfConsensStages
=
"mavl-paracross-supervision-selfconsens-stages-"
localSupervisionNodeGroupStatusTitle
=
"LODB-paracross-supervision-nodegroupStatusTitle-"
localSupervisionNodeStatusTitle
=
"LODB-paracross-supervision-nodeStatusTitle-"
}
func
calcTitleKey
(
t
string
)
[]
byte
{
...
...
@@ -213,6 +219,18 @@ func calcLocalSupervisionNodeGroupAllPrefix() []byte {
return
[]
byte
(
fmt
.
Sprintf
(
localSupervisionNodeGroupStatusTitle
))
}
func
calcLocalSupervisionNodeStatusTitle
(
status
int32
,
addr
,
title
,
id
string
)
[]
byte
{
return
[]
byte
(
fmt
.
Sprintf
(
localSupervisionNodeStatusTitle
+
"%s-%02d-%s-%s"
,
addr
,
status
,
title
,
id
))
}
//func calcLocalSupervisionNodeStatusPrefix(status int32, addr string) []byte {
// return []byte(fmt.Sprintf(localSupervisionNodeStatusTitle+"%02d-%s", status, addr))
//}
func
calcLocalSupervisionNodeAllPrefix
(
addr
string
)
[]
byte
{
return
[]
byte
(
fmt
.
Sprintf
(
localSupervisionNodeStatusTitle
+
"%s"
,
addr
))
}
//bind miner
func
calcParaBindMinerAddr
(
node
,
bind
string
)
[]
byte
{
return
[]
byte
(
fmt
.
Sprintf
(
paraBindMinderAddr
+
"%s-%s"
,
node
,
bind
))
...
...
@@ -233,3 +251,11 @@ func calcParaSupervisionNodeGroupStatusKey(title string) []byte {
func
calcParaSupervisionNodeGroupIDKey
(
title
,
hash
string
)
string
{
return
fmt
.
Sprintf
(
paraSupervisionNodeGroupIDPrefix
+
"%s-%s"
,
title
,
hash
)
}
//func calcParaSupervisionNodeStatusKey(title string) []byte {
// return []byte(fmt.Sprintf(paraSupervisionNodeStatusAddrs+"%s", title))
//}
func
calcParaSupervisionNodeIDKey
(
title
,
hash
string
)
string
{
return
fmt
.
Sprintf
(
paraSupervisionNodeIDPrefix
+
"%s-%s"
,
title
,
hash
)
}
plugin/dapp/paracross/executor/query.go
View file @
6add8072
...
...
@@ -305,6 +305,32 @@ func (p *Paracross) Query_ListSupervisionNodeGroupStatus(in *pt.ReqParacrossNode
return
resp
,
err
}
//
////Query_ListSupervisionNodeStatus list node info by status
//func (p *Paracross) Query_ListSupervisionNodeStatus(in *pt.ReqParacrossNodeInfo) (types.Message, error) {
// if in == nil {
// return nil, types.ErrInvalidParam
// }
// var prefix []byte
// prefix = calcLocalSupervisionNodeAllPrefix(in.Addr)
//
// //resp, err := listNodeGroupStatus(p.GetLocalDB(), prefix)
// value, err := p.GetLocalDB().Get(prefix)
// if err != nil {
// return nil, err
// }
//
// var rst pt.ParaNodeIdStatus
// err = types.Decode(value, &rst)
// if err != nil {
// return nil, err
// }
//
// //rst.Id = getParaNodeIDSuffix(rst.Id)
//
// return &rst, err
//}
//Query_ListTitles query paracross titles list
func
(
p
*
Paracross
)
Query_ListTitles
(
in
*
types
.
ReqNil
)
(
types
.
Message
,
error
)
{
return
p
.
paracrossListTitles
()
...
...
plugin/dapp/paracross/executor/supervisionaccount.go
View file @
6add8072
This diff is collapsed.
Click to expand it.
plugin/dapp/paracross/executor/supervisionaccount_test.go
View file @
6add8072
...
...
@@ -44,11 +44,11 @@ func (suite *NodeManageTestSuite) testSupervisionNodeConfigCancel() {
err
:=
types
.
Decode
(
receipt
.
Logs
[
0
]
.
Log
,
&
g
)
suite
.
Nil
(
err
)
//
Quit
//
cancel
config
=
&
pt
.
ParaNodeAddrConfig
{
Title
:
chain33TestCfg
.
GetTitle
(),
Op
:
pt
.
ParacrossSupervisionNodeCancel
,
Id
:
g
.
Current
.
Id
,
Id
:
g
etParaNodeIDSuffix
(
g
.
Current
.
Id
)
,
}
tx
=
createRawSupervisionNodeConfigTx
(
config
)
receipt
=
nodeCommit
(
suite
,
PrivKey14K
,
tx
)
...
...
@@ -62,7 +62,7 @@ func (suite *NodeManageTestSuite) testSupervisionNodeConfigApprove(addr, privKey
Addr
:
addr
,
}
tx
:=
createRawSupervisionNodeConfigTx
(
config
)
receipt
:=
nodeCommit
(
suite
,
PrivKey14K
,
tx
)
receipt
:=
nodeCommit
(
suite
,
privKey
,
tx
)
checkSupervisionGroupApplyReceipt
(
suite
,
receipt
)
var
g
pt
.
ReceiptParaNodeGroupConfig
...
...
@@ -71,7 +71,7 @@ func (suite *NodeManageTestSuite) testSupervisionNodeConfigApprove(addr, privKey
config
=
&
pt
.
ParaNodeAddrConfig
{
Title
:
chain33TestCfg
.
GetTitle
(),
Id
:
g
.
Current
.
Id
,
Id
:
g
etParaNodeIDSuffix
(
g
.
Current
.
Id
)
,
Op
:
pt
.
ParacrossSupervisionNodeApprove
,
}
tx
=
createRawSupervisionNodeConfigTx
(
config
)
...
...
@@ -108,7 +108,7 @@ func (suite *NodeManageTestSuite) testSupervisionNodeQuit() {
Addr
:
Account1Ku
,
}
tx
:=
createRawSupervisionNodeConfigTx
(
config
)
receipt
:=
nodeCommit
(
suite
,
PrivKey1
4K
,
tx
)
receipt
:=
nodeCommit
(
suite
,
PrivKey1
Ku
,
tx
)
assert
.
Equal
(
suite
.
T
(),
receipt
.
Ty
,
int32
(
types
.
ExecOk
))
assert
.
Len
(
suite
.
T
(),
receipt
.
KV
,
3
)
assert
.
Len
(
suite
.
T
(),
receipt
.
Logs
,
3
)
...
...
@@ -119,14 +119,13 @@ func (suite *NodeManageTestSuite) testSupervisionNodeQuit() {
resp
,
ok
:=
ret
.
(
*
types
.
ReplyConfig
)
assert
.
Equal
(
suite
.
T
(),
ok
,
true
)
assert
.
Equal
(
suite
.
T
(),
resp
.
Value
,
"14KEKbYtKKQm4wMthSK9J4La4nAiidGozt,1M3XCbWVxAPBH5AR8VmLky4ZtDdGgC6ugD"
)
}
func
checkSupervisionGroupApplyReceipt
(
suite
*
NodeManageTestSuite
,
receipt
*
types
.
Receipt
)
{
assert
.
Equal
(
suite
.
T
(),
receipt
.
Ty
,
int32
(
types
.
ExecOk
))
assert
.
Len
(
suite
.
T
(),
receipt
.
KV
,
1
)
assert
.
Len
(
suite
.
T
(),
receipt
.
Logs
,
1
)
assert
.
Equal
(
suite
.
T
(),
int32
(
pt
.
TyLogParaSupervisionNodeConfig
),
receipt
.
Logs
[
0
]
.
Ty
)
//
assert.Len(suite.T(), receipt.KV, 1)
//
assert.Len(suite.T(), receipt.Logs, 1)
//
assert.Equal(suite.T(), int32(pt.TyLogParaSupervisionNodeConfig), receipt.Logs[0].Ty)
}
func
(
suite
*
NodeManageTestSuite
)
testSupervisionQuery
()
{
...
...
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