Commit db73b524 authored by vipwzw's avatar vipwzw

Merge remote-tracking branch 'upstream/master'

parents 95acd3bf 44464808
...@@ -8,6 +8,7 @@ datadir* ...@@ -8,6 +8,7 @@ datadir*
.idea .idea
.vscode .vscode
build/chain33* build/chain33*
chain33_raft-1
build/datadir build/datadir
build/bityuan* build/bityuan*
build/para build/para
......
...@@ -9,7 +9,7 @@ jobs: ...@@ -9,7 +9,7 @@ jobs:
include: include:
- stage: check_fmt - stage: check_fmt
sudo: require sudo: require
go: "1.9.x" go: "1.11.x"
install: install:
- go get -u golang.org/x/tools/cmd/goimports - go get -u golang.org/x/tools/cmd/goimports
- go get -u gopkg.in/alecthomas/gometalinter.v2 - go get -u gopkg.in/alecthomas/gometalinter.v2
......
...@@ -13,7 +13,6 @@ CHAIN33_PATH=vendor/${CHAIN33} ...@@ -13,7 +13,6 @@ CHAIN33_PATH=vendor/${CHAIN33}
LDFLAGS := -ldflags "-w -s" LDFLAGS := -ldflags "-w -s"
PKG_LIST_VET := `go list ./... | grep -v "vendor" | grep -v plugin/dapp/evm/executor/vm/common/crypto/bn256` PKG_LIST_VET := `go list ./... | grep -v "vendor" | grep -v plugin/dapp/evm/executor/vm/common/crypto/bn256`
PKG_LIST := `go list ./... | grep -v "vendor" | grep -v "chain33/test" | grep -v "mocks" | grep -v "pbft"` PKG_LIST := `go list ./... | grep -v "vendor" | grep -v "chain33/test" | grep -v "mocks" | grep -v "pbft"`
PKG_LIST_Q := `go list ./... | grep -v "vendor" | grep -v "chain33/test" | grep -v "mocks" | grep -v "blockchain" | grep -v "pbft"`
BUILD_FLAGS = -ldflags "-X github.com/33cn/chain33/common/version.GitCommit=`git rev-parse --short=8 HEAD`" BUILD_FLAGS = -ldflags "-X github.com/33cn/chain33/common/version.GitCommit=`git rev-parse --short=8 HEAD`"
MKPATH=$(abspath $(lastword $(MAKEFILE_LIST))) MKPATH=$(abspath $(lastword $(MAKEFILE_LIST)))
MKDIR=$(dir $(MKPATH)) MKDIR=$(dir $(MKPATH))
...@@ -88,13 +87,16 @@ race: ## Run data race detector ...@@ -88,13 +87,16 @@ race: ## Run data race detector
test: ## Run unittests test: ## Run unittests
@go test -race $(PKG_LIST) @go test -race $(PKG_LIST)
testq: ## Run unittests
@go test $(PKG_LIST)
fmt: fmt_proto fmt_shell ## go fmt fmt: fmt_proto fmt_shell ## go fmt
@go fmt ./... @go fmt ./...
@find . -name '*.go' -not -path "./vendor/*" | xargs goimports -l -w @find . -name '*.go' -not -path "./vendor/*" | xargs goimports -l -w
.PHONY: fmt_proto fmt_shell .PHONY: fmt_proto fmt_shell
fmt_proto: ## go fmt protobuf file fmt_proto: ## go fmt protobuf file
@find . -name '*.proto' -not -path "./vendor/*" | xargs clang-format -i #@find . -name '*.proto' -not -path "./vendor/*" | xargs clang-format -i
fmt_shell: ## check shell file fmt_shell: ## check shell file
@find . -name '*.sh' -not -path "./vendor/*" | xargs shfmt -w -s -i 4 -ci -bn @find . -name '*.sh' -not -path "./vendor/*" | xargs shfmt -w -s -i 4 -ci -bn
...@@ -174,15 +176,6 @@ checkgofmt: ## get all go files and run go fmt on them ...@@ -174,15 +176,6 @@ checkgofmt: ## get all go files and run go fmt on them
exit 1; \ exit 1; \
fi; fi;
.PHONY: mock
mock:
@cd client && mockery -name=QueueProtocolAPI && mv mocks/QueueProtocolAPI.go mocks/api.go && cd -
@cd queue && mockery -name=Client && mv mocks/Client.go mocks/client.go && cd -
@cd common/db && mockery -name=KV && mv mocks/KV.go mocks/kv.go && cd -
@cd common/db && mockery -name=KVDB && mv mocks/KVDB.go mocks/kvdb.go && cd -
@cd types/ && mockery -name=Chain33Client && mv mocks/Chain33Client.go mocks/chain33client.go && cd -
.PHONY: auto_ci_before auto_ci_after auto_ci .PHONY: auto_ci_before auto_ci_after auto_ci
auto_ci_before: clean fmt protobuf auto_ci_before: clean fmt protobuf
@echo "auto_ci" @echo "auto_ci"
...@@ -266,7 +259,7 @@ pullpush: ...@@ -266,7 +259,7 @@ pullpush:
make pullsync make pullsync
git push ${name} ${name}-${b}:${b} git push ${name} ${name}-${b}:${b}
webhook_auto_ci: clean fmt_proto fmt_shell protobuf mock webhook_auto_ci: clean fmt_proto fmt_shell protobuf
@-find . -name '*.go' -not -path './vendor/*' | xargs gofmt -l -w -s @-find . -name '*.go' -not -path './vendor/*' | xargs gofmt -l -w -s
@-${auto_fmt} @-${auto_fmt}
@-find . -name '*.go' -not -path './vendor/*' | xargs gofmt -l -w -s @-find . -name '*.go' -not -path './vendor/*' | xargs gofmt -l -w -s
......
...@@ -149,7 +149,7 @@ func prepareTxList() *types.Transaction { ...@@ -149,7 +149,7 @@ func prepareTxList() *types.Transaction {
key = generateKey(i, 32) key = generateKey(i, 32)
value = generateValue(i, 180) value = generateValue(i, 180)
nput := &pty.NormAction_Nput{Nput: &pty.NormPut{Key: key, Value: []byte(value)}} nput := &pty.NormAction_Nput{Nput: &pty.NormPut{Key: []byte(key), Value: []byte(value)}}
action := &pty.NormAction{Value: nput, Ty: pty.NormActionPut} action := &pty.NormAction{Value: nput, Ty: pty.NormActionPut}
tx := &types.Transaction{Execer: []byte("norm"), Payload: types.Encode(action), Fee: 0} tx := &types.Transaction{Execer: []byte("norm"), Payload: types.Encode(action), Fee: 0}
tx.To = address.ExecAddress("norm") tx.To = address.ExecAddress("norm")
......
...@@ -330,7 +330,7 @@ func RandStringBytes(n int) string { ...@@ -330,7 +330,7 @@ func RandStringBytes(n int) string {
// NormPut run put action // NormPut run put action
func NormPut(privkey string, key string, value string) { func NormPut(privkey string, key string, value string) {
fmt.Println(key, "=", value) fmt.Println(key, "=", value)
nput := &pty.NormAction_Nput{Nput: &pty.NormPut{Key: key, Value: []byte(value)}} nput := &pty.NormAction_Nput{Nput: &pty.NormPut{Key: []byte(key), Value: []byte(value)}}
action := &pty.NormAction{Value: nput, Ty: pty.NormActionPut} action := &pty.NormAction{Value: nput, Ty: pty.NormActionPut}
tx := &types.Transaction{Execer: []byte("norm"), Payload: types.Encode(action), Fee: fee} tx := &types.Transaction{Execer: []byte("norm"), Payload: types.Encode(action), Fee: fee}
tx.To = address.ExecAddress("norm") tx.To = address.ExecAddress("norm")
...@@ -350,7 +350,7 @@ func NormPut(privkey string, key string, value string) { ...@@ -350,7 +350,7 @@ func NormPut(privkey string, key string, value string) {
// NormGet run query action // NormGet run query action
func NormGet(key string) { func NormGet(key string) {
in := &pty.NormGetKey{Key: key} in := &pty.NormGetKey{Key: []byte(key)}
data, err := proto.Marshal(in) data, err := proto.Marshal(in)
if err != nil { if err != nil {
fmt.Fprintln(os.Stderr, err) fmt.Fprintln(os.Stderr, err)
......
...@@ -147,7 +147,7 @@ func prepareTxList() *types.Transaction { ...@@ -147,7 +147,7 @@ func prepareTxList() *types.Transaction {
key = generateKey(i, 32) key = generateKey(i, 32)
value = generateValue(i, 180) value = generateValue(i, 180)
nput := &pty.NormAction_Nput{Nput: &pty.NormPut{Key: key, Value: []byte(value)}} nput := &pty.NormAction_Nput{Nput: &pty.NormPut{Key: []byte(key), Value: []byte(value)}}
action := &pty.NormAction{Value: nput, Ty: pty.NormActionPut} action := &pty.NormAction{Value: nput, Ty: pty.NormActionPut}
tx := &types.Transaction{Execer: []byte("norm"), Payload: types.Encode(action), Fee: fee} tx := &types.Transaction{Execer: []byte("norm"), Payload: types.Encode(action), Fee: fee}
tx.To = address.ExecAddress("norm") tx.To = address.ExecAddress("norm")
......
...@@ -59,12 +59,12 @@ var ( ...@@ -59,12 +59,12 @@ var (
"TimeoutDone": BlackwhiteActionTimeoutDone, "TimeoutDone": BlackwhiteActionTimeoutDone,
} }
logInfo = map[int64]*types.LogInfo{ logInfo = map[int64]*types.LogInfo{
TyLogBlackwhiteCreate: {reflect.TypeOf(ReceiptBlackwhite{}), "LogBlackwhiteCreate"}, TyLogBlackwhiteCreate: {Ty: reflect.TypeOf(ReceiptBlackwhite{}), Name: "LogBlackwhiteCreate"},
TyLogBlackwhitePlay: {reflect.TypeOf(ReceiptBlackwhite{}), "LogBlackwhitePlay"}, TyLogBlackwhitePlay: {Ty: reflect.TypeOf(ReceiptBlackwhite{}), Name: "LogBlackwhitePlay"},
TyLogBlackwhiteShow: {reflect.TypeOf(ReceiptBlackwhite{}), "LogBlackwhiteShow"}, TyLogBlackwhiteShow: {Ty: reflect.TypeOf(ReceiptBlackwhite{}), Name: "LogBlackwhiteShow"},
TyLogBlackwhiteTimeout: {reflect.TypeOf(ReceiptBlackwhite{}), "LogBlackwhiteTimeout"}, TyLogBlackwhiteTimeout: {Ty: reflect.TypeOf(ReceiptBlackwhite{}), Name: "LogBlackwhiteTimeout"},
TyLogBlackwhiteDone: {reflect.TypeOf(ReceiptBlackwhite{}), "LogBlackwhiteDone"}, TyLogBlackwhiteDone: {Ty: reflect.TypeOf(ReceiptBlackwhite{}), Name: "LogBlackwhiteDone"},
TyLogBlackwhiteLoopInfo: {reflect.TypeOf(ReplyLoopResults{}), "LogBlackwhiteLoopInfo"}, TyLogBlackwhiteLoopInfo: {Ty: reflect.TypeOf(ReplyLoopResults{}), Name: "LogBlackwhiteLoopInfo"},
} }
) )
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -45,10 +45,10 @@ type GameType struct { ...@@ -45,10 +45,10 @@ type GameType struct {
// GetLogMap get log // GetLogMap get log
func (gt *GameType) GetLogMap() map[int64]*types.LogInfo { func (gt *GameType) GetLogMap() map[int64]*types.LogInfo {
return map[int64]*types.LogInfo{ return map[int64]*types.LogInfo{
TyLogCreateGame: {reflect.TypeOf(ReceiptGame{}), "LogCreateGame"}, TyLogCreateGame: {Ty: reflect.TypeOf(ReceiptGame{}), Name: "LogCreateGame"},
TyLogCancleGame: {reflect.TypeOf(ReceiptGame{}), "LogCancleGame"}, TyLogCancleGame: {Ty: reflect.TypeOf(ReceiptGame{}), Name: "LogCancleGame"},
TyLogMatchGame: {reflect.TypeOf(ReceiptGame{}), "LogMatchGame"}, TyLogMatchGame: {Ty: reflect.TypeOf(ReceiptGame{}), Name: "LogMatchGame"},
TyLogCloseGame: {reflect.TypeOf(ReceiptGame{}), "LogCloseGame"}, TyLogCloseGame: {Ty: reflect.TypeOf(ReceiptGame{}), Name: "LogCloseGame"},
} }
} }
......
This diff is collapsed.
...@@ -38,10 +38,10 @@ func NewType() *LotteryType { ...@@ -38,10 +38,10 @@ func NewType() *LotteryType {
// GetLogMap method // GetLogMap method
func (lottery *LotteryType) GetLogMap() map[int64]*types.LogInfo { func (lottery *LotteryType) GetLogMap() map[int64]*types.LogInfo {
return map[int64]*types.LogInfo{ return map[int64]*types.LogInfo{
TyLogLotteryCreate: {reflect.TypeOf(ReceiptLottery{}), "LogLotteryCreate"}, TyLogLotteryCreate: {Ty: reflect.TypeOf(ReceiptLottery{}), Name: "LogLotteryCreate"},
TyLogLotteryBuy: {reflect.TypeOf(ReceiptLottery{}), "LogLotteryBuy"}, TyLogLotteryBuy: {Ty: reflect.TypeOf(ReceiptLottery{}), Name: "LogLotteryBuy"},
TyLogLotteryDraw: {reflect.TypeOf(ReceiptLottery{}), "LogLotteryDraw"}, TyLogLotteryDraw: {Ty: reflect.TypeOf(ReceiptLottery{}), Name: "LogLotteryDraw"},
TyLogLotteryClose: {reflect.TypeOf(ReceiptLottery{}), "LogLotteryClose"}, TyLogLotteryClose: {Ty: reflect.TypeOf(ReceiptLottery{}), Name: "LogLotteryClose"},
} }
} }
......
This diff is collapsed.
...@@ -53,7 +53,7 @@ func (n *Norm) CheckTx(tx *types.Transaction, index int) error { ...@@ -53,7 +53,7 @@ func (n *Norm) CheckTx(tx *types.Transaction, index int) error {
} }
// Key for norm // Key for norm
func Key(str string) (key []byte) { func Key(str []byte) (key []byte) {
key = append(key, []byte("mavl-norm-")...) key = append(key, []byte("mavl-norm-")...)
key = append(key, str...) key = append(key, str...)
return key return key
......
...@@ -4,7 +4,7 @@ package types; ...@@ -4,7 +4,7 @@ package types;
message Norm { message Norm {
bytes normId = 1; bytes normId = 1;
int64 createTime = 2; int64 createTime = 2;
string key = 3; bytes key = 3;
bytes value = 4; bytes value = 4;
} }
...@@ -16,10 +16,10 @@ message NormAction { ...@@ -16,10 +16,10 @@ message NormAction {
} }
message NormPut { message NormPut {
string key = 1; bytes key = 1;
bytes value = 2; bytes value = 2;
} }
message NormGetKey { message NormGetKey {
string key = 1; bytes key = 1;
} }
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
...@@ -16,25 +16,6 @@ var ( ...@@ -16,25 +16,6 @@ var (
// ParaX paracross exec name // ParaX paracross exec name
ParaX = "paracross" ParaX = "paracross"
glog = log.New("module", ParaX) glog = log.New("module", ParaX)
/*
logInfo = map[int64]*types.LogInfo{
TyLogParacrossCommit: {reflect.TypeOf(ReceiptParacrossCommit{}), "LogParacrossCommit"},
TyLogParacrossCommitDone: {reflect.TypeOf(ReceiptParacrossDone{}), "LogParacrossDone"},
TyLogParacrossCommitRecord: {reflect.TypeOf(ReceiptParacrossRecord{}), "LogParacrossCommitRecord"},
TyLogParaAssetTransfer: {reflect.TypeOf(types.ReceiptAccountTransfer{}), "LogParacrossAssetTransfer"},
TyLogParaAssetWithdraw: {reflect.TypeOf(types.ReceiptAccountTransfer{}), "LogParacrossAssetWithdraw"},
TyLogParacrossMiner: {reflect.TypeOf(ReceiptParacrossMiner{}), "LogParacrossMiner"},
TyLogParaAssetDeposit: {reflect.TypeOf(types.ReceiptAccountTransfer{}), "LogParacrossAssetDeposit"},
}*/
// init query rpc
/* TODO-TODO
types.RegisterRPCQueryHandle("ParacrossGetTitle", &ParacrossGetTitle{})
types.RegisterRPCQueryHandle("paracrossListTitles", &paracrossListTitles{})
types.RegisterRPCQueryHandle("paracrossGetTitleHeight", &paracrossGetTitleHeight{})
types.RegisterRPCQueryHandle("paracrossGetAssetTxResult", &paracrossGetAssetTxResult{})
*/
) )
func init() { func init() {
...@@ -64,13 +45,13 @@ func NewType() *ParacrossType { ...@@ -64,13 +45,13 @@ func NewType() *ParacrossType {
// GetLogMap get receipt log map // GetLogMap get receipt log map
func (p *ParacrossType) GetLogMap() map[int64]*types.LogInfo { func (p *ParacrossType) GetLogMap() map[int64]*types.LogInfo {
return map[int64]*types.LogInfo{ return map[int64]*types.LogInfo{
TyLogParacrossCommit: {reflect.TypeOf(ReceiptParacrossCommit{}), "LogParacrossCommit"}, TyLogParacrossCommit: {Ty: reflect.TypeOf(ReceiptParacrossCommit{}), Name: "LogParacrossCommit"},
TyLogParacrossCommitDone: {reflect.TypeOf(ReceiptParacrossDone{}), "LogParacrossCommitDone"}, TyLogParacrossCommitDone: {Ty: reflect.TypeOf(ReceiptParacrossDone{}), Name: "LogParacrossCommitDone"},
TyLogParacrossCommitRecord: {reflect.TypeOf(ReceiptParacrossRecord{}), "LogParacrossCommitRecord"}, TyLogParacrossCommitRecord: {Ty: reflect.TypeOf(ReceiptParacrossRecord{}), Name: "LogParacrossCommitRecord"},
TyLogParaAssetWithdraw: {reflect.TypeOf(types.ReceiptAccountTransfer{}), "LogParaAssetWithdraw"}, TyLogParaAssetWithdraw: {Ty: reflect.TypeOf(types.ReceiptAccountTransfer{}), Name: "LogParaAssetWithdraw"},
TyLogParaAssetTransfer: {reflect.TypeOf(types.ReceiptAccountTransfer{}), "LogParaAssetTransfer"}, TyLogParaAssetTransfer: {Ty: reflect.TypeOf(types.ReceiptAccountTransfer{}), Name: "LogParaAssetTransfer"},
TyLogParaAssetDeposit: {reflect.TypeOf(types.ReceiptAccountTransfer{}), "LogParaAssetDeposit"}, TyLogParaAssetDeposit: {Ty: reflect.TypeOf(types.ReceiptAccountTransfer{}), Name: "LogParaAssetDeposit"},
TyLogParacrossMiner: {reflect.TypeOf(ReceiptParacrossMiner{}), "LogParacrossMiner"}, TyLogParacrossMiner: {Ty: reflect.TypeOf(ReceiptParacrossMiner{}), Name: "LogParacrossMiner"},
} }
} }
......
This diff is collapsed.
...@@ -47,9 +47,9 @@ func (t *PokerBullType) GetTypeMap() map[string]int32 { ...@@ -47,9 +47,9 @@ func (t *PokerBullType) GetTypeMap() map[string]int32 {
// GetLogMap 获取日志map // GetLogMap 获取日志map
func (t *PokerBullType) GetLogMap() map[int64]*types.LogInfo { func (t *PokerBullType) GetLogMap() map[int64]*types.LogInfo {
return map[int64]*types.LogInfo{ return map[int64]*types.LogInfo{
TyLogPBGameStart: {reflect.TypeOf(ReceiptPBGame{}), "TyLogPBGameStart"}, TyLogPBGameStart: {Ty: reflect.TypeOf(ReceiptPBGame{}), Name: "TyLogPBGameStart"},
TyLogPBGameContinue: {reflect.TypeOf(ReceiptPBGame{}), "TyLogPBGameContinue"}, TyLogPBGameContinue: {Ty: reflect.TypeOf(ReceiptPBGame{}), Name: "TyLogPBGameContinue"},
TyLogPBGameQuit: {reflect.TypeOf(ReceiptPBGame{}), "TyLogPBGameQuit"}, TyLogPBGameQuit: {Ty: reflect.TypeOf(ReceiptPBGame{}), Name: "TyLogPBGameQuit"},
TyLogPBGameQuery: {reflect.TypeOf(ReceiptPBGame{}), "TyLogPBGameQuery"}, TyLogPBGameQuery: {Ty: reflect.TypeOf(ReceiptPBGame{}), Name: "TyLogPBGameQuery"},
} }
} }
...@@ -105,9 +105,9 @@ func (t *PrivacyType) GetName() string { ...@@ -105,9 +105,9 @@ func (t *PrivacyType) GetName() string {
// GetLogMap get PrivacyType log map // GetLogMap get PrivacyType log map
func (t *PrivacyType) GetLogMap() map[int64]*types.LogInfo { func (t *PrivacyType) GetLogMap() map[int64]*types.LogInfo {
return map[int64]*types.LogInfo{ return map[int64]*types.LogInfo{
TyLogPrivacyFee: {reflect.TypeOf(types.ReceiptExecAccountTransfer{}), "LogPrivacyFee"}, TyLogPrivacyFee: {Ty: reflect.TypeOf(types.ReceiptExecAccountTransfer{}), Name: "LogPrivacyFee"},
TyLogPrivacyInput: {reflect.TypeOf(PrivacyInput{}), "LogPrivacyInput"}, TyLogPrivacyInput: {Ty: reflect.TypeOf(PrivacyInput{}), Name: "LogPrivacyInput"},
TyLogPrivacyOutput: {reflect.TypeOf(PrivacyOutput{}), "LogPrivacyOutput"}, TyLogPrivacyOutput: {Ty: reflect.TypeOf(PrivacyOutput{}), Name: "LogPrivacyOutput"},
} }
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -234,7 +234,7 @@ func testStore_listFrozenUTXOs(t *testing.T) { ...@@ -234,7 +234,7 @@ func testStore_listFrozenUTXOs(t *testing.T) {
txs, err = store.listFrozenUTXOs(token, addr) txs, err = store.listFrozenUTXOs(token, addr)
assert.NoError(t, err) assert.NoError(t, err)
assert.Equal(t, 1, len(txs)) assert.Equal(t, 1, len(txs))
assert.Equal(t, tx, txs[0]) assert.Equal(t, true, proto.Equal(tx, txs[0]))
} }
func testStore_listAvailableUTXOs(t *testing.T) { func testStore_listAvailableUTXOs(t *testing.T) {
...@@ -260,7 +260,7 @@ func testStore_listAvailableUTXOs(t *testing.T) { ...@@ -260,7 +260,7 @@ func testStore_listAvailableUTXOs(t *testing.T) {
utxos, err = store.listAvailableUTXOs(token, addr) utxos, err = store.listAvailableUTXOs(token, addr)
assert.NoError(t, err) assert.NoError(t, err)
assert.Equal(t, 1, len(utxos)) assert.Equal(t, 1, len(utxos))
assert.Equal(t, utxo, utxos[0]) assert.Equal(t, true, proto.Equal(utxo, utxos[0]))
} }
func testStore_setWalletAccountPrivacy(t *testing.T) { func testStore_setWalletAccountPrivacy(t *testing.T) {
...@@ -291,7 +291,7 @@ func testStore_getAccountByAddr(t *testing.T) { ...@@ -291,7 +291,7 @@ func testStore_getAccountByAddr(t *testing.T) {
assert.NoError(t, err) assert.NoError(t, err)
err = store.Set(calcAddrKey(addr), bt) err = store.Set(calcAddrKey(addr), bt)
was, err = store.getAccountByAddr(addr) was, err = store.getAccountByAddr(addr)
assert.Equal(t, was, account) assert.Equal(t, true, proto.Equal(was, account))
assert.NoError(t, err) assert.NoError(t, err)
} }
...@@ -325,7 +325,7 @@ func testStore_getAccountByPrefix(t *testing.T) { ...@@ -325,7 +325,7 @@ func testStore_getAccountByPrefix(t *testing.T) {
assert.NoError(t, err) assert.NoError(t, err)
was, err = store.getAccountByAddr(addr) was, err = store.getAccountByAddr(addr)
assert.NoError(t, err) assert.NoError(t, err)
assert.Equal(t, was, account) assert.Equal(t, true, proto.Equal(was, account))
} }
func testStore_setVersion(t *testing.T) { func testStore_setVersion(t *testing.T) {
......
...@@ -14,6 +14,7 @@ import ( ...@@ -14,6 +14,7 @@ import (
"github.com/33cn/chain33/common/db/mocks" "github.com/33cn/chain33/common/db/mocks"
"github.com/33cn/chain33/types" "github.com/33cn/chain33/types"
ty "github.com/33cn/plugin/plugin/dapp/relay/types" ty "github.com/33cn/plugin/plugin/dapp/relay/types"
"github.com/gogo/protobuf/proto"
"github.com/stretchr/testify/mock" "github.com/stretchr/testify/mock"
"github.com/stretchr/testify/suite" "github.com/stretchr/testify/suite"
) )
...@@ -1197,8 +1198,10 @@ func (s *suiteSaveBtcHeader) TestSaveBtcHeader_1() { ...@@ -1197,8 +1198,10 @@ func (s *suiteSaveBtcHeader) TestSaveBtcHeader_1() {
s.Zero(log.LastBaseHeight) s.Zero(log.LastBaseHeight)
s.Equal(head2.Height, log.NewHeight) s.Equal(head2.Height, log.NewHeight)
s.Zero(log.NewBaseHeight) s.Zero(log.NewBaseHeight)
s.Equal(headers.BtcHeader, log.Headers) s.Equal(len(headers.BtcHeader), len(log.Headers))
for i, h := range headers.BtcHeader {
s.Equal(true, proto.Equal(h, log.Headers[i]))
}
} }
//not continuous //not continuous
...@@ -1325,8 +1328,10 @@ func (s *suiteSaveBtcHeader) TestSaveBtcHeader_4() { ...@@ -1325,8 +1328,10 @@ func (s *suiteSaveBtcHeader) TestSaveBtcHeader_4() {
s.Zero(log.LastBaseHeight) s.Zero(log.LastBaseHeight)
s.Equal(head5.Height, log.NewHeight) s.Equal(head5.Height, log.NewHeight)
s.Equal(head4.Height, log.NewBaseHeight) s.Equal(head4.Height, log.NewBaseHeight)
s.Equal(headers.BtcHeader, log.Headers) s.Equal(len(headers.BtcHeader), len(log.Headers))
for i, h := range headers.BtcHeader {
s.Equal(true, proto.Equal(h, log.Headers[i]))
}
} }
func TestRunSuiteSaveBtcHeader(t *testing.T) { func TestRunSuiteSaveBtcHeader(t *testing.T) {
......
...@@ -86,13 +86,13 @@ func (r *RelayType) GetName() string { ...@@ -86,13 +86,13 @@ func (r *RelayType) GetName() string {
// GetLogMap return receipt log map function // GetLogMap return receipt log map function
func (r *RelayType) GetLogMap() map[int64]*types.LogInfo { func (r *RelayType) GetLogMap() map[int64]*types.LogInfo {
return map[int64]*types.LogInfo{ return map[int64]*types.LogInfo{
TyLogRelayCreate: {reflect.TypeOf(ReceiptRelayLog{}), "LogRelayCreate"}, TyLogRelayCreate: {Ty: reflect.TypeOf(ReceiptRelayLog{}), Name: "LogRelayCreate"},
TyLogRelayRevokeCreate: {reflect.TypeOf(ReceiptRelayLog{}), "LogRelayRevokeCreate"}, TyLogRelayRevokeCreate: {Ty: reflect.TypeOf(ReceiptRelayLog{}), Name: "LogRelayRevokeCreate"},
TyLogRelayAccept: {reflect.TypeOf(ReceiptRelayLog{}), "LogRelayAccept"}, TyLogRelayAccept: {Ty: reflect.TypeOf(ReceiptRelayLog{}), Name: "LogRelayAccept"},
TyLogRelayRevokeAccept: {reflect.TypeOf(ReceiptRelayLog{}), "LogRelayRevokeAccept"}, TyLogRelayRevokeAccept: {Ty: reflect.TypeOf(ReceiptRelayLog{}), Name: "LogRelayRevokeAccept"},
TyLogRelayConfirmTx: {reflect.TypeOf(ReceiptRelayLog{}), "LogRelayConfirmTx"}, TyLogRelayConfirmTx: {Ty: reflect.TypeOf(ReceiptRelayLog{}), Name: "LogRelayConfirmTx"},
TyLogRelayFinishTx: {reflect.TypeOf(ReceiptRelayLog{}), "LogRelayFinishTx"}, TyLogRelayFinishTx: {Ty: reflect.TypeOf(ReceiptRelayLog{}), Name: "LogRelayFinishTx"},
TyLogRelayRcvBTCHead: {reflect.TypeOf(ReceiptRelayRcvBTCHeaders{}), "LogRelayRcvBTCHead"}, TyLogRelayRcvBTCHead: {Ty: reflect.TypeOf(ReceiptRelayRcvBTCHeaders{}), Name: "LogRelayRcvBTCHead"},
} }
} }
......
This diff is collapsed.
This diff is collapsed.
...@@ -148,7 +148,7 @@ func TestRPC_CallTestNode(t *testing.T) { ...@@ -148,7 +148,7 @@ func TestRPC_CallTestNode(t *testing.T) {
var result = "" var result = ""
err = jsonClient.Call("Chain33.Version", nil, &result) err = jsonClient.Call("Chain33.Version", nil, &result)
assert.Nil(t, err) assert.Nil(t, err)
assert.Equal(t, "5.3.0", result) assert.Equal(t, "6.0.1", result)
var isSnyc bool var isSnyc bool
err = jsonClient.Call("Chain33.IsSync", &types.ReqNil{}, &isSnyc) err = jsonClient.Call("Chain33.IsSync", &types.ReqNil{}, &isSnyc)
......
...@@ -82,10 +82,10 @@ func (ticket *TicketType) GetPayload() types.Message { ...@@ -82,10 +82,10 @@ func (ticket *TicketType) GetPayload() types.Message {
// GetLogMap get log map // GetLogMap get log map
func (ticket *TicketType) GetLogMap() map[int64]*types.LogInfo { func (ticket *TicketType) GetLogMap() map[int64]*types.LogInfo {
return map[int64]*types.LogInfo{ return map[int64]*types.LogInfo{
TyLogNewTicket: {reflect.TypeOf(ReceiptTicket{}), "LogNewTicket"}, TyLogNewTicket: {Ty: reflect.TypeOf(ReceiptTicket{}), Name: "LogNewTicket"},
TyLogCloseTicket: {reflect.TypeOf(ReceiptTicket{}), "LogCloseTicket"}, TyLogCloseTicket: {Ty: reflect.TypeOf(ReceiptTicket{}), Name: "LogCloseTicket"},
TyLogMinerTicket: {reflect.TypeOf(ReceiptTicket{}), "LogMinerTicket"}, TyLogMinerTicket: {Ty: reflect.TypeOf(ReceiptTicket{}), Name: "LogMinerTicket"},
TyLogTicketBind: {reflect.TypeOf(ReceiptTicketBind{}), "LogTicketBind"}, TyLogTicketBind: {Ty: reflect.TypeOf(ReceiptTicketBind{}), Name: "LogTicketBind"},
} }
} }
......
This diff is collapsed.
...@@ -121,10 +121,8 @@ func TestProtoNewEncodeOldDecode(t *testing.T) { ...@@ -121,10 +121,8 @@ func TestProtoNewEncodeOldDecode(t *testing.T) {
told := &TicketMinerOld{} told := &TicketMinerOld{}
err := types.Decode(data, told) err := types.Decode(data, told)
assert.Nil(t, err) assert.Nil(t, err)
assert.Equal(t, &TicketMinerOld{ assert.Equal(t, told.Bits, uint32(1))
Bits: 1, assert.Equal(t, told.Reward, int64(1))
Reward: 1, assert.Equal(t, told.TicketId, "id")
TicketId: "id", assert.Equal(t, told.Modify, []byte("modify"))
Modify: []byte("modify"),
}, told)
} }
...@@ -73,7 +73,7 @@ func main() { ...@@ -73,7 +73,7 @@ func main() {
panic(err) panic(err)
} }
approver := signatory.Signatory{cfg.Privkey} approver := signatory.Signatory{Privkey: cfg.Privkey}
server := rpc.NewServer() server := rpc.NewServer()
server.Register(&approver) server.Register(&approver)
......
This diff is collapsed.
...@@ -52,18 +52,18 @@ func (t *TokenType) GetTypeMap() map[string]int32 { ...@@ -52,18 +52,18 @@ func (t *TokenType) GetTypeMap() map[string]int32 {
// GetLogMap 获取log的映射对应关系 // GetLogMap 获取log的映射对应关系
func (t *TokenType) GetLogMap() map[int64]*types.LogInfo { func (t *TokenType) GetLogMap() map[int64]*types.LogInfo {
return map[int64]*types.LogInfo{ return map[int64]*types.LogInfo{
TyLogTokenTransfer: {reflect.TypeOf(types.ReceiptAccountTransfer{}), "LogTokenTransfer"}, TyLogTokenTransfer: {Ty: reflect.TypeOf(types.ReceiptAccountTransfer{}), Name: "LogTokenTransfer"},
TyLogTokenDeposit: {reflect.TypeOf(types.ReceiptAccountTransfer{}), "LogTokenDeposit"}, TyLogTokenDeposit: {Ty: reflect.TypeOf(types.ReceiptAccountTransfer{}), Name: "LogTokenDeposit"},
TyLogTokenExecTransfer: {reflect.TypeOf(types.ReceiptExecAccountTransfer{}), "LogTokenExecTransfer"}, TyLogTokenExecTransfer: {Ty: reflect.TypeOf(types.ReceiptExecAccountTransfer{}), Name: "LogTokenExecTransfer"},
TyLogTokenExecWithdraw: {reflect.TypeOf(types.ReceiptExecAccountTransfer{}), "LogTokenExecWithdraw"}, TyLogTokenExecWithdraw: {Ty: reflect.TypeOf(types.ReceiptExecAccountTransfer{}), Name: "LogTokenExecWithdraw"},
TyLogTokenExecDeposit: {reflect.TypeOf(types.ReceiptExecAccountTransfer{}), "LogTokenExecDeposit"}, TyLogTokenExecDeposit: {Ty: reflect.TypeOf(types.ReceiptExecAccountTransfer{}), Name: "LogTokenExecDeposit"},
TyLogTokenExecFrozen: {reflect.TypeOf(types.ReceiptExecAccountTransfer{}), "LogTokenExecFrozen"}, TyLogTokenExecFrozen: {Ty: reflect.TypeOf(types.ReceiptExecAccountTransfer{}), Name: "LogTokenExecFrozen"},
TyLogTokenExecActive: {reflect.TypeOf(types.ReceiptExecAccountTransfer{}), "LogTokenExecActive"}, TyLogTokenExecActive: {Ty: reflect.TypeOf(types.ReceiptExecAccountTransfer{}), Name: "LogTokenExecActive"},
TyLogTokenGenesisTransfer: {reflect.TypeOf(types.ReceiptAccountTransfer{}), "LogTokenGenesisTransfer"}, TyLogTokenGenesisTransfer: {Ty: reflect.TypeOf(types.ReceiptAccountTransfer{}), Name: "LogTokenGenesisTransfer"},
TyLogTokenGenesisDeposit: {reflect.TypeOf(types.ReceiptExecAccountTransfer{}), "LogTokenGenesisDeposit"}, TyLogTokenGenesisDeposit: {Ty: reflect.TypeOf(types.ReceiptExecAccountTransfer{}), Name: "LogTokenGenesisDeposit"},
TyLogPreCreateToken: {reflect.TypeOf(ReceiptToken{}), "LogPreCreateToken"}, TyLogPreCreateToken: {Ty: reflect.TypeOf(ReceiptToken{}), Name: "LogPreCreateToken"},
TyLogFinishCreateToken: {reflect.TypeOf(ReceiptToken{}), "LogFinishCreateToken"}, TyLogFinishCreateToken: {Ty: reflect.TypeOf(ReceiptToken{}), Name: "LogFinishCreateToken"},
TyLogRevokeCreateToken: {reflect.TypeOf(ReceiptToken{}), "LogRevokeCreateToken"}, TyLogRevokeCreateToken: {Ty: reflect.TypeOf(ReceiptToken{}), Name: "LogRevokeCreateToken"},
} }
} }
......
// 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 types
import (
"encoding/json"
)
// RPCReplyTradeOrder : trade order
type RPCReplyTradeOrder struct {
TokenSymbol string `protobuf:"bytes,1,opt,name=tokenSymbol" json:"tokenSymbol"`
Owner string `protobuf:"bytes,2,opt,name=owner" json:"owner"`
AmountPerBoardlot int64 `protobuf:"varint,3,opt,name=amountPerBoardlot" json:"amountPerBoardlot"`
MinBoardlot int64 `protobuf:"varint,4,opt,name=minBoardlot" json:"minBoardlot"`
PricePerBoardlot int64 `protobuf:"varint,5,opt,name=pricePerBoardlot" json:"pricePerBoardlot"`
TotalBoardlot int64 `protobuf:"varint,6,opt,name=totalBoardlot" json:"totalBoardlot"`
TradedBoardlot int64 `protobuf:"varint,7,opt,name=tradedBoardlot" json:"tradedBoardlot"`
BuyID string `protobuf:"bytes,8,opt,name=buyID" json:"buyID"`
Status int32 `protobuf:"varint,9,opt,name=status" json:"status"`
SellID string `protobuf:"bytes,10,opt,name=sellID" json:"sellID"`
TxHash string `protobuf:"bytes,11,opt,name=txHash" json:"txHash"`
Height int64 `protobuf:"varint,12,opt,name=height" json:"height"`
Key string `protobuf:"bytes,13,opt,name=key" json:"key"`
BlockTime int64 `protobuf:"varint,14,opt,name=blockTime" json:"blockTime"`
IsSellOrder bool `protobuf:"varint,15,opt,name=isSellOrder" json:"isSellOrder"`
AssetExec string `protobuf:"bytes,16,opt,name=assetExec" json:"assetExec"`
}
//MarshalJSON :
func (reply *ReplyTradeOrder) MarshalJSON() ([]byte, error) {
r := (*RPCReplyTradeOrder)(reply)
return json.Marshal(r)
}
...@@ -27,12 +27,12 @@ var ( ...@@ -27,12 +27,12 @@ var (
} }
logInfo = map[int64]*types.LogInfo{ logInfo = map[int64]*types.LogInfo{
TyLogTradeSellLimit: {reflect.TypeOf(ReceiptTradeSellLimit{}), "LogTradeSell"}, TyLogTradeSellLimit: {Ty: reflect.TypeOf(ReceiptTradeSellLimit{}), Name: "LogTradeSell"},
TyLogTradeBuyMarket: {reflect.TypeOf(ReceiptTradeBuyMarket{}), "LogTradeBuyMarket"}, TyLogTradeBuyMarket: {Ty: reflect.TypeOf(ReceiptTradeBuyMarket{}), Name: "LogTradeBuyMarket"},
TyLogTradeSellRevoke: {reflect.TypeOf(ReceiptTradeSellRevoke{}), "LogTradeSellRevoke"}, TyLogTradeSellRevoke: {Ty: reflect.TypeOf(ReceiptTradeSellRevoke{}), Name: "LogTradeSellRevoke"},
TyLogTradeSellMarket: {reflect.TypeOf(ReceiptSellMarket{}), "LogTradeSellMarket"}, TyLogTradeSellMarket: {Ty: reflect.TypeOf(ReceiptSellMarket{}), Name: "LogTradeSellMarket"},
TyLogTradeBuyLimit: {reflect.TypeOf(ReceiptTradeBuyLimit{}), "LogTradeBuyLimit"}, TyLogTradeBuyLimit: {Ty: reflect.TypeOf(ReceiptTradeBuyLimit{}), Name: "LogTradeBuyLimit"},
TyLogTradeBuyRevoke: {reflect.TypeOf(ReceiptTradeBuyRevoke{}), "LogTradeBuyRevoke"}, TyLogTradeBuyRevoke: {Ty: reflect.TypeOf(ReceiptTradeBuyRevoke{}), Name: "LogTradeBuyRevoke"},
} }
) )
......
This diff is collapsed.
This diff is collapsed.
...@@ -3,24 +3,56 @@ ...@@ -3,24 +3,56 @@
package types package types
import proto "github.com/golang/protobuf/proto" import (
import fmt "fmt" fmt "fmt"
import math "math" math "math"
proto "github.com/golang/protobuf/proto"
)
// Reference imports to suppress errors if they are not otherwise used. // Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal var _ = proto.Marshal
var _ = fmt.Errorf var _ = fmt.Errorf
var _ = math.Inf var _ = math.Inf
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
type ValNode struct { type ValNode struct {
PubKey []byte `protobuf:"bytes,1,opt,name=pubKey,proto3" json:"pubKey,omitempty"` PubKey []byte `protobuf:"bytes,1,opt,name=pubKey,proto3" json:"pubKey,omitempty"`
Power int64 `protobuf:"varint,2,opt,name=power" json:"power,omitempty"` Power int64 `protobuf:"varint,2,opt,name=power,proto3" json:"power,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
func (m *ValNode) Reset() { *m = ValNode{} } func (m *ValNode) Reset() { *m = ValNode{} }
func (m *ValNode) String() string { return proto.CompactTextString(m) } func (m *ValNode) String() string { return proto.CompactTextString(m) }
func (*ValNode) ProtoMessage() {} func (*ValNode) ProtoMessage() {}
func (*ValNode) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{0} } func (*ValNode) Descriptor() ([]byte, []int) {
return fileDescriptor_38e9a3523ca7e0ea, []int{0}
}
func (m *ValNode) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ValNode.Unmarshal(m, b)
}
func (m *ValNode) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ValNode.Marshal(b, m, deterministic)
}
func (m *ValNode) XXX_Merge(src proto.Message) {
xxx_messageInfo_ValNode.Merge(m, src)
}
func (m *ValNode) XXX_Size() int {
return xxx_messageInfo_ValNode.Size(m)
}
func (m *ValNode) XXX_DiscardUnknown() {
xxx_messageInfo_ValNode.DiscardUnknown(m)
}
var xxx_messageInfo_ValNode proto.InternalMessageInfo
func (m *ValNode) GetPubKey() []byte { func (m *ValNode) GetPubKey() []byte {
if m != nil { if m != nil {
...@@ -37,13 +69,36 @@ func (m *ValNode) GetPower() int64 { ...@@ -37,13 +69,36 @@ func (m *ValNode) GetPower() int64 {
} }
type ValNodes struct { type ValNodes struct {
Nodes []*ValNode `protobuf:"bytes,1,rep,name=nodes" json:"nodes,omitempty"` Nodes []*ValNode `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
func (m *ValNodes) Reset() { *m = ValNodes{} } func (m *ValNodes) Reset() { *m = ValNodes{} }
func (m *ValNodes) String() string { return proto.CompactTextString(m) } func (m *ValNodes) String() string { return proto.CompactTextString(m) }
func (*ValNodes) ProtoMessage() {} func (*ValNodes) ProtoMessage() {}
func (*ValNodes) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{1} } func (*ValNodes) Descriptor() ([]byte, []int) {
return fileDescriptor_38e9a3523ca7e0ea, []int{1}
}
func (m *ValNodes) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ValNodes.Unmarshal(m, b)
}
func (m *ValNodes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ValNodes.Marshal(b, m, deterministic)
}
func (m *ValNodes) XXX_Merge(src proto.Message) {
xxx_messageInfo_ValNodes.Merge(m, src)
}
func (m *ValNodes) XXX_Size() int {
return xxx_messageInfo_ValNodes.Size(m)
}
func (m *ValNodes) XXX_DiscardUnknown() {
xxx_messageInfo_ValNodes.DiscardUnknown(m)
}
var xxx_messageInfo_ValNodes proto.InternalMessageInfo
func (m *ValNodes) GetNodes() []*ValNode { func (m *ValNodes) GetNodes() []*ValNode {
if m != nil { if m != nil {
...@@ -57,26 +112,51 @@ type ValNodeAction struct { ...@@ -57,26 +112,51 @@ type ValNodeAction struct {
// *ValNodeAction_Node // *ValNodeAction_Node
// *ValNodeAction_BlockInfo // *ValNodeAction_BlockInfo
Value isValNodeAction_Value `protobuf_oneof:"value"` Value isValNodeAction_Value `protobuf_oneof:"value"`
Ty int32 `protobuf:"varint,3,opt,name=Ty" json:"Ty,omitempty"` Ty int32 `protobuf:"varint,3,opt,name=Ty,proto3" json:"Ty,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
func (m *ValNodeAction) Reset() { *m = ValNodeAction{} } func (m *ValNodeAction) Reset() { *m = ValNodeAction{} }
func (m *ValNodeAction) String() string { return proto.CompactTextString(m) } func (m *ValNodeAction) String() string { return proto.CompactTextString(m) }
func (*ValNodeAction) ProtoMessage() {} func (*ValNodeAction) ProtoMessage() {}
func (*ValNodeAction) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{2} } func (*ValNodeAction) Descriptor() ([]byte, []int) {
return fileDescriptor_38e9a3523ca7e0ea, []int{2}
}
func (m *ValNodeAction) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ValNodeAction.Unmarshal(m, b)
}
func (m *ValNodeAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ValNodeAction.Marshal(b, m, deterministic)
}
func (m *ValNodeAction) XXX_Merge(src proto.Message) {
xxx_messageInfo_ValNodeAction.Merge(m, src)
}
func (m *ValNodeAction) XXX_Size() int {
return xxx_messageInfo_ValNodeAction.Size(m)
}
func (m *ValNodeAction) XXX_DiscardUnknown() {
xxx_messageInfo_ValNodeAction.DiscardUnknown(m)
}
var xxx_messageInfo_ValNodeAction proto.InternalMessageInfo
type isValNodeAction_Value interface { type isValNodeAction_Value interface {
isValNodeAction_Value() isValNodeAction_Value()
} }
type ValNodeAction_Node struct { type ValNodeAction_Node struct {
Node *ValNode `protobuf:"bytes,1,opt,name=node,oneof"` Node *ValNode `protobuf:"bytes,1,opt,name=node,proto3,oneof"`
} }
type ValNodeAction_BlockInfo struct { type ValNodeAction_BlockInfo struct {
BlockInfo *TendermintBlockInfo `protobuf:"bytes,2,opt,name=blockInfo,oneof"` BlockInfo *TendermintBlockInfo `protobuf:"bytes,2,opt,name=blockInfo,proto3,oneof"`
} }
func (*ValNodeAction_Node) isValNodeAction_Value() {} func (*ValNodeAction_Node) isValNodeAction_Value() {}
func (*ValNodeAction_BlockInfo) isValNodeAction_Value() {} func (*ValNodeAction_BlockInfo) isValNodeAction_Value() {}
func (m *ValNodeAction) GetValue() isValNodeAction_Value { func (m *ValNodeAction) GetValue() isValNodeAction_Value {
...@@ -166,12 +246,12 @@ func _ValNodeAction_OneofSizer(msg proto.Message) (n int) { ...@@ -166,12 +246,12 @@ func _ValNodeAction_OneofSizer(msg proto.Message) (n int) {
switch x := m.Value.(type) { switch x := m.Value.(type) {
case *ValNodeAction_Node: case *ValNodeAction_Node:
s := proto.Size(x.Node) s := proto.Size(x.Node)
n += proto.SizeVarint(1<<3 | proto.WireBytes) n += 1 // tag and wire
n += proto.SizeVarint(uint64(s)) n += proto.SizeVarint(uint64(s))
n += s n += s
case *ValNodeAction_BlockInfo: case *ValNodeAction_BlockInfo:
s := proto.Size(x.BlockInfo) s := proto.Size(x.BlockInfo)
n += proto.SizeVarint(2<<3 | proto.WireBytes) n += 1 // tag and wire
n += proto.SizeVarint(uint64(s)) n += proto.SizeVarint(uint64(s))
n += s n += s
case nil: case nil:
...@@ -182,13 +262,36 @@ func _ValNodeAction_OneofSizer(msg proto.Message) (n int) { ...@@ -182,13 +262,36 @@ func _ValNodeAction_OneofSizer(msg proto.Message) (n int) {
} }
type ReqNodeInfo struct { type ReqNodeInfo struct {
Height int64 `protobuf:"varint,1,opt,name=height" json:"height,omitempty"` Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
func (m *ReqNodeInfo) Reset() { *m = ReqNodeInfo{} } func (m *ReqNodeInfo) Reset() { *m = ReqNodeInfo{} }
func (m *ReqNodeInfo) String() string { return proto.CompactTextString(m) } func (m *ReqNodeInfo) String() string { return proto.CompactTextString(m) }
func (*ReqNodeInfo) ProtoMessage() {} func (*ReqNodeInfo) ProtoMessage() {}
func (*ReqNodeInfo) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{3} } func (*ReqNodeInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_38e9a3523ca7e0ea, []int{3}
}
func (m *ReqNodeInfo) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReqNodeInfo.Unmarshal(m, b)
}
func (m *ReqNodeInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReqNodeInfo.Marshal(b, m, deterministic)
}
func (m *ReqNodeInfo) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReqNodeInfo.Merge(m, src)
}
func (m *ReqNodeInfo) XXX_Size() int {
return xxx_messageInfo_ReqNodeInfo.Size(m)
}
func (m *ReqNodeInfo) XXX_DiscardUnknown() {
xxx_messageInfo_ReqNodeInfo.DiscardUnknown(m)
}
var xxx_messageInfo_ReqNodeInfo proto.InternalMessageInfo
func (m *ReqNodeInfo) GetHeight() int64 { func (m *ReqNodeInfo) GetHeight() int64 {
if m != nil { if m != nil {
...@@ -198,13 +301,36 @@ func (m *ReqNodeInfo) GetHeight() int64 { ...@@ -198,13 +301,36 @@ func (m *ReqNodeInfo) GetHeight() int64 {
} }
type ReqBlockInfo struct { type ReqBlockInfo struct {
Height int64 `protobuf:"varint,1,opt,name=height" json:"height,omitempty"` Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
} }
func (m *ReqBlockInfo) Reset() { *m = ReqBlockInfo{} } func (m *ReqBlockInfo) Reset() { *m = ReqBlockInfo{} }
func (m *ReqBlockInfo) String() string { return proto.CompactTextString(m) } func (m *ReqBlockInfo) String() string { return proto.CompactTextString(m) }
func (*ReqBlockInfo) ProtoMessage() {} func (*ReqBlockInfo) ProtoMessage() {}
func (*ReqBlockInfo) Descriptor() ([]byte, []int) { return fileDescriptor1, []int{4} } func (*ReqBlockInfo) Descriptor() ([]byte, []int) {
return fileDescriptor_38e9a3523ca7e0ea, []int{4}
}
func (m *ReqBlockInfo) XXX_Unmarshal(b []byte) error {
return xxx_messageInfo_ReqBlockInfo.Unmarshal(m, b)
}
func (m *ReqBlockInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
return xxx_messageInfo_ReqBlockInfo.Marshal(b, m, deterministic)
}
func (m *ReqBlockInfo) XXX_Merge(src proto.Message) {
xxx_messageInfo_ReqBlockInfo.Merge(m, src)
}
func (m *ReqBlockInfo) XXX_Size() int {
return xxx_messageInfo_ReqBlockInfo.Size(m)
}
func (m *ReqBlockInfo) XXX_DiscardUnknown() {
xxx_messageInfo_ReqBlockInfo.DiscardUnknown(m)
}
var xxx_messageInfo_ReqBlockInfo proto.InternalMessageInfo
func (m *ReqBlockInfo) GetHeight() int64 { func (m *ReqBlockInfo) GetHeight() int64 {
if m != nil { if m != nil {
...@@ -221,9 +347,9 @@ func init() { ...@@ -221,9 +347,9 @@ func init() {
proto.RegisterType((*ReqBlockInfo)(nil), "types.ReqBlockInfo") proto.RegisterType((*ReqBlockInfo)(nil), "types.ReqBlockInfo")
} }
func init() { proto.RegisterFile("valnode.proto", fileDescriptor1) } func init() { proto.RegisterFile("valnode.proto", fileDescriptor_38e9a3523ca7e0ea) }
var fileDescriptor1 = []byte{ var fileDescriptor_38e9a3523ca7e0ea = []byte{
// 261 bytes of a gzipped FileDescriptorProto // 261 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0x41, 0x4b, 0xc3, 0x30, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0x41, 0x4b, 0xc3, 0x30,
0x14, 0xc7, 0x97, 0xd6, 0x74, 0xfa, 0xba, 0x0d, 0x09, 0x32, 0xca, 0x4e, 0x25, 0x4c, 0xe9, 0xa9, 0x14, 0xc7, 0x97, 0xd6, 0x74, 0xfa, 0xba, 0x0d, 0x09, 0x32, 0xca, 0x4e, 0x25, 0x4c, 0xe9, 0xa9,
......
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