Commit d677c980 authored by QM's avatar QM

updata

parent 7af4efd5
...@@ -235,7 +235,6 @@ function paracross_ListNodeStatus() { ...@@ -235,7 +235,6 @@ function paracross_ListNodeStatus() {
function paracross_GetSupervisionInfo() { 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":"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":"ListSupervisionNodeStatusInfo","payload":{"title":"user.p.para.","status":0}}]}' ${UNIT_HTTP} '(.error|not) and (.result| [has("status"),true])' "ListSupervisionNodeStatusInfo status:0" chain33_Http '{"method":"Chain33.Query","params":[{ "execer":"paracross", "funcName":"ListSupervisionNodeStatusInfo","payload":{"title":"user.p.para.","status":0}}]}' ${UNIT_HTTP} '(.error|not) and (.result| [has("status"),true])' "ListSupervisionNodeStatusInfo status:0"
} }
...@@ -608,7 +607,6 @@ function run_testcases() { ...@@ -608,7 +607,6 @@ function run_testcases() {
paracross_testTxGroup "$UNIT_HTTP" paracross_testTxGroup "$UNIT_HTTP"
paracross_testTxGroupFail "$UNIT_HTTP" paracross_testTxGroupFail "$UNIT_HTTP"
#paracross_testParaAssetWithdrawFail "$UNIT_HTTP"
paracross_testSelfConsensStages "$UNIT_HTTP" paracross_testSelfConsensStages "$UNIT_HTTP"
} }
......
...@@ -85,10 +85,12 @@ func getSupervisionNodeID(db dbm.KV, title string, id string) (*pt.ParaNodeIdSta ...@@ -85,10 +85,12 @@ func getSupervisionNodeID(db dbm.KV, title string, id string) (*pt.ParaNodeIdSta
func (a *action) updateSupervisionNodeGroup(title, addr string, add bool) (*types.Receipt, error) { func (a *action) updateSupervisionNodeGroup(title, addr string, add bool) (*types.Receipt, error) {
var item types.ConfigItem var item types.ConfigItem
key := calcParaSupervisionNodeGroupAddrsKey(title) key := calcParaSupervisionNodeGroupAddrsKey(title)
value, err := a.db.Get(key) value, err := a.db.Get(key)
if err != nil { if err != nil {
return nil, err return nil, err
} }
if value != nil { if value != nil {
err = types.Decode(value, &item) err = types.Decode(value, &item)
if err != nil { if err != nil {
...@@ -105,7 +107,7 @@ func (a *action) updateSupervisionNodeGroup(title, addr string, add bool) (*type ...@@ -105,7 +107,7 @@ func (a *action) updateSupervisionNodeGroup(title, addr string, add bool) (*type
if add { if add {
item.GetArr().Value = append(item.GetArr().Value, addr) item.GetArr().Value = append(item.GetArr().Value, addr)
item.Addr = addr item.Addr = addr
clog.Info("updateSupervisionNodeGroup add", "addr", addr, "from", copyItem.GetArr().Value, "to", item.GetArr().Value) clog.Info("updateSupervisionNodeGroup add", "addr", addr)
} else { } else {
item.Addr = addr item.Addr = addr
item.GetArr().Value = make([]string, 0) item.GetArr().Value = make([]string, 0)
...@@ -153,11 +155,6 @@ func (a *action) checkSupervisionNodeGroupExist(title string) (error, bool) { ...@@ -153,11 +155,6 @@ func (a *action) checkSupervisionNodeGroupExist(title string) (error, bool) {
return err, false return err, false
} }
// quit 后 数据没有了
if len(item.GetArr().Value) <= 0 {
return nil, false
}
return nil, true return nil, true
} }
...@@ -301,6 +298,10 @@ func (a *action) supervisionNodeApprove(config *pt.ParaNodeAddrConfig) (*types.R ...@@ -301,6 +298,10 @@ func (a *action) supervisionNodeApprove(config *pt.ParaNodeAddrConfig) (*types.R
return nil, errors.Wrapf(pt.ErrNodeNotForTheTitle, "config title:%s,id title:%s", config.Title, apply.Title) return nil, errors.Wrapf(pt.ErrNodeNotForTheTitle, "config title:%s,id title:%s", config.Title, apply.Title)
} }
if apply.CoinsFrozen < config.CoinsFrozen {
return nil, errors.Wrapf(pt.ErrParaNodeGroupFrozenCoinsNotEnough, "id not enough coins apply:%d,config:%d", apply.CoinsFrozen, config.CoinsFrozen)
}
// 判断监督账户组是否已经存在 // 判断监督账户组是否已经存在
err, exist := a.checkSupervisionNodeGroupExist(config.Title) err, exist := a.checkSupervisionNodeGroupExist(config.Title)
if err != nil { if err != nil {
...@@ -310,10 +311,6 @@ func (a *action) supervisionNodeApprove(config *pt.ParaNodeAddrConfig) (*types.R ...@@ -310,10 +311,6 @@ func (a *action) supervisionNodeApprove(config *pt.ParaNodeAddrConfig) (*types.R
receipt := &types.Receipt{Ty: types.ExecOk} receipt := &types.Receipt{Ty: types.ExecOk}
// 监督账户组不存在 // 监督账户组不存在
if !exist { if !exist {
if apply.CoinsFrozen < config.CoinsFrozen {
return nil, errors.Wrapf(pt.ErrParaNodeGroupFrozenCoinsNotEnough, "id not enough coins apply:%d,config:%d", apply.CoinsFrozen, config.CoinsFrozen)
}
r, err := a.supervisionNodeGroupCreate(apply.Title, apply.TargetAddr) r, err := a.supervisionNodeGroupCreate(apply.Title, apply.TargetAddr)
if err != nil { if err != nil {
return nil, errors.Wrapf(err, "nodegroup create:title:%s,addrs:%s", config.Title, apply.TargetAddr) return nil, errors.Wrapf(err, "nodegroup create:title:%s,addrs:%s", config.Title, apply.TargetAddr)
......
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