Commit 07dcb5cb authored by liuyuhang's avatar liuyuhang

merge master

parent 3b38b667
...@@ -4,41 +4,78 @@ go 1.12 ...@@ -4,41 +4,78 @@ go 1.12
require ( require (
github.com/33cn/chain33 v0.0.0-20191017025459-6d5c61c7d134 github.com/33cn/chain33 v0.0.0-20191017025459-6d5c61c7d134
github.com/AndreasBriese/bbloom v0.0.0-20180913140656-343706a395b7
github.com/BurntSushi/toml v0.3.1 github.com/BurntSushi/toml v0.3.1
github.com/NebulousLabs/Sia v1.3.7 github.com/NebulousLabs/Sia v1.3.7
github.com/NebulousLabs/entropy-mnemonics v0.0.0-20170316012907-7b01a644a636
github.com/NebulousLabs/errors v0.0.0-20171229012116-7ead97ef90b8
github.com/NebulousLabs/fastrand v0.0.0-20180208210444-3cf7173006a0
github.com/NebulousLabs/merkletree v0.0.0-20181025040823-2a1d1d1dc33c
github.com/XiaoMi/pegasus-go-client v0.0.0-20181029071519-9400942c5d1c
github.com/apache/thrift v0.0.0-20171203172758-327ebb6c2b6d
github.com/beorn7/perks v1.0.1
github.com/btcsuite/btcd v0.0.0-20181013004428-67e573d211ac github.com/btcsuite/btcd v0.0.0-20181013004428-67e573d211ac
github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f // indirect github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f
github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d // indirect github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d
github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd // indirect github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd
github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 // indirect github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792
github.com/coreos/bbolt v1.3.0
github.com/coreos/etcd v3.3.15+incompatible github.com/coreos/etcd v3.3.15+incompatible
github.com/coreos/go-semver v0.3.0 // indirect github.com/coreos/go-semver v0.3.0
github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f // indirect github.com/coreos/go-systemd v0.0.0-20190719114852-fd7a80b32e1f
github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f // indirect github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f
github.com/davecgh/go-spew v1.1.1 github.com/davecgh/go-spew v1.1.1
github.com/dchest/blake256 v1.0.0
github.com/decred/base58 v1.0.0
github.com/dgraph-io/badger v1.5.4
github.com/dgryski/go-farm v0.0.0-20180109070241-2de33835d102
github.com/go-stack/stack v1.8.0
github.com/gogo/protobuf v1.3.0 github.com/gogo/protobuf v1.3.0
github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3 github.com/golang-collections/collections v0.0.0-20130729185459-604e922904d3
github.com/golang/protobuf v1.3.2 github.com/golang/protobuf v1.3.2
github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db
github.com/haltingstate/secp256k1-go v0.0.0-20151224084235-572209b26df6
github.com/hashicorp/golang-lru v0.5.0 github.com/hashicorp/golang-lru v0.5.0
github.com/huin/goupnp v1.0.0
github.com/inconshreveable/mousetrap v1.0.0
github.com/jackpal/go-nat-pmp v1.0.1
github.com/klauspost/compress v1.8.2
github.com/klauspost/cpuid v1.2.1
github.com/mattn/go-colorable v0.0.9
github.com/mattn/go-isatty v0.0.4
github.com/matttproud/golang_protobuf_extensions v1.0.1
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.1 // indirect github.com/modern-go/reflect2 v1.0.1 // indirect
github.com/mr-tron/base58 v1.1.0
github.com/pkg/errors v0.8.0 github.com/pkg/errors v0.8.0
github.com/prometheus/client_golang v1.1.0 // indirect github.com/pmezard/go-difflib v1.0.0
github.com/prometheus/client_golang v1.1.0
github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90
github.com/prometheus/common v0.6.0
github.com/prometheus/procfs v0.0.3
github.com/robertkrimen/otto v0.0.0-20180617131154-15f95af6e78d github.com/robertkrimen/otto v0.0.0-20180617131154-15f95af6e78d
github.com/rs/cors v1.6.0 github.com/rs/cors v1.6.0
github.com/spf13/cobra v0.0.3 github.com/spf13/cobra v0.0.3
github.com/spf13/pflag v1.0.3
github.com/stretchr/objx v0.1.1
github.com/stretchr/testify v1.3.0 github.com/stretchr/testify v1.3.0
github.com/syndtr/goleveldb v0.0.0-20181105012736-f9080354173f
github.com/tjfoc/gmsm v0.0.0-20171124023159-98aa888b79d8 github.com/tjfoc/gmsm v0.0.0-20171124023159-98aa888b79d8
github.com/valyala/fasthttp v1.5.0 github.com/valyala/fasthttp v1.5.0
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2
go.uber.org/atomic v1.4.0 // indirect go.uber.org/atomic v1.4.0
go.uber.org/multierr v1.2.0 // indirect go.uber.org/multierr v1.2.0
go.uber.org/zap v1.10.0 // indirect go.uber.org/zap v1.10.0
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297
golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0 // indirect golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a
golang.org/x/text v0.3.2
golang.org/x/time v0.0.0-20190921001708-c4c64cad1fd0
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8
google.golang.org/grpc v1.22.1 google.golang.org/grpc v1.22.1
gopkg.in/sourcemap.v1 v1.0.5 // indirect gopkg.in/natefinch/lumberjack.v2 v2.0.0-20170531160350-a96e63847dc3
gopkg.in/sourcemap.v1 v1.0.5
gopkg.in/tomb.v2 v2.0.0-20161208151619-d5d1b5820637
) )
replace github.com/33cn/chain33 => github.com/lyh169/chain33 v0.0.0-20191017080109-0e21124b01fc replace github.com/33cn/chain33 => github.com/lyh169/chain33 v0.0.0-20191021072850-f71d3eddca4a
...@@ -124,6 +124,8 @@ github.com/lyh169/chain33 v0.0.0-20191012060858-1e258d8cc3bf h1:TXOjG6jLLFCjSZoK ...@@ -124,6 +124,8 @@ github.com/lyh169/chain33 v0.0.0-20191012060858-1e258d8cc3bf h1:TXOjG6jLLFCjSZoK
github.com/lyh169/chain33 v0.0.0-20191012060858-1e258d8cc3bf/go.mod h1:4I8n+Zyf3t0UKM5jjpqJY627Tub62oXkLsdzIv4r6rQ= github.com/lyh169/chain33 v0.0.0-20191012060858-1e258d8cc3bf/go.mod h1:4I8n+Zyf3t0UKM5jjpqJY627Tub62oXkLsdzIv4r6rQ=
github.com/lyh169/chain33 v0.0.0-20191017080109-0e21124b01fc h1:X9d9RvQaECoqK1jWhSUzjcMa77Xxed1a50p9uWSYoQ4= github.com/lyh169/chain33 v0.0.0-20191017080109-0e21124b01fc h1:X9d9RvQaECoqK1jWhSUzjcMa77Xxed1a50p9uWSYoQ4=
github.com/lyh169/chain33 v0.0.0-20191017080109-0e21124b01fc/go.mod h1:4I8n+Zyf3t0UKM5jjpqJY627Tub62oXkLsdzIv4r6rQ= github.com/lyh169/chain33 v0.0.0-20191017080109-0e21124b01fc/go.mod h1:4I8n+Zyf3t0UKM5jjpqJY627Tub62oXkLsdzIv4r6rQ=
github.com/lyh169/chain33 v0.0.0-20191021072850-f71d3eddca4a h1:m4xrIrvYN8pe3aASOxNpSvFOsZA7Fy+KKLmN8gRugkA=
github.com/lyh169/chain33 v0.0.0-20191021072850-f71d3eddca4a/go.mod h1:4I8n+Zyf3t0UKM5jjpqJY627Tub62oXkLsdzIv4r6rQ=
github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs=
......
...@@ -820,7 +820,8 @@ func (cs *ConsensusState) defaultDoPrevote(height int64, round int) { ...@@ -820,7 +820,8 @@ func (cs *ConsensusState) defaultDoPrevote(height int64, round int) {
cs.signAddVote(ttypes.VoteTypePrevote, nil) cs.signAddVote(ttypes.VoteTypePrevote, nil)
return return
} }
if !bytes.Equal(blockNew.Hash(), cs.ProposalBlock.Data.Hash()) { cfg := cs.client.GetQueueClient().GetConfig()
if !bytes.Equal(blockNew.Hash(cfg), cs.ProposalBlock.Data.Hash(cfg)) {
tendermintlog.Error("enterPrevote: PreExec ProposalBlock has change") tendermintlog.Error("enterPrevote: PreExec ProposalBlock has change")
cs.signAddVote(ttypes.VoteTypePrevote, nil) cs.signAddVote(ttypes.VoteTypePrevote, nil)
return return
......
...@@ -365,6 +365,7 @@ func TestGuess(t *testing.T) { ...@@ -365,6 +365,7 @@ func TestGuess(t *testing.T) {
func testGuessImp(t *testing.T) { func testGuessImp(t *testing.T) {
fmt.Println("=======start guess test!=======") fmt.Println("=======start guess test!=======")
q, chain, s, mem, exec, cs, p2p, cmd := initEnvGuess() q, chain, s, mem, exec, cs, p2p, cmd := initEnvGuess()
cfg := q.GetConfig()
defer chain.Close() defer chain.Close()
defer mem.Close() defer mem.Close()
defer exec.Close() defer exec.Close()
...@@ -386,8 +387,8 @@ func testGuessImp(t *testing.T) { ...@@ -386,8 +387,8 @@ func testGuessImp(t *testing.T) {
fmt.Println("=======start sendTransferTx sendTransferToExecTx!=======") fmt.Println("=======start sendTransferTx sendTransferToExecTx!=======")
//从创世地址向测试地址A转入代币 //从创世地址向测试地址A转入代币
sendTransferTx(adminPriv, userAAddr, 2000000000000) sendTransferTx(cfg, adminPriv, userAAddr, 2000000000000)
sendTransferTx(adminPriv, userBAddr, 2000000000000) sendTransferTx(cfg, adminPriv, userBAddr, 2000000000000)
time.Sleep(2 * time.Second) time.Sleep(2 * time.Second)
in := &types.ReqBalance{} in := &types.ReqBalance{}
...@@ -411,8 +412,8 @@ func testGuessImp(t *testing.T) { ...@@ -411,8 +412,8 @@ func testGuessImp(t *testing.T) {
assert.Equal(t, true, acct2.Acc[0].Balance == 2000000000000) assert.Equal(t, true, acct2.Acc[0].Balance == 2000000000000)
//从测试地址向dos合约转入代币 //从测试地址向dos合约转入代币
sendTransferToExecTx(userAPriv, "guess", 1000000000000) sendTransferToExecTx(cfg, userAPriv, "guess", 1000000000000)
sendTransferToExecTx(userBPriv, "guess", 1000000000000) sendTransferToExecTx(cfg, userBPriv, "guess", 1000000000000)
time.Sleep(2 * time.Second) time.Sleep(2 * time.Second)
fmt.Println("=======start GetBalance!=======") fmt.Println("=======start GetBalance!=======")
...@@ -441,25 +442,28 @@ func testGuessImp(t *testing.T) { ...@@ -441,25 +442,28 @@ func testGuessImp(t *testing.T) {
} }
func initEnvGuess() (queue.Queue, *blockchain.BlockChain, queue.Module, queue.Module, *executor.Executor, queue.Module, queue.Module, *cobra.Command) { func initEnvGuess() (queue.Queue, *blockchain.BlockChain, queue.Module, queue.Module, *executor.Executor, queue.Module, queue.Module, *cobra.Command) {
var q = queue.New("channel")
flag.Parse() flag.Parse()
cfg, sub := types.InitCfg("chain33.test.toml")
types.Init(cfg.Title, cfg) chain33Cfg := types.NewChain33Config(types.ReadFile("chain33.test.toml"))
chain := blockchain.New(cfg.BlockChain) var q = queue.New("channel")
q.SetConfig(chain33Cfg)
cfg := chain33Cfg.GetModuleConfig()
sub := chain33Cfg.GetSubConfig()
chain := blockchain.New(chain33Cfg)
chain.SetQueueClient(q.Client()) chain.SetQueueClient(q.Client())
exec := executor.New(cfg.Exec, sub.Exec) exec := executor.New(chain33Cfg)
exec.SetQueueClient(q.Client()) exec.SetQueueClient(q.Client())
types.SetMinFee(0) chain33Cfg.SetMinFee(0)
s := store.New(cfg.Store, sub.Store) s := store.New(chain33Cfg)
s.SetQueueClient(q.Client()) s.SetQueueClient(q.Client())
cs := solo.New(cfg.Consensus, sub.Consensus["solo"]) cs := solo.New(cfg.Consensus, sub.Consensus["solo"])
cs.SetQueueClient(q.Client()) cs.SetQueueClient(q.Client())
mem := mempool.New(cfg.Mempool, nil) mem := mempool.New(chain33Cfg)
mem.SetQueueClient(q.Client()) mem.SetQueueClient(q.Client())
network := p2p.New(cfg.P2P) network := p2p.New(chain33Cfg)
network.SetQueueClient(q.Client()) network.SetQueueClient(q.Client())
...@@ -550,7 +554,7 @@ func NormPut() { ...@@ -550,7 +554,7 @@ func NormPut() {
} }
} }
func sendTransferTx(fromKey, to string, amount int64) bool { func sendTransferTx(cfg *types.Chain33Config, fromKey, to string, amount int64) bool {
signer := util.HexToPrivkey(fromKey) signer := util.HexToPrivkey(fromKey)
var tx *types.Transaction var tx *types.Transaction
transfer := &cty.CoinsAction{} transfer := &cty.CoinsAction{}
...@@ -559,7 +563,7 @@ func sendTransferTx(fromKey, to string, amount int64) bool { ...@@ -559,7 +563,7 @@ func sendTransferTx(fromKey, to string, amount int64) bool {
transfer.Ty = cty.CoinsActionTransfer transfer.Ty = cty.CoinsActionTransfer
execer := []byte("coins") execer := []byte("coins")
tx = &types.Transaction{Execer: execer, Payload: types.Encode(transfer), To: to, Fee: fee} tx = &types.Transaction{Execer: execer, Payload: types.Encode(transfer), To: to, Fee: fee}
tx, err := types.FormatTx(string(execer), tx) tx, err := types.FormatTx(cfg, string(execer), tx)
if err != nil { if err != nil {
fmt.Println("in sendTransferTx formatTx failed") fmt.Println("in sendTransferTx formatTx failed")
return false return false
...@@ -584,7 +588,7 @@ func sendTransferTx(fromKey, to string, amount int64) bool { ...@@ -584,7 +588,7 @@ func sendTransferTx(fromKey, to string, amount int64) bool {
return true return true
} }
func sendTransferToExecTx(fromKey, execName string, amount int64) bool { func sendTransferToExecTx(cfg *types.Chain33Config, fromKey, execName string, amount int64) bool {
signer := util.HexToPrivkey(fromKey) signer := util.HexToPrivkey(fromKey)
var tx *types.Transaction var tx *types.Transaction
transfer := &cty.CoinsAction{} transfer := &cty.CoinsAction{}
...@@ -594,7 +598,7 @@ func sendTransferToExecTx(fromKey, execName string, amount int64) bool { ...@@ -594,7 +598,7 @@ func sendTransferToExecTx(fromKey, execName string, amount int64) bool {
transfer.Ty = cty.CoinsActionTransferToExec transfer.Ty = cty.CoinsActionTransferToExec
execer := []byte("coins") execer := []byte("coins")
tx = &types.Transaction{Execer: execer, Payload: types.Encode(transfer), To: address.ExecAddress("guess"), Fee: fee} tx = &types.Transaction{Execer: execer, Payload: types.Encode(transfer), To: address.ExecAddress("guess"), Fee: fee}
tx, err := types.FormatTx(string(execer), tx) tx, err := types.FormatTx(cfg, string(execer), tx)
if err != nil { if err != nil {
fmt.Println("sendTransferToExecTx formatTx failed.") fmt.Println("sendTransferToExecTx formatTx failed.")
...@@ -627,6 +631,11 @@ func testCmd(cmd *cobra.Command) { ...@@ -627,6 +631,11 @@ func testCmd(cmd *cobra.Command) {
Short: "chain33 client tools", Short: "chain33 client tools",
} }
chain33Cfg := types.NewChain33Config(types.ReadFile("chain33.test.toml"))
types.SetCliSysParam(chain33Cfg.GetTitle(), chain33Cfg)
rootCmd.PersistentFlags().String("title", chain33Cfg.GetTitle(), "get title name")
rootCmd.PersistentFlags().String("rpc_laddr", "http://127.0.0.1:8802", "http url") rootCmd.PersistentFlags().String("rpc_laddr", "http://127.0.0.1:8802", "http url")
rootCmd.AddCommand(cmd) rootCmd.AddCommand(cmd)
......
...@@ -368,6 +368,7 @@ func TestGuess(t *testing.T) { ...@@ -368,6 +368,7 @@ func TestGuess(t *testing.T) {
func testGuessImp(t *testing.T) { func testGuessImp(t *testing.T) {
fmt.Println("=======start guess test!=======") fmt.Println("=======start guess test!=======")
q, chain, s, mem, exec, cs, p2p := initEnvGuess() q, chain, s, mem, exec, cs, p2p := initEnvGuess()
cfg := q.GetConfig()
defer chain.Close() defer chain.Close()
defer mem.Close() defer mem.Close()
defer exec.Close() defer exec.Close()
...@@ -389,8 +390,8 @@ func testGuessImp(t *testing.T) { ...@@ -389,8 +390,8 @@ func testGuessImp(t *testing.T) {
fmt.Println("=======start sendTransferTx!=======") fmt.Println("=======start sendTransferTx!=======")
//从创世地址向测试地址A转入代币 //从创世地址向测试地址A转入代币
sendTransferTx(adminPriv, userAAddr, 2000000000000) sendTransferTx(cfg, adminPriv, userAAddr, 2000000000000)
sendTransferTx(adminPriv, userBAddr, 2000000000000) sendTransferTx(cfg, adminPriv, userBAddr, 2000000000000)
time.Sleep(2 * time.Second) time.Sleep(2 * time.Second)
in := &types.ReqBalance{} in := &types.ReqBalance{}
...@@ -415,8 +416,8 @@ func testGuessImp(t *testing.T) { ...@@ -415,8 +416,8 @@ func testGuessImp(t *testing.T) {
fmt.Println("=======start sendTransferToExecTx!=======") fmt.Println("=======start sendTransferToExecTx!=======")
//从测试地址向dos合约转入代币 //从测试地址向dos合约转入代币
sendTransferToExecTx(userAPriv, "guess", 1000000000000) sendTransferToExecTx(cfg, userAPriv, "guess", 1000000000000)
sendTransferToExecTx(userBPriv, "guess", 1000000000000) sendTransferToExecTx(cfg, userBPriv, "guess", 1000000000000)
time.Sleep(2 * time.Second) time.Sleep(2 * time.Second)
fmt.Println("=======start GetBalance!=======") fmt.Println("=======start GetBalance!=======")
...@@ -442,7 +443,7 @@ func testGuessImp(t *testing.T) { ...@@ -442,7 +443,7 @@ func testGuessImp(t *testing.T) {
assert.Equal(t, true, acct4.Acc[0].Balance == 1000000000000) assert.Equal(t, true, acct4.Acc[0].Balance == 1000000000000)
fmt.Println("=======start sendGuessStartTx!=======") fmt.Println("=======start sendGuessStartTx!=======")
ok, gameid := sendGuessStartTx("WorldCup Final", "A:France;B:Claodia", "football", adminPriv) ok, gameid := sendGuessStartTx(cfg, "WorldCup Final", "A:France;B:Claodia", "football", adminPriv)
if !ok { if !ok {
panic("Guess start failed.") panic("Guess start failed.")
} else { } else {
...@@ -456,7 +457,7 @@ func testGuessImp(t *testing.T) { ...@@ -456,7 +457,7 @@ func testGuessImp(t *testing.T) {
assert.Equal(t, true, reply.Games[0].Status == gty.GuessGameStatusStart) assert.Equal(t, true, reply.Games[0].Status == gty.GuessGameStatusStart)
fmt.Println("=======start sendGuessBetTx!=======") fmt.Println("=======start sendGuessBetTx!=======")
ok, txid := sendGuessBetTx(strGameID1, "A", 5e8, userAPriv) ok, txid := sendGuessBetTx(cfg, strGameID1, "A", 5e8, userAPriv)
if !ok { if !ok {
panic("Guess A bet failed.") panic("Guess A bet failed.")
} else { } else {
...@@ -466,7 +467,7 @@ func testGuessImp(t *testing.T) { ...@@ -466,7 +467,7 @@ func testGuessImp(t *testing.T) {
reply = queryGuessByIds(strGameID1) reply = queryGuessByIds(strGameID1)
assert.Equal(t, true, reply.Games[0].Status == gty.GuessGameStatusBet && reply.Games[0].BetStat.TotalBetTimes == 1) assert.Equal(t, true, reply.Games[0].Status == gty.GuessGameStatusBet && reply.Games[0].BetStat.TotalBetTimes == 1)
ok, txid = sendGuessBetTx(strGameID1, "B", 5e8, userBPriv) ok, txid = sendGuessBetTx(cfg, strGameID1, "B", 5e8, userBPriv)
if !ok { if !ok {
panic("Guess B bet failed.") panic("Guess B bet failed.")
} else { } else {
...@@ -477,7 +478,7 @@ func testGuessImp(t *testing.T) { ...@@ -477,7 +478,7 @@ func testGuessImp(t *testing.T) {
assert.Equal(t, true, reply.Games[0].Status == gty.GuessGameStatusBet && reply.Games[0].BetStat.TotalBetTimes == 2) assert.Equal(t, true, reply.Games[0].Status == gty.GuessGameStatusBet && reply.Games[0].BetStat.TotalBetTimes == 2)
fmt.Println("=======start sendGuessStopTx failed!=======") fmt.Println("=======start sendGuessStopTx failed!=======")
ok, txid = sendGuessStopTx(strGameID1, userBPriv) ok, txid = sendGuessStopTx(cfg, strGameID1, userBPriv)
if !ok { if !ok {
panic("Guess stop failed,only admin can stop.") panic("Guess stop failed,only admin can stop.")
} else { } else {
...@@ -488,7 +489,7 @@ func testGuessImp(t *testing.T) { ...@@ -488,7 +489,7 @@ func testGuessImp(t *testing.T) {
assert.Equal(t, true, reply.Games[0].Status == gty.GuessGameStatusBet && reply.Games[0].BetStat.TotalBetTimes == 2) assert.Equal(t, true, reply.Games[0].Status == gty.GuessGameStatusBet && reply.Games[0].BetStat.TotalBetTimes == 2)
fmt.Println("=======start sendGuessStopTx!=======") fmt.Println("=======start sendGuessStopTx!=======")
ok, txid = sendGuessStopTx(strGameID1, adminPriv) ok, txid = sendGuessStopTx(cfg, strGameID1, adminPriv)
if !ok { if !ok {
panic("Guess stop failed.") panic("Guess stop failed.")
} else { } else {
...@@ -499,7 +500,7 @@ func testGuessImp(t *testing.T) { ...@@ -499,7 +500,7 @@ func testGuessImp(t *testing.T) {
assert.Equal(t, true, reply.Games[0].Status == gty.GuessGameStatusStopBet && reply.Games[0].BetStat.TotalBetTimes == 2) assert.Equal(t, true, reply.Games[0].Status == gty.GuessGameStatusStopBet && reply.Games[0].BetStat.TotalBetTimes == 2)
fmt.Println("=======start sendGuessBetTx failed!=======") fmt.Println("=======start sendGuessBetTx failed!=======")
ok, txid = sendGuessBetTx(strGameID1, "A", 5e8, userAPriv) ok, txid = sendGuessBetTx(cfg, strGameID1, "A", 5e8, userAPriv)
if !ok { if !ok {
fmt.Println("Guess stopped, bet failed.") fmt.Println("Guess stopped, bet failed.")
} else { } else {
...@@ -510,7 +511,7 @@ func testGuessImp(t *testing.T) { ...@@ -510,7 +511,7 @@ func testGuessImp(t *testing.T) {
assert.Equal(t, true, reply.Games[0].Status == gty.GuessGameStatusStopBet && reply.Games[0].BetStat.TotalBetTimes == 2) assert.Equal(t, true, reply.Games[0].Status == gty.GuessGameStatusStopBet && reply.Games[0].BetStat.TotalBetTimes == 2)
fmt.Println("=======start sendGuessPublishTx failed!=======") fmt.Println("=======start sendGuessPublishTx failed!=======")
ok, txid = sendGuessPublishTx(strGameID1, "A", userAPriv) ok, txid = sendGuessPublishTx(cfg, strGameID1, "A", userAPriv)
if !ok { if !ok {
fmt.Println("sendGuessPublishTx failed,only admin can publish.") fmt.Println("sendGuessPublishTx failed,only admin can publish.")
} else { } else {
...@@ -521,7 +522,7 @@ func testGuessImp(t *testing.T) { ...@@ -521,7 +522,7 @@ func testGuessImp(t *testing.T) {
assert.Equal(t, true, reply.Games[0].Status == gty.GuessGameStatusStopBet && reply.Games[0].BetStat.TotalBetTimes == 2) assert.Equal(t, true, reply.Games[0].Status == gty.GuessGameStatusStopBet && reply.Games[0].BetStat.TotalBetTimes == 2)
fmt.Println("=======start sendGuessPublishTx!=======") fmt.Println("=======start sendGuessPublishTx!=======")
ok, txid = sendGuessPublishTx(strGameID1, "A", adminPriv) ok, txid = sendGuessPublishTx(cfg, strGameID1, "A", adminPriv)
if !ok { if !ok {
fmt.Println("sendGuessPublishTx failed.") fmt.Println("sendGuessPublishTx failed.")
} else { } else {
...@@ -532,7 +533,7 @@ func testGuessImp(t *testing.T) { ...@@ -532,7 +533,7 @@ func testGuessImp(t *testing.T) {
assert.Equal(t, true, reply.Games[0].Status == gty.GuessGameStatusPublish && reply.Games[0].BetStat.TotalBetTimes == 2) assert.Equal(t, true, reply.Games[0].Status == gty.GuessGameStatusPublish && reply.Games[0].BetStat.TotalBetTimes == 2)
fmt.Println("=======start sendGuessAbortTx!=======") fmt.Println("=======start sendGuessAbortTx!=======")
ok, txid = sendGuessAbortTx(strGameID1, adminPriv) ok, txid = sendGuessAbortTx(cfg, strGameID1, adminPriv)
if !ok { if !ok {
fmt.Println("Guess abort failed, already published.") fmt.Println("Guess abort failed, already published.")
} else { } else {
...@@ -544,7 +545,7 @@ func testGuessImp(t *testing.T) { ...@@ -544,7 +545,7 @@ func testGuessImp(t *testing.T) {
//再来一次,测试异常流程:start->abort->stop //再来一次,测试异常流程:start->abort->stop
fmt.Println("=======start sendGuessStartTx!=======") fmt.Println("=======start sendGuessStartTx!=======")
ok, gameid = sendGuessStartTx("WorldCup Final", "A:France;B:Claodia", "football", adminPriv) ok, gameid = sendGuessStartTx(cfg, "WorldCup Final", "A:France;B:Claodia", "football", adminPriv)
if !ok { if !ok {
fmt.Println("Guess start failed.") fmt.Println("Guess start failed.")
} else { } else {
...@@ -558,7 +559,7 @@ func testGuessImp(t *testing.T) { ...@@ -558,7 +559,7 @@ func testGuessImp(t *testing.T) {
assert.Equal(t, true, reply.Games[0].Status == gty.GuessGameStatusStart) assert.Equal(t, true, reply.Games[0].Status == gty.GuessGameStatusStart)
fmt.Println("=======start sendGuessAbortTx!=======") fmt.Println("=======start sendGuessAbortTx!=======")
ok, txid = sendGuessAbortTx(strGameID2, adminPriv) ok, txid = sendGuessAbortTx(cfg, strGameID2, adminPriv)
if !ok { if !ok {
fmt.Println("Guess abort failed.") fmt.Println("Guess abort failed.")
} else { } else {
...@@ -569,7 +570,7 @@ func testGuessImp(t *testing.T) { ...@@ -569,7 +570,7 @@ func testGuessImp(t *testing.T) {
assert.Equal(t, true, reply.Games[0].Status == gty.GuessGameStatusAbort) assert.Equal(t, true, reply.Games[0].Status == gty.GuessGameStatusAbort)
fmt.Println("=======start sendGuessStopTx failed!=======") fmt.Println("=======start sendGuessStopTx failed!=======")
ok, txid = sendGuessStopTx(strGameID2, adminPriv) ok, txid = sendGuessStopTx(cfg, strGameID2, adminPriv)
if !ok { if !ok {
fmt.Println("Guess stop failed,it's already aborted.") fmt.Println("Guess stop failed,it's already aborted.")
} else { } else {
...@@ -581,7 +582,7 @@ func testGuessImp(t *testing.T) { ...@@ -581,7 +582,7 @@ func testGuessImp(t *testing.T) {
//再来一次,测试流程:start->stop->abort //再来一次,测试流程:start->stop->abort
fmt.Println("=======start sendGuessStartTx!=======") fmt.Println("=======start sendGuessStartTx!=======")
ok, gameid = sendGuessStartTx("WorldCup Final", "A:France;B:Claodia", "football", adminPriv) ok, gameid = sendGuessStartTx(cfg, "WorldCup Final", "A:France;B:Claodia", "football", adminPriv)
if !ok { if !ok {
fmt.Println("Guess start failed.") fmt.Println("Guess start failed.")
} else { } else {
...@@ -594,7 +595,7 @@ func testGuessImp(t *testing.T) { ...@@ -594,7 +595,7 @@ func testGuessImp(t *testing.T) {
assert.Equal(t, true, reply.Games[0].Status == gty.GuessGameStatusStart) assert.Equal(t, true, reply.Games[0].Status == gty.GuessGameStatusStart)
fmt.Println("=======start sendGuessStopTx!=======") fmt.Println("=======start sendGuessStopTx!=======")
ok, txid = sendGuessStopTx(strGameID3, adminPriv) ok, txid = sendGuessStopTx(cfg, strGameID3, adminPriv)
if !ok { if !ok {
fmt.Println("Guess stop failed") fmt.Println("Guess stop failed")
} else { } else {
...@@ -605,7 +606,7 @@ func testGuessImp(t *testing.T) { ...@@ -605,7 +606,7 @@ func testGuessImp(t *testing.T) {
assert.Equal(t, true, reply.Games[0].Status == gty.GuessGameStatusStopBet) assert.Equal(t, true, reply.Games[0].Status == gty.GuessGameStatusStopBet)
fmt.Println("=======start sendGuessAbortTx!=======") fmt.Println("=======start sendGuessAbortTx!=======")
ok, txid = sendGuessAbortTx(strGameID3, adminPriv) ok, txid = sendGuessAbortTx(cfg, strGameID3, adminPriv)
if !ok { if !ok {
fmt.Println("Guess abort failed.") fmt.Println("Guess abort failed.")
} else { } else {
...@@ -662,25 +663,27 @@ func testGuessImp(t *testing.T) { ...@@ -662,25 +663,27 @@ func testGuessImp(t *testing.T) {
} }
func initEnvGuess() (queue.Queue, *blockchain.BlockChain, queue.Module, queue.Module, *executor.Executor, queue.Module, queue.Module) { func initEnvGuess() (queue.Queue, *blockchain.BlockChain, queue.Module, queue.Module, *executor.Executor, queue.Module, queue.Module) {
var q = queue.New("channel")
flag.Parse() flag.Parse()
cfg, sub := types.InitCfg("chain33.test.toml") chain33Cfg := types.NewChain33Config(types.ReadFile("chain33.test.toml"))
types.Init(cfg.Title, cfg) var q = queue.New("channel")
chain := blockchain.New(cfg.BlockChain) q.SetConfig(chain33Cfg)
cfg := chain33Cfg.GetModuleConfig()
sub := chain33Cfg.GetSubConfig()
chain := blockchain.New(chain33Cfg)
chain.SetQueueClient(q.Client()) chain.SetQueueClient(q.Client())
exec := executor.New(cfg.Exec, sub.Exec) exec := executor.New(chain33Cfg)
exec.SetQueueClient(q.Client()) exec.SetQueueClient(q.Client())
types.SetMinFee(0) chain33Cfg.SetMinFee(0)
s := store.New(cfg.Store, sub.Store) s := store.New(chain33Cfg)
s.SetQueueClient(q.Client()) s.SetQueueClient(q.Client())
cs := solo.New(cfg.Consensus, sub.Consensus["solo"]) cs := solo.New(cfg.Consensus, sub.Consensus["solo"])
cs.SetQueueClient(q.Client()) cs.SetQueueClient(q.Client())
mem := mempool.New(cfg.Mempool, nil) mem := mempool.New(chain33Cfg)
mem.SetQueueClient(q.Client()) mem.SetQueueClient(q.Client())
network := p2p.New(cfg.P2P) network := p2p.New(chain33Cfg)
network.SetQueueClient(q.Client()) network.SetQueueClient(q.Client())
...@@ -770,7 +773,7 @@ func NormPut() { ...@@ -770,7 +773,7 @@ func NormPut() {
} }
} }
func sendTransferTx(fromKey, to string, amount int64) bool { func sendTransferTx(cfg *types.Chain33Config, fromKey, to string, amount int64) bool {
signer := util.HexToPrivkey(fromKey) signer := util.HexToPrivkey(fromKey)
var tx *types.Transaction var tx *types.Transaction
transfer := &cty.CoinsAction{} transfer := &cty.CoinsAction{}
...@@ -779,7 +782,7 @@ func sendTransferTx(fromKey, to string, amount int64) bool { ...@@ -779,7 +782,7 @@ func sendTransferTx(fromKey, to string, amount int64) bool {
transfer.Ty = cty.CoinsActionTransfer transfer.Ty = cty.CoinsActionTransfer
execer := []byte("coins") execer := []byte("coins")
tx = &types.Transaction{Execer: execer, Payload: types.Encode(transfer), To: to, Fee: fee} tx = &types.Transaction{Execer: execer, Payload: types.Encode(transfer), To: to, Fee: fee}
tx, err := types.FormatTx(string(execer), tx) tx, err := types.FormatTx(cfg, string(execer), tx)
if err != nil { if err != nil {
fmt.Println("in sendTransferTx formatTx failed") fmt.Println("in sendTransferTx formatTx failed")
return false return false
...@@ -804,7 +807,7 @@ func sendTransferTx(fromKey, to string, amount int64) bool { ...@@ -804,7 +807,7 @@ func sendTransferTx(fromKey, to string, amount int64) bool {
return true return true
} }
func sendTransferToExecTx(fromKey, execName string, amount int64) bool { func sendTransferToExecTx(cfg *types.Chain33Config, fromKey, execName string, amount int64) bool {
signer := util.HexToPrivkey(fromKey) signer := util.HexToPrivkey(fromKey)
var tx *types.Transaction var tx *types.Transaction
transfer := &cty.CoinsAction{} transfer := &cty.CoinsAction{}
...@@ -814,7 +817,7 @@ func sendTransferToExecTx(fromKey, execName string, amount int64) bool { ...@@ -814,7 +817,7 @@ func sendTransferToExecTx(fromKey, execName string, amount int64) bool {
transfer.Ty = cty.CoinsActionTransferToExec transfer.Ty = cty.CoinsActionTransferToExec
execer := []byte("coins") execer := []byte("coins")
tx = &types.Transaction{Execer: execer, Payload: types.Encode(transfer), To: address.ExecAddress("guess"), Fee: fee} tx = &types.Transaction{Execer: execer, Payload: types.Encode(transfer), To: address.ExecAddress("guess"), Fee: fee}
tx, err := types.FormatTx(string(execer), tx) tx, err := types.FormatTx(cfg, string(execer), tx)
if err != nil { if err != nil {
fmt.Println("sendTransferToExecTx formatTx failed.") fmt.Println("sendTransferToExecTx formatTx failed.")
...@@ -841,7 +844,7 @@ func sendTransferToExecTx(fromKey, execName string, amount int64) bool { ...@@ -841,7 +844,7 @@ func sendTransferToExecTx(fromKey, execName string, amount int64) bool {
return true return true
} }
func sendGuessStartTx(topic, option, category, privKey string) (bool, []byte) { func sendGuessStartTx(cfg *types.Chain33Config, topic, option, category, privKey string) (bool, []byte) {
signer := util.HexToPrivkey(privKey) signer := util.HexToPrivkey(privKey)
var tx *types.Transaction var tx *types.Transaction
action := &gty.GuessGameAction{} action := &gty.GuessGameAction{}
...@@ -864,7 +867,7 @@ func sendGuessStartTx(topic, option, category, privKey string) (bool, []byte) { ...@@ -864,7 +867,7 @@ func sendGuessStartTx(topic, option, category, privKey string) (bool, []byte) {
action.Ty = gty.GuessGameActionStart action.Ty = gty.GuessGameActionStart
execer := []byte("guess") execer := []byte("guess")
tx = &types.Transaction{Execer: execer, Payload: types.Encode(action), To: address.ExecAddress(string(execer)), Fee: fee} tx = &types.Transaction{Execer: execer, Payload: types.Encode(action), To: address.ExecAddress(string(execer)), Fee: fee}
tx, err := types.FormatTx(string(execer), tx) tx, err := types.FormatTx(cfg, string(execer), tx)
if err != nil { if err != nil {
fmt.Println("sendGuessStartTx formatTx failed.") fmt.Println("sendGuessStartTx formatTx failed.")
...@@ -892,7 +895,7 @@ func sendGuessStartTx(topic, option, category, privKey string) (bool, []byte) { ...@@ -892,7 +895,7 @@ func sendGuessStartTx(topic, option, category, privKey string) (bool, []byte) {
return true, reply.Msg return true, reply.Msg
} }
func sendGuessBetTx(gameID, option string, betsNum int64, privKey string) (bool, []byte) { func sendGuessBetTx(cfg *types.Chain33Config, gameID, option string, betsNum int64, privKey string) (bool, []byte) {
signer := util.HexToPrivkey(privKey) signer := util.HexToPrivkey(privKey)
var tx *types.Transaction var tx *types.Transaction
action := &gty.GuessGameAction{} action := &gty.GuessGameAction{}
...@@ -909,7 +912,7 @@ func sendGuessBetTx(gameID, option string, betsNum int64, privKey string) (bool, ...@@ -909,7 +912,7 @@ func sendGuessBetTx(gameID, option string, betsNum int64, privKey string) (bool,
action.Ty = gty.GuessGameActionBet action.Ty = gty.GuessGameActionBet
execer := []byte("guess") execer := []byte("guess")
tx = &types.Transaction{Execer: execer, Payload: types.Encode(action), To: address.ExecAddress(string(execer)), Fee: fee} tx = &types.Transaction{Execer: execer, Payload: types.Encode(action), To: address.ExecAddress(string(execer)), Fee: fee}
tx, err := types.FormatTx(string(execer), tx) tx, err := types.FormatTx(cfg, string(execer), tx)
if err != nil { if err != nil {
fmt.Println("sendGuessBetTx formatTx failed.") fmt.Println("sendGuessBetTx formatTx failed.")
...@@ -937,7 +940,7 @@ func sendGuessBetTx(gameID, option string, betsNum int64, privKey string) (bool, ...@@ -937,7 +940,7 @@ func sendGuessBetTx(gameID, option string, betsNum int64, privKey string) (bool,
return true, reply.Msg return true, reply.Msg
} }
func sendGuessStopTx(gameID, privKey string) (bool, []byte) { func sendGuessStopTx(cfg *types.Chain33Config, gameID, privKey string) (bool, []byte) {
signer := util.HexToPrivkey(privKey) signer := util.HexToPrivkey(privKey)
var tx *types.Transaction var tx *types.Transaction
action := &gty.GuessGameAction{} action := &gty.GuessGameAction{}
...@@ -952,7 +955,7 @@ func sendGuessStopTx(gameID, privKey string) (bool, []byte) { ...@@ -952,7 +955,7 @@ func sendGuessStopTx(gameID, privKey string) (bool, []byte) {
action.Ty = gty.GuessGameActionStopBet action.Ty = gty.GuessGameActionStopBet
execer := []byte("guess") execer := []byte("guess")
tx = &types.Transaction{Execer: execer, Payload: types.Encode(action), To: address.ExecAddress(string(execer)), Fee: fee} tx = &types.Transaction{Execer: execer, Payload: types.Encode(action), To: address.ExecAddress(string(execer)), Fee: fee}
tx, err := types.FormatTx(string(execer), tx) tx, err := types.FormatTx(cfg, string(execer), tx)
if err != nil { if err != nil {
fmt.Println("sendGuessStopTx formatTx failed.") fmt.Println("sendGuessStopTx formatTx failed.")
...@@ -980,7 +983,7 @@ func sendGuessStopTx(gameID, privKey string) (bool, []byte) { ...@@ -980,7 +983,7 @@ func sendGuessStopTx(gameID, privKey string) (bool, []byte) {
return true, reply.Msg return true, reply.Msg
} }
func sendGuessAbortTx(gameID, privKey string) (bool, []byte) { func sendGuessAbortTx(cfg *types.Chain33Config, gameID, privKey string) (bool, []byte) {
signer := util.HexToPrivkey(privKey) signer := util.HexToPrivkey(privKey)
var tx *types.Transaction var tx *types.Transaction
action := &gty.GuessGameAction{} action := &gty.GuessGameAction{}
...@@ -995,7 +998,7 @@ func sendGuessAbortTx(gameID, privKey string) (bool, []byte) { ...@@ -995,7 +998,7 @@ func sendGuessAbortTx(gameID, privKey string) (bool, []byte) {
action.Ty = gty.GuessGameActionAbort action.Ty = gty.GuessGameActionAbort
execer := []byte("guess") execer := []byte("guess")
tx = &types.Transaction{Execer: execer, Payload: types.Encode(action), To: address.ExecAddress(string(execer)), Fee: fee} tx = &types.Transaction{Execer: execer, Payload: types.Encode(action), To: address.ExecAddress(string(execer)), Fee: fee}
tx, err := types.FormatTx(string(execer), tx) tx, err := types.FormatTx(cfg, string(execer), tx)
if err != nil { if err != nil {
fmt.Println("sendGuessAbortTx formatTx failed.") fmt.Println("sendGuessAbortTx formatTx failed.")
...@@ -1023,7 +1026,7 @@ func sendGuessAbortTx(gameID, privKey string) (bool, []byte) { ...@@ -1023,7 +1026,7 @@ func sendGuessAbortTx(gameID, privKey string) (bool, []byte) {
return true, reply.Msg return true, reply.Msg
} }
func sendGuessPublishTx(gameID, result, privKey string) (bool, []byte) { func sendGuessPublishTx(cfg *types.Chain33Config, gameID, result, privKey string) (bool, []byte) {
signer := util.HexToPrivkey(privKey) signer := util.HexToPrivkey(privKey)
var tx *types.Transaction var tx *types.Transaction
action := &gty.GuessGameAction{} action := &gty.GuessGameAction{}
...@@ -1039,7 +1042,7 @@ func sendGuessPublishTx(gameID, result, privKey string) (bool, []byte) { ...@@ -1039,7 +1042,7 @@ func sendGuessPublishTx(gameID, result, privKey string) (bool, []byte) {
action.Ty = gty.GuessGameActionPublish action.Ty = gty.GuessGameActionPublish
execer := []byte("guess") execer := []byte("guess")
tx = &types.Transaction{Execer: execer, Payload: types.Encode(action), To: address.ExecAddress(string(execer)), Fee: fee} tx = &types.Transaction{Execer: execer, Payload: types.Encode(action), To: address.ExecAddress(string(execer)), Fee: fee}
tx, err := types.FormatTx(string(execer), tx) tx, err := types.FormatTx(cfg, string(execer), tx)
if err != nil { if err != nil {
fmt.Println("sendGuessPublishTx formatTx failed.") fmt.Println("sendGuessPublishTx formatTx failed.")
......
...@@ -193,3 +193,85 @@ func TestRPC_CallTestNode(t *testing.T) { ...@@ -193,3 +193,85 @@ func TestRPC_CallTestNode(t *testing.T) {
assert.Nil(t, err) assert.Nil(t, err)
assert.Equal(t, r.IsOk, true) assert.Equal(t, r.IsOk, true)
} }
var cfgstring = `
Title="test"
[mempool]
poolCacheSize=102400
minTxFee=100000
maxTxNumPerAccount=100
[exec]
isFree=false
minExecFee=100000
enableStat=false
enableMVCC=false
[wallet]
minFee=100000
driver="leveldb"
dbPath="wallet"
dbCache=16
signType="secp256k1"
minerdisable=false
minerwhitelist=["*"]
[mver.consensus]
fundKeyAddr = "1BQXS6TxaYYG5mADaWij4AxhZZUTpw95a5"
powLimitBits = "0x1f00ffff"
maxTxNumber = 10000
[mver.consensus.ticket]
coinReward = 18
coinDevFund = 12
ticketPrice = 10000
retargetAdjustmentFactor = 4
futureBlockTime = 16
ticketFrozenTime = 5
ticketWithdrawTime = 10
ticketMinerWaitTime = 2
targetTimespan = 2304
targetTimePerBlock = 16
[mver.consensus.ticket.ForkChainParamV1]
ticketPrice = 3000
[mver.consensus.ticket.ForkChainParamV2]
ticketPrice = 6000
[fork.system]
ForkChainParamV1= 10
ForkChainParamV2= 20
ForkStateDBSet=-1
ForkCheckTxDup=0
ForkBlockHash= 1
ForkMinerTime= 10
ForkTransferExec= 100000
ForkExecKey= 200000
ForkTxGroup= 200000
ForkResetTx0= 200000
ForkWithdraw= 200000
ForkExecRollback= 450000
ForkTxHeight= -1
ForkTxGroupPara= -1
ForkCheckBlockTime=1200000
ForkMultiSignAddress=1298600
ForkBlockCheck=1
ForkLocalDBAccess=0
ForkBase58AddressCheck=1800000
ForkEnableParaRegExec=0
ForkCacheDriver=0
ForkTicketFundAddrV1=-1
[fork.sub.coins]
Enable=0
[fork.sub.manage]
Enable=0
ForkManageExec=100000
[fork.sub.store-kvmvccmavl]
ForkKvmvccmavl=1
`
\ No newline at end of file
...@@ -306,6 +306,7 @@ func (mvccs *KVMVCCStore) checkVersion(height int64) ([]*types.KeyValue, error) ...@@ -306,6 +306,7 @@ func (mvccs *KVMVCCStore) checkVersion(height int64) ([]*types.KeyValue, error)
panic(err) panic(err)
} else { } else {
maxVersion = -1 maxVersion = -1
kmlog.Error("store kvmvcc checkVersion GetMaxVersion failed", "err", err, "maxVersion", maxVersion)
} }
} }
......
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