Commit 0cb95366 authored by vipwzw's avatar vipwzw Committed by 33cn

update chain33

parent 0c5d333f
......@@ -116,6 +116,7 @@ func TestBlockChain(t *testing.T) {
testProcDelParaChainBlockMsg(t, mock33, blockchain)
testProcAddParaChainBlockMsg(t, mock33, blockchain)
testProcGetBlockBySeqMsg(t, mock33, blockchain)
testProcBlockChainFork(t, blockchain)
testDelBlock(t, blockchain, curBlock)
......@@ -895,6 +896,28 @@ func testProcAddParaChainBlockMsg(t *testing.T, mock33 *testnode.Chain33Mock, bl
chainlog.Info("testProcAddParaChainBlockMsg end --------------------")
}
func testProcGetBlockBySeqMsg(t *testing.T, mock33 *testnode.Chain33Mock, blockchain *blockchain.BlockChain) {
chainlog.Info("testProcGetBlockBySeqMsg begin --------------------")
seq, err := blockchain.GetStore().LoadBlockLastSequence()
assert.Nil(t, err)
//block, err := blockchain.GetBlock(curheight)
//require.NoError(t, err)
msgGen := mock33.GetClient().NewMessage("blockchain", types.EventGetBlockBySeq, &types.Int64{Data: seq})
mock33.GetClient().Send(msgGen, true)
msg, err := mock33.GetClient().Wait(msgGen)
if err != nil {
t.Log(err)
//t.Error("testProcAddParaChainBlockMsg only in parachain ")
}
blockseq := msg.Data.(*types.BlockSeq)
assert.Equal(t, seq, blockseq.Num)
chainlog.Info("testProcGetBlockBySeqMsg end --------------------")
}
func testProcBlockChainFork(t *testing.T, blockchain *blockchain.BlockChain) {
chainlog.Info("testProcBlockChainFork begin --------------------")
......
......@@ -73,6 +73,9 @@ func (chain *BlockChain) ProcRecvMsg() {
case types.EventGetBlockByHashes:
go chain.processMsg(msg, reqnum, chain.getBlockByHashes)
case types.EventGetBlockBySeq:
go chain.processMsg(msg, reqnum, chain.getBlockBySeq)
case types.EventDelParaChainBlockDetail:
go chain.processMsg(msg, reqnum, chain.delParaChainBlockDetail)
......@@ -418,6 +421,32 @@ func (chain *BlockChain) getBlockByHashes(msg queue.Message) {
}
}
func (chain *BlockChain) getBlockBySeq(msg queue.Message) {
seq := (msg.Data).(*types.Int64)
req := &types.ReqBlocks{Start: seq.Data, End: seq.Data, IsDetail: false, Pid: []string{}}
sequences, err := chain.GetBlockSequences(req)
if err != nil {
chainlog.Error("getBlockBySeq", "seq err", err.Error())
msg.Reply(chain.client.NewMessage("rpc", types.EventGetBlockBySeq, err))
return
}
reqHashes := &types.ReqHashes{Hashes: [][]byte{sequences.Items[0].Hash}}
blocks, err := chain.GetBlockByHashes(reqHashes.Hashes)
if err != nil {
chainlog.Error("getBlockBySeq", "hash err", err.Error())
msg.Reply(chain.client.NewMessage("rpc", types.EventGetBlockBySeq, err))
return
}
blockSeq := &types.BlockSeq{
Num: seq.Data,
Seq: sequences.Items[0],
Detail: blocks.Items[0],
}
msg.Reply(chain.client.NewMessage("rpc", types.EventGetBlockBySeq, blockSeq))
}
//平行链del block的处理
func (chain *BlockChain) delParaChainBlockDetail(msg queue.Message) {
var parablockDetail *types.ParaChainBlockDetail
......
......@@ -104,6 +104,14 @@ func (m *mockBlockChain) SetQueueClient(q queue.Queue) {
case types.EventGetSeqByHash:
msg.Reply(client.NewMessage(blockchainKey, types.EventReplyQuery, &types.Int64{Data: 1}))
case types.EventGetBlockBySeq:
if req, ok := msg.GetData().(*types.Int64); ok {
// just for cover
if req.Data == 10 {
msg.Reply(client.NewMessage(blockchainKey, types.EventReplyQuery, &types.Reply{IsOk: false, Msg: []byte("not support")}))
}
msg.Reply(client.NewMessage(blockchainKey, types.EventReplyQuery, &types.BlockSeq{Num: 1}))
}
case types.EventIsSync:
msg.Reply(client.NewMessage(blockchainKey, types.EventReplyIsSync, &types.IsCaughtUp{}))
case types.EventIsNtpClockSync:
......
......@@ -200,21 +200,21 @@ func (_m *QueueProtocolAPI) GetBlockByHashes(param *types.ReqHashes) (*types.Blo
return r0, r1
}
// GetBlockHash provides a mock function with given fields: param
func (_m *QueueProtocolAPI) GetBlockHash(param *types.ReqInt) (*types.ReplyHash, error) {
// GetBlockBySeq provides a mock function with given fields: param
func (_m *QueueProtocolAPI) GetBlockBySeq(param *types.Int64) (*types.BlockSeq, error) {
ret := _m.Called(param)
var r0 *types.ReplyHash
if rf, ok := ret.Get(0).(func(*types.ReqInt) *types.ReplyHash); ok {
var r0 *types.BlockSeq
if rf, ok := ret.Get(0).(func(*types.Int64) *types.BlockSeq); ok {
r0 = rf(param)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.ReplyHash)
r0 = ret.Get(0).(*types.BlockSeq)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(*types.ReqInt) error); ok {
if rf, ok := ret.Get(1).(func(*types.Int64) error); ok {
r1 = rf(param)
} else {
r1 = ret.Error(1)
......@@ -223,21 +223,21 @@ func (_m *QueueProtocolAPI) GetBlockHash(param *types.ReqInt) (*types.ReplyHash,
return r0, r1
}
// GetBlockOverview provides a mock function with given fields: param
func (_m *QueueProtocolAPI) GetBlockOverview(param *types.ReqHash) (*types.BlockOverview, error) {
// GetBlockHash provides a mock function with given fields: param
func (_m *QueueProtocolAPI) GetBlockHash(param *types.ReqInt) (*types.ReplyHash, error) {
ret := _m.Called(param)
var r0 *types.BlockOverview
if rf, ok := ret.Get(0).(func(*types.ReqHash) *types.BlockOverview); ok {
var r0 *types.ReplyHash
if rf, ok := ret.Get(0).(func(*types.ReqInt) *types.ReplyHash); ok {
r0 = rf(param)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.BlockOverview)
r0 = ret.Get(0).(*types.ReplyHash)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(*types.ReqHash) error); ok {
if rf, ok := ret.Get(1).(func(*types.ReqInt) error); ok {
r1 = rf(param)
} else {
r1 = ret.Error(1)
......@@ -246,21 +246,21 @@ func (_m *QueueProtocolAPI) GetBlockOverview(param *types.ReqHash) (*types.Block
return r0, r1
}
// GetBlockSequences provides a mock function with given fields: param
func (_m *QueueProtocolAPI) GetBlockSequences(param *types.ReqBlocks) (*types.BlockSequences, error) {
// GetBlockOverview provides a mock function with given fields: param
func (_m *QueueProtocolAPI) GetBlockOverview(param *types.ReqHash) (*types.BlockOverview, error) {
ret := _m.Called(param)
var r0 *types.BlockSequences
if rf, ok := ret.Get(0).(func(*types.ReqBlocks) *types.BlockSequences); ok {
var r0 *types.BlockOverview
if rf, ok := ret.Get(0).(func(*types.ReqHash) *types.BlockOverview); ok {
r0 = rf(param)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.BlockSequences)
r0 = ret.Get(0).(*types.BlockOverview)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(*types.ReqBlocks) error); ok {
if rf, ok := ret.Get(1).(func(*types.ReqHash) error); ok {
r1 = rf(param)
} else {
r1 = ret.Error(1)
......
......@@ -950,24 +950,22 @@ func (q *QueueProtocol) GetBlockByHashes(param *types.ReqHashes) (*types.BlockDe
return nil, err
}
// GetBlockSequences block执行序列号
func (q *QueueProtocol) GetBlockSequences(param *types.ReqBlocks) (*types.BlockSequences, error) {
// GetBlockBySeq get block detail and hash by seq
func (q *QueueProtocol) GetBlockBySeq(param *types.Int64) (*types.BlockSeq, error) {
if param == nil {
err := types.ErrInvalidParam
log.Error("GetBlockSequences", "Error", err)
log.Error("GetBlockBySeq", "Error", err)
return nil, err
}
msg, err := q.query(blockchainKey, types.EventGetBlockSequences, param)
msg, err := q.query(blockchainKey, types.EventGetBlockBySeq, param)
if err != nil {
log.Error("GetBlockSequences", "Error", err.Error())
log.Error("GetBlockBySeq", "Error", err.Error())
return nil, err
}
if reply, ok := msg.GetData().(*types.BlockSequences); ok {
if reply, ok := msg.GetData().(*types.BlockSeq); ok {
return reply, nil
}
err = types.ErrTypeAsset
log.Error("GetBlockSequences", "Error", err)
return nil, err
return nil, types.ErrTypeAsset
}
// QueryChain query chain
......
......@@ -807,6 +807,7 @@ func TestGRPC(t *testing.T) {
testGetAddrOverviewGRPC(t, &grpcMock)
testGetBlockHashGRPC(t, &grpcMock)
testGetSequenceByHashGRPC(t, &grpcMock)
testGetBlockBySeqGRPC(t, &grpcMock)
testGenSeedGRPC(t, &grpcMock)
testGetSeedGRPC(t, &grpcMock)
testSaveSeedGRPC(t, &grpcMock)
......@@ -818,6 +819,7 @@ func TestGRPC(t *testing.T) {
testIsSyncGRPC(t, &grpcMock)
testIsNtpClockSyncGRPC(t, &grpcMock)
testNetInfoGRPC(t, &grpcMock)
}
func testNetInfoGRPC(t *testing.T, rpc *mockGRPCSystem) {
......@@ -1140,3 +1142,21 @@ func testGetSequenceByHashGRPC(t *testing.T, rpc *mockGRPCSystem) {
t.Error("Call GetSequenceByHash Failed.", err)
}
}
func testGetBlockBySeqGRPC(t *testing.T, rpc *mockGRPCSystem) {
var res types.BlockSeq
//just for coverage
err := rpc.newRpcCtx("GetBlockBySeq", &types.Int64{Data: 1}, &res)
assert.Nil(t, err)
err = rpc.newRpcCtx("GetBlockBySeq", &types.Int64{Data: 10}, &res)
assert.NotNil(t, err)
}
func TestGetBlockBySeq(t *testing.T) {
q := client.QueueProtocol{}
_, err := q.GetBlockBySeq(nil)
assert.NotNil(t, err)
}
......@@ -107,10 +107,11 @@ type QueueProtocolAPI interface {
//types.EventGetLastBlockSequence:
GetLastBlockSequence() (*types.Int64, error)
//types.EventGetBlockSequences:
GetBlockSequences(param *types.ReqBlocks) (*types.BlockSequences, error)
//types.EventGetBlockByHashes:
GetBlockByHashes(param *types.ReqHashes) (*types.BlockDetails, error)
//types.EventGetBlockBySeq:
GetBlockBySeq(param *types.Int64) (*types.BlockSeq, error)
//types.EventGetSequenceByHash:
GetSequenceByHash(param *types.ReqHash) (*types.Int64, error)
......
......@@ -321,6 +321,12 @@ func (c *GrpcCtx) Run() (err error) {
*c.Res.(*types.Int64) = *reply
}
errRet = err
case "GetBlockBySeq":
reply, err := rpc.GetBlockBySeq(context.Background(), c.Params.(*types.Int64))
if err == nil {
*c.Res.(*types.BlockSeq) = *reply
}
errRet = err
default:
errRet = errors.New(fmt.Sprintf("Unsupport method %v", c.Method))
}
......
......@@ -344,11 +344,6 @@ func (g *Grpc) GetLastBlockSequence(ctx context.Context, in *pb.ReqNil) (*pb.Int
return g.cli.GetLastBlockSequence()
}
// GetBlockSequences get block sequeces
func (g *Grpc) GetBlockSequences(ctx context.Context, in *pb.ReqBlocks) (*pb.BlockSequences, error) {
return g.cli.GetBlockSequences(in)
}
// GetBlockByHashes get block by hashes
func (g *Grpc) GetBlockByHashes(ctx context.Context, in *pb.ReqHashes) (*pb.BlockDetails, error) {
return g.cli.GetBlockByHashes(in)
......@@ -359,6 +354,11 @@ func (g *Grpc) GetSequenceByHash(ctx context.Context, in *pb.ReqHash) (*pb.Int64
return g.cli.GetSequenceByHash(in)
}
// GetBlockBySeq get block with hash by seq
func (g *Grpc) GetBlockBySeq(ctx context.Context, in *pb.Int64) (*pb.BlockSeq, error) {
return g.cli.GetBlockBySeq(in)
}
// SignRawTx signature rawtransaction
func (g *Grpc) SignRawTx(ctx context.Context, in *pb.ReqSignRawTx) (*pb.ReplySignRawTx, error) {
return g.cli.SignRawTx(in)
......@@ -372,3 +372,8 @@ func (g *Grpc) QueryRandNum(ctx context.Context, in *pb.ReqRandHash) (*pb.ReplyH
}
return reply.(*pb.ReplyHash), nil
}
// GetFork get fork height by fork key
func (g *Grpc) GetFork(ctx context.Context, in *pb.ReqKey) (*pb.Int64, error) {
return &pb.Int64{Data: pb.GetFork(string(in.Key))}, nil
}
......@@ -1051,22 +1051,6 @@ func (c *Chain33) GetLastBlockSequence(in *types.ReqNil, result *interface{}) er
return nil
}
// GetBlockSequences get the block loading sequence number information for the specified interval
func (c *Chain33) GetBlockSequences(in rpctypes.BlockParam, result *interface{}) error {
resp, err := c.cli.GetBlockSequences(&types.ReqBlocks{Start: in.Start, End: in.End, IsDetail: in.Isdetail, Pid: []string{""}})
if err != nil {
return err
}
var BlkSeqs rpctypes.ReplyBlkSeqs
items := resp.GetItems()
for _, item := range items {
BlkSeqs.BlkSeqInfos = append(BlkSeqs.BlkSeqInfos, &rpctypes.ReplyBlkSeq{Hash: common.ToHex(item.GetHash()),
Type: item.GetType()})
}
*result = &BlkSeqs
return nil
}
// GetBlockByHashes get block information by hashes
func (c *Chain33) GetBlockByHashes(in rpctypes.ReqHashes, result *interface{}) error {
log.Warn("GetBlockByHashes", "hashes", in)
......
......@@ -1214,26 +1214,6 @@ func TestChain33_GetLastBlockSequence(t *testing.T) {
assert.Equal(t, int64(1), result2)
}
func TestChain33_GetBlockSequences(t *testing.T) {
api := new(mocks.QueueProtocolAPI)
client := newTestChain33(api)
var result interface{}
api.On("GetBlockSequences", mock.Anything).Return(nil, types.ErrInvalidParam)
err := client.GetBlockSequences(rpctypes.BlockParam{}, &result)
assert.NotNil(t, err)
api = new(mocks.QueueProtocolAPI)
client = newTestChain33(api)
var result2 interface{}
blocks := types.BlockSequences{}
blocks.Items = make([]*types.BlockSequence, 0)
blocks.Items = append(blocks.Items, &types.BlockSequence{Hash: []byte("h1"), Type: 1})
api.On("GetBlockSequences", mock.Anything).Return(&blocks, nil)
err = client.GetBlockSequences(rpctypes.BlockParam{}, &result2)
assert.Nil(t, err)
assert.Equal(t, 1, len(result2.(*rpctypes.ReplyBlkSeqs).BlkSeqInfos))
}
func TestChain33_GetBlockByHashes(t *testing.T) {
api := new(mocks.QueueProtocolAPI)
client := newTestChain33(api)
......
......@@ -175,6 +175,15 @@ func TestGrpc_Call(t *testing.T) {
assert.Equal(t, ret.IsOk, result.IsOk)
assert.Equal(t, ret.Msg, result.Msg)
rst, err := client.GetFork(ctx, &types.ReqKey{Key: []byte("ForkBlockHash")})
assert.Nil(t, err)
assert.Equal(t, int64(1), rst.Data)
api.On("GetBlockBySeq", mock.Anything).Return(&types.BlockSeq{}, nil)
blockSeq, err := client.GetBlockBySeq(ctx, &types.Int64{Data: 1})
assert.Nil(t, err)
assert.Equal(t, &types.BlockSeq{}, blockSeq)
server.Close()
mock.AssertExpectationsForObjects(t, api)
}
......@@ -138,6 +138,7 @@ const (
EventStoreListReply = 131
EventListBlockSeqCB = 132
EventGetSeqCBLastNum = 133
EventGetBlockBySeq = 134
//exec
EventBlockChainQuery = 212
......@@ -276,4 +277,6 @@ var eventName = map[int]string{
// Token
EventBlockChainQuery: "EventBlockChainQuery",
EventConsensusQuery: "EventConsensusQuery",
EventGetBlockBySeq: "EventGetBlockBySeq",
}
......@@ -402,6 +402,36 @@ func (_m *Chain33Client) GetBlockByHashes(ctx context.Context, in *types.ReqHash
return r0, r1
}
// GetBlockBySeq provides a mock function with given fields: ctx, in, opts
func (_m *Chain33Client) GetBlockBySeq(ctx context.Context, in *types.Int64, opts ...grpc.CallOption) (*types.BlockSeq, error) {
_va := make([]interface{}, len(opts))
for _i := range opts {
_va[_i] = opts[_i]
}
var _ca []interface{}
_ca = append(_ca, ctx, in)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
var r0 *types.BlockSeq
if rf, ok := ret.Get(0).(func(context.Context, *types.Int64, ...grpc.CallOption) *types.BlockSeq); ok {
r0 = rf(ctx, in, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.BlockSeq)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *types.Int64, ...grpc.CallOption) error); ok {
r1 = rf(ctx, in, opts...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// GetBlockHash provides a mock function with given fields: ctx, in, opts
func (_m *Chain33Client) GetBlockHash(ctx context.Context, in *types.ReqInt, opts ...grpc.CallOption) (*types.ReplyHash, error) {
_va := make([]interface{}, len(opts))
......@@ -462,8 +492,8 @@ func (_m *Chain33Client) GetBlockOverview(ctx context.Context, in *types.ReqHash
return r0, r1
}
// GetBlockSequences provides a mock function with given fields: ctx, in, opts
func (_m *Chain33Client) GetBlockSequences(ctx context.Context, in *types.ReqBlocks, opts ...grpc.CallOption) (*types.BlockSequences, error) {
// GetBlocks provides a mock function with given fields: ctx, in, opts
func (_m *Chain33Client) GetBlocks(ctx context.Context, in *types.ReqBlocks, opts ...grpc.CallOption) (*types.Reply, error) {
_va := make([]interface{}, len(opts))
for _i := range opts {
_va[_i] = opts[_i]
......@@ -473,12 +503,12 @@ func (_m *Chain33Client) GetBlockSequences(ctx context.Context, in *types.ReqBlo
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
var r0 *types.BlockSequences
if rf, ok := ret.Get(0).(func(context.Context, *types.ReqBlocks, ...grpc.CallOption) *types.BlockSequences); ok {
var r0 *types.Reply
if rf, ok := ret.Get(0).(func(context.Context, *types.ReqBlocks, ...grpc.CallOption) *types.Reply); ok {
r0 = rf(ctx, in, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.BlockSequences)
r0 = ret.Get(0).(*types.Reply)
}
}
......@@ -492,8 +522,8 @@ func (_m *Chain33Client) GetBlockSequences(ctx context.Context, in *types.ReqBlo
return r0, r1
}
// GetBlocks provides a mock function with given fields: ctx, in, opts
func (_m *Chain33Client) GetBlocks(ctx context.Context, in *types.ReqBlocks, opts ...grpc.CallOption) (*types.Reply, error) {
// GetFatalFailure provides a mock function with given fields: ctx, in, opts
func (_m *Chain33Client) GetFatalFailure(ctx context.Context, in *types.ReqNil, opts ...grpc.CallOption) (*types.Int32, error) {
_va := make([]interface{}, len(opts))
for _i := range opts {
_va[_i] = opts[_i]
......@@ -503,17 +533,17 @@ func (_m *Chain33Client) GetBlocks(ctx context.Context, in *types.ReqBlocks, opt
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
var r0 *types.Reply
if rf, ok := ret.Get(0).(func(context.Context, *types.ReqBlocks, ...grpc.CallOption) *types.Reply); ok {
var r0 *types.Int32
if rf, ok := ret.Get(0).(func(context.Context, *types.ReqNil, ...grpc.CallOption) *types.Int32); ok {
r0 = rf(ctx, in, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.Reply)
r0 = ret.Get(0).(*types.Int32)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *types.ReqBlocks, ...grpc.CallOption) error); ok {
if rf, ok := ret.Get(1).(func(context.Context, *types.ReqNil, ...grpc.CallOption) error); ok {
r1 = rf(ctx, in, opts...)
} else {
r1 = ret.Error(1)
......@@ -522,8 +552,8 @@ func (_m *Chain33Client) GetBlocks(ctx context.Context, in *types.ReqBlocks, opt
return r0, r1
}
// GetFatalFailure provides a mock function with given fields: ctx, in, opts
func (_m *Chain33Client) GetFatalFailure(ctx context.Context, in *types.ReqNil, opts ...grpc.CallOption) (*types.Int32, error) {
// GetFork provides a mock function with given fields: ctx, in, opts
func (_m *Chain33Client) GetFork(ctx context.Context, in *types.ReqKey, opts ...grpc.CallOption) (*types.Int64, error) {
_va := make([]interface{}, len(opts))
for _i := range opts {
_va[_i] = opts[_i]
......@@ -533,17 +563,17 @@ func (_m *Chain33Client) GetFatalFailure(ctx context.Context, in *types.ReqNil,
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
var r0 *types.Int32
if rf, ok := ret.Get(0).(func(context.Context, *types.ReqNil, ...grpc.CallOption) *types.Int32); ok {
var r0 *types.Int64
if rf, ok := ret.Get(0).(func(context.Context, *types.ReqKey, ...grpc.CallOption) *types.Int64); ok {
r0 = rf(ctx, in, opts...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*types.Int32)
r0 = ret.Get(0).(*types.Int64)
}
}
var r1 error
if rf, ok := ret.Get(1).(func(context.Context, *types.ReqNil, ...grpc.CallOption) error); ok {
if rf, ok := ret.Get(1).(func(context.Context, *types.ReqKey, ...grpc.CallOption) error); ok {
r1 = rf(ctx, in, opts...)
} else {
r1 = ret.Error(1)
......
......@@ -122,14 +122,15 @@ service chain33 {
rpc GetFatalFailure(types.ReqNil) returns (Int32) {}
rpc GetLastBlockSequence(ReqNil) returns (Int64) {}
//获取指定区间的block加载序列号信息
rpc GetBlockSequences(ReqBlocks) returns (BlockSequences) {}
// get add block's sequence by hash
rpc GetSequenceByHash(ReqHash) returns (Int64) {}
//通过block hash 获取对应的blocks信息
rpc GetBlockByHashes(ReqHashes) returns (BlockDetails) {}
//通过block seq 获取对应的blocks hash 信息
rpc GetBlockBySeq(Int64) returns (BlockSeq) {}
//关闭chain33
rpc CloseQueue(ReqNil) returns (Reply) {}
......@@ -142,4 +143,7 @@ service chain33 {
// 获取随机HASH
rpc QueryRandNum(ReqRandHash) returns (ReplyHash) {}
// 获取是否达到fork高度
rpc GetFork(ReqKey) returns (Int64) {}
}
......@@ -26,72 +26,73 @@ const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
func init() { proto.RegisterFile("rpc.proto", fileDescriptor_77a6da22d6a3feb1) }
var fileDescriptor_77a6da22d6a3feb1 = []byte{
// 1031 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0xdd, 0x6f, 0xe2, 0x46,
0x10, 0xf7, 0x43, 0x1b, 0x8e, 0x3d, 0x20, 0x64, 0x43, 0xa2, 0x3b, 0xab, 0xa7, 0x93, 0x2c, 0x55,
0x7d, 0xa8, 0x0e, 0x7a, 0xd0, 0xa6, 0x1f, 0xd7, 0x56, 0x0a, 0x49, 0x21, 0x48, 0x1c, 0xe5, 0x62,
0xd2, 0x4a, 0x7d, 0x5b, 0xcc, 0x94, 0x58, 0x31, 0x6b, 0xc7, 0xbb, 0x0e, 0xe6, 0xcf, 0xeb, 0x7f,
0x56, 0xed, 0xda, 0xeb, 0x6f, 0x92, 0xdc, 0x9b, 0x77, 0x66, 0x7e, 0xf3, 0xe1, 0xfd, 0xcd, 0xcc,
0xa2, 0xba, 0xef, 0x59, 0x5d, 0xcf, 0x77, 0xb9, 0x8b, 0xbf, 0xe4, 0x3b, 0x0f, 0x98, 0xde, 0xb0,
0xdc, 0xcd, 0xc6, 0xa5, 0x91, 0x50, 0x3f, 0xe2, 0x3e, 0xa1, 0x8c, 0x58, 0xdc, 0x4e, 0x44, 0xed,
0xa5, 0xe3, 0x5a, 0x77, 0xd6, 0x2d, 0xb1, 0x95, 0xa4, 0xb1, 0x25, 0x8e, 0x03, 0x3c, 0x3e, 0xd5,
0xbd, 0xbe, 0x17, 0x7f, 0x36, 0x89, 0x65, 0x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 0x92, 0xed,
0xee, 0xc4, 0xd0, 0xd0, 0xf0, 0x40, 0xe2, 0x95, 0xe4, 0x89, 0xeb, 0x54, 0x41, 0x3f, 0xa4, 0xf3,
0xe4, 0x91, 0xe5, 0x7f, 0x9c, 0x8d, 0x99, 0x2e, 0xbf, 0x6f, 0x11, 0xba, 0x70, 0x5c, 0x06, 0x9f,
0x02, 0x08, 0xe0, 0xa9, 0xff, 0xfe, 0xab, 0x4c, 0xef, 0xdc, 0x71, 0x04, 0x8f, 0x55, 0x03, 0x16,
0xe7, 0x8f, 0x2a, 0x2e, 0x6f, 0x26, 0x39, 0x5e, 0x17, 0x8f, 0x2f, 0xf9, 0xb6, 0xc3, 0xc7, 0x19,
0xd2, 0x29, 0x61, 0x02, 0x8d, 0x78, 0xa7, 0xc4, 0x86, 0x86, 0x27, 0x48, 0x8f, 0x9a, 0x60, 0xe6,
0xc6, 0xfe, 0xaa, 0x9e, 0x59, 0xa9, 0xf2, 0x11, 0x57, 0x67, 0xa8, 0x21, 0x3b, 0xf4, 0x9a, 0xd0,
0xd5, 0x2c, 0xd8, 0xe0, 0x94, 0xeb, 0xf7, 0x42, 0x24, 0xff, 0x70, 0xc5, 0x30, 0x1c, 0xbe, 0xfd,
0xe7, 0xcd, 0xda, 0xe6, 0xb7, 0xc1, 0xb2, 0x6b, 0xb9, 0x9b, 0xde, 0x60, 0x60, 0xd1, 0x5e, 0xfc,
0xa4, 0xee, 0x49, 0xe3, 0xe5, 0x81, 0x7c, 0x6b, 0x0f, 0xfe, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x2a,
0x38, 0xe4, 0x13, 0xea, 0x0b, 0x00, 0x00,
// 1049 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0x6d, 0x6f, 0xdb, 0x36,
0x10, 0xd6, 0x87, 0xad, 0x69, 0x58, 0xc7, 0x71, 0x18, 0x37, 0x68, 0x85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4, 0x30, 0x85, 0xc6, 0x4c, 0xd3, 0x62, 0xcb, 0xc0, 0x63,
0x64, 0xc6, 0xb4, 0x9f, 0xb2, 0xc4, 0x5f, 0xdd, 0x87, 0x55, 0xa6, 0xbc, 0xc7, 0xd5, 0x29, 0x6a,
0xa8, 0x99, 0xbc, 0x22, 0x74, 0x39, 0x0d, 0xd7, 0x38, 0x63, 0xf7, 0xad, 0x14, 0xa9, 0x9e, 0xd4,
0xad, 0xbf, 0xaf, 0xd5, 0x2e, 0x1b, 0xb2, 0xa0, 0x70, 0xa1, 0x7e, 0x87, 0x6d, 0xb9, 0x83, 0x83,
0xd7, 0x7f, 0xbf, 0x5a, 0xb9, 0xe2, 0x3a, 0x5c, 0x74, 0x1c, 0xb6, 0xee, 0xf6, 0xfb, 0x0e, 0xed,
0x26, 0x9f, 0xdb, 0x5d, 0x65, 0xb8, 0x78, 0xa2, 0xbe, 0xc3, 0xfb, 0xff, 0x05, 0x00, 0x00, 0xff,
0xff, 0xf5, 0xb2, 0x51, 0x39, 0x06, 0x0c, 0x00, 0x00,
}
// Reference imports to suppress errors if they are not otherwise used.
......@@ -189,12 +190,12 @@ type Chain33Client interface {
//获取系统致命故障信息
GetFatalFailure(ctx context.Context, in *ReqNil, opts ...grpc.CallOption) (*Int32, error)
GetLastBlockSequence(ctx context.Context, in *ReqNil, opts ...grpc.CallOption) (*Int64, error)
//获取指定区间的block加载序列号信息
GetBlockSequences(ctx context.Context, in *ReqBlocks, opts ...grpc.CallOption) (*BlockSequences, error)
// get add block's sequence by hash
GetSequenceByHash(ctx context.Context, in *ReqHash, opts ...grpc.CallOption) (*Int64, error)
//通过block hash 获取对应的blocks信息
GetBlockByHashes(ctx context.Context, in *ReqHashes, opts ...grpc.CallOption) (*BlockDetails, error)
//通过block seq 获取对应的blocks hash 信息
GetBlockBySeq(ctx context.Context, in *Int64, opts ...grpc.CallOption) (*BlockSeq, error)
//关闭chain33
CloseQueue(ctx context.Context, in *ReqNil, opts ...grpc.CallOption) (*Reply, error)
//获取地址所以合约下的余额
......@@ -204,6 +205,8 @@ type Chain33Client interface {
CreateNoBalanceTransaction(ctx context.Context, in *NoBalanceTx, opts ...grpc.CallOption) (*ReplySignRawTx, error)
// 获取随机HASH
QueryRandNum(ctx context.Context, in *ReqRandHash, opts ...grpc.CallOption) (*ReplyHash, error)
// 获取是否达到fork高度
GetFork(ctx context.Context, in *ReqKey, opts ...grpc.CallOption) (*Int64, error)
}
type chain33Client struct {
......@@ -601,15 +604,6 @@ func (c *chain33Client) GetLastBlockSequence(ctx context.Context, in *ReqNil, op
return out, nil
}
func (c *chain33Client) GetBlockSequences(ctx context.Context, in *ReqBlocks, opts ...grpc.CallOption) (*BlockSequences, error) {
out := new(BlockSequences)
err := c.cc.Invoke(ctx, "/types.chain33/GetBlockSequences", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *chain33Client) GetSequenceByHash(ctx context.Context, in *ReqHash, opts ...grpc.CallOption) (*Int64, error) {
out := new(Int64)
err := c.cc.Invoke(ctx, "/types.chain33/GetSequenceByHash", in, out, opts...)
......@@ -628,6 +622,15 @@ func (c *chain33Client) GetBlockByHashes(ctx context.Context, in *ReqHashes, opt
return out, nil
}
func (c *chain33Client) GetBlockBySeq(ctx context.Context, in *Int64, opts ...grpc.CallOption) (*BlockSeq, error) {
out := new(BlockSeq)
err := c.cc.Invoke(ctx, "/types.chain33/GetBlockBySeq", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *chain33Client) CloseQueue(ctx context.Context, in *ReqNil, opts ...grpc.CallOption) (*Reply, error) {
out := new(Reply)
err := c.cc.Invoke(ctx, "/types.chain33/CloseQueue", in, out, opts...)
......@@ -673,6 +676,15 @@ func (c *chain33Client) QueryRandNum(ctx context.Context, in *ReqRandHash, opts
return out, nil
}
func (c *chain33Client) GetFork(ctx context.Context, in *ReqKey, opts ...grpc.CallOption) (*Int64, error) {
out := new(Int64)
err := c.cc.Invoke(ctx, "/types.chain33/GetFork", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Chain33Server is the server API for Chain33 service.
type Chain33Server interface {
// chain33 对外提供服务的接口
......@@ -758,12 +770,12 @@ type Chain33Server interface {
//获取系统致命故障信息
GetFatalFailure(context.Context, *ReqNil) (*Int32, error)
GetLastBlockSequence(context.Context, *ReqNil) (*Int64, error)
//获取指定区间的block加载序列号信息
GetBlockSequences(context.Context, *ReqBlocks) (*BlockSequences, error)
// get add block's sequence by hash
GetSequenceByHash(context.Context, *ReqHash) (*Int64, error)
//通过block hash 获取对应的blocks信息
GetBlockByHashes(context.Context, *ReqHashes) (*BlockDetails, error)
//通过block seq 获取对应的blocks hash 信息
GetBlockBySeq(context.Context, *Int64) (*BlockSeq, error)
//关闭chain33
CloseQueue(context.Context, *ReqNil) (*Reply, error)
//获取地址所以合约下的余额
......@@ -773,6 +785,8 @@ type Chain33Server interface {
CreateNoBalanceTransaction(context.Context, *NoBalanceTx) (*ReplySignRawTx, error)
// 获取随机HASH
QueryRandNum(context.Context, *ReqRandHash) (*ReplyHash, error)
// 获取是否达到fork高度
GetFork(context.Context, *ReqKey) (*Int64, error)
}
func RegisterChain33Server(s *grpc.Server, srv Chain33Server) {
......@@ -1553,56 +1567,56 @@ func _Chain33_GetLastBlockSequence_Handler(srv interface{}, ctx context.Context,
return interceptor(ctx, in, info, handler)
}
func _Chain33_GetBlockSequences_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReqBlocks)
func _Chain33_GetSequenceByHash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReqHash)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(Chain33Server).GetBlockSequences(ctx, in)
return srv.(Chain33Server).GetSequenceByHash(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/types.chain33/GetBlockSequences",
FullMethod: "/types.chain33/GetSequenceByHash",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(Chain33Server).GetBlockSequences(ctx, req.(*ReqBlocks))
return srv.(Chain33Server).GetSequenceByHash(ctx, req.(*ReqHash))
}
return interceptor(ctx, in, info, handler)
}
func _Chain33_GetSequenceByHash_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReqHash)
func _Chain33_GetBlockByHashes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReqHashes)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(Chain33Server).GetSequenceByHash(ctx, in)
return srv.(Chain33Server).GetBlockByHashes(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/types.chain33/GetSequenceByHash",
FullMethod: "/types.chain33/GetBlockByHashes",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(Chain33Server).GetSequenceByHash(ctx, req.(*ReqHash))
return srv.(Chain33Server).GetBlockByHashes(ctx, req.(*ReqHashes))
}
return interceptor(ctx, in, info, handler)
}
func _Chain33_GetBlockByHashes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReqHashes)
func _Chain33_GetBlockBySeq_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(Int64)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(Chain33Server).GetBlockByHashes(ctx, in)
return srv.(Chain33Server).GetBlockBySeq(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/types.chain33/GetBlockByHashes",
FullMethod: "/types.chain33/GetBlockBySeq",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(Chain33Server).GetBlockByHashes(ctx, req.(*ReqHashes))
return srv.(Chain33Server).GetBlockBySeq(ctx, req.(*Int64))
}
return interceptor(ctx, in, info, handler)
}
......@@ -1697,6 +1711,24 @@ func _Chain33_QueryRandNum_Handler(srv interface{}, ctx context.Context, dec fun
return interceptor(ctx, in, info, handler)
}
func _Chain33_GetFork_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReqKey)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(Chain33Server).GetFork(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/types.chain33/GetFork",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(Chain33Server).GetFork(ctx, req.(*ReqKey))
}
return interceptor(ctx, in, info, handler)
}
var _Chain33_serviceDesc = grpc.ServiceDesc{
ServiceName: "types.chain33",
HandlerType: (*Chain33Server)(nil),
......@@ -1874,10 +1906,6 @@ var _Chain33_serviceDesc = grpc.ServiceDesc{
Handler: _Chain33_GetLastBlockSequence_Handler,
},
{
MethodName: "GetBlockSequences",
Handler: _Chain33_GetBlockSequences_Handler,
},
{
MethodName: "GetSequenceByHash",
Handler: _Chain33_GetSequenceByHash_Handler,
},
......@@ -1886,6 +1914,10 @@ var _Chain33_serviceDesc = grpc.ServiceDesc{
Handler: _Chain33_GetBlockByHashes_Handler,
},
{
MethodName: "GetBlockBySeq",
Handler: _Chain33_GetBlockBySeq_Handler,
},
{
MethodName: "CloseQueue",
Handler: _Chain33_CloseQueue_Handler,
},
......@@ -1905,6 +1937,10 @@ var _Chain33_serviceDesc = grpc.ServiceDesc{
MethodName: "QueryRandNum",
Handler: _Chain33_QueryRandNum_Handler,
},
{
MethodName: "GetFork",
Handler: _Chain33_GetFork_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "rpc.proto",
......
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