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
cdef5a14
Commit
cdef5a14
authored
Apr 26, 2019
by
vipwzw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
auto ci
parent
3115c050
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
24 deletions
+20
-24
testcase.sh
plugin/dapp/paracross/cmd/build/testcase.sh
+16
-19
superaccount.go
plugin/dapp/paracross/executor/superaccount.go
+3
-4
type.go
plugin/dapp/paracross/types/type.go
+1
-1
No files found.
plugin/dapp/paracross/cmd/build/testcase.sh
View file @
cdef5a14
...
@@ -105,7 +105,7 @@ function para_transfer() {
...
@@ -105,7 +105,7 @@ function para_transfer() {
para_transfer2paracross
"0x9c451df9e5cb05b88b28729aeaaeb3169a2414097401fcb4c79c1971df734588"
para_transfer2paracross
"0x9c451df9e5cb05b88b28729aeaaeb3169a2414097401fcb4c79c1971df734588"
block_wait
"
${
CLI
}
"
2
block_wait
"
${
CLI
}
"
2
# para_create_manage_nodegroup
# para_create_manage_nodegroup
para_create_nodegroup
para_create_nodegroup
#token precreate
#token precreate
...
@@ -121,26 +121,25 @@ function para_transfer2account() {
...
@@ -121,26 +121,25 @@ function para_transfer2account() {
echo
"
${
hash1
}
"
echo
"
${
hash1
}
"
}
}
function
para_transfer2paracross
(){
function
para_transfer2paracross
()
{
echo
"addr=
${
1
}
"
echo
"addr=
${
1
}
"
hash1
=
$(${
CLI
}
send coins send_exec
-a
20
-e
paracross
-k
"
${
1
}
"
)
hash1
=
$(${
CLI
}
send coins send_exec
-a
20
-e
paracross
-k
"
${
1
}
"
)
echo
"
${
hash1
}
"
echo
"
${
hash1
}
"
}
}
function
para_create_nodegroup_test
()
{
function
para_create_nodegroup_test
(){
echo
"=========== # para chain create node group ============="
echo
"=========== # para chain create node group ============="
##apply
##apply
txhash
=
$(${
PARA_CLI
}
send para nodegroup
-o
1
-a
"1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4,1JRNjdEqp4LJ5fqycUBm9ayCKSeeskgMKR,1NLHPEcbTWWxxU3dGUZBhayjrCHD3psX7k,1MCftFynyvG2F4ED5mdHYgziDxx6vDrScs"
-c
20
-k
0x6da92a632ab7deb67d38c0f6560bcfed28167998f6496db64c258d5e8393a81b
)
txhash
=
$(${
PARA_CLI
}
send para nodegroup
-o
1
-a
"1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4,1JRNjdEqp4LJ5fqycUBm9ayCKSeeskgMKR,1NLHPEcbTWWxxU3dGUZBhayjrCHD3psX7k,1MCftFynyvG2F4ED5mdHYgziDxx6vDrScs"
-c
20
-k
0x6da92a632ab7deb67d38c0f6560bcfed28167998f6496db64c258d5e8393a81b
)
echo
"tx=
$txhash
"
echo
"tx=
$txhash
"
query_tx
"
${
PARA_CLI
}
"
"
${
txhash
}
"
query_tx
"
${
PARA_CLI
}
"
"
${
txhash
}
"
status
=
$(${
PARA_CLI
}
para nodegroup_status
-t
user.p.para. | jq
-r
".status"
)
status
=
$(${
PARA_CLI
}
para nodegroup_status
-t
user.p.para. | jq
-r
".status"
)
if
[
"
$status
"
!=
1
]
;
then
if
[
"
$status
"
!=
1
]
;
then
echo
"status not apply"
echo
"status not apply"
fi
fi
balance
=
$(${
CLI
}
account balance
-a
1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4
-e
paracross | jq
-r
".frozen"
)
balance
=
$(${
CLI
}
account balance
-a
1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4
-e
paracross | jq
-r
".frozen"
)
if
[
"
$balance
"
!=
"
$PARA_COIN_FROZEN
"
]
;
then
if
[
"
$balance
"
!=
"
$PARA_COIN_FROZEN
"
]
;
then
echo
"apply coinfrozen error balance=
$balance
"
echo
"apply coinfrozen error balance=
$balance
"
exit
1
exit
1
fi
fi
...
@@ -150,18 +149,18 @@ function para_create_nodegroup_test(){
...
@@ -150,18 +149,18 @@ function para_create_nodegroup_test(){
echo
"tx=
$txhash
"
echo
"tx=
$txhash
"
query_tx
"
${
PARA_CLI
}
"
"
${
txhash
}
"
query_tx
"
${
PARA_CLI
}
"
"
${
txhash
}
"
status
=
$(${
PARA_CLI
}
para nodegroup_status
-t
user.p.para. | jq
-r
".status"
)
status
=
$(${
PARA_CLI
}
para nodegroup_status
-t
user.p.para. | jq
-r
".status"
)
if
[
"
$status
"
!=
3
]
;
then
if
[
"
$status
"
!=
3
]
;
then
echo
"status not quit"
echo
"status not quit"
fi
fi
balance
=
$(${
CLI
}
account balance
-a
1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4
-e
paracross | jq
-r
".balance"
)
balance
=
$(${
CLI
}
account balance
-a
1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4
-e
paracross | jq
-r
".balance"
)
if
[
"
$balance
"
!=
"
$PARA_COIN_FROZEN
"
]
;
then
if
[
"
$balance
"
!=
"
$PARA_COIN_FROZEN
"
]
;
then
echo
"quit coinfrozen error balance=
$balance
"
echo
"quit coinfrozen error balance=
$balance
"
exit
1
exit
1
fi
fi
}
}
function
para_create_nodegroup
(){
function
para_create_nodegroup
()
{
para_create_nodegroup_test
para_create_nodegroup_test
##apply
##apply
...
@@ -169,7 +168,7 @@ function para_create_nodegroup(){
...
@@ -169,7 +168,7 @@ function para_create_nodegroup(){
echo
"tx=
$txhash
"
echo
"tx=
$txhash
"
query_tx
"
${
PARA_CLI
}
"
"
${
txhash
}
"
query_tx
"
${
PARA_CLI
}
"
"
${
txhash
}
"
status
=
$(${
PARA_CLI
}
para nodegroup_status
-t
user.p.para. | jq
-r
".status"
)
status
=
$(${
PARA_CLI
}
para nodegroup_status
-t
user.p.para. | jq
-r
".status"
)
if
[
"
$status
"
!=
1
]
;
then
if
[
"
$status
"
!=
1
]
;
then
echo
"status not apply"
echo
"status not apply"
fi
fi
...
@@ -179,7 +178,7 @@ function para_create_nodegroup(){
...
@@ -179,7 +178,7 @@ function para_create_nodegroup(){
query_tx
"
${
PARA_CLI
}
"
"
${
txhash
}
"
query_tx
"
${
PARA_CLI
}
"
"
${
txhash
}
"
status
=
$(${
PARA_CLI
}
para nodegroup_status
-t
user.p.para. | jq
-r
".status"
)
status
=
$(${
PARA_CLI
}
para nodegroup_status
-t
user.p.para. | jq
-r
".status"
)
if
[
"
$status
"
!=
2
]
;
then
if
[
"
$status
"
!=
2
]
;
then
echo
"status not approve"
echo
"status not approve"
fi
fi
...
@@ -189,24 +188,23 @@ function para_create_nodegroup(){
...
@@ -189,24 +188,23 @@ function para_create_nodegroup(){
fi
fi
##quit fail
##quit fail
txhash
=
$(${
PARA_CLI
}
send para nodegroup
-o
3
-a
"1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4,1JRNjdEqp4LJ5fqycUBm9ayCKSeeskgMKR,1NLHPEcbTWWxxU3dGUZBhayjrCHD3psX7k,1MCftFynyvG2F4ED5mdHYgziDxx6vDrScs"
-k
0x6da92a632ab7deb67d38c0f6560bcfed28167998f6496db64c258d5e8393a81b
)
txhash
=
$(${
PARA_CLI
}
send para nodegroup
-o
3
-a
"1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4,1JRNjdEqp4LJ5fqycUBm9ayCKSeeskgMKR,1NLHPEcbTWWxxU3dGUZBhayjrCHD3psX7k,1MCftFynyvG2F4ED5mdHYgziDxx6vDrScs"
-k
0x6da92a632ab7deb67d38c0f6560bcfed28167998f6496db64c258d5e8393a81b
)
echo
"tx=
$txhash
"
echo
"tx=
$txhash
"
query_tx
"
${
CLI
}
"
"
${
txhash
}
"
query_tx
"
${
CLI
}
"
"
${
txhash
}
"
status
=
$(${
CLI
}
para nodegroup_status
-t
user.p.para. | jq
-r
".status"
)
status
=
$(${
CLI
}
para nodegroup_status
-t
user.p.para. | jq
-r
".status"
)
if
[
"
$status
"
!=
2
]
;
then
if
[
"
$status
"
!=
2
]
;
then
echo
"status quit not approve"
echo
"status quit not approve"
fi
fi
balance
=
$(${
CLI
}
account balance
-a
1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4
-e
paracross | jq
-r
".frozen"
)
balance
=
$(${
CLI
}
account balance
-a
1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4
-e
paracross | jq
-r
".frozen"
)
if
[
"
$balance
"
!=
"
$PARA_COIN_FROZEN
"
]
;
then
if
[
"
$balance
"
!=
"
$PARA_COIN_FROZEN
"
]
;
then
echo
"quit fail coinfrozen error balance=
$balance
"
echo
"quit fail coinfrozen error balance=
$balance
"
exit
1
exit
1
fi
fi
}
}
function
para_create_manage_nodegroup
(){
function
para_create_manage_nodegroup
()
{
echo
"=========== # para chain send config ============="
echo
"=========== # para chain send config ============="
para_configkey
"
${
CLI
}
"
"paracross-nodes-user.p.
${
PARANAME
}
."
"1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4"
para_configkey
"
${
CLI
}
"
"paracross-nodes-user.p.
${
PARANAME
}
."
"1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4"
para_configkey
"
${
CLI
}
"
"paracross-nodes-user.p.
${
PARANAME
}
."
"1JRNjdEqp4LJ5fqycUBm9ayCKSeeskgMKR"
para_configkey
"
${
CLI
}
"
"paracross-nodes-user.p.
${
PARANAME
}
."
"1JRNjdEqp4LJ5fqycUBm9ayCKSeeskgMKR"
...
@@ -220,7 +218,6 @@ function para_create_manage_nodegroup(){
...
@@ -220,7 +218,6 @@ function para_create_manage_nodegroup(){
block_wait
"
${
CLI
}
"
1
block_wait
"
${
CLI
}
"
1
}
}
function
para_configkey
()
{
function
para_configkey
()
{
tx
=
$(${
1
}
config config_tx
-o
add
-c
"
${
2
}
"
-v
"
${
3
}
"
)
tx
=
$(${
1
}
config config_tx
-o
add
-c
"
${
2
}
"
-v
"
${
3
}
"
)
sign
=
$(${
CLI
}
wallet sign
-k
0xc34b5d9d44ac7b754806f761d3d4d2c4fe5214f6b074c19f069c4f5c2a29c8cc
-d
"
${
tx
}
"
)
sign
=
$(${
CLI
}
wallet sign
-k
0xc34b5d9d44ac7b754806f761d3d4d2c4fe5214f6b074c19f069c4f5c2a29c8cc
-d
"
${
tx
}
"
)
...
@@ -452,7 +449,7 @@ function para_cross_transfer_withdraw_for_token() {
...
@@ -452,7 +449,7 @@ function para_cross_transfer_withdraw_for_token() {
function
para_nodemanage_test
()
{
function
para_nodemanage_test
()
{
echo
"================# para node manage test ================="
echo
"================# para node manage test ================="
balance
=
$(${
CLI
}
account balance
-a
1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY
-e
paracross | jq
-r
".balance"
)
balance
=
$(${
CLI
}
account balance
-a
1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY
-e
paracross | jq
-r
".balance"
)
if
[
"
$balance
"
!=
"
$PARA_COIN_FROZEN
"
]
;
then
if
[
"
$balance
"
!=
"
$PARA_COIN_FROZEN
"
]
;
then
echo
"balance coinfrozen error balance=
$balance
"
echo
"balance coinfrozen error balance=
$balance
"
exit
1
exit
1
fi
fi
...
@@ -463,7 +460,7 @@ function para_nodemanage_test() {
...
@@ -463,7 +460,7 @@ function para_nodemanage_test() {
query_tx
"
${
PARA_CLI
}
"
"
${
hash
}
"
query_tx
"
${
PARA_CLI
}
"
"
${
hash
}
"
balance
=
$(${
CLI
}
account balance
-a
1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY
-e
paracross | jq
-r
".frozen"
)
balance
=
$(${
CLI
}
account balance
-a
1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY
-e
paracross | jq
-r
".frozen"
)
if
[
"
$balance
"
!=
"
$PARA_COIN_FROZEN
"
]
;
then
if
[
"
$balance
"
!=
"
$PARA_COIN_FROZEN
"
]
;
then
echo
"frozen coinfrozen error balance=
$balance
"
echo
"frozen coinfrozen error balance=
$balance
"
exit
1
exit
1
fi
fi
...
@@ -516,7 +513,7 @@ function para_nodemanage_test() {
...
@@ -516,7 +513,7 @@ function para_nodemanage_test() {
query_tx
"
${
PARA_CLI
}
"
"
${
hash
}
"
query_tx
"
${
PARA_CLI
}
"
"
${
hash
}
"
balance
=
$(${
CLI
}
account balance
-a
1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY
-e
paracross | jq
-r
".balance"
)
balance
=
$(${
CLI
}
account balance
-a
1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY
-e
paracross | jq
-r
".balance"
)
if
[
"
$balance
"
!=
"
$PARA_COIN_FROZEN
"
]
;
then
if
[
"
$balance
"
!=
"
$PARA_COIN_FROZEN
"
]
;
then
echo
"unfrozen coinfrozen error balance=
$balance
"
echo
"unfrozen coinfrozen error balance=
$balance
"
exit
1
exit
1
fi
fi
...
...
plugin/dapp/paracross/executor/superaccount.go
View file @
cdef5a14
...
@@ -11,11 +11,11 @@ import (
...
@@ -11,11 +11,11 @@ import (
"strings"
"strings"
dbm
"github.com/33cn/chain33/common/db"
dbm
"github.com/33cn/chain33/common/db"
"github.com/33cn/chain33/system/dapp"
manager
"github.com/33cn/chain33/system/dapp/manage/types"
manager
"github.com/33cn/chain33/system/dapp/manage/types"
"github.com/33cn/chain33/types"
"github.com/33cn/chain33/types"
pt
"github.com/33cn/plugin/plugin/dapp/paracross/types"
pt
"github.com/33cn/plugin/plugin/dapp/paracross/types"
"github.com/pkg/errors"
"github.com/pkg/errors"
"github.com/33cn/chain33/system/dapp"
)
)
var
(
var
(
...
@@ -565,7 +565,7 @@ func (a *action) nodeGroupCoinsFrozen(addrs []string, configCoinsFrozen int64) (
...
@@ -565,7 +565,7 @@ func (a *action) nodeGroupCoinsFrozen(addrs []string, configCoinsFrozen int64) (
for
_
,
addr
:=
range
addrs
{
for
_
,
addr
:=
range
addrs
{
r
,
err
:=
a
.
coinsAccount
.
ExecFrozen
(
addr
,
realExecAddr
,
configCoinsFrozen
)
r
,
err
:=
a
.
coinsAccount
.
ExecFrozen
(
addr
,
realExecAddr
,
configCoinsFrozen
)
if
err
!=
nil
{
if
err
!=
nil
{
clog
.
Error
(
"node group apply"
,
"addr"
,
addr
,
"realExec"
,
realExec
,
"realAddr"
,
realExecAddr
,
"amount"
,
configCoinsFrozen
)
clog
.
Error
(
"node group apply"
,
"addr"
,
addr
,
"realExec"
,
realExec
,
"realAddr"
,
realExecAddr
,
"amount"
,
configCoinsFrozen
)
return
nil
,
err
return
nil
,
err
}
}
logs
=
append
(
logs
,
r
.
Logs
...
)
logs
=
append
(
logs
,
r
.
Logs
...
)
...
@@ -587,7 +587,7 @@ func (a *action) nodeGroupCoinsActive(addrs []string, configCoinsFrozen int64) (
...
@@ -587,7 +587,7 @@ func (a *action) nodeGroupCoinsActive(addrs []string, configCoinsFrozen int64) (
for
_
,
addr
:=
range
addrs
{
for
_
,
addr
:=
range
addrs
{
r
,
err
:=
a
.
coinsAccount
.
ExecActive
(
addr
,
realExecAddr
,
configCoinsFrozen
)
r
,
err
:=
a
.
coinsAccount
.
ExecActive
(
addr
,
realExecAddr
,
configCoinsFrozen
)
if
err
!=
nil
{
if
err
!=
nil
{
clog
.
Error
(
"node group apply"
,
"addr"
,
addr
,
"realExec"
,
realExec
,
"realAddr"
,
realExecAddr
,
"amount"
,
configCoinsFrozen
)
clog
.
Error
(
"node group apply"
,
"addr"
,
addr
,
"realExec"
,
realExec
,
"realAddr"
,
realExecAddr
,
"amount"
,
configCoinsFrozen
)
return
nil
,
err
return
nil
,
err
}
}
logs
=
append
(
logs
,
r
.
Logs
...
)
logs
=
append
(
logs
,
r
.
Logs
...
)
...
@@ -757,7 +757,6 @@ func (a *action) nodeGroupCreate(title string, nodes []string, coinFrozen int64)
...
@@ -757,7 +757,6 @@ func (a *action) nodeGroupCreate(title string, nodes []string, coinFrozen int64)
arr
:=
types
.
ConfigItem_Arr
{
Arr
:
emptyValue
}
arr
:=
types
.
ConfigItem_Arr
{
Arr
:
emptyValue
}
item
.
Value
=
&
arr
item
.
Value
=
&
arr
item
.
GetArr
()
.
Value
=
append
(
item
.
GetArr
()
.
Value
,
nodes
...
)
item
.
GetArr
()
.
Value
=
append
(
item
.
GetArr
()
.
Value
,
nodes
...
)
item
.
Addr
=
a
.
fromaddr
item
.
Addr
=
a
.
fromaddr
a
.
db
.
Set
(
key
,
types
.
Encode
(
&
item
))
a
.
db
.
Set
(
key
,
types
.
Encode
(
&
item
))
...
...
plugin/dapp/paracross/types/type.go
View file @
cdef5a14
...
@@ -81,7 +81,7 @@ func (p *ParacrossType) GetTypeMap() map[string]int32 {
...
@@ -81,7 +81,7 @@ func (p *ParacrossType) GetTypeMap() map[string]int32 {
"Withdraw"
:
ParacrossActionWithdraw
,
"Withdraw"
:
ParacrossActionWithdraw
,
"TransferToExec"
:
ParacrossActionTransferToExec
,
"TransferToExec"
:
ParacrossActionTransferToExec
,
"NodeConfig"
:
ParacrossActionNodeConfig
,
"NodeConfig"
:
ParacrossActionNodeConfig
,
"NodeGroupConfig"
:
ParacrossActionNodeGroupApply
,
"NodeGroupConfig"
:
ParacrossActionNodeGroupApply
,
}
}
}
}
...
...
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