Skip to content
This repository was archived by the owner on Jul 15, 2018. It is now read-only.
This repository was archived by the owner on Jul 15, 2018. It is now read-only.

Unify the response protobuf types #165

@ethanfrey

Description

@ethanfrey

I would like to simplify the representation of the types, make unified error handling. Write now, some types have a Code and Log field which is used to create IsErr, and IsOk.

I would prefer something more like:

Response = Error(string) | Result(ABCIResult)
ABCIResult = SetOptionResult() | DeliverTxResult(...) | ...

To make this more concrete, now looks something like this:

message Response {
  oneof value{
    ResponseInfo info = 4;
    ResponseDeliverTx deliver_tx = 6;
   // ....
  }
}

message ResponseInfo {
  string data = 1;
  string version = 2;
  int64 last_block_height = 3;
  bytes last_block_app_hash = 4;
}

message ResponseDeliverTx{
  uint32            code        = 1;
  bytes             data        = 2 ;
  string            log         = 3;
  repeated KVPair tags = 4;
}

I would propose something more like

message Response {
  Error error = 1;
  oneof result{
    ResponseInfo info = 2;
    ResponseDeliverTx deliver_tx = 3;
  };
}

message Error {
  uint32 code = 1;
  string log = 2;
}

message ResponseInfo {
  string data = 1;
  string version = 2;
  int64 last_block_height = 3;
  bytes last_block_app_hash = 4;
}

message ResponseDeliverTx{
  bytes    data = 1;
  repeated KVPair tags = 2;
}

// .....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions