Commit 503acbfc authored by liuyuhang's avatar liuyuhang Committed by 33cn

add prob rule

parent c4b89c92
......@@ -18,10 +18,10 @@ import (
const (
minBoards = 3
maxBoards = 30
lockAmount int64 = types.Coin * 1000 //创建者消耗金额
lockAmount int64 = types.Coin * 1000 // 创建者消耗金额
ticketPrice = types.Coin * 3000 // 单张票价
participationRate = float32(2)/float32(3) //参与率
approveRate = float32(2)/float32(3) //赞成率
participationRate int32 = 66 // 参与率以%计
approveRate int32 = 66 // 赞成率以%计
)
type action struct {
......@@ -226,8 +226,8 @@ func (a *action) votePropBoard(voteProb *auty.VoteProposalBoard) (*types.Receipt
if cur.VoteResult.TotalVotes != 0 &&
cur.VoteResult.ApproveVotes + cur.VoteResult.OpposeVotes != 0 &&
float32(cur.VoteResult.ApproveVotes + cur.VoteResult.OpposeVotes) / float32(cur.VoteResult.TotalVotes) >= participationRate &&
float32(cur.VoteResult.ApproveVotes) / float32(cur.VoteResult.ApproveVotes + cur.VoteResult.OpposeVotes) >= approveRate {
float32(cur.VoteResult.ApproveVotes + cur.VoteResult.OpposeVotes) / float32(cur.VoteResult.TotalVotes) >= float32(participationRate) &&
float32(cur.VoteResult.ApproveVotes) / float32(cur.VoteResult.ApproveVotes + cur.VoteResult.OpposeVotes) >= float32(approveRate) {
cur.VoteResult.Pass = true
cur.PropBoard.RealEndBlockHeight = a.height
......@@ -309,8 +309,8 @@ func (a *action) tmintPropBoard(tmintProb *auty.TerminateProposalBoard) (*types.
cur.VoteResult.TotalVotes = int32(account.Balance/ticketPrice)
}
if float32(cur.VoteResult.ApproveVotes + cur.VoteResult.OpposeVotes) / float32(cur.VoteResult.TotalVotes) >= participationRate &&
float32(cur.VoteResult.ApproveVotes) / float32(cur.VoteResult.ApproveVotes + cur.VoteResult.OpposeVotes) >= approveRate {
if float32(cur.VoteResult.ApproveVotes + cur.VoteResult.OpposeVotes) / float32(cur.VoteResult.TotalVotes) >= float32(participationRate) &&
float32(cur.VoteResult.ApproveVotes) / float32(cur.VoteResult.ApproveVotes + cur.VoteResult.OpposeVotes) >= float32(approveRate) {
cur.VoteResult.Pass = true
} else {
cur.VoteResult.Pass = false
......
......@@ -9,7 +9,8 @@ import (
auty "github.com/33cn/plugin/plugin/dapp/autonomy/types"
)
// ExecDelLocal_PropBoard 创建提案
// 提案董事会相关
// ExecDelLocal_PropBoard 创建提案董事会
func (a *Autonomy) ExecDelLocal_PropBoard(payload *auty.ProposalBoard, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
return a.execDelLocalBoard(receiptData)
}
......@@ -28,3 +29,29 @@ func (a *Autonomy) ExecDelLocal_VotePropBoard(payload *auty.VoteProposalBoard, t
func (a *Autonomy) ExecDelLocal_TmintPropBoard(payload *auty.TerminateProposalBoard, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
return a.execDelLocalBoard(receiptData)
}
// 提案项目相关
// ExecDelLocal_PropProject 创建提案项目
func (a *Autonomy) ExecDelLocal_PropProject(payload *auty.ProposalProject, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
return a.execDelLocalProject(receiptData)
}
// ExecDelLocal_RvkPropProject 撤销提案
func (a *Autonomy) ExecDelLocal_RvkPropProject(payload *auty.RevokeProposalProject, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error){
return a.execDelLocalProject(receiptData)
}
// ExecDelLocal_VotePropProject 投票提案
func (a *Autonomy) ExecDelLocal_VotePropProject(payload *auty.VoteProposalProject, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
return a.execDelLocalProject(receiptData)
}
// ExecDelLocal_PubVotePropProject 投票提案
func (a *Autonomy) ExecDelLocal_PubVotePropProject(payload *auty.PubVoteProposalProject, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
return a.execDelLocalProject(receiptData)
}
// ExecDelLocal_TmintPropProject 终止提案
func (a *Autonomy) ExecDelLocal_TmintPropProject(payload *auty.TerminateProposalProject, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
return a.execDelLocalProject(receiptData)
}
\ No newline at end of file
......@@ -55,6 +55,22 @@ func calcProjectKey4StatusHeight(status int32, heightindex string) []byte {
return []byte(key)
}
var (
// rule
rulePrefix = idPrefix + "rule" + "-"
localRulePrefix = localPrefix + "rule" + "-"
)
func activeRuleID() []byte {
return []byte(fmt.Sprintf("%s", rulePrefix))
}
func propRuleID(txHash string) []byte {
return []byte(fmt.Sprintf("%s%s", rulePrefix, txHash))
}
func calcRuleKey4StatusHeight(status int32, heightindex string) []byte {
key := fmt.Sprintf(localRulePrefix + "%d-" +"%s", status, heightindex)
return []byte(key)
}
......@@ -15,7 +15,7 @@ import (
const (
largeAmount = types.Coin * 100 *10000 // 重大项目金额阈值
publicPeriod = 120960 // 公示一周时间,以区块高度计算
opposeRate = float32(1)/float32(3) // 反对率
opposeRate int32 = 33 // 反对率以%计
)
......@@ -224,8 +224,8 @@ func (a *action) votePropProject(voteProb *auty.VoteProposalProject) (*types.Rec
if cur.BoardVoteRes.TotalVotes != 0 &&
cur.BoardVoteRes.ApproveVotes + cur.BoardVoteRes.OpposeVotes != 0 &&
float32(cur.BoardVoteRes.ApproveVotes + cur.BoardVoteRes.OpposeVotes) / float32(cur.BoardVoteRes.TotalVotes) >= participationRate &&
float32(cur.BoardVoteRes.ApproveVotes) / float32(cur.BoardVoteRes.ApproveVotes + cur.BoardVoteRes.OpposeVotes) >= approveRate {
float32(cur.BoardVoteRes.ApproveVotes + cur.BoardVoteRes.OpposeVotes) / float32(cur.BoardVoteRes.TotalVotes) >= float32(participationRate) &&
float32(cur.BoardVoteRes.ApproveVotes) / float32(cur.BoardVoteRes.ApproveVotes + cur.BoardVoteRes.OpposeVotes) >= float32(approveRate) {
cur.BoardVoteRes.Pass = true
cur.PropProject.RealEndBlockHeight = a.height
receipt, err := a.coinsAccount.ExecTransferFrozen(cur.Address, autonomyAddr, a.execaddr, lockAmount)
......@@ -347,7 +347,7 @@ func (a *action) pubVotePropProject(voteProb *auty.PubVoteProposalProject) (*typ
var kv []*types.KeyValue
if cur.PubVote.TotalVotes != 0 &&
float32(cur.PubVote.OpposeVotes) / float32(cur.PubVote.TotalVotes) >= opposeRate {
float32(cur.PubVote.OpposeVotes) / float32(cur.PubVote.TotalVotes) >= float32(opposeRate) {
cur.PubVote.PubPass = false
cur.PropProject.RealEndBlockHeight = a.height
......@@ -452,8 +452,8 @@ func (a *action) tmintPropProject(tmintProb *auty.TerminateProposalProject) (*ty
if cur.BoardVoteRes.TotalVotes != 0 &&
cur.BoardVoteRes.ApproveVotes + cur.BoardVoteRes.OpposeVotes != 0 &&
float32(cur.BoardVoteRes.ApproveVotes + cur.BoardVoteRes.OpposeVotes) / float32(cur.BoardVoteRes.TotalVotes) >= participationRate &&
float32(cur.BoardVoteRes.ApproveVotes) / float32(cur.BoardVoteRes.ApproveVotes + cur.BoardVoteRes.OpposeVotes) >= approveRate {
float32(cur.BoardVoteRes.ApproveVotes + cur.BoardVoteRes.OpposeVotes) / float32(cur.BoardVoteRes.TotalVotes) >= float32(participationRate) &&
float32(cur.BoardVoteRes.ApproveVotes) / float32(cur.BoardVoteRes.ApproveVotes + cur.BoardVoteRes.OpposeVotes) >= float32(approveRate) {
cur.BoardVoteRes.Pass = true
} else {
cur.BoardVoteRes.Pass = false
......@@ -469,7 +469,7 @@ func (a *action) tmintPropProject(tmintProb *auty.TerminateProposalProject) (*ty
cur.PubVote.TotalVotes = int32(account.Balance/ticketPrice)
}
if cur.PubVote.TotalVotes != 0 &&
float32(cur.PubVote.OpposeVotes) / float32(cur.PubVote.TotalVotes) >= opposeRate {
float32(cur.PubVote.OpposeVotes) / float32(cur.PubVote.TotalVotes) >= float32(opposeRate) {
cur.PubVote.PubPass = false
}
}
......
// Copyright Fuzamei Corp. 2018 All Rights Reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package executor
import (
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/types"
auty "github.com/33cn/plugin/plugin/dapp/autonomy/types"
)
const (
ruleAttendRate = 50 // 提案规则修改参与率
ruleApproveRate = 50 // 提案规则修改赞成率
)
func (a *action) propRule(prob *auty.ProposalRule) (*types.Receipt, error) {
//如果全小于等于0,则说明该提案规则参数不正确
if prob.RuleCfg == nil || prob.RuleCfg.BoardAttendProb <= 0 && prob.RuleCfg.BoardPassProb <= 0 &&
prob.RuleCfg.OpposeProb <= 0 && prob.RuleCfg.ProposalAmount <= 0 && prob.RuleCfg.PubAmountThreshold <= 0 {
return nil, types.ErrInvalidParam
}
if prob.StartBlockHeight < a.height || prob.EndBlockHeight < a.height {
return nil, types.ErrInvalidParam
}
// 获取当前生效提案规则,并且将不修改的规则补齐
rule := &auty.RuleConfig{}
value, err := a.db.Get(activeRuleID())
if err == nil {
err = types.Decode(value, rule)
if err != nil {
alog.Error("propRule ", "addr", a.fromaddr, "execaddr", a.execaddr, "decode ProposalRule failed", err)
return nil, err
}
} else {// 载入系统默认值
rule.BoardAttendProb = participationRate
rule.BoardPassProb = approveRate
rule.OpposeProb = opposeRate
rule.ProposalAmount = lockAmount
rule.PubAmountThreshold = largeAmount
}
if prob.RuleCfg.BoardAttendProb > 0 {
rule.BoardAttendProb = prob.RuleCfg.BoardAttendProb
}
if prob.RuleCfg.BoardPassProb > 0 {
rule.BoardPassProb = prob.RuleCfg.BoardPassProb
}
if prob.RuleCfg.ProposalAmount > 0{
rule.ProposalAmount = prob.RuleCfg.ProposalAmount
}
if prob.RuleCfg.PubAmountThreshold > 0 {
rule.PubAmountThreshold = prob.RuleCfg.PubAmountThreshold
}
receipt, err := a.coinsAccount.ExecFrozen(a.fromaddr, a.execaddr, lockAmount)
if err != nil {
alog.Error("propRule ", "addr", a.fromaddr, "execaddr", a.execaddr, "ExecFrozen amount", lockAmount)
return nil, err
}
var logs []*types.ReceiptLog
var kv []*types.KeyValue
logs = append(logs, receipt.Logs...)
kv = append(kv, receipt.KV...)
cur := &auty.AutonomyProposalRule{
PropRule:prob,
Rule: rule,
VoteResult: &auty.VoteResult{},
Status: auty.AutonomyStatusProposalRule,
Address: a.fromaddr,
Height: a.height,
Index: a.index,
}
key := propRuleID(common.ToHex(a.txhash))
value = types.Encode(cur)
kv = append(kv, &types.KeyValue{Key: key, Value: value})
receiptLog := getRuleReceiptLog(nil, cur, auty.TyLogPropRule)
logs = append(logs, receiptLog)
return &types.Receipt{Ty: types.ExecOk, KV: kv, Logs: logs}, nil
}
func (a *action) rvkPropRule(rvkProb *auty.RevokeProposalRule) (*types.Receipt, error) {
// 获取GameID
value, err := a.db.Get(propRuleID(rvkProb.ProposalID))
if err != nil {
alog.Error("rvkPropRule ", "addr", a.fromaddr, "execaddr", a.execaddr, "get ProposalRule) failed",
rvkProb.ProposalID, "err", err)
return nil, err
}
var cur auty.AutonomyProposalRule
err = types.Decode(value, &cur)
if err != nil {
alog.Error("rvkPropRule ", "addr", a.fromaddr, "execaddr", a.execaddr, "decode ProposalRule failed",
rvkProb.ProposalID, "err", err)
return nil, err
}
pre := copyAutonomyProposalRule(&cur)
// 检查当前状态
if cur.Status != auty.AutonomyStatusProposalRule {
err := auty.ErrProposalStatus
alog.Error("rvkPropRule ", "addr", a.fromaddr, "status", cur.Status, "status is not match",
rvkProb.ProposalID, "err", err)
return nil, err
}
start := cur.GetPropRule().StartBlockHeight
if a.height > start {
err := auty.ErrRevokeProposalPeriod
alog.Error("rvkPropRule ", "addr", a.fromaddr, "execaddr", a.execaddr, "ProposalID",
rvkProb.ProposalID, "err", err)
return nil, err
}
if a.fromaddr != cur.Address {
err := auty.ErrRevokeProposalPower
alog.Error("rvkPropRule ", "addr", a.fromaddr, "execaddr", a.execaddr, "ProposalID",
rvkProb.ProposalID, "err", err)
return nil, err
}
var logs []*types.ReceiptLog
var kv []*types.KeyValue
receipt, err := a.coinsAccount.ExecActive(a.fromaddr, a.execaddr, lockAmount)
if err != nil {
alog.Error("rvkPropRule ", "addr", a.fromaddr, "execaddr", a.execaddr, "ExecActive amount", lockAmount, "err", err)
return nil, err
}
logs = append(logs, receipt.Logs...)
kv = append(kv, receipt.KV...)
cur.Status = auty.AutonomyStatusRvkPropRule
kv = append(kv, &types.KeyValue{Key: propRuleID(rvkProb.ProposalID), Value: types.Encode(&cur)})
getRuleReceiptLog(pre, &cur, auty.TyLogRvkPropRule)
return &types.Receipt{Ty: types.ExecOk, KV: kv, Logs: logs}, nil
}
func (a *action) votePropRule(voteProb *auty.VoteProposalRule) (*types.Receipt, error) {
// 获取GameID
value, err := a.db.Get(propRuleID(voteProb.ProposalID))
if err != nil {
alog.Error("votePropRule ", "addr", a.fromaddr, "execaddr", a.execaddr, "get propRuleID failed",
voteProb.ProposalID, "err", err)
return nil, err
}
var cur auty.AutonomyProposalRule
err = types.Decode(value, &cur)
if err != nil {
alog.Error("votePropRule ", "addr", a.fromaddr, "execaddr", a.execaddr, "decode AutonomyProposalRule failed",
voteProb.ProposalID, "err", err)
return nil, err
}
pre := copyAutonomyProposalRule(&cur)
// 检查当前状态
if cur.Status != auty.AutonomyStatusProposalRule && cur.Status != auty.AutonomyStatusVotePropRule {
err := auty.ErrProposalStatus
alog.Error("votePropRule ", "addr", a.fromaddr, "status", cur.Status, "ProposalID",
voteProb.ProposalID, "err", err)
return nil, err
}
start := cur.GetPropRule().StartBlockHeight
end := cur.GetPropRule().EndBlockHeight
real := cur.GetPropRule().RealEndBlockHeight
if start < a.height || end < a.height || (real != 0 && real < a.height) {
err := auty.ErrVotePeriod
alog.Error("votePropRule ", "addr", a.fromaddr, "execaddr", a.execaddr, "ProposalID",
voteProb.ProposalID, "err", err)
return nil, err
}
// 检查是否已经参与投票
var votes auty.VotesRecord
value, err = a.db.Get(VotesRecord(voteProb.ProposalID))
if err == nil {
err = types.Decode(value, &votes)
if err != nil {
alog.Error("votePropRule ", "addr", a.fromaddr, "execaddr", a.execaddr, "decode VotesRecord failed",
voteProb.ProposalID, "err", err)
return nil, err
}
}
// 检查是否有重复
for _, addr := range votes.Address {
if addr == a.fromaddr {
err := auty.ErrRepeatVoteAddr
alog.Error("votePropRule ", "addr", a.fromaddr, "execaddr", a.execaddr, "repeat address GameID",
voteProb.ProposalID, "err", err)
return nil, err
}
}
// 加入已经投票的
votes.Address = append(votes.Address, a.fromaddr)
if cur.GetVoteResult().TotalVotes == 0 { //需要统计票数
addr := "16htvcBNSEA7fZhAdLJphDwQRQJaHpyHTp"
account, err := a.getStartHeightVoteAccount(addr, start)
if err != nil {
return nil, err
}
cur.VoteResult.TotalVotes = int32(account.Balance/ticketPrice)
}
account, err := a.getStartHeightVoteAccount(a.fromaddr, start)
if err != nil {
return nil, err
}
if voteProb.Approve {
cur.VoteResult.ApproveVotes += int32(account.Balance/ticketPrice)
} else {
cur.VoteResult.OpposeVotes += int32(account.Balance/ticketPrice)
}
var logs []*types.ReceiptLog
var kv []*types.KeyValue
if cur.VoteResult.TotalVotes != 0 &&
cur.VoteResult.ApproveVotes + cur.VoteResult.OpposeVotes != 0 &&
float32(cur.VoteResult.ApproveVotes + cur.VoteResult.OpposeVotes) / float32(cur.VoteResult.TotalVotes) >= float32(ruleAttendRate)/100.0 &&
float32(cur.VoteResult.ApproveVotes) / float32(cur.VoteResult.ApproveVotes + cur.VoteResult.OpposeVotes) >= float32(ruleApproveRate)/100.0 {
cur.VoteResult.Pass = true
cur.PropRule.RealEndBlockHeight = a.height
receipt, err := a.coinsAccount.ExecTransferFrozen(cur.Address, autonomyAddr, a.execaddr, lockAmount)
if err != nil {
alog.Error("votePropRule ", "addr", cur.Address, "execaddr", a.execaddr, "ExecTransferFrozen amount fail", err)
return nil, err
}
logs = append(logs, receipt.Logs...)
kv = append(kv, receipt.KV...)
}
key := propRuleID(voteProb.ProposalID)
cur.Status = auty.AutonomyStatusVotePropRule
if cur.VoteResult.Pass {
cur.Status = auty.AutonomyStatusTmintPropRule
}
value = types.Encode(&cur)
kv = append(kv, &types.KeyValue{Key: key, Value: value})
// 更新VotesRecord
kv = append(kv, &types.KeyValue{Key: VotesRecord(voteProb.ProposalID), Value: types.Encode(&votes)})
// 更新当前具有权利的董事会成员
if cur.VoteResult.Pass {
kv = append(kv, &types.KeyValue{Key: activeRuleID(), Value:types.Encode(cur.Rule)})
}
ty := auty.TyLogVotePropRule
if cur.VoteResult.Pass {
ty = auty.TyLogTmintPropRule
}
receiptLog := getRuleReceiptLog(pre, &cur, int32(ty))
logs = append(logs, receiptLog)
return &types.Receipt{Ty: types.ExecOk, KV: kv, Logs: logs}, nil
}
func (a *action) tmintPropRule(tmintProb *auty.TerminateProposalRule) (*types.Receipt, error) {
// 获取GameID
value, err := a.db.Get(propRuleID(tmintProb.ProposalID))
if err != nil {
alog.Error("tmintPropRule ", "addr", a.fromaddr, "execaddr", a.execaddr, "get propRuleID failed",
tmintProb.ProposalID, "err", err)
return nil, err
}
var cur auty.AutonomyProposalRule
err = types.Decode(value, &cur)
if err != nil {
alog.Error("tmintPropRule ", "addr", a.fromaddr, "execaddr", a.execaddr, "decode AutonomyProposalRule failed",
tmintProb.ProposalID, "err", err)
return nil, err
}
pre := copyAutonomyProposalRule(&cur)
// 检查当前状态
if cur.Status == auty.AutonomyStatusTmintPropRule {
err := auty.ErrProposalStatus
alog.Error("tmintPropRule ", "addr", a.fromaddr, "status", cur.Status, "status is not match",
tmintProb.ProposalID, "err", err)
return nil, err
}
start := cur.GetPropRule().StartBlockHeight
end := cur.GetPropRule().EndBlockHeight
if a.height < end && !cur.VoteResult.Pass {
err := auty.ErrTerminatePeriod
alog.Error("tmintPropRule ", "addr", a.fromaddr, "status", cur.Status, "height", a.height,
"in vote period can not terminate", tmintProb.ProposalID, "err", err)
return nil, err
}
if cur.GetVoteResult().TotalVotes == 0 { //需要统计票数
addr := "16htvcBNSEA7fZhAdLJphDwQRQJaHpyHTp"
account, err := a.getStartHeightVoteAccount(addr, start)
if err != nil {
return nil, err
}
cur.VoteResult.TotalVotes = int32(account.Balance/ticketPrice)
}
if float32(cur.VoteResult.ApproveVotes + cur.VoteResult.OpposeVotes) / float32(cur.VoteResult.TotalVotes) >= float32(ruleAttendRate)/100.0 &&
float32(cur.VoteResult.ApproveVotes) / float32(cur.VoteResult.ApproveVotes + cur.VoteResult.OpposeVotes) >= float32(ruleApproveRate)/100.0 {
cur.VoteResult.Pass = true
} else {
cur.VoteResult.Pass = false
}
cur.PropRule.RealEndBlockHeight = a.height
var logs []*types.ReceiptLog
var kv []*types.KeyValue
receipt, err := a.coinsAccount.ExecTransferFrozen(cur.Address, autonomyAddr, a.execaddr, lockAmount)
if err != nil {
alog.Error("votePropRule ", "addr", a.fromaddr, "execaddr", a.execaddr, "ExecTransferFrozen amount fail", err)
return nil, err
}
logs = append(logs, receipt.Logs...)
kv = append(kv, receipt.KV...)
cur.Status = auty.AutonomyStatusTmintPropRule
kv = append(kv, &types.KeyValue{Key: propRuleID(tmintProb.ProposalID), Value: types.Encode(&cur)})
// 更新当前具有权利的董事会成员
if cur.VoteResult.Pass {
kv = append(kv, &types.KeyValue{Key: activeRuleID(), Value:types.Encode(cur.Rule)})
}
getRuleReceiptLog(pre, &cur, auty.TyLogTmintPropRule)
return &types.Receipt{Ty: types.ExecOk, KV: kv, Logs: logs}, nil
}
// getReceiptLog 根据提案信息获取log
// 状态变化:
func getRuleReceiptLog(pre, cur *auty.AutonomyProposalRule, ty int32) *types.ReceiptLog {
log := &types.ReceiptLog{}
log.Ty = ty
r := &auty.ReceiptProposalRule{Prev: pre, Current: cur}
log.Log = types.Encode(r)
return log
}
func copyAutonomyProposalRule(cur *auty.AutonomyProposalRule) *auty.AutonomyProposalRule {
newAut := *cur
newRule := *cur.GetPropRule()
newCfg := *cur.GetPropRule().GetRuleCfg()
newRes := *cur.GetVoteResult()
newAut.PropRule = &newRule
newAut.PropRule.RuleCfg = &newCfg
newAut.VoteResult = &newRes
return &newAut
}
......@@ -31,3 +31,16 @@ message PublicVote {
message VotesRecord {
repeated string address = 1;
}
message RuleConfig {
// 参与率,以%为单位,只保留整数部分
int32 boardAttendProb = 1;
// 通过率
int32 boardPassProb = 2;
// 否决率
int32 opposeProb = 3;
// 提案金额
int64 proposalAmount = 4;
// 公示金额阈值
int64 pubAmountThreshold = 5;
}
\ No newline at end of file
......@@ -10,17 +10,19 @@ package types;
message AutonomyProposalProject {
ProposalProject propProject = 1;
// 投票该提案的规则
RuleConfig CurRule = 2;
// 投票该提案的董事会成员
repeated string boards = 2;
repeated string boards = 3;
// 董事会投票结果
VoteResult boardVoteRes = 3;
VoteResult boardVoteRes = 4;
// 公示投票
PublicVote pubVote = 4;
PublicVote pubVote = 5;
// 状态
int32 status = 5;
string address = 6;
int64 height = 7;
int32 index = 8;
int32 status = 6;
string address = 7;
int64 height = 8;
int32 index = 9;
}
message ProposalProject {
......
......@@ -10,10 +10,14 @@ package types;
message AutonomyProposalRule {
ProposalRule propRule = 1;
RuleConfig rule = 2;
// 全体持票人投票结果
VoteResult res = 2;
VoteResult voteResult = 3;
// 状态
int32 status = 3;
int32 status = 4;
string address = 5;
int64 height = 6;
int32 index = 7;
}
message ProposalRule {
......@@ -22,17 +26,12 @@ message ProposalRule {
int32 month = 2;
int32 day = 3;
// 可修改项
int32 boardAttendProb = 4; //参与率,以%为单位,只保留整数部分
int32 boardPassProb = 5; //通过率
int32 opposeProb = 6; //否决率
int32 proposalAmount = 7; //提案金额
int32 pubAmountThreshold = 8; //公示金额阈值
// 规则可修改项,如果某项不修改则置为-1
RuleConfig ruleCfg = 4;
// 投票相关
int64 startBlockHeight = 9; // 提案开始投票高度
int64 endBlockHeight = 10; // 提案结束投票高度
int64 realEndBlockHeight = 11; // 实际提案结束投票高度
int64 startBlockHeight = 5; // 提案开始投票高度
int64 endBlockHeight = 6; // 提案结束投票高度
int64 realEndBlockHeight = 7; // 实际提案结束投票高度
}
message RevokeProposalRule {
......@@ -60,10 +59,14 @@ message LocalProposalRule {
}
// query
message ReplyQueryProposalRule {
string proposalID = 1;
message ReqQueryProposalRule {
//优先根据status查询
int32 status = 1;
int32 count = 2;
int32 direction = 3;
int64 index = 4;
}
message ReplyProposalRule {
repeated LocalProposalRule propRules = 1;
message ReplyQueryProposalRule {
repeated AutonomyProposalRule propRules = 1;
}
\ No newline at end of file
......@@ -12,6 +12,7 @@ import (
auty "github.com/33cn/plugin/plugin/dapp/autonomy/types"
)
// 提案董事会相关
// PropBoardTx 提案董事会成员RPC接口
func (c *Jrpc) PropBoardTx(parm *auty.ProposalBoard, result *interface{}) error {
if parm == nil {
......@@ -64,3 +65,70 @@ func (c *Jrpc) TerminateProposalBoardTx(parm *auty.TerminateProposalBoard, resul
*result = hex.EncodeToString(reply.Data)
return nil
}
// 提案项目相关
// PropProjectTx 提案项目RPC接口
func (c *Jrpc) PropProjectTx(parm *auty.ProposalProject, result *interface{}) error {
if parm == nil {
return types.ErrInvalidParam
}
reply, err := c.cli.propProject(context.Background(), parm)
if err != nil {
return err
}
*result = hex.EncodeToString(reply.Data)
return nil
}
// RevokeProposalProjectTx 撤销提案项目的RPC接口
func (c *Jrpc) RevokeProposalProjectTx(parm *auty.RevokeProposalProject, result *interface{}) error {
if parm == nil {
return types.ErrInvalidParam
}
reply, err := c.cli.revokeProposalProject(context.Background(), parm)
if err != nil {
return err
}
*result = hex.EncodeToString(reply.Data)
return nil
}
// VoteProposalProjectTx 董事会投票提案项目的RPC接口
func (c *Jrpc) VoteProposalProjectTx(parm *auty.VoteProposalProject, result *interface{}) error {
if parm == nil {
return types.ErrInvalidParam
}
reply, err := c.cli.voteProposalProject(context.Background(), parm)
if err != nil {
return err
}
*result = hex.EncodeToString(reply.Data)
return nil
}
// PubVoteProposalProjectTx 全体持票人投票提案项目的RPC接口
func (c *Jrpc) PubVoteProposalProjectTx(parm *auty.PubVoteProposalProject, result *interface{}) error {
if parm == nil {
return types.ErrInvalidParam
}
reply, err := c.cli.pubVoteProposalProject(context.Background(), parm)
if err != nil {
return err
}
*result = hex.EncodeToString(reply.Data)
return nil
}
// TerminateProposalProjectTx 终止提案项目的RPC接口
func (c *Jrpc) TerminateProposalProjectTx(parm *auty.TerminateProposalProject, result *interface{}) error {
if parm == nil {
return types.ErrInvalidParam
}
reply, err := c.cli.terminateProposalProject(context.Background(), parm)
if err != nil {
return err
}
*result = hex.EncodeToString(reply.Data)
return nil
}
\ No newline at end of file
......@@ -73,3 +73,77 @@ func (c *channelClient) terminateProposalBoard(ctx context.Context, head *auty.T
}
// Proposal Project 相关的接口
func (c *channelClient) propProject(ctx context.Context, head *auty.ProposalProject) (*types.UnsignTx, error) {
val := &auty.AutonomyAction{
Ty: auty.AutonomyActionPropProject,
Value: &auty.AutonomyAction_PropProject{PropProject: head},
}
tx := &types.Transaction{
Payload: types.Encode(val),
}
data, err := types.FormatTxEncode(types.ExecName(auty.AutonomyX), tx)
if err != nil {
return nil, err
}
return &types.UnsignTx{Data: data}, nil
}
func (c *channelClient) revokeProposalProject(ctx context.Context, head *auty.RevokeProposalProject) (*types.UnsignTx, error) {
val := &auty.AutonomyAction{
Ty: auty.AutonomyActionRvkPropProject,
Value: &auty.AutonomyAction_RvkPropProject{RvkPropProject: head},
}
tx := &types.Transaction{
Payload: types.Encode(val),
}
data, err := types.FormatTxEncode(types.ExecName(auty.AutonomyX), tx)
if err != nil {
return nil, err
}
return &types.UnsignTx{Data: data}, nil
}
func (c *channelClient) voteProposalProject(ctx context.Context, head *auty.VoteProposalProject) (*types.UnsignTx, error) {
val := &auty.AutonomyAction{
Ty: auty.AutonomyActionVotePropProject,
Value: &auty.AutonomyAction_VotePropProject{VotePropProject: head},
}
tx := &types.Transaction{
Payload: types.Encode(val),
}
data, err := types.FormatTxEncode(types.ExecName(auty.AutonomyX), tx)
if err != nil {
return nil, err
}
return &types.UnsignTx{Data: data}, nil
}
func (c *channelClient) pubVoteProposalProject(ctx context.Context, head *auty.PubVoteProposalProject) (*types.UnsignTx, error) {
val := &auty.AutonomyAction{
Ty: auty.AutonomyActionPubVotePropProject,
Value: &auty.AutonomyAction_PubVotePropProject{PubVotePropProject: head},
}
tx := &types.Transaction{
Payload: types.Encode(val),
}
data, err := types.FormatTxEncode(types.ExecName(auty.AutonomyX), tx)
if err != nil {
return nil, err
}
return &types.UnsignTx{Data: data}, nil
}
func (c *channelClient) terminateProposalProject(ctx context.Context, head *auty.TerminateProposalProject) (*types.UnsignTx, error) {
val := &auty.AutonomyAction{
Ty: auty.AutonomyActionTmintPropProject,
Value: &auty.AutonomyAction_TmintPropProject{TmintPropProject: head},
}
tx := &types.Transaction{
Payload: types.Encode(val),
}
data, err := types.FormatTxEncode(types.ExecName(auty.AutonomyX), tx)
if err != nil {
return nil, err
}
return &types.UnsignTx{Data: data}, nil
}
\ No newline at end of file
......@@ -25,6 +25,7 @@ It has these top-level messages:
VoteResult
PublicVote
VotesRecord
RuleConfig
AutonomyProposalProject
ProposalProject
RevokeProposalProject
......@@ -42,8 +43,8 @@ It has these top-level messages:
TerminateProposalRule
ReceiptProposalRule
LocalProposalRule
ReqQueryProposalRule
ReplyQueryProposalRule
ReplyProposalRule
*/
package types
......
......@@ -14,6 +14,7 @@ const (
AutonomyActionPropProject
AutonomyActionRvkPropProject
AutonomyActionVotePropProject
AutonomyActionPubVotePropProject
AutonomyActionTmintPropProject
AutonomyActionPropRule
......@@ -39,29 +40,6 @@ const (
TyLogTmintPropRule = 2124
)
const (
// Action_PropBoard Action 名字
Action_PropBoard = "propBoard"
// Action_RvkPropBoard Action 名字
Action_RvkPropBoard = "rvkPropBoard"
// Action_TmintPropBoard Action 名字
Action_TmintPropBoard = "tmintPropBoard"
// Action_PropProject Action 名字
Action_PropProject = "propProject"
// Action_RvkPropProject Action 名字
Action_RvkPropProject = "rvkPropProject"
// Action_TmintPropProject Action 名字
Action_TmintPropProject = "tmintPropProject"
// Action_PropRule Action 名字
Action_PropRule= "propRule"
// Action_RvkPropRule Action 名字
Action_RvkPropRule = "rvkPropRule"
// Action_TmintPropRule Action 名字
Action_TmintPropRule = "tmintPropRule"
)
// status
const (
AutonomyStatusProposalBoard = iota + 1
......
......@@ -116,27 +116,87 @@ func (m *VotesRecord) GetAddress() []string {
return nil
}
type RuleConfig struct {
// 参与率,以%为单位,只保留整数部分
BoardAttendProb int32 `protobuf:"varint,1,opt,name=boardAttendProb" json:"boardAttendProb,omitempty"`
// 通过率
BoardPassProb int32 `protobuf:"varint,2,opt,name=boardPassProb" json:"boardPassProb,omitempty"`
// 否决率
OpposeProb int32 `protobuf:"varint,3,opt,name=opposeProb" json:"opposeProb,omitempty"`
// 提案金额
ProposalAmount int64 `protobuf:"varint,4,opt,name=proposalAmount" json:"proposalAmount,omitempty"`
// 公示金额阈值
PubAmountThreshold int64 `protobuf:"varint,5,opt,name=pubAmountThreshold" json:"pubAmountThreshold,omitempty"`
}
func (m *RuleConfig) Reset() { *m = RuleConfig{} }
func (m *RuleConfig) String() string { return proto.CompactTextString(m) }
func (*RuleConfig) ProtoMessage() {}
func (*RuleConfig) Descriptor() ([]byte, []int) { return fileDescriptor2, []int{3} }
func (m *RuleConfig) GetBoardAttendProb() int32 {
if m != nil {
return m.BoardAttendProb
}
return 0
}
func (m *RuleConfig) GetBoardPassProb() int32 {
if m != nil {
return m.BoardPassProb
}
return 0
}
func (m *RuleConfig) GetOpposeProb() int32 {
if m != nil {
return m.OpposeProb
}
return 0
}
func (m *RuleConfig) GetProposalAmount() int64 {
if m != nil {
return m.ProposalAmount
}
return 0
}
func (m *RuleConfig) GetPubAmountThreshold() int64 {
if m != nil {
return m.PubAmountThreshold
}
return 0
}
func init() {
proto.RegisterType((*VoteResult)(nil), "types.VoteResult")
proto.RegisterType((*PublicVote)(nil), "types.PublicVote")
proto.RegisterType((*VotesRecord)(nil), "types.VotesRecord")
proto.RegisterType((*RuleConfig)(nil), "types.RuleConfig")
}
func init() { proto.RegisterFile("lcommon.proto", fileDescriptor2) }
var fileDescriptor2 = []byte{
// 204 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x90, 0x3d, 0x6e, 0x84, 0x30,
0x10, 0x46, 0x65, 0x7e, 0x12, 0x18, 0x92, 0xc6, 0x15, 0x45, 0x14, 0x21, 0x9a, 0x50, 0xa5, 0xc9,
0x45, 0x90, 0x8b, 0xf4, 0x06, 0x5c, 0x20, 0x99, 0xcc, 0xc8, 0x36, 0x91, 0xb8, 0x40, 0xce, 0x1d,
0x79, 0x12, 0x04, 0xbb, 0x5b, 0x6c, 0x37, 0xdf, 0xd3, 0x2b, 0x9e, 0x06, 0x9e, 0xed, 0x88, 0xcb,
0x82, 0x5f, 0xef, 0xe4, 0x30, 0xa0, 0xcc, 0xc3, 0x46, 0xc6, 0xb7, 0x3f, 0x02, 0xe0, 0x13, 0x83,
0x51, 0xc6, 0xaf, 0x36, 0xc8, 0x57, 0x80, 0x80, 0x41, 0xdb, 0x88, 0x7c, 0x2d, 0x1a, 0xd1, 0xe5,
0xea, 0x44, 0x64, 0x0b, 0x4f, 0x9a, 0xc8, 0xe1, 0xb7, 0xf9, 0x33, 0x12, 0x36, 0x2e, 0x98, 0x6c,
0xa0, 0x42, 0x22, 0xf4, 0xff, 0x4a, 0xca, 0xca, 0x19, 0x49, 0x09, 0x19, 0x69, 0xef, 0xeb, 0xac,
0x11, 0x5d, 0xa1, 0xf8, 0xe6, 0x90, 0x7e, 0x1d, 0xec, 0x3c, 0x46, 0x47, 0xbe, 0x40, 0x49, 0xbc,
0xe6, 0xb0, 0x71, 0x47, 0xa1, 0x0e, 0x70, 0x95, 0x99, 0xdc, 0x64, 0xde, 0x4f, 0xa8, 0xe1, 0x91,
0xd6, 0xa1, 0x3f, 0x2a, 0xf6, 0xd9, 0xbe, 0x41, 0xc5, 0x8a, 0x32, 0x23, 0xba, 0x29, 0x8a, 0x7a,
0x9a, 0x9c, 0xf1, 0xf1, 0x1d, 0x69, 0x57, 0xaa, 0x7d, 0x0e, 0x0f, 0xfc, 0xc8, 0x8f, 0xdf, 0x00,
0x00, 0x00, 0xff, 0xff, 0x86, 0x6a, 0x7e, 0x62, 0x59, 0x01, 0x00, 0x00,
// 297 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x92, 0xcb, 0x4a, 0x33, 0x41,
0x10, 0x85, 0x99, 0x5c, 0xfe, 0x3f, 0xa9, 0x18, 0x85, 0x5a, 0xcd, 0x42, 0x24, 0x0c, 0xa2, 0xb3,
0xca, 0xc6, 0x27, 0x08, 0xbe, 0x40, 0x68, 0xc4, 0xfd, 0x74, 0xba, 0x35, 0x81, 0xce, 0x54, 0xd1,
0x17, 0x21, 0x2f, 0xe0, 0x13, 0xfa, 0x40, 0xd2, 0x35, 0x09, 0xb9, 0x28, 0xb8, 0x9b, 0xf3, 0xcd,
0x07, 0x73, 0x4e, 0x31, 0x30, 0x75, 0x2b, 0xda, 0x6e, 0xa9, 0x9d, 0xb3, 0xa7, 0x48, 0x38, 0x8c,
0x3b, 0xb6, 0xa1, 0xfa, 0x2c, 0x00, 0x5e, 0x29, 0x5a, 0x65, 0x43, 0x72, 0x11, 0xef, 0x00, 0x22,
0xc5, 0xc6, 0x65, 0x14, 0xca, 0x62, 0x56, 0xd4, 0x43, 0x75, 0x42, 0xb0, 0x82, 0xab, 0x86, 0xd9,
0xd3, 0x87, 0xed, 0x8c, 0x9e, 0x18, 0x67, 0x0c, 0x67, 0x30, 0x21, 0x66, 0x0a, 0x7b, 0xa5, 0x2f,
0xca, 0x29, 0x42, 0x84, 0x01, 0x37, 0x21, 0x94, 0x83, 0x59, 0x51, 0x8f, 0x94, 0x3c, 0x4b, 0x91,
0x65, 0xd2, 0x6e, 0xb3, 0xca, 0x0e, 0xde, 0xc2, 0x98, 0x25, 0x6d, 0xe2, 0x4e, 0x7a, 0x8c, 0xd4,
0x11, 0x5c, 0xd4, 0xec, 0xfd, 0xa8, 0xf9, 0x77, 0x85, 0x12, 0xfe, 0x73, 0xd2, 0xcb, 0x63, 0x8b,
0x43, 0xac, 0x1e, 0x61, 0x22, 0x8a, 0xb2, 0x2b, 0xf2, 0x26, 0x8b, 0x8d, 0x31, 0xde, 0x86, 0x7c,
0x8e, 0x7e, 0x3d, 0x56, 0x87, 0x58, 0x7d, 0x15, 0x00, 0x2a, 0x39, 0xfb, 0x4c, 0xed, 0xdb, 0xe6,
0x1d, 0x6b, 0xb8, 0xd1, 0xd4, 0x78, 0xb3, 0x88, 0xd1, 0xb6, 0x66, 0xe9, 0x49, 0xef, 0xef, 0x77,
0x89, 0xf1, 0x1e, 0xa6, 0x82, 0xf2, 0xe7, 0xc4, 0xeb, 0x06, 0x9c, 0xc3, 0xbc, 0xb1, 0x2b, 0x2c,
0x4a, 0x37, 0xe1, 0x84, 0xe0, 0x03, 0x5c, 0xb3, 0x27, 0xa6, 0xd0, 0xb8, 0xc5, 0x96, 0x52, 0x1b,
0x65, 0x48, 0x5f, 0x5d, 0x50, 0x9c, 0x03, 0x72, 0xd2, 0x5d, 0x78, 0x59, 0x7b, 0x1b, 0xd6, 0xe4,
0x4c, 0x39, 0x14, 0xf7, 0x97, 0x37, 0xfa, 0x9f, 0xfc, 0x1f, 0x4f, 0xdf, 0x01, 0x00, 0x00, 0xff,
0xff, 0x8a, 0x95, 0x5e, 0xd6, 0x30, 0x02, 0x00, 0x00,
}
......@@ -14,17 +14,19 @@ var _ = math.Inf
type AutonomyProposalProject struct {
PropProject *ProposalProject `protobuf:"bytes,1,opt,name=propProject" json:"propProject,omitempty"`
// 投票该提案的规则
CurRule *RuleConfig `protobuf:"bytes,2,opt,name=CurRule" json:"CurRule,omitempty"`
// 投票该提案的董事会成员
Boards []string `protobuf:"bytes,2,rep,name=boards" json:"boards,omitempty"`
Boards []string `protobuf:"bytes,3,rep,name=boards" json:"boards,omitempty"`
// 董事会投票结果
BoardVoteRes *VoteResult `protobuf:"bytes,3,opt,name=boardVoteRes" json:"boardVoteRes,omitempty"`
BoardVoteRes *VoteResult `protobuf:"bytes,4,opt,name=boardVoteRes" json:"boardVoteRes,omitempty"`
// 公示投票
PubVote *PublicVote `protobuf:"bytes,4,opt,name=pubVote" json:"pubVote,omitempty"`
PubVote *PublicVote `protobuf:"bytes,5,opt,name=pubVote" json:"pubVote,omitempty"`
// 状态
Status int32 `protobuf:"varint,5,opt,name=status" json:"status,omitempty"`
Address string `protobuf:"bytes,6,opt,name=address" json:"address,omitempty"`
Height int64 `protobuf:"varint,7,opt,name=height" json:"height,omitempty"`
Index int32 `protobuf:"varint,8,opt,name=index" json:"index,omitempty"`
Status int32 `protobuf:"varint,6,opt,name=status" json:"status,omitempty"`
Address string `protobuf:"bytes,7,opt,name=address" json:"address,omitempty"`
Height int64 `protobuf:"varint,8,opt,name=height" json:"height,omitempty"`
Index int32 `protobuf:"varint,9,opt,name=index" json:"index,omitempty"`
}
func (m *AutonomyProposalProject) Reset() { *m = AutonomyProposalProject{} }
......@@ -39,6 +41,13 @@ func (m *AutonomyProposalProject) GetPropProject() *ProposalProject {
return nil
}
func (m *AutonomyProposalProject) GetCurRule() *RuleConfig {
if m != nil {
return m.CurRule
}
return nil
}
func (m *AutonomyProposalProject) GetBoards() []string {
if m != nil {
return m.Boards
......@@ -423,47 +432,48 @@ func init() {
func init() { proto.RegisterFile("project.proto", fileDescriptor3) }
var fileDescriptor3 = []byte{
// 663 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x5f, 0x6f, 0xd3, 0x3e,
0x14, 0x55, 0xd7, 0xa6, 0x5d, 0x6f, 0xbb, 0x3f, 0x3f, 0x6f, 0xbf, 0xce, 0x4c, 0x68, 0xaa, 0xf2,
0x80, 0x2a, 0x90, 0x2a, 0x34, 0x84, 0x98, 0x78, 0xdb, 0x34, 0x24, 0x90, 0xd0, 0x28, 0x06, 0xf1,
0x8a, 0xdc, 0xe4, 0xb2, 0x65, 0x4b, 0x63, 0xe3, 0x38, 0x13, 0x15, 0xef, 0x7c, 0x1d, 0x3e, 0x1e,
0xaf, 0x28, 0xd7, 0x0e, 0x4d, 0xbb, 0x21, 0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x78, 0x20, 0x50, 0xa7, 0xf3, 0x5b, 0x7f, 0xfe, 0x04, 0xfa, 0xb5, 0x34, 0x2e, 0x3f, 0xa2, 0x79,
0x87, 0x4d, 0x2f, 0x79, 0xa6, 0x6d, 0xfa, 0x7f, 0x78, 0xf6, 0x3b, 0x00, 0x00, 0xff, 0xff, 0x5e,
0x6c, 0xb6, 0x4b, 0x46, 0x06, 0x00, 0x00,
// 684 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x55, 0x5d, 0x6f, 0xd3, 0x30,
0x14, 0x55, 0x97, 0xa6, 0x5d, 0x6f, 0xbb, 0x0f, 0xbc, 0xd1, 0x99, 0x09, 0x4d, 0x55, 0x1e, 0x50,
0x05, 0x52, 0x85, 0x86, 0x10, 0x13, 0x6f, 0xfb, 0x40, 0x02, 0x09, 0x8d, 0x62, 0x10, 0xaf, 0xc8,
0x4d, 0xbc, 0x2d, 0x5b, 0x1a, 0x1b, 0xc7, 0x99, 0xa8, 0x78, 0xe7, 0x57, 0xf2, 0x3f, 0x78, 0x45,
0xbe, 0x76, 0x68, 0xd3, 0x0d, 0xb1, 0xbd, 0xf9, 0x9c, 0x7b, 0xce, 0x4d, 0x7d, 0x6d, 0x9f, 0xc2,
0x9a, 0xd2, 0xf2, 0x52, 0xc4, 0x66, 0xa4, 0xb4, 0x34, 0x92, 0x84, 0x66, 0xa6, 0x44, 0xb1, 0xbb,
0x96, 0xc5, 0x72, 0x3a, 0x95, 0xb9, 0x63, 0xa3, 0x5f, 0x2b, 0xb0, 0x73, 0x58, 0x1a, 0x99, 0xcb,
0xe9, 0x6c, 0xac, 0xa5, 0x92, 0x05, 0xcf, 0xc6, 0xce, 0x47, 0x0e, 0xa0, 0xab, 0xb4, 0x54, 0x1e,
0xd2, 0xc6, 0xa0, 0x31, 0xec, 0xee, 0xf7, 0x47, 0xd8, 0x67, 0xb4, 0x24, 0x66, 0x8b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 0x51, 0xb5, 0xf4, 0x28, 0x7a, 0x0d, 0xf4, 0xb3, 0xd0, 0xd3, 0x34, 0xe7, 0xf7, 0xee,
0x19, 0xfd, 0x6c, 0x40, 0x9f, 0x89, 0x58, 0xa4, 0xca, 0x2c, 0x5b, 0xf7, 0xa1, 0xa9, 0xb4, 0xb8,
0xf6, 0x41, 0xb3, 0xe7, 0x9f, 0xed, 0x3f, 0xd2, 0x89, 0xa1, 0x96, 0x1c, 0x40, 0x3b, 0x2e, 0xb5,
0x16, 0xb9, 0xf1, 0x49, 0xf3, 0x3f, 0x5b, 0x25, 0x8f, 0x32, 0xd8, 0x7e, 0x2f, 0x63, 0x2c, 0x2c,
0xa5, 0x5e, 0xdb, 0x45, 0xd9, 0xe5, 0x1d, 0x7f, 0x48, 0x25, 0x27, 0xbb, 0xb0, 0x6a, 0xb3, 0x55,
0xe4, 0xa6, 0xa0, 0x2b, 0x18, 0x65, 0x7f, 0x71, 0xf4, 0x03, 0x76, 0x98, 0xf8, 0xf6, 0xb1, 0x14,
0xfa, 0x46, 0xcc, 0xce, 0x33, 0xa8, 0x51, 0xcb, 0xa0, 0x6d, 0x08, 0x63, 0x7c, 0x4a, 0x3e, 0x13,
0x10, 0xd8, 0x17, 0x9e, 0xa4, 0x5a, 0xb8, 0x27, 0xec, 0x92, 0x61, 0x4e, 0xcc, 0x53, 0xa8, 0x89,
0x57, 0xd9, 0xa7, 0xd0, 0x57, 0x78, 0xc4, 0x84, 0xca, 0x66, 0xb7, 0x7e, 0xfe, 0x08, 0x7a, 0x0b,
0xd1, 0x6d, 0x7f, 0x44, 0x70, 0x87, 0x4d, 0xd7, 0x3c, 0x93, 0x16, 0xfe, 0x99, 0xbc, 0xf8, 0x13,
0x00, 0x00, 0xff, 0xff, 0x8d, 0x4a, 0xb0, 0x36, 0x73, 0x06, 0x00, 0x00,
}
......@@ -14,10 +14,14 @@ var _ = math.Inf
type AutonomyProposalRule struct {
PropRule *ProposalRule `protobuf:"bytes,1,opt,name=propRule" json:"propRule,omitempty"`
Rule *RuleConfig `protobuf:"bytes,2,opt,name=rule" json:"rule,omitempty"`
// 全体持票人投票结果
Res *VoteResult `protobuf:"bytes,2,opt,name=res" json:"res,omitempty"`
VoteResult *VoteResult `protobuf:"bytes,3,opt,name=voteResult" json:"voteResult,omitempty"`
// 状态
Status int32 `protobuf:"varint,3,opt,name=status" json:"status,omitempty"`
Status int32 `protobuf:"varint,4,opt,name=status" json:"status,omitempty"`
Address string `protobuf:"bytes,5,opt,name=address" json:"address,omitempty"`
Height int64 `protobuf:"varint,6,opt,name=height" json:"height,omitempty"`
Index int32 `protobuf:"varint,7,opt,name=index" json:"index,omitempty"`
}
func (m *AutonomyProposalRule) Reset() { *m = AutonomyProposalRule{} }
......@@ -32,9 +36,16 @@ func (m *AutonomyProposalRule) GetPropRule() *ProposalRule {
return nil
}
func (m *AutonomyProposalRule) GetRes() *VoteResult {
func (m *AutonomyProposalRule) GetRule() *RuleConfig {
if m != nil {
return m.Res
return m.Rule
}
return nil
}
func (m *AutonomyProposalRule) GetVoteResult() *VoteResult {
if m != nil {
return m.VoteResult
}
return nil
}
......@@ -46,21 +57,38 @@ func (m *AutonomyProposalRule) GetStatus() int32 {
return 0
}
func (m *AutonomyProposalRule) GetAddress() string {
if m != nil {
return m.Address
}
return ""
}
func (m *AutonomyProposalRule) GetHeight() int64 {
if m != nil {
return m.Height
}
return 0
}
func (m *AutonomyProposalRule) GetIndex() int32 {
if m != nil {
return m.Index
}
return 0
}
type ProposalRule struct {
// 提案时间
Year int32 `protobuf:"varint,1,opt,name=year" json:"year,omitempty"`
Month int32 `protobuf:"varint,2,opt,name=month" json:"month,omitempty"`
Day int32 `protobuf:"varint,3,opt,name=day" json:"day,omitempty"`
// 可修改项
BoardAttendProb int32 `protobuf:"varint,4,opt,name=boardAttendProb" json:"boardAttendProb,omitempty"`
BoardPassProb int32 `protobuf:"varint,5,opt,name=boardPassProb" json:"boardPassProb,omitempty"`
OpposeProb int32 `protobuf:"varint,6,opt,name=opposeProb" json:"opposeProb,omitempty"`
ProposalAmount int32 `protobuf:"varint,7,opt,name=proposalAmount" json:"proposalAmount,omitempty"`
PubAmountThreshold int32 `protobuf:"varint,8,opt,name=pubAmountThreshold" json:"pubAmountThreshold,omitempty"`
// 规则可修改项,如果某项不修改则置为-1
RuleCfg *RuleConfig `protobuf:"bytes,4,opt,name=ruleCfg" json:"ruleCfg,omitempty"`
// 投票相关
StartBlockHeight int64 `protobuf:"varint,9,opt,name=startBlockHeight" json:"startBlockHeight,omitempty"`
EndBlockHeight int64 `protobuf:"varint,10,opt,name=endBlockHeight" json:"endBlockHeight,omitempty"`
RealEndBlockHeight int64 `protobuf:"varint,11,opt,name=realEndBlockHeight" json:"realEndBlockHeight,omitempty"`
StartBlockHeight int64 `protobuf:"varint,5,opt,name=startBlockHeight" json:"startBlockHeight,omitempty"`
EndBlockHeight int64 `protobuf:"varint,6,opt,name=endBlockHeight" json:"endBlockHeight,omitempty"`
RealEndBlockHeight int64 `protobuf:"varint,7,opt,name=realEndBlockHeight" json:"realEndBlockHeight,omitempty"`
}
func (m *ProposalRule) Reset() { *m = ProposalRule{} }
......@@ -89,39 +117,11 @@ func (m *ProposalRule) GetDay() int32 {
return 0
}
func (m *ProposalRule) GetBoardAttendProb() int32 {
if m != nil {
return m.BoardAttendProb
}
return 0
}
func (m *ProposalRule) GetBoardPassProb() int32 {
if m != nil {
return m.BoardPassProb
}
return 0
}
func (m *ProposalRule) GetOpposeProb() int32 {
if m != nil {
return m.OpposeProb
}
return 0
}
func (m *ProposalRule) GetProposalAmount() int32 {
func (m *ProposalRule) GetRuleCfg() *RuleConfig {
if m != nil {
return m.ProposalAmount
return m.RuleCfg
}
return 0
}
func (m *ProposalRule) GetPubAmountThreshold() int32 {
if m != nil {
return m.PubAmountThreshold
}
return 0
return nil
}
func (m *ProposalRule) GetStartBlockHeight() int64 {
......@@ -251,32 +251,57 @@ func (m *LocalProposalRule) GetComments() []string {
}
// query
type ReplyQueryProposalRule struct {
ProposalID string `protobuf:"bytes,1,opt,name=proposalID" json:"proposalID,omitempty"`
type ReqQueryProposalRule struct {
// 优先根据status查询
Status int32 `protobuf:"varint,1,opt,name=status" json:"status,omitempty"`
Count int32 `protobuf:"varint,2,opt,name=count" json:"count,omitempty"`
Direction int32 `protobuf:"varint,3,opt,name=direction" json:"direction,omitempty"`
Index int64 `protobuf:"varint,4,opt,name=index" json:"index,omitempty"`
}
func (m *ReplyQueryProposalRule) Reset() { *m = ReplyQueryProposalRule{} }
func (m *ReplyQueryProposalRule) String() string { return proto.CompactTextString(m) }
func (*ReplyQueryProposalRule) ProtoMessage() {}
func (*ReplyQueryProposalRule) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{7} }
func (m *ReqQueryProposalRule) Reset() { *m = ReqQueryProposalRule{} }
func (m *ReqQueryProposalRule) String() string { return proto.CompactTextString(m) }
func (*ReqQueryProposalRule) ProtoMessage() {}
func (*ReqQueryProposalRule) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{7} }
func (m *ReplyQueryProposalRule) GetProposalID() string {
func (m *ReqQueryProposalRule) GetStatus() int32 {
if m != nil {
return m.ProposalID
return m.Status
}
return ""
return 0
}
type ReplyProposalRule struct {
PropRules []*LocalProposalRule `protobuf:"bytes,1,rep,name=propRules" json:"propRules,omitempty"`
func (m *ReqQueryProposalRule) GetCount() int32 {
if m != nil {
return m.Count
}
return 0
}
func (m *ReplyProposalRule) Reset() { *m = ReplyProposalRule{} }
func (m *ReplyProposalRule) String() string { return proto.CompactTextString(m) }
func (*ReplyProposalRule) ProtoMessage() {}
func (*ReplyProposalRule) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{8} }
func (m *ReqQueryProposalRule) GetDirection() int32 {
if m != nil {
return m.Direction
}
return 0
}
func (m *ReqQueryProposalRule) GetIndex() int64 {
if m != nil {
return m.Index
}
return 0
}
type ReplyQueryProposalRule struct {
PropRules []*AutonomyProposalRule `protobuf:"bytes,1,rep,name=propRules" json:"propRules,omitempty"`
}
func (m *ReplyQueryProposalRule) Reset() { *m = ReplyQueryProposalRule{} }
func (m *ReplyQueryProposalRule) String() string { return proto.CompactTextString(m) }
func (*ReplyQueryProposalRule) ProtoMessage() {}
func (*ReplyQueryProposalRule) Descriptor() ([]byte, []int) { return fileDescriptor4, []int{8} }
func (m *ReplyProposalRule) GetPropRules() []*LocalProposalRule {
func (m *ReplyQueryProposalRule) GetPropRules() []*AutonomyProposalRule {
if m != nil {
return m.PropRules
}
......@@ -291,44 +316,45 @@ func init() {
proto.RegisterType((*TerminateProposalRule)(nil), "types.TerminateProposalRule")
proto.RegisterType((*ReceiptProposalRule)(nil), "types.ReceiptProposalRule")
proto.RegisterType((*LocalProposalRule)(nil), "types.LocalProposalRule")
proto.RegisterType((*ReqQueryProposalRule)(nil), "types.ReqQueryProposalRule")
proto.RegisterType((*ReplyQueryProposalRule)(nil), "types.ReplyQueryProposalRule")
proto.RegisterType((*ReplyProposalRule)(nil), "types.ReplyProposalRule")
}
func init() { proto.RegisterFile("rule.proto", fileDescriptor4) }
var fileDescriptor4 = []byte{
// 500 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x94, 0x4d, 0x6b, 0xdb, 0x4c,
0x10, 0xc7, 0xd1, 0x23, 0xcb, 0x2f, 0xe3, 0x27, 0xad, 0xbd, 0x49, 0x83, 0x48, 0x21, 0x18, 0xb5,
0x14, 0xd1, 0x83, 0x0b, 0xe9, 0x4b, 0x7a, 0x75, 0x69, 0xa1, 0xa5, 0x39, 0xb8, 0x4b, 0xe8, 0x7d,
0x6d, 0x0f, 0x95, 0x89, 0xa4, 0x59, 0x76, 0x57, 0x06, 0x1d, 0x7a, 0xeb, 0x67, 0xe8, 0xe7, 0x2d,
0x1a, 0xcb, 0x89, 0x65, 0x9b, 0x80, 0x6f, 0x3b, 0xff, 0xf9, 0xcd, 0x8b, 0x3c, 0x33, 0x06, 0x30,
0x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c, 0x51, 0xa0, 0x29, 0x8f, 0xfa, 0x89, 0xbe, 0xc3, 0x90, 0x23, 0x1b, 0x41, 0x1f, 0xa0,
0xb7, 0x29, 0x6b, 0x43, 0x6f, 0xe4, 0xc7, 0xfd, 0xab, 0xb0, 0x6e, 0x72, 0xef, 0x83, 0xe4, 0x03,
0x3a, 0x6b, 0xf3, 0x7f, 0xca, 0xdb, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x4d, 0x3e, 0x74, 0x94,
0x77, 0x04, 0x00, 0x00,
// 519 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x5b, 0x6f, 0xd3, 0x30,
0x14, 0x56, 0xda, 0xba, 0x97, 0xc3, 0x45, 0x9d, 0x57, 0xa6, 0x68, 0x20, 0x54, 0x45, 0x02, 0x55,
0x20, 0x15, 0x71, 0xd3, 0xc4, 0x23, 0x0c, 0x24, 0x90, 0xf6, 0x00, 0x07, 0xc4, 0x7b, 0x48, 0xce,
0xda, 0x68, 0xa9, 0x6d, 0x1c, 0xa7, 0x5a, 0x1f, 0x78, 0xe0, 0x77, 0xf3, 0x82, 0xec, 0xb8, 0x4d,
0xb3, 0x56, 0x9b, 0xf6, 0x96, 0xef, 0xf8, 0x3b, 0x97, 0xcf, 0x3e, 0x5f, 0x00, 0x74, 0x99, 0xd3,
0x54, 0x69, 0x69, 0x24, 0x67, 0x66, 0xa5, 0xa8, 0x38, 0xbe, 0x97, 0x27, 0x72, 0xb1, 0x90, 0xa2,
0x8a, 0x46, 0x7f, 0x5b, 0x30, 0x7a, 0x5f, 0x1a, 0x29, 0xe4, 0x62, 0xf5, 0x55, 0x4b, 0x25, 0x8b,
0x38, 0xc7, 0x32, 0x27, 0xfe, 0x02, 0xfa, 0x4a, 0x4b, 0x65, 0xbf, 0xc3, 0x60, 0x1c, 0x4c, 0xee,
0xbc, 0x3a, 0x9c, 0xba, 0x0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af, 0xae, 0xfb, 0xfb, 0xbc, 0xfe, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x2c,
0x38, 0xbe, 0x35, 0xa1, 0x04, 0x00, 0x00,
}
......@@ -55,6 +55,7 @@ func (a *AutonomyType) GetLogMap() map[int64]*types.LogInfo {
TyLogPropProject: {Ty: reflect.TypeOf(ReceiptProposalProject{}), Name: "LogPropProject"},
TyLogRvkPropProject: {Ty: reflect.TypeOf(ReceiptProposalProject{}), Name: "LogRvkPropProject"},
TyLogVotePropProject: {Ty: reflect.TypeOf(ReceiptProposalProject{}), Name: "LogVotePropProject"},
TyLogPubVotePropProject: {Ty: reflect.TypeOf(ReceiptProposalProject{}), Name: "LogPubVotePropProject"},
TyLogTmintPropProject: {Ty: reflect.TypeOf(ReceiptProposalProject{}), Name: "LogTmintPropProject"},
TyLogPropRule: {Ty: reflect.TypeOf(ReceiptProposalRule{}), Name: "LogPropRule"},
......@@ -80,6 +81,7 @@ func (a *AutonomyType) GetTypeMap() map[string]int32 {
"PropProject": AutonomyActionPropProject,
"RvkPropProject": AutonomyActionRvkPropProject,
"VotePropProject": AutonomyActionVotePropProject,
"PubVotePropProject": AutonomyActionPubVotePropProject,
"TmintPropProject": AutonomyActionTmintPropProject,
"PropRule": AutonomyActionPropRule,
......
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