Commit e8e2734e authored by vipwzw's avatar vipwzw

auto ci

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