From a3ce1900c90d3269f6d76ed08c7bb73c2ca09f24 Mon Sep 17 00:00:00 2001 From: George Tankersley Date: Fri, 30 Nov 2018 18:00:07 +0000 Subject: [PATCH] rpc: minor nits on prior update --- proto/compact_formats.proto | 6 +++--- proto/generate.go | 1 + proto/service.proto | 12 +++++------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/proto/compact_formats.proto b/proto/compact_formats.proto index ee3b07d..7db1e9a 100644 --- a/proto/compact_formats.proto +++ b/proto/compact_formats.proto @@ -11,9 +11,9 @@ package proto; message CompactBlock { uint32 protoVersion = 1; // the version of this wire format, for storage uint64 height = 2; // the height of this block - bytes hash = 3; // the hash of this block - uint32 time = 4; // the block time - bytes header = 5; // OR send the full header + bytes hash = 3; + uint32 time = 4; + bytes header = 5; // (hash and time) OR (full header) repeated CompactTx vtx = 6; // compact transactions from this block } diff --git a/proto/generate.go b/proto/generate.go index d786a48..eef0e45 100644 --- a/proto/generate.go +++ b/proto/generate.go @@ -1,3 +1,4 @@ package proto //go:generate protoc -I . ./compact_formats.proto --go_out=plugins=grpc:. +//go:generate protoc -I . ./service.proto --go_out=plugins=grpc:. diff --git a/proto/service.proto b/proto/service.proto index 7807766..304582d 100644 --- a/proto/service.proto +++ b/proto/service.proto @@ -1,6 +1,8 @@ syntax = "proto3"; package proto; +import "compact_formats.proto"; + // A BlockID message contains identifiers to select a block: a height or a // hash. If the hash is present it takes precedence. message BlockID { @@ -24,12 +26,8 @@ message TxFilter { bytes hash = 3; } -message FullTransaction { - TxFilter txID = 1; - bytes data = 2; -} - -message SentTransaction { +// RawTransaction contains the complete transaction data. +message RawTransaction { bytes data = 1; } @@ -45,6 +43,6 @@ service CompactTxStreamer { rpc GetLatestBlock(ChainSpec) returns (BlockID) {} rpc GetBlock(BlockID) returns (CompactBlock) {} rpc GetBlockRange(BlockRange) returns (stream CompactBlock) {} - rpc GetTransaction(TxFilter) returns (FullTransaction) {} + rpc GetTransaction(TxFilter) returns (RawTransaction) {} rpc SendTransaction(RawTransaction) returns (SendResponse) {} }