Commit bacdd6cf authored by liuyuhang's avatar liuyuhang Committed by 33cn

modify linter

parent cf9a539d
......@@ -117,9 +117,9 @@ type RoundState struct {
// RoundStateMessage ...
func (rs *RoundState) RoundStateMessage() *tmtypes.NewRoundStepMsg {
return &tmtypes.NewRoundStepMsg{
Height: rs.Height,
Round: int32(rs.Round),
Step: int32(rs.Step),
Height: rs.Height,
Round: int32(rs.Round),
Step: int32(rs.Step),
SecondsSinceStartTime: int32(time.Since(rs.StartTime).Seconds()),
LastCommitRound: int32(rs.LastCommit.Round()),
}
......
......@@ -5,7 +5,7 @@
source ../dapp-test-common.sh
MAIN_HTTP=""
txhash=""
#txhash=""
function run_testcases() {
echo "run_testcases"
......@@ -32,4 +32,4 @@ function rpc_test() {
fi
}
debug_function rpc_test "$1"
#debug_function rpc_test "$1"
#!/usr/bin/env bash
CLI="docker exec ${NODE3} /root/chain33-cli"
#CLI="docker exec ${NODE3} /root/chain33-cli"
......@@ -174,7 +174,7 @@ func voteProposalBoard(cmd *cobra.Command, args []string) {
ctx.RunWithoutMarshal()
}
// TerminateProposalBoard 终止提案
// TerminateProposalBoardCmd 终止提案
func TerminateProposalBoardCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "terminateBoard",
......
......@@ -194,7 +194,7 @@ func pubVoteProposalProject(cmd *cobra.Command, args []string) {
ctx.RunWithoutMarshal()
}
// TerminateProposalProject 终止提案
// TerminateProposalProjectCmd 终止提案
func TerminateProposalProjectCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "terminateProject",
......
......@@ -144,7 +144,7 @@ func voteProposalRule(cmd *cobra.Command, args []string) {
ctx.RunWithoutMarshal()
}
// TerminateProposalRule 终止提案
// TerminateProposalRuleCmd 终止提案
func TerminateProposalRuleCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "terminateRule",
......
......@@ -15,7 +15,6 @@ import (
var (
alog = log.New("module", "execs.autonomy")
driverName = auty.AutonomyX
autonomyAddr = address.ExecAddress(auty.AutonomyX)
autonomyFundAddr = address.ExecAddress("autonomyfund")
)
......
......@@ -255,6 +255,7 @@ func TestListProposalBoard(t *testing.T) {
Index: Index,
}
rsp, err = au.listProposalBoard(req)
require.NoError(t, err)
require.Equal(t, len(rsp.(*auty.ReplyQueryProposalBoard).PropBoards), 2)
require.Equal(t, rsp.(*auty.ReplyQueryProposalBoard).PropBoards[0].Height, testcase2[1].height)
require.Equal(t, rsp.(*auty.ReplyQueryProposalBoard).PropBoards[0].Index, int32(testcase2[1].index))
......
......@@ -24,7 +24,8 @@ import (
"github.com/stretchr/testify/require"
)
type execEnv struct {
// ExecEnv exec environment
type ExecEnv struct {
blockTime int64 // 1539918074
blockHeight int64
index int
......@@ -52,7 +53,8 @@ func init() {
commonlog.SetLogLevel("error")
}
func InitEnv() (*execEnv, drivers.Driver, dbm.KV, dbm.KVDB) {
// InitEnv 初始化环境
func InitEnv() (*ExecEnv, drivers.Driver, dbm.KV, dbm.KVDB) {
accountA := types.Account{
Balance: total,
Frozen: 0,
......@@ -77,7 +79,7 @@ func InitEnv() (*execEnv, drivers.Driver, dbm.KV, dbm.KVDB) {
Addr: AddrD,
}
env := &execEnv{
env := &ExecEnv{
blockTime: 1539918074,
blockHeight: 10,
index: 2,
......@@ -131,7 +133,7 @@ func TestTerminateProposalBoard(t *testing.T) {
terminateProposalBoard(t, env, exec, stateDB, kvdb, true)
}
func testPropBoard(t *testing.T, env *execEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
func testPropBoard(t *testing.T, env *ExecEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
opt1 := &auty.ProposalBoard{
Year: 2019,
Month: 7,
......@@ -194,7 +196,7 @@ func propBoardTx(parm *auty.ProposalBoard) (*types.Transaction, error) {
return types.CreateFormatTx(types.ExecName(auty.AutonomyX), types.Encode(val))
}
func revokeProposalBoard(t *testing.T, env *execEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
func revokeProposalBoard(t *testing.T, env *ExecEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
proposalID := env.txHash
opt2 := &auty.RevokeProposalBoard{
ProposalID: proposalID,
......@@ -244,7 +246,7 @@ func revokeProposalBoardTx(parm *auty.RevokeProposalBoard) (*types.Transaction,
return types.CreateFormatTx(types.ExecName(auty.AutonomyX), types.Encode(val))
}
func voteProposalBoard(t *testing.T, env *execEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
func voteProposalBoard(t *testing.T, env *ExecEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
api := new(apimock.QueueProtocolAPI)
api.On("StoreList", mock.Anything).Return(&types.StoreListReply{}, nil)
api.On("GetLastHeader", mock.Anything).Return(&types.Header{StateHash: []byte("")}, nil)
......@@ -356,7 +358,7 @@ func voteProposalBoardTx(parm *auty.VoteProposalBoard) (*types.Transaction, erro
return types.CreateFormatTx(types.ExecName(auty.AutonomyX), types.Encode(val))
}
func terminateProposalBoard(t *testing.T, env *execEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
func terminateProposalBoard(t *testing.T, env *ExecEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
api := new(apimock.QueueProtocolAPI)
api.On("StoreList", mock.Anything).Return(&types.StoreListReply{}, nil)
api.On("GetLastHeader", mock.Anything).Return(&types.Header{StateHash: []byte("")}, nil)
......
......@@ -10,6 +10,7 @@ import (
)
// 提案董事会相关
// Exec_PropBoard 创建提案
func (a *Autonomy) Exec_PropBoard(payload *auty.ProposalBoard, tx *types.Transaction, index int) (*types.Receipt, error) {
action := newAction(a, tx, int32(index))
......@@ -35,37 +36,39 @@ func (a *Autonomy) Exec_TmintPropBoard(payload *auty.TerminateProposalBoard, tx
}
// 提案项目相关
// Exec_PropProject 创建提案项目
func (a *Autonomy) Exec_PropProject(payload *auty.ProposalProject, tx *types.Transaction, index int) (*types.Receipt, error) {
action := newAction(a, tx, int32(index))
return action.propProject(payload)
}
// Exec_RvkPropBoard 撤销提案项目
// Exec_RvkPropProject 撤销提案项目
func (a *Autonomy) Exec_RvkPropProject(payload *auty.RevokeProposalProject, tx *types.Transaction, index int) (*types.Receipt, error) {
action := newAction(a, tx, int32(index))
return action.rvkPropProject(payload)
}
// Exec_VotePropBoard 投票提案项目
// Exec_VotePropProject 投票提案项目
func (a *Autonomy) Exec_VotePropProject(payload *auty.VoteProposalProject, tx *types.Transaction, index int) (*types.Receipt, error) {
action := newAction(a, tx, int32(index))
return action.votePropProject(payload)
}
// Exec_VotePropBoard 投票提案项目
// Exec_PubVotePropProject 投票提案项目
func (a *Autonomy) Exec_PubVotePropProject(payload *auty.PubVoteProposalProject, tx *types.Transaction, index int) (*types.Receipt, error) {
action := newAction(a, tx, int32(index))
return action.pubVotePropProject(payload)
}
// Exec_TmintPropBoard 终止提案项目
// Exec_TmintPropProject 终止提案项目
func (a *Autonomy) Exec_TmintPropProject(payload *auty.TerminateProposalProject, tx *types.Transaction, index int) (*types.Receipt, error) {
action := newAction(a, tx, int32(index))
return action.tmintPropProject(payload)
}
// 提案规则相关
// Exec_PropRule 创建提案规则
func (a *Autonomy) Exec_PropRule(payload *auty.ProposalRule, tx *types.Transaction, index int) (*types.Receipt, error) {
action := newAction(a, tx, int32(index))
......@@ -96,7 +99,7 @@ func (a *Autonomy) Exec_Transfer(payload *auty.TransferFund, tx *types.Transacti
return action.transfer(payload)
}
// Exec_Comment 评论提案
// Exec_CommentProp 评论提案
func (a *Autonomy) Exec_CommentProp(payload *auty.Comment, tx *types.Transaction, index int) (*types.Receipt, error) {
action := newAction(a, tx, int32(index))
return action.commentProp(payload)
......
......@@ -10,6 +10,7 @@ import (
)
// 提案董事会相关
// 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)
......@@ -31,6 +32,7 @@ func (a *Autonomy) ExecDelLocal_TmintPropBoard(payload *auty.TerminateProposalBo
}
// 提案项目相关
// 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)
......@@ -57,6 +59,7 @@ func (a *Autonomy) ExecDelLocal_TmintPropProject(payload *auty.TerminateProposal
}
// 提案规则相关
// ExecDelLocal_PropRule 创建提案规则
func (a *Autonomy) ExecDelLocal_PropRule(payload *auty.ProposalRule, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
return a.execDelLocalRule(receiptData)
......@@ -77,7 +80,7 @@ func (a *Autonomy) ExecDelLocal_TmintPropRule(payload *auty.TerminateProposalRul
return a.execDelLocalRule(receiptData)
}
// ExecDelLocal_TmintPropRule 终止提案规则
// ExecDelLocal_CommentProp 终止提案规则
func (a *Autonomy) ExecDelLocal_CommentProp(payload *auty.Comment, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
return a.execDelLocalCommentProp(receiptData)
}
......@@ -10,6 +10,7 @@ import (
)
// 提案董事会相关
// ExecLocal_PropBoard 创建提案
func (a *Autonomy) ExecLocal_PropBoard(payload *auty.ProposalBoard, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
return a.execLocalBoard(receiptData)
......@@ -31,6 +32,7 @@ func (a *Autonomy) ExecLocal_TmintPropBoard(payload *auty.TerminateProposalBoard
}
// 提案项目相关
// ExecLocal_PropProject 创建提案项目
func (a *Autonomy) ExecLocal_PropProject(payload *auty.ProposalProject, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
return a.execLocalProject(receiptData)
......@@ -57,6 +59,7 @@ func (a *Autonomy) ExecLocal_TmintPropProject(payload *auty.TerminateProposalPro
}
// 提案规则相关
// ExecLocal_PropRule 创建提案规则
func (a *Autonomy) ExecLocal_PropRule(payload *auty.ProposalRule, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
return a.execLocalRule(receiptData)
......@@ -77,7 +80,7 @@ func (a *Autonomy) ExecLocal_TmintPropRule(payload *auty.TerminateProposalRule,
return a.execLocalRule(receiptData)
}
// ExecLocal_Comment 评论提案
// ExecLocal_CommentProp 评论提案
func (a *Autonomy) ExecLocal_CommentProp(payload *auty.Comment, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error) {
return a.execLocalCommentProp(receiptData)
}
......@@ -29,7 +29,7 @@ var (
)
func activeBoardID() []byte {
return []byte(fmt.Sprintf("%s", boardPrefix))
return []byte(boardPrefix)
}
func propBoardID(txHash string) []byte {
......@@ -67,7 +67,7 @@ var (
)
func activeRuleID() []byte {
return []byte(fmt.Sprintf("%s", rulePrefix))
return []byte(rulePrefix)
}
func propRuleID(txHash string) []byte {
......
......@@ -261,6 +261,7 @@ func TestListProposalProject(t *testing.T) {
Index: Index,
}
rsp, err = au.listProposalProject(req)
require.NoError(t, err)
require.Equal(t, len(rsp.(*auty.ReplyQueryProposalProject).PropProjects), 2)
require.Equal(t, rsp.(*auty.ReplyQueryProposalProject).PropProjects[0].Height, testcase2[1].height)
require.Equal(t, rsp.(*auty.ReplyQueryProposalProject).PropProjects[0].Index, int32(testcase2[1].index))
......
......@@ -199,9 +199,9 @@ func (a *action) votePropProject(voteProb *auty.VoteProposalProject) (*types.Rec
votes.Address = append(votes.Address, a.fromaddr)
// 更新投票结果
if voteProb.Approve {
cur.BoardVoteRes.ApproveVotes += 1
cur.BoardVoteRes.ApproveVotes++
} else {
cur.BoardVoteRes.OpposeVotes += 1
cur.BoardVoteRes.OpposeVotes++
}
var logs []*types.ReceiptLog
......
......@@ -28,6 +28,8 @@ import (
// testLargeProjectAmount int64 = 1
//)
var autonomyAddr = address.ExecAddress(auty.AutonomyX)
const (
testProjectAmount int64 = types.Coin * 100 // 工程需要资金
)
......@@ -166,7 +168,7 @@ func TestTerminateProposalProject(t *testing.T) {
terminateProposalProject(t, env, exec, stateDB, kvdb, true)
}
func testPropProject(t *testing.T, env *execEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
func testPropProject(t *testing.T, env *ExecEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
opt1 := &auty.ProposalProject{
Year: 2019,
Month: 7,
......@@ -229,7 +231,7 @@ func propProjectTx(parm *auty.ProposalProject) (*types.Transaction, error) {
return types.CreateFormatTx(types.ExecName(auty.AutonomyX), types.Encode(val))
}
func revokeProposalProject(t *testing.T, env *execEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
func revokeProposalProject(t *testing.T, env *ExecEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
proposalID := env.txHash
opt2 := &auty.RevokeProposalProject{
ProposalID: proposalID,
......@@ -287,7 +289,7 @@ func revokeProposalProjectTx(parm *auty.RevokeProposalProject) (*types.Transacti
return types.CreateFormatTx(types.ExecName(auty.AutonomyX), types.Encode(val))
}
func voteProposalProject(t *testing.T, env *execEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
func voteProposalProject(t *testing.T, env *ExecEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
api := new(apimock.QueueProtocolAPI)
api.On("StoreList", mock.Anything).Return(&types.StoreListReply{}, nil)
api.On("GetLastHeader", mock.Anything).Return(&types.Header{StateHash: []byte("")}, nil)
......@@ -401,7 +403,7 @@ func checkVoteProposalProjectResult(t *testing.T, stateDB dbm.KV, proposalID str
require.Equal(t, AddrA, cur.Address)
}
func pubVoteProposalProject(t *testing.T, env *execEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
func pubVoteProposalProject(t *testing.T, env *ExecEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
api := new(apimock.QueueProtocolAPI)
api.On("StoreList", mock.Anything).Return(&types.StoreListReply{}, nil)
api.On("GetLastHeader", mock.Anything).Return(&types.Header{StateHash: []byte("")}, nil)
......@@ -515,7 +517,7 @@ func pubVoteProposalProjectTx(parm *auty.PubVoteProposalProject) (*types.Transac
return types.CreateFormatTx(types.ExecName(auty.AutonomyX), types.Encode(val))
}
func terminateProposalProject(t *testing.T, env *execEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
func terminateProposalProject(t *testing.T, env *ExecEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
api := new(apimock.QueueProtocolAPI)
api.On("StoreList", mock.Anything).Return(&types.StoreListReply{}, nil)
api.On("GetLastHeader", mock.Anything).Return(&types.Header{StateHash: []byte("")}, nil)
......
......@@ -255,6 +255,7 @@ func TestListProposalRule(t *testing.T) {
Index: Index,
}
rsp, err = au.listProposalRule(req)
require.NoError(t, err)
require.Equal(t, len(rsp.(*auty.ReplyQueryProposalRule).PropRules), 2)
require.Equal(t, rsp.(*auty.ReplyQueryProposalRule).PropRules[0].Height, testcase2[1].height)
require.Equal(t, rsp.(*auty.ReplyQueryProposalRule).PropRules[0].Index, int32(testcase2[1].index))
......@@ -324,7 +325,7 @@ func TestListProposalComment(t *testing.T) {
au.SetLocalDB(kvdb)
type statu struct {
propId string
propID string
height int64
index int64
}
......@@ -351,7 +352,7 @@ func TestListProposalComment(t *testing.T) {
Comment: "bbbbbbbbbb",
}
for _, tcase := range testcase {
key := calcCommentHeight(tcase.propId,
key := calcCommentHeight(tcase.propID,
dapp.HeightIndexStr(tcase.height, int64(tcase.index)))
cur.Height = tcase.height
cur.Index = int32(tcase.index)
......@@ -414,6 +415,7 @@ func TestListProposalComment(t *testing.T) {
Index: Index,
}
rsp, err = au.listProposalComment(req)
require.NoError(t, err)
require.Equal(t, len(rsp.(*auty.ReplyQueryProposalComment).RltCmt), 2)
require.Equal(t, rsp.(*auty.ReplyQueryProposalComment).RltCmt[0].Height, testcase2[1].height)
require.Equal(t, rsp.(*auty.ReplyQueryProposalComment).RltCmt[0].Index, int32(testcase2[1].index))
......
......@@ -305,7 +305,7 @@ func (a *action) tmintPropRule(tmintProb *auty.TerminateProposalRule) (*types.Re
}
func (a *action) transfer(tf *auty.TransferFund) (*types.Receipt, error) {
if a.execaddr != dapp.ExecAddress(string(auty.AutonomyX)) {
if a.execaddr != dapp.ExecAddress(auty.AutonomyX) {
err := auty.ErrNoAutonomyExec
alog.Error("autonomy transfer ", "addr", a.fromaddr, "execaddr", a.execaddr, "this exec is not autonomy", err)
return nil, err
......
......@@ -53,7 +53,7 @@ func TestTerminateProposalRule(t *testing.T) {
terminateProposalRule(t, env, exec, stateDB, kvdb, true)
}
func testPropRule(t *testing.T, env *execEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
func testPropRule(t *testing.T, env *ExecEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
opt1 := &auty.ProposalRule{
Year: 2019,
Month: 7,
......@@ -121,7 +121,7 @@ func propRuleTx(parm *auty.ProposalRule) (*types.Transaction, error) {
return types.CreateFormatTx(types.ExecName(auty.AutonomyX), types.Encode(val))
}
func revokeProposalRule(t *testing.T, env *execEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
func revokeProposalRule(t *testing.T, env *ExecEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
proposalID := env.txHash
opt2 := &auty.RevokeProposalRule{
ProposalID: proposalID,
......@@ -186,7 +186,7 @@ func revokeProposalRuleTx(parm *auty.RevokeProposalRule) (*types.Transaction, er
return types.CreateFormatTx(types.ExecName(auty.AutonomyX), types.Encode(val))
}
func voteProposalRule(t *testing.T, env *execEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
func voteProposalRule(t *testing.T, env *ExecEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
api := new(apimock.QueueProtocolAPI)
api.On("StoreList", mock.Anything).Return(&types.StoreListReply{}, nil)
api.On("GetLastHeader", mock.Anything).Return(&types.Header{StateHash: []byte("")}, nil)
......@@ -313,7 +313,7 @@ func voteProposalRuleTx(parm *auty.VoteProposalRule) (*types.Transaction, error)
return types.CreateFormatTx(types.ExecName(auty.AutonomyX), types.Encode(val))
}
func terminateProposalRule(t *testing.T, env *execEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
func terminateProposalRule(t *testing.T, env *ExecEnv, exec drivers.Driver, stateDB dbm.KV, kvdb dbm.KVDB, save bool) {
api := new(apimock.QueueProtocolAPI)
api.On("StoreList", mock.Anything).Return(&types.StoreListReply{}, nil)
api.On("GetLastHeader", mock.Anything).Return(&types.Header{StateHash: []byte("")}, nil)
......
......@@ -13,6 +13,7 @@ import (
)
// 提案董事会相关
// PropBoardTx 提案董事会成员RPC接口
func (c *Jrpc) PropBoardTx(parm *auty.ProposalBoard, result *interface{}) error {
if parm == nil {
......@@ -67,6 +68,7 @@ func (c *Jrpc) TerminateProposalBoardTx(parm *auty.TerminateProposalBoard, resul
}
// 提案项目相关
// PropProjectTx 提案项目RPC接口
func (c *Jrpc) PropProjectTx(parm *auty.ProposalProject, result *interface{}) error {
if parm == nil {
......@@ -134,6 +136,7 @@ func (c *Jrpc) TerminateProposalProjectTx(parm *auty.TerminateProposalProject, r
}
// 提案规则相关
// PropRuleTx 提案规则RPC接口
func (c *Jrpc) PropRuleTx(parm *auty.ProposalRule, result *interface{}) error {
if parm == nil {
......@@ -187,7 +190,7 @@ func (c *Jrpc) TerminateProposalRuleTx(parm *auty.TerminateProposalRule, result
return nil
}
// TransferTx 资金转入自治系统合约中
// TransferFundTx 资金转入自治系统合约中
func (c *Jrpc) TransferFundTx(parm *auty.TransferFund, result *interface{}) error {
if parm == nil {
return types.ErrInvalidParam
......
......@@ -45,7 +45,7 @@ const (
TyLogCommentProp = 2131
)
// status
// Board status
const (
AutonomyStatusProposalBoard = iota + 1
AutonomyStatusRvkPropBoard
......@@ -53,6 +53,7 @@ const (
AutonomyStatusTmintPropBoard
)
// Project status
const (
AutonomyStatusProposalProject = iota + 1
AutonomyStatusRvkPropProject
......@@ -61,6 +62,7 @@ const (
AutonomyStatusTmintPropProject
)
// Rule status
const (
AutonomyStatusProposalRule = iota + 1
AutonomyStatusRvkPropRule
......@@ -71,17 +73,17 @@ const (
const (
// GetProposalBoard 用于在cmd里面的区分不同的查询
GetProposalBoard = "GetProposalBoard"
// ListProposalBoard
// ListProposalBoard 查询多个
ListProposalBoard = "ListProposalBoard"
// GetProposalProject 用于在cmd里面的区分不同的查询
GetProposalProject = "GetProposalProject"
// ListProposalProject
// ListProposalProject 查询多个
ListProposalProject = "ListProposalProject"
// GetProposalRule 用于在cmd里面的区分不同的查询
GetProposalRule = "GetProposalRule"
// ListProposalRule
// ListProposalRule 查询多个
ListProposalRule = "ListProposalRule"
// ListProposalComment
// ListProposalComment 查询多个
ListProposalComment = "ListProposalComment"
)
......
......@@ -13,7 +13,7 @@ var (
ErrProposalStatus = errors.New("ErrProposalStatus")
// ErrRepeatVoteAddr 重复投票地址
ErrRepeatVoteAddr = errors.New("ErrRepeatVoteAddr")
// ErrRevokePeriod 非取消提案期间
// ErrRevokeProposalPeriod 非取消提案期间
ErrRevokeProposalPeriod = errors.New("ErrRevokeProposalPeriod")
// ErrRevokeProposalPower 不能取消
ErrRevokeProposalPower = errors.New("ErrRevokeProposalPower")
......
......@@ -7,14 +7,11 @@ package types
import (
"reflect"
log "github.com/33cn/chain33/common/log/log15"
"github.com/33cn/chain33/types"
)
var name string
var tlog = log.New("module", name)
func init() {
name = AutonomyX
types.AllowUserExec = append(types.AllowUserExec, []byte(name))
......@@ -23,11 +20,6 @@ func init() {
types.RegisterDappFork(name, "Enable", 0)
}
//getRealExecName
func getRealExecName(paraName string) string {
return types.ExecName(paraName + AutonomyX)
}
// NewType 生成新的基础类型
func NewType() *AutonomyType {
c := &AutonomyType{}
......
......@@ -73,9 +73,9 @@ func ParseX509CertificateToSm2(x509Cert *x509.Certificate) *sm2.Certificate {
UnknownExtKeyUsage: x509Cert.UnknownExtKeyUsage,
BasicConstraintsValid: x509Cert.BasicConstraintsValid,
IsCA: x509Cert.IsCA,
MaxPathLen: x509Cert.MaxPathLen,
MaxPathLenZero: x509Cert.MaxPathLenZero,
IsCA: x509Cert.IsCA,
MaxPathLen: x509Cert.MaxPathLen,
MaxPathLenZero: x509Cert.MaxPathLenZero,
SubjectKeyId: x509Cert.SubjectKeyId,
AuthorityKeyId: x509Cert.AuthorityKeyId,
......@@ -136,9 +136,9 @@ func ParseSm2CertificateToX509(sm2Cert *sm2.Certificate) *x509.Certificate {
UnknownExtKeyUsage: sm2Cert.UnknownExtKeyUsage,
BasicConstraintsValid: sm2Cert.BasicConstraintsValid,
IsCA: sm2Cert.IsCA,
MaxPathLen: sm2Cert.MaxPathLen,
MaxPathLenZero: sm2Cert.MaxPathLenZero,
IsCA: sm2Cert.IsCA,
MaxPathLen: sm2Cert.MaxPathLen,
MaxPathLenZero: sm2Cert.MaxPathLenZero,
SubjectKeyId: sm2Cert.SubjectKeyId,
AuthorityKeyId: sm2Cert.AuthorityKeyId,
......
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