Commit 49acc8c4 authored by liuyuhang's avatar liuyuhang

mod amount judge

parent dbb886b4
......@@ -23,13 +23,19 @@ func (a *action) propProject(prob *auty.ProposalProject) (*types.Receipt, error)
return nil, types.ErrInvalidAddress
}
if prob.StartBlockHeight < a.height || prob.EndBlockHeight < a.height || prob.Amount <= 0 ||
if prob.StartBlockHeight < a.height || prob.EndBlockHeight < a.height ||
prob.StartBlockHeight+startEndBlockPeriod > prob.EndBlockHeight {
alog.Error("propProject height or amount invaild", "StartBlockHeight", prob.StartBlockHeight, "EndBlockHeight",
prob.EndBlockHeight, "height", a.height, "amount", prob.Amount)
alog.Error("propProject height invaild", "StartBlockHeight", prob.StartBlockHeight, "EndBlockHeight",
prob.EndBlockHeight, "height", a.height)
return nil, auty.ErrSetBlockHeight
}
if prob.Amount <= 0 {
err := types.ErrInvalidParam
alog.Error("propProject amount invaild", "amount", prob.Amount, "error", err)
return nil, err
}
// 获取董事会成员
pboard, err := a.getActiveBoard()
if err != nil {
......
......@@ -93,7 +93,7 @@ func TestPropProject(t *testing.T) {
result := []error{
types.ErrInvalidAddress,
auty.ErrSetBlockHeight,
types.ErrInvalidParam,
auty.ErrSetBlockHeight,
types.ErrNotFound,
auty.ErrNoPeriodAmount,
......
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