Commit e8e2734e authored by vipwzw's avatar vipwzw

auto ci

parent 363fb6f3
......@@ -539,8 +539,6 @@ function para_create_nodegroup() {
fi
}
function para_nodegroup_behalf_quit_test() {
echo "=========== # para chain behalf node quit ============="
status=$(${PARA_CLI} para node_addr_status -t user.p.para. -a 1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY | jq -r ".status")
......@@ -590,8 +588,6 @@ function para_nodegroup_behalf_quit_test() {
}
function para_nodemanage_cancel_test() {
echo "================# para node manage test ================="
balance=$(${CLI} account balance -a 1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY -e paracross | jq -r ".balance")
......@@ -632,7 +628,6 @@ function para_nodemanage_cancel_test() {
function para_nodemanage_test() {
echo "================# para node manage test ================="
balance=$(${CLI} account balance -a 1E5saiXVb9mW8wcWUUZjsHJPZs5GmdzuSY -e paracross | jq -r ".balance")
if [ "$balance" != "$PARA_COIN_FROZEN" ]; then
......@@ -696,7 +691,6 @@ function para_nodemanage_test() {
echo "${txhash}"
query_tx "${PARA_CLI}" "${txhash}"
id=$(${PARA_CLI} tx query -s "${txhash}" | jq -r ".receipt.logs[0].log.current.id")
if [ -z "$id" ]; then
echo "id not found"
......@@ -711,7 +705,6 @@ function para_nodemanage_test() {
echo "${hash}"
query_tx "${PARA_CLI}" "${hash}"
status=$(${PARA_CLI} para node_addr_status -t user.p.para. -a 1KSBd17H7ZK8iT37aJztFB22XGwsPTdwE4 | jq -r ".status")
if [ "${status}" != "10" ]; then
echo "wrong vote status"
......@@ -734,7 +727,6 @@ function para_nodemanage_test() {
}
function para_nodemanage_node_behalf_join() {
echo "=========== # para chain behalf node vote test ============="
echo "=========== # para chain new node join 1 ============="
......@@ -761,8 +753,6 @@ function para_nodemanage_node_behalf_join() {
exit 1
fi
echo "=========== # para chain new node join 2============="
hash=$(${PARA_CLI} send para node -o 1 -c 9 -a 1NNaYHkscJaLJ2wUrFNeh6cQXBS4TrFYeB -k 0xd165c84ed37c2a427fea487470ee671b7a0495d68d82607cafbc6348bf23bec5)
echo "${hash}"
......@@ -807,7 +797,6 @@ function para_nodemanage_node_behalf_join() {
exit 1
fi
echo "=========== # para chain same node vote again fail ============="
${PARA_CLI} send para node -o 2 -i "$node1_id" -v 1 -k 0x6da92a632ab7deb67d38c0f6560bcfed28167998f6496db64c258d5e8393a81b
${PARA_CLI} send para node -o 2 -i "$node1_id" -v 1 -k 0x19c069234f9d3e61135fefbeb7791b149cdf6af536f26bebb310d4cd22c3fee4
......@@ -884,8 +873,6 @@ function para_nodemanage_node_behalf_join() {
exit 1
fi
}
function para_test() {
......
......@@ -444,7 +444,6 @@ func updateVotes(stat *pt.ParaNodeIdStatus, nodes map[string]struct{}) {
stat.Votes = votes
}
func (a *action) updateNodeAddrStatus(stat *pt.ParaNodeIdStatus) (*types.Receipt, error) {
addrStat, err := getNodeAddr(a.db, stat.Title, stat.TargetAddr)
if err != nil {
......@@ -512,10 +511,10 @@ func (a *action) nodeVote(config *pt.ParaNodeAddrConfig) (*types.Receipt, error)
}
//已经被其他id pass 场景
if stat.Status == pt.ParacrossNodeJoining && validNode(stat.TargetAddr,nodes){
if stat.Status == pt.ParacrossNodeJoining && validNode(stat.TargetAddr, nodes) {
return nil, errors.Wrapf(pt.ErrParaNodeAddrExisted, "config id:%s,addr:%s", config.Id, stat.TargetAddr)
}
if stat.Status == pt.ParacrossNodeQuiting && !validNode(stat.TargetAddr,nodes){
if stat.Status == pt.ParacrossNodeQuiting && !validNode(stat.TargetAddr, nodes) {
return nil, errors.Wrapf(pt.ErrParaNodeAddrNotExisted, "config id:%s,addr:%s", config.Id, stat.TargetAddr)
}
......@@ -893,9 +892,9 @@ func (a *action) nodeGroupApproveApply(config *pt.ParaNodeGroupConfig, apply *pt
receipt := &types.Receipt{Ty: types.ExecOk}
//create the node group
r,err := a.nodeGroupCreate(apply)
if err != nil{
return nil, errors.Wrapf(err, "nodegroup create:title:%s,addrs:%s", config.Title,apply.TargetAddrs)
r, err := a.nodeGroupCreate(apply)
if err != nil {
return nil, errors.Wrapf(err, "nodegroup create:title:%s,addrs:%s", config.Title, apply.TargetAddrs)
}
receipt.KV = append(receipt.KV, r.KV...)
receipt.Logs = append(receipt.Logs, r.Logs...)
......@@ -944,7 +943,7 @@ func (a *action) nodeGroupApprove(config *pt.ParaNodeGroupConfig) (*types.Receip
}
func (a *action) nodeGroupCreate(status *pt.ParaNodeGroupStatus) (*types.Receipt,error) {
func (a *action) nodeGroupCreate(status *pt.ParaNodeGroupStatus) (*types.Receipt, error) {
nodes := strings.Split(status.TargetAddrs, ",")
var item types.ConfigItem
......@@ -971,15 +970,15 @@ func (a *action) nodeGroupCreate(status *pt.ParaNodeGroupStatus) (*types.Receipt
Height: a.height}
r := makeNodeConfigReceipt(a.fromaddr, nil, nil, stat)
receipt = mergeReceipt(receipt,r)
receipt = mergeReceipt(receipt, r)
r,err :=a.updateNodeAddrStatus(stat)
if err != nil{
r, err := a.updateNodeAddrStatus(stat)
if err != nil {
return nil, err
}
receipt = mergeReceipt(receipt,r)
receipt = mergeReceipt(receipt, r)
}
return receipt,nil
return receipt, nil
}
//NodeGroupConfig support super node group config
......
......@@ -293,7 +293,7 @@ func (suite *NodeManageTestSuite) testNodeConfig() {
//Quit test
config = &pt.ParaNodeAddrConfig{
Op: pt.ParaNodeQuit,
Op: pt.ParaNodeQuit,
Addr: Account14K,
}
tx, err = pt.CreateRawNodeConfigTx(config)
......
......@@ -109,7 +109,7 @@ var ParaNodeVoteStr = []string{"invalid", "yes", "no"}
const (
// ParacrossNodeJoined pass to add by votes
ParacrossNodeJoined =iota + 10
ParacrossNodeJoined = iota + 10
// ParacrossNodeQuited pass to quite by votes
ParacrossNodeQuited
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment