From 645f0d0f9f36954f46dc31c44b126487811a9acf Mon Sep 17 00:00:00 2001 From: Nex Date: Tue, 9 Oct 2018 15:42:25 +0800 Subject: [PATCH] Revert "Add error info" This reverts commit 5b0dc19 --- bdchain/api/ac_chain.proto | 23 ++++++----------------- bdchain/api/common.proto | 10 +--------- bdchain/api/tx_ledger.proto | 8 +++----- 3 files changed, 10 insertions(+), 31 deletions(-) diff --git a/bdchain/api/ac_chain.proto b/bdchain/api/ac_chain.proto index 4f43ea8..d78edaa 100644 --- a/bdchain/api/ac_chain.proto +++ b/bdchain/api/ac_chain.proto @@ -13,11 +13,11 @@ option java_multiple_files = true; service AccountingChain { rpc ClientVersion (google.protobuf.Empty) returns (ClientVersionResponse); rpc BlockNumber (BlockNumberRequest) returns (BlockNumberResponse); - rpc GetBlockByNumber (GetBlockByNumberRequest) returns (BlockResponse); - rpc GetBlockByHash (GetBlockByHashRequest) returns (BlockResponse); - rpc GetTransactionByHash (GetTransactionByHashRequest) returns (TransactionResponse); - rpc GetTransactionByBlockNumberAndIndex (GetTransactionByBlockNumberAndIndexRequest) returns (TransactionResponse); - rpc GetTransactionByBlockHashAndIndex (GetTransactionByBlockHashAndIndexRequest) returns (TransactionResponse); + rpc GetBlockByNumber (GetBlockByNumberRequest) returns (Block); + rpc GetBlockByHash (GetBlockByHashRequest) returns (Block); + rpc GetTransactionByHash (GetTransactionByHashRequest) returns (Transaction); + rpc GetTransactionByBlockNumberAndIndex (GetTransactionByBlockNumberAndIndexRequest) returns (Transaction); + rpc GetTransactionByBlockHashAndIndex (GetTransactionByBlockHashAndIndexRequest) returns (Transaction); } message Transaction { @@ -51,8 +51,7 @@ message BlockNumberRequest { string ledger = 1; } message BlockNumberResponse { - Error error = 1; - uint64 block_number = 2; + uint64 block_number = 1; } message GetBlockByNumberRequest { @@ -67,11 +66,6 @@ message GetBlockByHashRequest { bool full_transaction = 3; } -message BlockResponse { - Error error = 1; - Block block = 2; -} - message GetTransactionByHashRequest { string ledger = 1; bytes hash = 2; @@ -88,8 +82,3 @@ message GetTransactionByBlockHashAndIndexRequest { bytes block_hash = 2; uint32 index = 3; } - -message TransactionResponse { - Error error = 1; - Transaction transaction = 2; -} diff --git a/bdchain/api/common.proto b/bdchain/api/common.proto index 69268cf..6367d5a 100644 --- a/bdchain/api/common.proto +++ b/bdchain/api/common.proto @@ -7,16 +7,8 @@ option java_package = "bdchain.api.grpc"; option java_outer_classname = "CommonProto"; option java_multiple_files = true; -message Error { - string code = 1; // One of a server-defined set of error codes. - string message = 2; // A human-readable representation of the error. - string target = 3; // The target of the error. - repeated Error details = 4; // An array of details about specific errors that led to this reported error. -} - message ClientVersionResponse { - Error error = 1; - string version = 2; // 节点客户端版本 + string version = 1; // 节点客户端版本 } /* 事务类型 */ diff --git a/bdchain/api/tx_ledger.proto b/bdchain/api/tx_ledger.proto index 4130970..9f0ed33 100644 --- a/bdchain/api/tx_ledger.proto +++ b/bdchain/api/tx_ledger.proto @@ -21,12 +21,11 @@ message CreateLedgerRequest { string name = 1; } message CreateLedgerResponse { - Error error = 1; + bool ok = 1; } message GetLedgersResponse { - Error error = 1; - repeated string ledgers = 2; + repeated string ledgers = 1; } message SendTransactionRequest { @@ -40,6 +39,5 @@ message SendTransactionRequest { Transaction transaction = 2; } message SendTransactionResponse { - Error error = 1; - bytes hash = 2; + bytes hash = 1; }